Ticket #222 (new defect)

Opened 3 years ago

Last modified 2 years ago

pacmd doesn't work with pulseaudio running as a system-wide daemon

Reported by: JeroenHoek Owned by: lennart
Milestone: Component: daemon
Keywords: Cc: hrubi13@…

Description

I have PulseAudio running as a system-wide daemon. The rationale for this is the presence of two users and a system-wide MPD daemon. The users should be able to control MPD and change its volume or redirect streams through PulseAudio.

pacmd doesn't seem to work in this setup. It does work if a user runs his own pulsedaemon and connects to that, but not the system-wide one. The user is in all three pulse* groups and the PID file is accessible.

Error:
E: pacmd.c: no PulseAudio daemon running

Version:
pulseaudio 0.9.8

OS:
Ubunutu 7.10 (Gutsy Gibbon)

Change History

Changed 2 years ago by hrubi

first of all you have to set correct PULSE_RUNTIME_PATH environment variable set (this is not documented as far as i know). on my system i set it to /var/run/pulse, can differ on your system.

as i've looked in the code, pacmd is trying to send signal 0 to the daemon, to check if daemon is alive, then it tries to send SIGUSR2, so the module-cli-protocol-unix is loaded. none of these succeeds as you lack permissions to do that as an ordinary user.

i've made a workaround for this via sudo, it's rather ugly, but it works:

put these lines into /etc/sudoers

Defaults:<your_user>    env_keep=PULSE_RUNTIME_PATH
<your_user> ALL=(pulse) NOPASSWD: /usr/bin/pacmd

then you can create some alias like this:

alias pacmd='PULSE_RUNTIME_PATH=/var/run/pulse sudo -u pulse pacmd'

i know it's just a weird hack, but it works for this time.

Changed 2 years ago by hrubi

  • cc hrubi13@… added
Note: See TracTickets for help on using tickets.