You are not logged in.

#1 2023-05-15 12:25:43

Section8
Member
Registered: 2023-05-12
Posts: 23

[solved] No sound when pulseaudio is started by systemd units.

New Arch user here - running LXQT started from sddm

I am having a problem with pulseaudio.  When it is started through the systemd pulseaudio.socket and pulseaudio.service units, I have no sound and when my music player (strawberry) tries to connect, it gets "connection refused":

Failed to connect: Connection refused
../gstreamer/subprojects/gst-plugins-good/ext/pulse/pulsesink.c(616): gst_pulseringbuffer_open_device (): /GstBin:audiobin/GstPulseSink:pipeline-1-pulsesink

If I do "systemctl --user stop pulseaudio.socket pulseaudio.service", and just enter "pulseaudio" from a terminal, I have sound and I don't get connections refused.  I have tried to compare the outputs of "pulseaudio -v", from journalctl and when run from a terminal, but can't see the difference.  Can someone please help me fix this?

systemctl --user status pulseaudio:

● pulseaudio.service - Sound Service
     Loaded: loaded (/home/john/.config/systemd/user/pulseaudio.service; enabled; preset: enabled)
     Active: active (running) since Mon 2023-05-15 06:17:30 CDT; 1h 3min ago
TriggeredBy: ● pulseaudio.socket
   Main PID: 714 (pulseaudio)
      Tasks: 7 (limit: 38345)
     Memory: 50.1M
        CPU: 93ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pulseaudio.service
             ├─714 /usr/bin/pulseaudio --daemonize=no --log-target=journal -v
             └─780 /usr/lib/pulse/gsettings-helper

pulseaudio -v output from journalctl:  https://bpa.st/YB2KY

pulseaudio -v output from terminal:  https://bpa.st/NC35S

Last edited by Section8 (2023-05-28 21:11:25)

Offline

#2 2023-05-16 07:42:14

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,248

Re: [solved] No sound when pulseaudio is started by systemd units.

What do you get from

sudo fuser -v /dev/snd/*

during not working? Do you potentially use some VPN or so after logging in that might aggressively redirect/block network connections?

Offline

#3 2023-05-16 09:49:51

Section8
Member
Registered: 2023-05-12
Posts: 23

Re: [solved] No sound when pulseaudio is started by systemd units.

With no sound, pulseaudio running via systemd, I have:

[john@officepc ~]$ sudo fuser -v /dev/snd/*
                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  john        724 F.... pulseaudio
/dev/snd/controlC1:  john        724 F.... pulseaudio

I don't have anything like a VPN running that should block the connection.

Offline

#4 2023-05-28 21:09:59

Section8
Member
Registered: 2023-05-12
Posts: 23

Re: [solved] No sound when pulseaudio is started by systemd units.

I think I have finally resolved this, although I still don't understand everything involved.

At some time in the past, I was trying pipewire (maybe under gentoo, before I switched to arch), and for some reason, I set this in my user .bash_profile:

# set XDG_RUNTIME_DIR for pipewire:
unset XDG_RUNTIME_DIR
export XDG_RUNTIME_DIR=$(mktemp -d /tmp/$(id -u)-runtime-dir.XXX)

Anyway, removing that from my .bash_profile, and letting XDG_RUNTIME_DIR default to /run/user/1000 fixes this problem and pulseaudio starts under systemd successfully.

Offline

Board footer

Powered by FluxBB