20

i play vlc but surprised by this error :Audio output failed: The audio device "default" could not be used: No such file or directory. so i search for it and the run this command : vlc --reset-config --reset-plugins-cache but it produce this error PulseAudio server connection failure: Connection refused and also there's no sound when i using browser and i don't know what to do hint: my sound was work well but suddenly this happen

1
  • Check logfiles, look for pulseaudio lines. It seems to be crashed. May 23, 2018 at 11:24

5 Answers 5

14

It might be because either your pulseaudio driver is broken and/or has permissions set to root.

I had solved this problem with the following commands :

# clean and reinstall pulseaudio
sudo apt-get remove --purge alsa-base pulseaudio
sudo apt-get install alsa-base pulseaudio
sudo apt-get -f install && sudo apt-get -y autoremove && sudo apt-get autoclean && sudo apt-get clean && sudo sync && echo 3 | sudo tee /proc/sys/vm/drop_caches
# fixes user folder permissions
sudo chown -R $USER:$USER $HOME/
# then reboot
sudo reboot

Pulseaudio should be started at startup but you can manually start it with :

pulseaudio --start

If the problem persists, feel free to paste your system log here

tail -100f /var/log/syslog
4
  • chown command took very long but then I though it might be not needed. I have web projects in my home dire and it might make somewthing wrong, so I cancelled this. After pulseaudio --start - sound worked ,but after computer restart - it did not. In my case even before fixing - at the begggining it was not working, after like half an hour it used to start working. I have added to startup "pulseaudio --start" and now audio workse again on OS start. Using xubuntu 18
    – Darius.V
    Mar 9, 2020 at 12:09
  • 6
    Yes - that chown -R is very reckless and unlikely to be necessary. If the user directory and/or the pulse directory need correct permissions, then just set those, don't blow away all of someone's ownership settings. May 12, 2020 at 8:53
  • I actually did only the first of these steps i.e. removed pulse and alsa, and just tried vlc then and it worked! Never did the reinstall VLC works better without these somehow.
    – robert
    Sep 28, 2022 at 12:37
  • The apt-get command to purge... The following packages will be REMOVED: ... ubuntu-desktop* ubuntu-desktop-minimal* ... so clearly that cannot work. I don't want to remove the whole desktop. Feb 4 at 20:36
5

On my Xubuntu 18.04 system, I had a problem with pulseaudio not accepting the ~/.config/pulse/cookie file.

I tried to reinstall pulseaudio as suggested in the other answer but that didn't help, so I simply removed and re-generated the user configuration as follows:

mv ~/.config/pulse ~/.config/pulse.old
pulseaudio --start

which fixed the problem for me.

5

Got a temporary solution at ubuntuforums

$ pulseaudio --check
corei3@corei3 ~ $ pulseaudio -k
corei3@corei3 ~ $ pulseaudio -D
E: [pulseaudio] main.c: Daemon startup failed.
1
  • fwiw, i seemed to need to create and set the XDG_RUNTIME_DIR. sudo install -o $myuser -d /var/run/user/$myuserid then XDG_RUNTIME_DIR=/var/run/user/$myuserid dbus-launch bash then (with the pulse ~/.config/pulse directory cleaned) pulseaudio -D THEN I could start my app. when did multi-user systems get so complicated :( Jul 30, 2023 at 20:29
3

For my pulseaudio "connection refused" issue the following helped:

mv -v ~/.config/pulseaudio{,~}

This way the pulseaudio userspace configuration is reset (without destroying the old). No reinstall or reboot was needed.

0

For me all other solutions failed. This made the trick :

pax11publish -r

After that, pulseaudio is found by everybody.

You must log in to answer this question.

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