3

I'm using Devuan ASCII (~= Debian Stretch). Audio seems to be work, or at least - playback is working, in my browsers and media players. However, if I try to run pavucontrol to make some settings - which usually works - it tells me:

Connection to pulseaudio failed

in this case etc. etc. This situation can also arise if pulseaudio crashed etc. etc. If this is the case, then PulseAudio should autospawn again, or if this is not configured you should run start-pulseaudio-x11 manually.

So, I don't know if autospawn is configured, but in /etc/pulse/client.conf it says:

; autospawn = yes

and daemon.conf it doesn't mention autospawning. Anyway, there is no process with pulse in its name, nor a kernel module.

Here are the kernel modules with snd in their name:

nd_hda_codec_hdmi     49152  2
snd_hda_codec_realtek    90112  1
snd_hda_codec_generic    69632  1 snd_hda_codec_realtek
snd_usb_audio         180224  0
snd_usbmidi_lib        28672  1 snd_usb_audio
snd_hda_intel          36864  1
snd_rawmidi            32768  1 snd_usbmidi_lib
snd_seq_device         16384  1 snd_rawmidi
snd_hda_codec         135168  4 snd_hda_intel,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec_realtek
snd_hda_core           86016  5 snd_hda_intel,snd_hda_codec,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec_realtek
snd_hwdep              16384  2 snd_hda_codec,snd_usb_audio
snd_pcm               110592  5 snd_hda_intel,snd_hda_codec,snd_usb_audio,snd_hda_core,snd_hda_codec_hdmi
snd_timer              32768  1 snd_pcm
snd                    86016  14 snd_hda_intel,snd_hwdep,snd_hda_codec,snd_usb_audio,snd_timer,snd_rawmidi,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_usbmidi_lib,snd_seq_device,snd_hda_codec_realtek,snd_pcm
soundcore              16384  1 snd
usbcore               253952  8 uvcvideo,usbhid,snd_usb_audio,usb_storage,xhci_pci,snd_usbmidi_lib,uas,xhci_hcd

So, I tried restarting the service, and here's what I got:

$ start-pulseaudio-x11 
Connection failure: Connection refused
pa_context_connect() failed: Connection refused

and if I try that as root, I get:

# start-pulseaudio-x11
XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e g happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
Connection failure: Connection refused
pa_context_connect() failed: Connection refused

Another thing I tried:

$ pulseaudio --start --verbose
E: [pulseaudio] main.c: Daemon startup failed.

But there is something interesting going on: /var/log/syslog is being filled with more and more of the following:

Jan 28 22:01:16 myhostname pulseaudio[22085]: [pulseaudio] cli-command.c: stat('/usr/share/pulseaudio/default.pa'): No such file or directory
Jan 28 22:01:16 myhostname pulseaudio[22085]: [pulseaudio] main.c: Failed to initialize daemon.
Jan 28 22:01:16 myhostname pulseaudio[22082]: [pulseaudio] main.c: Daemon startup failed.

so, there's a continuing failing attempt at a respawn, and it's missing a file.

What should I do?

einpoklum
  • 10,666

3 Answers3

5

I encountered a similar issue, however I did not have a default.pa file.

I found the following steps worked. In terminal:

apt-get purge pulseaudio

Then, under

$HOME/.config

Delete the entire pulse folder.

Then reinstall pulseaudio:

apt-get install pulseaudio

When firing up, pulseaudio will complain it failed to 'open cookie file' if called from terminal, however it will recreate the entire folder structure. Running it again, it will resume normal operations with sound (hopefully) enabled.

1

This solution is due to "wabbit" on #pulseaudio@irc.freenode.net

You probably have a file named

$HOME/.config/pulse/default.pa

remove it, and pulseaudio should either respawn itself, or you can start it with something like pactl info or just pulseaudio. When that happens, the pavucontrol volume control GUI should also work again.

To ensure the daemon is up, have a look at /var/log/syslog; you should lines such as:

Jan 29 00:56:34 myhostname pulseaudio[19553]: [pulseaudio] source.c: Default and alternate sample rates are the same.

and maybe

Jan 29 00:56:36 myhostname pulseaudio[19563]: [pulseaudio] pid.c: Daemon already running.
einpoklum
  • 10,666
0

sudo mkdir -p /run/user/1000/pulse

sudo chown -R $USER:$USER /run/user/1000

pulseaudio --start