The Linux Page

pulseaudio not starting on newer Ubuntu (21.10, 22.04...)

Namibia Desert has audio like curves

Issue with pulseaudio

It looks like pulseaudio is about to become history¹. I've read that you should be using a new system in replacement to pulseaudio.

In the meantime, I have pulse audio installed and so was thinking it makes more sense to use that at the moment rather than trying to get a new thing going and that was preventing Shotcut from working².

Is it running?

To see whether it is running, use:

$ pactl info

If it works, you see a list of details about your audio device.

Server String: 127.0.0.1
Library Protocol Version: 35
Server Protocol Version: 35
Is Local: no
Client Index: 4
Tile Size: 65472
User Name: alexis
Host Name: monster
Server Name: pulseaudio
Server Version: 15.99.1
Default Sample Specification: s16le 2ch 44100Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo
Default Source: alsa_input.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.mono-fallback
Cookie: 43e5:b427

Is it failing?

If it is not working, you see the following message instead:

N: [pulseaudio] main.c: User-configured server at 127.0.0.1, refusing to start/autospawn.

and, in that case, you need to restart the system. Note that this is a user service so you do not want to use sudo at all.

Restarting pulseaudio

If done by hand, you can search for pulseaudio with:

$ ps -ef | grep pulseaudio
alexis     62617    6408  1 09:49 ?        00:00:00 /usr/bin/pulseaudio --daemonize=no --log-target=journal
alexis     62642    8723  0 09:50 pts/3    00:00:00 grep --color=auto pulseaudi

This gives you the PID of the pulseaudio process which you can kill like so:

$ kill 62617

Of course, you want to change the 62617 PID with the one you get in your console.

Note: there is a pulseaudio --kill option which may very well work. I've not tried it.

Now you're ready to restart pulseaudio with:

$ pulseaudio --start

After that command returns, the pactl info command should work. Note that the command returns an error message similar to the one I see when the pactl info fails.


¹ New System is PipeWire

From this post on the Shotcut Forum, it looks like the new system is going to be PipeWire. However, the user who posted is not using Ubuntu...

Please be aware that PipeWire has been replacing PulseAudio, but it is API compatible.

The fact is that it looks like that is the case and probably why pulseaudio is having issue. Here is a forum post on the Ubuntu website which says that the PipeWire replaced Pulseaudio. So I think that confirms the statement above. It may be that the upgrade scripts would not automatically replace such an element. This is why, once in a while, you need to re-install fresh instead of upgrading! (at least I did that with 18.04... I guess it's time I do that again...)

² Shotcut Issue

The reason I ended up looking into this is because I was trying to start Shotcut and it would not open the video area. Yet the OpenGL system was working just fine... The fact is that if the audio fails, then the system ends up not opening the OpenGL widget.

The issue is not directly in Shotcut. Instead, it happens in the SDL library. Interesting side effect, if you ask me.