256

Sometimes the pulseaudio service stops and it doesn't restart itself when I open an audio file with banshee or totem.

How I can make pulseaudio start again without having to logout?

3
  • 2
    Could I be so bold as to suggest accepting TikTak's answer? It works for me whereas the answer with the most upvotes has extra unnecessary steps. Apr 29, 2018 at 0:50
  • TikTak's answer is not the way one should restart PulseAudio in Ubuntu 2020 releases. systemctl should be used to restart PulseAudio.
    – kas
    Nov 1, 2020 at 19:47
  • Also note that the default audio system is Pipewire since Ubuntu 22.10 so you may need this instead: askubuntu.com/questions/230888/… Oct 21, 2023 at 19:12

10 Answers 10

248

I solved my problem.

  1. Check if any pulseaudio instance is running:

     pulseaudio --check
    

It normally prints no output, just exit code. 0 means running. Mine were not running, so I just advanced to step 3.

  1. If any instance is running, kill it:

     pulseaudio -k
    
  2. Finally, start pulseaudio again as a daemon:

     pulseaudio -D
    
  3. Start banshee again and enjoy!

6
  • 6
    For me --check didn't show anything, even though -k stopped audio playback, implying pulseaudio was running.
    – Cerin
    Apr 24, 2015 at 19:24
  • 10
    For me, pulseaudio gets so hung up (forgetting a sink) that pulseaudio -k doesn't do the job. After sudo killall pulseaudio, everything starts up again and works fine. (Ubuntu 16.04)
    – Raphael
    Nov 17, 2017 at 13:01
  • 11
    fyi, the step 1: "pulseaudio --check normally prints no output, just exit code 0 which means running" => so, there is no output, it's running; but, if you want to check the exit code anyway, run: echo $? which should print 0 if it's running. (the $? is the exit code of the previous command. If you run it twice, then it prints the exit code of echo)
    – michael
    Dec 7, 2017 at 6:15
  • 2
    You could combine steps 1 and 2 like so: pulseaudio --check && pulseaudio -k - it will only run the kill if check exits with 0 (running)
    – Jeff Ward
    Dec 1, 2020 at 17:32
  • 1
    Combining Raphael and Jeff's observations, I frequently find myself running pulseaudio --check && (pulseaudio -k || sudo killall pulseaudio)
    – Nick Bull
    Jul 5, 2021 at 14:46
112

Pulseaudio is a user service, so:

systemctl --user restart pulseaudio.service

Also there is this:

systemctl --user restart pulseaudio.socket

For checks replace restart with status.

3
  • 7
    To be run as normal user, the user which runs pulseaudio of course. Should be the top answer. And I have to say that for me pulseaudio was functioning well. But after some libraries where upgraded it had to be restarted.
    – Stéphane
    Aug 18, 2019 at 14:28
  • 1
    This is the right answer for me. pulseaudio -k does or returns nothing at all. The other option that worked was killall pulseaudio.
    – nyxee
    May 8, 2020 at 20:05
  • 3
    This is the correct answer for Ubuntu & other distros using SystemD to launch PulseAudio as a logged in user.
    – TrinitronX
    Jul 25, 2020 at 19:04
63

In a standard setup running pulseaudio -k restarts the daemon. Nothing else to do.

In case pulseaudio is not running typing pulseaudio without further options will start the daemon using defaults in /etc/pulse/daemon.conf and /etc/pulse/default.pa.

User-defined settings in ~/.pulse/ or ~/.config/pulse/ will override system-wide settings. In case of issues it will often help to delete these directories before restarting pulseaudio.

For details see PulseAudio Wiki.

7
  • /usr/bin/pulseaudio returns bash: /usr/bin/pulseaudio: Permission denied even though the file permissions seem fine: -rwxr-xr-x+ 1 root root 87K Jun 21 08:09 /usr/bin/pulseaudiowhy Jul 21, 2017 at 9:27
  • because the daemon is running as root Mar 20, 2018 at 15:07
  • rm ~/.config/pulse/* followed by pulseaudio -k did the trick. Mar 31, 2018 at 18:52
  • 1
    @Takkat What ?? pulseaudio -k kills the daemon, period. The manpage is very clear on that. You have to run pulseaudio --start afterwards to start the daemon.
    – Atralb
    Dec 21, 2020 at 6:42
  • 1
    @Atralb did you try my answer? As stated, in it's default installation pulseaudio will respawn automatically. If you then try to start the server a second time it will give you an error. If respawning was broken you may have a serious issue with your audio setup.
    – Takkat
    Dec 21, 2020 at 8:00
18

Following works for me on Ubuntu 18.04:

pulseaudio -k && sudo alsa force-reload
2
  • This just kills the sound completely.
    – mathtick
    Aug 21, 2020 at 14:04
  • @mathtick for me, 'pulseaudio -D' worked afterwards to restore the missing audio. This starts pulseaudio again.
    – mkV
    Jan 15, 2021 at 17:07
16

Use the service command (Ubuntu 14.04 or older only):

sudo service pulseaudio restart
4
  • I unfortunately don't have any specific knowledge in addition to the very explicit command. If if had, I would have had explained more. If you have any idea, please be my guest.
    – PowerKiKi
    Mar 2, 2015 at 13:40
  • 38
    Ubuntu 16.04: Failed to restart pulseaudio.service: Unit pulseaudio.service not found. Apr 11, 2017 at 18:58
  • 4
    pulseaudio runs in user mode (i.e. the currently logged-in user), no "service" registered. So that command cannot work.
    – Izzy
    Oct 17, 2018 at 15:27
  • Indeed, pulseaudio runs in user mode. See my answer
    – Rolf
    Mar 7, 2019 at 20:17
11

Run the following commands:

pulseaudio --check
pulseaudio --kill
pulseaudio --start
9

Here's how to do it in Ubuntu 15.10:

  1. Launch Terminal
  2. Run pulseaudio -k to kill the running daemon. You will get an error only if no daemon was running, otherwise no messages will appear.
  3. Ubuntu will attempt to restart the daemon automatically assuming there are no problems with the configuration. You can run pulseaudio --check to check that Pulseaudio is running. A clean exit (no message) from the check command indicates that the daemon has started successfully. Otherwise, run pulseaudio --start to launch the daemon. If you recently changed your configuration file and the daemon fails to start, check your file for errors and check the syslog (with the SystemLog app) for any messages from Pulseaudio.
8

If the pulseaudio failing to work is related to S3 sleep (Suspend to RAM), the real cause may be audio hardware problem and then you have to do heavy-handed full reset:

pulseaudio -k && sudo alsa force-reload && sleep 2 && pulseaudio -k && sudo alsa force-reload

Yeah, it needs to be done twice with small delay. I don't know why but this seems to work every time.

If you have multiple desktop environments in parallel (fast user switching)

sudo killall pulseaudio && sudo alsa force-reload && sleep 2 && sudo killall pulseaudio && sudo alsa force-reload
5

You would run this command to restart PulseAudio in Ubuntu 2020 releases:

systemctl --user restart pulseaudio
1
  • 2
    finally, a command that works on ubuntu 20. Also not sure what caused the service to not restart itself after reboot, but it happened after a recent update.
    – lasec0203
    Nov 8, 2020 at 5:19
4

I'd like to add my penny's worth to my namesake @rolf's systemDanswer.
The scenario:
Pulseaudio is locked up tight

You've tried:

systemctl --user stop pulseaudio.service pulseaudio.socket
systemctl --user restart pulseaudio.service
systemctl --user reset-failed pulseaudio.service

Still stubbonly it shows:

● pulseaudio.service - Sound Service
     Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Sun 2022-08-07 17:43:39 CEST; 8min ago
TriggeredBy: ● pulseaudio.socket
    Process: 6598 ExecStart=/usr/bin/pulseaudio --daemonize=no --log-target=journal (code=exited, status=1/FAILURE)
   Main PID: 6598 (code=exited, status=1/FAILURE)

Aug 07 17:43:39 pc1 systemd[1063]: pulseaudio.service: Failed with result 'exit-code'.
Aug 07 17:43:39 pc1 systemd[1063]: Failed to start Sound Service.
Aug 07 17:43:39 pc1 systemd[1063]: pulseaudio.service: Scheduled restart job, restart counter is at 5.
Aug 07 17:43:39 pc1 systemd[1063]: Stopped Sound Service.
Aug 07 17:43:39 pc1 systemd[1063]: pulseaudio.service: Start request repeated too quickly.
Aug 07 17:43:39 pc1 systemd[1063]: pulseaudio.service: Failed with result 'exit-code'.
Aug 07 17:43:39 pc1 systemd[1063]: Failed to start Sound Service.

The key here is that the restart counter has been exceeded.
If you manually run:
pulseaudio -vvvv

You may find the final lines say:

E: [pulseaudio] pid.c: Daemon already running.
E: [pulseaudio] main.c: pa_pid_file_create() failed.

Here, you need to find your user id's /run/user/1000/pulse directory, where the number 1000 is my user id number

Get your uid from the command: id

In the the pulse run directory is a file called pid , delete it!

Try starting pulseaudio -vvvv again, only to discover that it's bound to the Dbus or the bind Address already in use

E: [pulseaudio] main.c: D-Bus name org.PulseAudio1 already taken.
or
E: [pulseaudio] socket-server.c: bind(): Address already in use

So: ps -ef | grep pulseaudio to find any process still running it and kill it with

kill -15 pid number from grep

Now you can restart pulseaudio:

systemctl --user start pulseaudio.service pulseaudio.socket

or:

You could logout and log back in again :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .