Previously, everything was working as one would expect, all apps could play audio and all devices were listed and could be selected via
pavucontrol, Xubuntu's "Volume Control" app.
After trying (unsuccessfully) to install a better mixer GUI, now I have strange audio issues on my Xubuntu 18.04 box. Initially no audio was working, but after trying different things (see below), I'm in a somewhat better - but by no measure ideal - situation:
- When I first log into the machine, Pulseaudio isn't started: "Volume Control" shows a small x on the speaker icon in the tray and when opening, says "Establishing connection to PulseAudio. Please wait...". That doesn't really bother me much as I think I can work around that rather easily.
- Even in this state,
aplay -lis showing all my audio devices, but it can't play anything. Same with Firefox, no audio there.
- After starting Pulseaudio via
pulseaudio --start, playing files with
aplayis working, even Firefox (I had to restart it after starting Pulseaudio) and VLC can play audio (tested with a WAV file, YouTube and an MP3 respectively). But if I open YouTube via Tor Browser, the video plays but I can't hear a thing.
- I this state, the Volume Control's Configuration tab only has digital, HDMI audio devices in the playback dropdown, in fact it is set to "Off" even while the audio is playing fine.
- I tried the following:
- Restarting the machine after
rm -r ~/.config/pulse/* ; rm -r ~/.pulse*(as found here)
sudo apt-get -y --reinstall install linux-sound-base alsa-base alsa-utils linux-image-$(uname -r) libasound2(on the same page, I didn't want to (re)install packages that I thought were unrelated to the problem or my system)
- Played with the settings in the
alsamixerconsole app, I suspect switching to the analog audio output in there was what eventually got some apps to play audio again.
- Restarting the machine after
For reference, here's the machine's ALSA Configuration, but since some apps can actually play audio fine, I suspect it's a pulseaudio problem. Note that I haven't tested any of the many HDMI output options, as I don't use HDMI at all on this machine.
There are some similar questions, but none of them fixed the issue for me:
- Analog sound output does not appear in “Sound settings”: The fix involves using Volume Control, which in my case doesn't list the analog output at all.
- My sound stopped working today, how can I fix it?: Issue there was the installation of the
randomsoundpackage, which I don't have installed.
- Analog audio recognized by ALSA, but not by PulseAudio: Currently the only answer suggests to edit
/etc/pulse/default.pa, but in that file there's a comment suggesting "better to not load these drivers manually, but instead use module-udev-detect [...] for doing this automatically". Not sure if this is the part in my system that's broken?
How can I get the Volume Control to show (and set) the Analog output, across all apps?
How can I get sound in the broken apps working again?
Update 1: Tor Browser workaround
Since the only application that appears affected is Tor Browser, I did some more research and found a Tor Browser bug report #29360.
Messing with Pulseaudio settings invalidated the original pulse cookie I had after installing my system initially, but I didn't actually find where Tor Browser keeps its own pulse config: The
<installfolder>/Browser/.config/pulse/ folder only included a symbolic link
fd54e00ba87640399a53c282574d152c-runtime -> /tmp/pulse-eeOG1j3w9rzO and the destination folder
/tmp/pulse-eeOG1j3w9rzO was empty.
With the help of debugging via
from the installation folder, I could solve the issue by following comment 11:
Initially I tried to create a symlink like so
cd Browser/.config mv pulse pulse.orig ln -s ~/.config/pulse
but that resulted in errors
Failed to create secure directory (.../Browser/.config/pulse): Too many levels of symbolic links) [Child 5912, MediaPlayback #2] WARNING: 7f85ab585a10 OpenCubeb() failed to init cubeb: file /var/tmp/build/firefox-869854aeea80/dom/media/AudioStream.cpp, line 382 [Child 5912, MediaPlayback #2] WARNING: Decoder=7f85a79d5000 [OnMediaSinkAudioError]: file /var/tmp/build/firefox-869854aeea80/dom/media/MediaDecoderStateMachine.cpp, line 3639 [Child 5912, MediaPlayback #2] WARNING: Decoder=7f85a79d5000 Decode error: NS_ERROR_DOM_MEDIA_MEDIASINK_ERR (0x806e000b) - OnMediaSinkAudioError: file /var/tmp/build/firefox-869854aeea80/dom/media/MediaDecoderStateMachine
The solution was to create a copy instead of a link:
mv pulse pulse.old cp -a ~/.config/pulse ./
I hope this practice doesn't cause any security/privacy issues with Tor Browser.
Note that I also reported this issue (and workaround) on https://trac.torproject.org/projects/tor/ticket/33443
My original question, namely How can I get the Volume Control to show the Analog output is still open.