Sound only usable as root?

Sat, Oct 3, 2020 3-minute read

Similar to the issue I ran into with my keyboard and mouse, following a bunch of updates, my soundcard was only usable as root. I checked the permissions of all the nodes in /dev/snd/* and saw they were indeed exclusively accessible by root. Running this:

1
sudo setfacl -m g:audio:rw /dev/snd/*

Allowed all users in the audio group to at least list the available sound cards via:

1
aplay -l
Previously, the above command would return an empty list. At this point attempting to play an audio file with aplay still yielded an error saying the audio device was stuck. Being very explicit about which device to use, however, did work:

1
aplay -D plughw:0,0 /usr/share/sounds/alsa/Front_Center.wav

So now to make that the default sink used by pulse audio, I added a line to /etc/pulse/default.pa before the .ifexists module-udev-detect.so line, below the comment that says: ### Load audio drivers statically

1
load-module module-alsa-sink device=plughw:0,0
Now as my own user I ran:
1
2
pulseaudio --kill
pulseaudio --start
Now if I run:
1
pacmd list-sinks
I get the output below and I can use the soundcard:

1 sink(s) available.
  * index: 0
        name: <alsa_output.plughw_0_0>
        driver: <module-alsa-sink.c>
        flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
        state: SUSPENDED
        suspend cause: IDLE
        priority: 9000
        volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        base volume: 65536 / 100% / 0.00 dB
        volume steps: 65537
        muted: no
        current latency: 0.00 ms
        max request: 0 KiB
        max rewind: 0 KiB
        monitor source: 0
        sample spec: s16le 2ch 44100Hz
        channel map: front-left,front-right
                     Stereo
        used by: 0
        linked by: 0
        configured latency: 0.00 ms; range is 0.50 .. 2000.00 ms
        module: 5
        properties:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "ALC887-VD Analog"
                alsa.id = "ALC887-VD Analog"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "0"
                alsa.card_name = "HDA Intel PCH"
                alsa.long_card_name = "HDA Intel PCH at 0xdf320000 irq 129"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
                sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
                device.string = "plughw:0,0"
                device.buffering.buffer_size = "352800"
                device.buffering.fragment_size = "176400"
                device.access_mode = "mmap+timer"
                device.description = "HDA Intel PCH"
                device.icon_name = "audio-card"

NOTE: occasionally the pulseaudio config may get corupted so removing or moving the ~/.config/pulse folder (which will get regenerated the next time pulse starts) may fix other issues.

May need to manually create a link for a cookie file to avoid this error: pulseaudio[23401]: [pulseaudio] authkey.c: Failed to open cookie file ‘/home/sebortiz/.config/pulse/cookie’: No such file or directory

in the ~/.config/pulse directory, do: ln -s ../../.pulse-cookie cookie

because there is a ~/.pulse-cookie file present