284

I was listening to music, and my sound suddenly went dead in all my applications. I'm using Ubuntu 12.04, which uses pulseaudio, so I tried sudo /etc/init.d/pulseaudio restart, but nothing happened. According to lsof | grep pcm, nothing is using the soundcard at the moment, although I'm not entirely sure if my source for that command is applicable.

Is there a way another way to restart Ubuntu 12.04's sound system from the command line without rebooting the system?

10 Answers10

531

I've used pulseaudio -k && sudo alsa force-reload a couple of times, and it worked well. The first part kills pulseaudio, the second reloads ALSA. You don't need to restart pulseaudio, because it auto-restarts.

mikewhatever
  • 33,013
70

What I do when my sound doesn't work is

killall pulseaudio

and then I press Alt + F2 and type in pulseaudio. It usually works for me.

Pablo Bianchi
  • 17,371
tofurator
  • 1,379
66

Just for completeness, in newer Ubuntus versions that use systemd, I used this and it worked well:

systemctl --user restart pulseaudio

Governa
  • 791
29

In my case there were nasty messages in kern.log / dmesg:

sound hdaudioC0D2: HDMI: invalid ELD buf size -1

The solution was simply to suspend and resume the machine!

$ sudo pm-suspend
joeytwiddle
  • 2,009
17

For the new multimedia framework Pipewire, which became the default since Ubuntu 22.10, restart the Pipewire services.

❯ systemctl --user restart pipewire.service

if the above is not enough, try

❯ systemctl --user restart pipewire-pulse.service

Rahil Wazir
  • 379
  • 7
  • 12
1

I had exactly the same symptom: sound suddenly died (after trying to use Audacity, in my case). The OP didn't mention he was/wasn't wearing headphones, which was my case. I tried all options here and, when going to Preferences and changing to HDMI or Speaker output worked, but switching to Headphones didn't work (no sound). I then tried to unplug and re-plug the headphones and it worked.

1

I encountered this issue with a USB audio device that would sometimes when booting the machine, not connect properly leaving me without audio until a reboot. If you are someone who is having the same issue but with a USB audio device then I recommend the following which fixed it for me:

sudo rmmod xhci_pci && sudo rmmod xhci_hcd && sudo modprobe xhci_pci xhci_hcd

None of the other answers would fix it and I assume that came down to the USB device not registering properly on boot. This simply reboots the USB devices. Note: you should only run all commands at once, running sudo rmmod xhci_hcd alone will disable all USB devices e.g., your keyboard, meaning the remaining commands cannot be run.

I will be honest and say that I doubt that the xchi_pci part is necessary, so if someone is more knowledgeable regarding this please correct me.

Hive7
  • 111
  • 2
1

For me on MX Linux 23 (Debian 12.1) the following worked:

sudo alsactl -F restore
SimonH
  • 115
0

Sleeping + waking up the PC is the only thing that's fixed it for me (other than a reboot). I'm using bluetooth audio w/ the notoriously buggy intel ax20x.

0

Have you looked inside the folder to see if pulseaudio was available in init.d, try replacing pulse audio with alsa-utils