<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=DenysNykula</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=DenysNykula"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/DenysNykula"/>
	<updated>2026-05-05T21:54:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=ALSA&amp;diff=32156</id>
		<title>ALSA</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=ALSA&amp;diff=32156"/>
		<updated>2026-03-20T00:03:16Z</updated>

		<summary type="html">&lt;p&gt;DenysNykula: Mention snd-seq required by USB MIDI controllers&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://en.wikipedia.org/wiki/Advanced_Linux_Sound_Architecture Advanced Linux Sound Architecture (ALSA)] provides audio and MIDI functionality to the Linux operating system. As part of the Linux kernel, it provides an application programming interface (API) for sound card device drivers. &lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
First you will need to install the Alsa packages, Linux sound driver and volume adjuster: {{Cmd|# apk add {{pkg|alsa-utils}} {{pkg|alsaconf}}}}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
Then you will need to add all your users (including root) to the &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; group.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;# addgroup $USER audio&lt;br /&gt;
# addgroup root audio&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Find the default sound card.:  {{Cmd|# alsamixer}}&lt;br /&gt;
&lt;br /&gt;
The default sound card will show up. Try turning up the volume of Master and the device(s) such as speakers or microphones that you need, and make sure they are not muted (mute is denoted by MM and can be toggled using the {{Key|M}} key).&lt;br /&gt;
Audio should now work (you can use the {{Key|F1}} key to get additional help within alsamixer).&lt;br /&gt;
&lt;br /&gt;
If there are no volume controls visible, try hitting {{Key|F6}} on your keyboard and toggling between the sound cards (which all might have the same name in the context menu that pops up except for the numbers next to and before the names).&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve found the sound card name that gives you volume controls, set the unique number that showed up in the {{Key|F6}} context menu as your default soundcard.&lt;br /&gt;
&lt;br /&gt;
Put the number (you found in the {{Key|F6}} context menu of the alsamixer command for the soundcard you want as your default) at the end of below lines separated by a space for each. For example, if the default sound card you want is &amp;quot;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Use your favourite editor to edit the {{Path|~/.asoundrc}} file as follows:{{Cat|~/.asoundrc|defaults.ctl.card 1&lt;br /&gt;
defaults.pcm.card 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The {{Path|~/.asoundrc}} file installed in a user&#039;s home directory($HOME) is called from {{Path|/usr/share/alsa/alsa.conf}}. It is also possible to install the above in a system-wide configuration file as {{Path|/etc/asound.conf}}. When an ALSA application starts both configuration files are read but the settings in the {{Path|~/.asoundrc}} file override the settings in the {{Path|/etc/asound.conf}} settings.&lt;br /&gt;
&lt;br /&gt;
Most programs require a restart to reread {{Path|~/.asoundrc}} or {{Path|/etc/asound.conf}}. This includes desktop environment audio daemons, such as [[PulseAudio]]. For most changes, you will need to restart the sound server. &lt;br /&gt;
&lt;br /&gt;
Try turning up the volume of Master and the device(s) such as speakers or microphones that you need with the &amp;lt;code&amp;gt;alsamixer&amp;lt;/code&amp;gt; command, and audio should work.&lt;br /&gt;
&lt;br /&gt;
Gstreamer can now catch the device once the [[#Service management|service is started]] and the audio mixer will be working.&lt;br /&gt;
&lt;br /&gt;
=== Service management === &lt;br /&gt;
&lt;br /&gt;
Use standard start|stop|restart [[OpenRC]] commands to manage {{ic|alsa}} service.&lt;br /&gt;
Note that {{ic|alsa}} service is not started on install. To start, issue the command:{{Cmd|# rc-service alsa start}}&lt;br /&gt;
To enable the Alsa user service, issue the command:{{Cmd|# rc-update add alsa}}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
To list all the detected sound cards and their assigned numbers, use the command:{{Cmd|$ cat /proc/asound/cards}}&lt;br /&gt;
&lt;br /&gt;
=== MIDI ===&lt;br /&gt;
&lt;br /&gt;
If your USB MIDI controller isn&#039;t found by music production applications such as {{pkg|mixxx}} and {{pkg|lmms}}, load the ALSA Sequencer kernel module before starting the applications: {{Cmd|# modprobe snd-seq}}&lt;br /&gt;
&lt;br /&gt;
You can add {{ic|snd-seq}} to {{Path|/etc/modules}} to make it autoload at boot.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.alsa-project.org/wiki/Main_Page Official website]&lt;br /&gt;
* [https://alsa.opensrc.org/ Unofficial alsa wiki]&lt;br /&gt;
* [[Sound_Setup|Main page for Sound Setup]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Sound]]&lt;br /&gt;
[[Category:Drivers]]&lt;/div&gt;</summary>
		<author><name>DenysNykula</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Polkit&amp;diff=32155</id>
		<title>Polkit</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Polkit&amp;diff=32155"/>
		<updated>2026-03-19T22:18:41Z</updated>

		<summary type="html">&lt;p&gt;DenysNykula: /* Example1 */ Fix 50-udisks.rules JS syntax and the action id for eject&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://polkit.pages.freedesktop.org/polkit/polkit.8.html Polkit] is an authorization manager which is used for allowing unprivileged processes to speak to privileged processes through some form of inter-process communication mechanism like [[D-Bus]]. &lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
* Install and configure [[D-Bus#Installation|D-Bus]].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
For graphical applications, polkit relies on [[Elogind|elogind]] or [[Seatd]] to determine the identity of the user making a request. To use the full features of polkit, [[#Using polkit with elogind|using polkit with elogind]] is recommended.&lt;br /&gt;
&lt;br /&gt;
=== Using polkit with elogind ===&lt;br /&gt;
&lt;br /&gt;
For a feature-rich [[Desktop environments and Window managers|desktop]] experience, use polkit with [[Elogind|elogind]]. Features like [[#Authentication agents|authentication agents]] can be used only with elogind. Install the {{Pkg|polkit-elogind}} package and enable the {{ic|polkit}} service using [[OpenRC]].&lt;br /&gt;
&lt;br /&gt;
{{Cmd|&amp;lt;nowiki&amp;gt;# apk add polkit-elogind&lt;br /&gt;
# rc-update add polkit&lt;br /&gt;
# rc-service polkit start &amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Proceed to configure [[Elogind|elogind]], if not done already.&lt;br /&gt;
&lt;br /&gt;
=== Using polkit with seatd ===&lt;br /&gt;
&lt;br /&gt;
For a minimal desktop like [[Sway]], polkit can be used with [[Seatd#Polkit|seatd with certain limitations]]. With Seatd, polkit rules can only evaluate group membership, resulting in a &#039;yes&#039; or &#039;no&#039; decision. Graphical, session aware [[#Authentication agents|authentication agents]] are not supported.  &lt;br /&gt;
&lt;br /&gt;
To proceed to use polkit with seatd, install the {{Pkg|polkit}} package and enable the {{ic|polkit}} service using [[OpenRC]]: {{Cmd|&amp;lt;nowiki&amp;gt;# apk add polkit&lt;br /&gt;
# rc-update add polkit&lt;br /&gt;
# rc-service polkit start &amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Authentication agents ==&lt;br /&gt;
&lt;br /&gt;
Polkit authentication agent integration helps coordinate the display of a password prompt to the active and local users. &lt;br /&gt;
When an unprivileged user attempts to access a privileged location (such as by typing admin:// in the address bar of a [[File_management#File_managers|File Manager]]), when the appropriate polkit policy requires administrative authentication, a password dialogue will typically appear. &lt;br /&gt;
&lt;br /&gt;
{{Warning|Authentication agents will work only when [[PAM]] is properly set up and [[#Using polkit with elogind|polkit is used with elogind]].}}&lt;br /&gt;
&lt;br /&gt;
Some of the authentication agents available in Alpine linux is listed below:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|xfce-polkit}}&lt;br /&gt;
* {{Pkg|mate-polkit}}&lt;br /&gt;
* {{Pkg|polkit-gnome}}&lt;br /&gt;
* {{Pkg|polkit-kde-agent-1}}&lt;br /&gt;
&lt;br /&gt;
For [[Xfce]], install {{Pkg|xfce-polkit}} as follows:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# apk add xfce-polkit}}&lt;br /&gt;
&lt;br /&gt;
== Polkit rule files ==&lt;br /&gt;
&lt;br /&gt;
The following example rule files have been provided to show the limitations of [[#Using polkit with seatd|seatd]].&lt;br /&gt;
&lt;br /&gt;
Ensure that correct permissions are set for the rule files. For example, for the rule file {{Path|/etc/polkit-1/rules.d/50-udisks.rules}}:{{Cmd|&amp;lt;nowiki&amp;gt;# chown root:root /etc/polkit-1/rules.d/50-udisks.rules&lt;br /&gt;
# chmod 644 /etc/polkit-1/rules.d/50-udisks.rules&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Example1 ===&lt;br /&gt;
&lt;br /&gt;
A sample polkit rule file {{Path|/etc/polkit-1/rules.d/50-udisks.rules}} which allow [[File_management#Automounting_removable_storage|automatic mounting of removable storage]] based on being a member of &#039;&#039;&#039;disk&#039;&#039;&#039; or &#039;&#039;&#039;storage&#039;&#039;&#039; group. This rule depends only on group membership which works with seatd: {{cat|/etc/polkit-1/rules.d/50-udisks.rules|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
polkit.addRule(function(action, subject) {&lt;br /&gt;
    if ((subject.isInGroup(&amp;quot;disk&amp;quot;) || subject.isInGroup(&amp;quot;storage&amp;quot;)) &amp;amp;&amp;amp;&lt;br /&gt;
        (action.id == &amp;quot;org.freedesktop.udisks2.filesystem-mount&amp;quot; ||&lt;br /&gt;
         action.id == &amp;quot;org.freedesktop.udisks2.filesystem-mount-system&amp;quot; ||&lt;br /&gt;
         action.id == &amp;quot;org.freedesktop.udisks2.filesystem-unmount-others&amp;quot; ||  &lt;br /&gt;
         action.id == &amp;quot;org.freedesktop.udisks2.eject-media&amp;quot; ||&lt;br /&gt;
         action.id == &amp;quot;org.freedesktop.udisks2.encrypted-unlock&amp;quot; ||&lt;br /&gt;
         action.id == &amp;quot;org.freedesktop.udisks2.power-off-drive&amp;quot;)) {&lt;br /&gt;
        return polkit.Result.YES;&lt;br /&gt;
    }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}} &lt;br /&gt;
&lt;br /&gt;
The above polkit rule file is fully supported when used with both [[#Using polkit with seatd|seatd]] and [[#Using polkit with elogind|Elogind]].&lt;br /&gt;
&lt;br /&gt;
=== Example2 ===&lt;br /&gt;
&lt;br /&gt;
[[elogind|Elogind]] is required for &amp;quot;subject.active&amp;quot; rules and no AUTH_ADMIN, since polkit agents need POLKIT_IS_SUBJECT. Given below is a sample polkit rule file {{Path|/etc/polkit-1/rules.d/51-require-active-session.rules}} which allow only active local sessions to suspend:{{Cat|/etc/polkit-1/rules.d/51-require-active-session.rules|&amp;lt;nowiki&amp;gt; &lt;br /&gt;
    polkit.addRule(function(action, subject) {&lt;br /&gt;
        if (action.id == &amp;quot;org.freedesktop.login1.suspend&amp;quot; &amp;amp;&amp;amp;&lt;br /&gt;
            subject.active) {&lt;br /&gt;
            return polkit.Result.YES;&lt;br /&gt;
        } else if (action.id == &amp;quot;org.freedesktop.login1.suspend&amp;quot;) {&lt;br /&gt;
            return polkit.Result.NO; // Or polkit.Result.AUTH_ADMIN to prompt for password&lt;br /&gt;
        }&lt;br /&gt;
    });&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}     &lt;br /&gt;
&lt;br /&gt;
The above rule file depends on &#039;&#039;subject.active&#039;&#039; which is supported only when [[#Using polkit with elogind|polkit is used with Elogind]].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [https://polkit.pages.freedesktop.org/polkit/polkit.8.html polkit Architecture]&lt;br /&gt;
* [https://github.com/polkit-org/polkit polkit github page]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Polkit  Arch wiki Polkit page]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Running_GUI_applications_as_root Arch wiki Running GUI applications as root]&lt;br /&gt;
&lt;br /&gt;
[[Category:Authentication]]&lt;/div&gt;</summary>
		<author><name>DenysNykula</name></author>
	</entry>
</feed>