Pulseaudio is running in daemon mode and I am able to play sound through aplay, vlc, etc, so I know sound is working.
The output of dmesg when chromium is running indicates that apparmor is blocking access to the sound device:
[Mon Feb 24 16:54:34 2020] audit: type=1400 audit(1582581275.262:2277): apparmor="DENIED" operation="mkdir" profile="snap.chromium.chromium" name="/run/user/1000/" pid=16304 comm="mkdir" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[Mon Feb 24 16:54:42 2020] audit: type=1400 audit(1582581283.250:2278): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/dev/snd/controlC0" pid=16275 comm="chrome" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[Mon Feb 24 16:54:42 2020] audit: type=1400 audit(1582581283.618:2279): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/dev/snd/controlC0" pid=16275 comm="chrome" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[Mon Feb 24 16:54:42 2020] audit: type=1400 audit(1582581283.618:2280): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/dev/snd/controlC0" pid=16275 comm="chrome" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[Mon Feb 24 16:54:42 2020] audit: type=1400 audit(1582581283.750:2281): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/dev/snd/controlC0" pid=16275 comm="chrome" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[Mon Feb 24 16:54:42 2020] audit: type=1400 audit(1582581283.750:2282): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/dev/snd/controlC0" pid=16275 comm="chrome" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[Mon Feb 24 16:58:48 2020] audit: type=1400 audit(1582581529.770:2284): apparmor="DENIED" operation="open" profile="snap.chromium.chromium" name="/dev/snd/controlC0" pid=16275 comm="chrome" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
I have stopped apparmor via systemctl stop apparmor.
EDIT: #1:
19 processes are in enforce mode.
/snap/chromium/1036/usr/lib/chromium-browser/chrome (1227) snap.chromium.chromium
/snap/chromium/1036/usr/lib/chromium-browser/chrome (1622) snap.chromium.chromium
/snap/chromium/1036/usr/lib/chromium-browser/chrome (1633) snap.chromium.chromium
/snap/chromium/1036/usr/lib/chromium-browser/chrome (1686) snap.chromium.chromium
/snap/chromium/1036/usr/lib/chromium-browser/chrome (1690) snap.chromium.chromium
/snap/chromium/1036/usr/lib/chromium-browser/chrome (3354) snap.chromium.chromium
/snap/chromium/1036/usr/lib/chromium-browser/chrome (12295) snap.chromium.chromium
/snap/chromium/1036/usr/lib/chromium-browser/chrome (12414) snap.chromium.chromium
/snap/chromium/1036/usr/lib/chromium-browser/chrome (16471) snap.chromium.chromium
/snap/chromium/1036/usr/lib/chromium-browser/chrome (17290) snap.chromium.chromium
/snap/chromium/1036/usr/lib/chromium-browser/chrome (20617) snap.chromium.chromium
/snap/chromium/1036/usr/lib/chromium-browser/chrome (22088) snap.chromium.chromium
/snap/chromium/1036/usr/lib/chromium-browser/chrome (23416) snap.chromium.chromium
I have omitted irrelevant processes. The chromium snap is in enforce mode.
I don't believe the problem to be with pulseaudio, but instead with the configuration of the chromium snap. It is apparently blocking access to the sound device as indicated by the logs above.
Apparmor protects linux services and have two types of profile modes: enforce and complain. In the complain mode, system doesn’t enforce any rules. It will only log the violation attempts
So you could check what profile mode applied to your daemon:
You need to add your pulseaudio daemon into complain mode using
aa-complain
command:Use
whereis pulseaudio
command to see where it is located in your system if path is not displayed in case ofapparmor_status
command execution.I have temporarily disabled the apparmor profiles via:
apparmor_parser -R <path to profile>
<path to profile> /etc/apparmor.d/disable/<profile-to-disable>