Ubuntu – Sound keeps breaking, when it does it doesn’t change volume, headphones not detected


So, I'm not sure what caused this because I haven't messed with the sound system at all. But, for some reason the sound keeps breaking, that is, no sound is produced. Sometimes just a Dummy output exists and sometimes it detects everything and it can be seen in pulseaudio and the sound application, but still no sound is produced.

Now this appears to occur quite often, as there are many fixes on this internet. This command usually works for me:

sudo apt-get update;sudo apt-get dist-upgrade; sudo apt-get install pavucontrol linux-sound-base alsa-base alsa-utils lightdm ubuntu-desktop  linux-image-`uname -r` libasound2; sudo apt-get -y --reinstall install linux-sound-base alsa-base alsa-utils lightdm ubuntu-desktop  linux-image-`uname -r` libasound2; killall pulseaudio; rm -r ~/.pulse*; ubuntu-support-status; sudo usermod -aG `cat /etc/group | grep -e '^pulse:' -e '^audio:' -e '^pulse-access:' -e '^pulse-rt:' -e '^video:' | awk -F: '{print $1}' | tr '\n' ',' | sed 's:,$::g'` `whoami`

The problem is however, that this is very temporary usually after a reboot it's broken again.

Also, during the time that it is working the volume level doesn't change, it's either off or very loud. This appears to be because of PCM in alsamixer being set to 100%. So I turn that down, but if I change the volume it goes back up to 100%. I tried a solution which blocked it from going up to 100%, but the volume level stays fairly flat, it doesn't go from quiet to loud as it should.

Also my headphones are just not detected by my computer. They used to be until all this sound stuff started going wrong.

How can I just put everything back to normal?

I'm using a dell xps 13 with ubuntu 16.04. My soundcard is being detected by aplay -l.

Best Answer

Turns out that in my case, the squeezelite package was causing the issues.

I disabled it with:

sudo systemctl stop squeezelite.service
sudo systemctl disable squeezelite.service

Now I am not seeing the problem anymore. There is an existing bug report for this, here: https://bugs.launchpad.net/ubuntu/+source/squeezelite/+bug/1636253

This was my original answer, not really relevant anymore but I'll leave it here for context

I was also experiencing this problem, on the same Dell laptop model. For me, I was able to fix it by re-installing pulseaudio.

I note that your command above has some apt installs in it, but these packages aren't the same as in those in the command in the question.

sudo apt install --reinstall pulseaudio pulseaudio-utils pulseaudio-module-bluetooth pulseaudio-module-x11 libpulse-mainloop-glib0 libpulse0 libpulsedsp 

Then do a reboot.

UPDATE 1: Turns out that this only works for the first 30 seconds or so after the reboot. Then it crashes again, and I get no sound at all. :(

UPDATE 2: Actually, now it's been running for a while now and sound is still working. Over a few reboots. I've run the reinstall command several times now - I was hoping to reproduce this so I could file a bug, but now it won't break again.

UPDATE 3: OK it crashed again. I've filed a bug report. https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1643870

Related Question