You are not logged in.

#1 2017-11-27 02:43:03

Brocellous
Member
Registered: 2017-11-27
Posts: 155

Cannot start PulseAudio

Not sure if this is the right place, but here goes:

I recently noticed that pulseaudio does not start automatically, and I cannot start it from the command line.
pulseaudio fails with the following errors

$ pulseaudio
E: [pulseaudio] socket-server.c: bind(): Address already in use
E: [pulseaudio] module.c: Failed to load module "module-native-protocol-unix" (argument: ""): initialization failed.
E: [pulseaudio] main.c: Module load failed.
E: [pulseaudio] main.c: Failed to initialize daemon.

I can't find this error mentioned on the ArchWiki, so I did my best to investigate.
I wanted to know why the socket would already be in use, so I

pulseaudio -k

and try again

$ strace -e bind pulseaudio
...
bind(31, {sa_family=AF_UNIX, sun_path="/run/user/1000/pulse/native"}, 29) = -1 EADDRINUSE (Address already in use)
...

and

$ fuser -v /run/user/1000/pulse/native

shows that socket is used by systemd and pulseaudio.

I'm not sure why systemd wants this socket, so I poked around in /etc/systemd for a while and found that /etc/systemd/user/sockets.target.wants/ has only one file which has changed even remotely recently, pipewire.socket.
This change appears to have been the caused by pacman a few days ago:

From /var/log/pacman.log:

[ALPM] upgraded pipewire (0.1.6-1 -> 0.1.6-2)
[ALPM-SCRIPTLET] Created symlink /etc/systemd/user/sockets.target.wants/pipewire.socket → /usr/lib/systemd/user/pipewire.socket.

I think this is the conflicting socket, but I don't know.
I don't know what pipewire is, but removing it with

pacman -Rs pipewire

shows me a chain of dependencies pipewire <- mutter <- gnome-shell. I'm using gnome-shell at the moment so I'd rather not remove it unless someone suggests a similar alternative.

Why is systemd stealing the socket I want? How can I tell systemd to stop? This problem seems to persist after a reboot, so I think its here to stay until I can fix it.

Thanks for any help.

Offline

#2 2017-11-27 02:55:46

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,841

Re: Cannot start PulseAudio

Systemd has a socket listening. As soon as anything need pulse, it will be started. Why are you trying to start it manually?

Offline

#3 2017-11-27 03:09:05

Brocellous
Member
Registered: 2017-11-27
Posts: 155

Re: Cannot start PulseAudio

Scimmia wrote:

Systemd has a socket listening. As soon as anything need pulse, it will be started. Why are you trying to start it manually?

Because audio does not play anymore. When I discovered that pulse was not running, I figured that was the issue. Pavucontrol shows playback volume from chromium, but none from my output device, no matter what device I use.

Offline

#4 2017-11-27 03:20:50

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,841

Re: Cannot start PulseAudio

If pavucontrol is showing anything, pulse is running. Check systemctl --user status pulseaudio.service to verify.

Offline

#5 2017-11-27 03:32:03

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: Cannot start PulseAudio

Also make sure alsa is configured properly.  It's possible the sound is going to another output.

Offline

#6 2017-11-27 04:34:56

Brocellous
Member
Registered: 2017-11-27
Posts: 155

Re: Cannot start PulseAudio

Scimmia wrote:

If pavucontrol is showing anything, pulse is running. Check systemctl --user status pulseaudio.service to verify.

I did not know about the --user flag, it appears I was looking for pulseaudio service logs in the wrong place. I still have a lot to learn about systemd. Anyway,

$ systemctl --user status pulseaudio.service

confirms that pulseaudio is running, and in fact when I went to test audio from chromium again in pavucontrol my audio is mysteriously working again. . .

I'm not sure what could have fixed it, but I strongly suspect that I was just being a moron earlier. If the problem returns I'll make sure to properly investigate.

Thank you for your help and your patience.

Offline

Board footer

Powered by FluxBB