How to Fix the No Sound Issue in Ubuntu

Ubuntuaudio Alsavolume

An issue often faced by Ubuntu users after installing Ubuntu or upgrading to a new version is the sound problem, or more specifically, the “no-sound” problem. This can happen for a variety of reasons. Sometimes it is related to a misconfiguration in the speaker settings, or maybe your hardware is not well-supported.

For most people, it’s usually a pretty easy problem to resolve. This is because most problems stem from an issue with services running on the system. In this article we go through a few simple fixes you can try. You don’t necessarily have to try them all. Just start at the top of the list and work your way down.

Also read: How to Easily Rename Files in Linux

Install Volume Control for PulseAudio

PulseAudio is a default sound service for Ubuntu as well as a few others. It’s open source and generally reliable, working with ALSA and OSS drivers to make sure the sound signals your system generates get passed on to your speakers.

Ubuntu Sound Not Working Pavucontrol

But while applications and desktop environments come with their own volume controls for PulseAudio, it’s not that granular and doesn’t let you control each playback stream individually. Pavucontrol gives you more control over each audio device on your PC, so you can play around with those sliders to make sure that your speaker or headphone volume is set to what it should be, for instance.

To install pavucontrol, open the Terminal and enter the following commands:

pulseaudio --start
sudo apt install pavucontrol

After that, run pavucontrol either from the terminal or looking up “PulseAudio Volume Control” in your desktop environment’s launch menu. Go to the “Output Devices” tab and make sure your default speakers are selected.

Check Your Speaker Settings

When experiencing sound issues on your Ubuntu machine, you first need to is check out your headphones and speakers for connection problems. It could be that a audio cable is connected to the wrong port or not connected at all.

If you’re using a Bluetooth device, check to see if it’s paired correctly. Don’t forget to take a look at the volume controls of your devices to make sure they’re at acceptable levels. You should also verify that the output volume is not muted on your computer and that the correct output device is selected.

ubuntu-sound-issue-1

Also read: How to Use ALSA Utilities to Manage Linux Audio from the Terminal

Check the ALSA Mixer

Under the hood PulseAudio uses ALSA, a kernel module that directly controls your sound devices. If you need more fine-grained control over your ALSA-level volume, follow the steps below:

  1. Open the terminal.
  2. Type alsamixer and press the Enter key. You will see the following output in your terminal.
ubuntu-sound-issue-2
  1. Select your correct sound card by pressing F6. For me, the defaults work just fine, but feel free to try other options if it doesn’t work.
  2. Use the left arrow and right arrow keys to select a volume control. The currently selected item is shown in red at the bottom.
  3. Use the up arrow and down arrow keys to increase and decrease volume levels for each control.
  4. When a mixer control is muted, “MM” appears below the volume bar. Note that a bar can be 100% full but still be muted, so do check for this. You can unmute a control by pressing the m key. This changes “MM” to “OO.”
  5. To exit alsamixer, press the Esc key.

Note: when you mute or unmute a control, pulseaudio may pick it up and mute and unmute other controls as well. Make sure to confirm that the relevant controls as well as the master control are unmuted before exiting.

Reload ALSA

Another thing you can try if the sound issue persists is to reload ALSA. To do that, use the following command in the terminal:

sudo alsa force-reload

The output looks like the following image.

ubuntu-sound-issue-3

Once it’s done, if you still have trouble getting the sound working, try

pulseaudio -k && pulseaudio -D

You may have trouble after reloading ALSA if pulseaudio does not register that the modules were reloaded.

If you’re still not getting audio, try this one-shot ALSA command directly:

alsactl restore

Also read: Subwoofer Not Working in Linux? Try These Tricks!

Reinstall ALSA and PulseAudio

If the above methods did not fix your issue, try reinstalling ALSA and PulseAudio in the following manner. Open your terminal and enter the following commands:

sudo apt remove --purge alsa-base pulseaudio
sudo apt install alsa-base pulseaudio

Reload ALSA again and reboot your computer.

Also read: How to Hide the Top Bar and Side Panel in Ubuntu

Advanced Troubleshooting

To properly troubleshoot your audio after all else fails, we have to get our hands just a bit dirtier and go into more advanced troubleshooting:

Your Output Might Trigger ALSA but Not PulseAudio

Ultimately, if PulseAudio mutes an output, it doesn’t matter what ALSA says. The sound coming out to your devices will be processed through ALSA but won’t be served to them through PulseAudio.

To get around this, we need to force ALSA to talk to PulseAudio when the master volume shifts to ensure that the latter follows along.

amixer -D pulse sset Master toggle

Devices whose volume can only interact with ALSA for some odd reason will also interact with PulseAudio.

Are You Sure It’s Not Just One Application?

A misbehaving application can cause more problems than you think in ways that would surprise you. It may even be an application you didn’t open!

To have a look at everything using your audio control, type:

pacmd list-sink-inputs

If you want to be more surgical about it, type:

pacmd list-sink-inputs | grep application.name
Ubuntuaudio Sinkinputs

In my case, as in the image, Firefox is the only thing I’m listening to. If you used grep to narrow down the output in terminal, use the original command again and pay attention to the values “muted:”, “index:” and “volume:”.

You might have had volume in the application and it could still be muted or on zero volume!

To fix a muted application, type (replace application_index with the index number you found in “index:”):

pacmd set-sink-input-mute application_index false

To fix applications with unusually low volume, type:

pacmd set-sink-input-volume application_index 0x10000

No Audio When Resuming After Suspend/Sleep

Sometimes PulseAudio just isn’t in the mood to wake up with the rest of your computer. In this case, running

pasuspender /bin/true

brings your audio back from the dead, but don’t get too excited. This will not survive another reboot or suspend/sleep. Carefully follow this mini-guide to make the problem go away permanently:

  1. In the terminal, type
sudo touch /etc/systemd/system/pulseaudio-sleep-fix@.service

to create a systemd service manager file.

  1. Open the file for editing:
sudo nano /etc/systemd/system/pulseaudio-sleep-fix.service

Paste (Ctrl + Shift + V for terminal paste) this into it:

[Unit]
Description=Fix PulseAudio after resume from suspend
After=suspend.target
 
[Service]
User=%I
Type=oneshot
Environment="XDG_RUNTIME_DIR=/run/user/%U"
ExecStart=/usr/bin/pasuspender /bin/true
 
[Install]
WantedBy=suspend.target
  1. Press Ctrl + X to exit and Y in the prompt asking you whether you want to save the modified buffer.
  2. Type the following to register this as a systemd service.
sudo systemctl enable pulseaudio-sleep-fix@your_username.service

Remember to replace your_username with the appropriate value.

Are You Running Timidity?

If you run the timidity package in Ubuntu (check by running apt search timidity and checking for [installed] at the end of the appropriate entry), you may have problems running PulseAudio with it due to the funky way it handles audio processing.

To get timidity to run properly, start by adding it to autostart (sometimes called Startup Applications in desktop environments like GNOME) and modifying the command that runs the application to be:

timidity -iA -Os

Taking things a little further, type the following to add root to the pulse-access group

sudo usermod -a -G pulse-access root

Once you reboot, your audio should work fine. If it still fails, the only other solution within reach is to remove timidity from Ubuntu.

Now you’ll have a service that’s meant to run only when you resume after suspend, immediately shutting down once it’s done its job to avoid adding bloat.

Frequently Asked Questions

1. Can I remove ALSA and keep PulseAudio?

Tread very carefully here! PulseAudio needs a kernel-level audio module to work. If you’re planning on replacing ALSA with something else that operates in the kernel (like Open Sound System), then by all means, go ahead and do that. The process is a bit more complex than replacing a Realtek kernel module for networking, so be aware that you may be sitting for a very long time trying to sort out issues.

2. Does PulseAudio have alternatives?

Yes! The most popular (and most viable, if you plan on using a desktop) alternative to PulseAudio is PipeWire. It contains better integrated support for Bluetooth devices and improves PulseAudio’s wonky way of handling sampling and post-processing. Many distributions now make it available in official repositories, and its stability has improved significantly in recent years.

If you want a more professional setup with your audio, however, you may want to opt for something like JACK.

3. Can I run PulseAudio alongside other services?

While some services have libraries and setup options in place to get PulseAudio working with them, it’s highly recommended that you stick to one service on your system at a time. Most services will simply compete with PulseAudio for your system’s applications, and it can cause unpredictable behavior. Others will simply not work at all without getting rid of PulseAudio entirely. (PipeWire uses the pipewire-pulse service, which replaces pulseaudio.)

Hopefully, the advice we’ve provided here got the sound running on Ubuntu again, so that you can start enjoying your operating system again. Have you tried turning a website into an app in Linux and casting the screen of your Android phone to Linux?

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Miguel Leiva-Gomez
Miguel Leiva-Gomez - Staff Writer

Miguel has been a business growth and technology expert for more than a decade and has written software for even longer. From his little castle in Romania, he presents cold and analytical perspectives to things that affect the tech world.