Eu quero rodar o sistema Pulseaudio, em um servidor headless do CentOS 7. O Pulseaudio funciona muito bem se eu começar com o startx, mas no modo de texto (equivalente ao nível de execução 3) os clientes de áudio de pulso falham.
Então criei um arquivo de serviço systemd:
[Unit]
Description=PulseAudio Daemon
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
PrivateTmp=true
ExecStart=/usr/bin/pulseaudio --system --realtime --disallow-exit --no-cpu-limit
que começa, mas vejo o seguinte no journalctl:
Jan 19 13:31:47 lserver.mydomain pulseaudio[2523]: W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading not set!
Jan 19 13:31:47 lserver.mydomain pulseaudio[2523]: N: [pulseaudio] main.c: Running in system mode, forcibly disabling SHM mode!
Jan 19 13:31:47 lserver.mydomain pulseaudio[2523]: N: [pulseaudio] main.c: Running in system mode, forcibly disabling exit idle time!
Jan 19 13:31:47 lserver.mydomain pulseaudio[2523]: W: [pulseaudio] main.c: OK, so you are running PA in system mode. Please note that you most likely shouldn't be doing that.
Jan 19 13:31:47 lserver.mydomain pulseaudio[2523]: W: [pulseaudio] main.c: If you do it nonetheless then it's your own fault if things don't work as expected.
Jan 19 13:31:47 lserver.mydomain pulseaudio[2523]: W: [pulseaudio] main.c: Please read http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/ for an explanation why system mode is usually a bad idea.
Jan 19 13:31:48 lserver.mydomain pulseaudio[2523]: N: [pulseaudio] alsa-util.c: Disabling timer-based scheduling because running inside a VM.
Jan 19 13:31:48 lserver.mydomain pulseaudio[2523]: N: [pulseaudio] alsa-util.c: Disabling timer-based scheduling because running inside a VM.
Jan 19 13:31:48 lserver.mydomain pulseaudio[2523]: W: [pulseaudio] authkey.c: Failed to open cookie file '/var/run/pulse/.config/pulse/cookie': No such file or directory
Jan 19 13:31:48 lserver.mydomain pulseaudio[2523]: W: [pulseaudio] authkey.c: Failed to load authentication key '/var/run/pulse/.config/pulse/cookie': No such file or directory
Jan 19 13:31:48 lserver.mydomain pulseaudio[2523]: W: [pulseaudio] authkey.c: Failed to open cookie file '/var/run/pulse/.pulse-cookie': No such file or directory
Jan 19 13:31:48 lserver.mydomain pulseaudio[2523]: W: [pulseaudio] authkey.c: Failed to load authentication key '/var/run/pulse/.pulse-cookie': No such file or directory
Jan 19 13:31:48 lserver.mydomain systemd[1]: Got message type=signal sender=org.freedesktop.DBus destination=n/a object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameOwnerChanged cookie=56 reply_cookie=0 error=n/a
Jan 19 13:31:48 lserver.mydomain systemd-logind[575]: Got message type=signal sender=org.freedesktop.DBus destination=n/a object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameOwnerChanged cookie=56 reply_cookie=0 error=n/a
Jan 19 13:31:48 lserver.mydomain systemd-logind[575]: Got message type=signal sender=org.freedesktop.DBus destination=n/a object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameOwnerChanged cookie=57 reply_cookie=0 error=n/a
Jan 19 13:31:48 lserver.mydomain systemd[1]: Got message type=signal sender=org.freedesktop.DBus destination=n/a object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameOwnerChanged cookie=57 reply_cookie=0 error=n/a
e tentativas de acessar o áudio falham:
speaker-test 1.1.1
Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Access denied
Playback open error: -111,Connection refused
E após o teste de alto-falante, o registro mostra:
Jan 19 14:06:39 lserver.ocg.ca pulseaudio[2795]: W: [pulseaudio] protocol-native.c: Denied access to client with invalid authentication data.
A raiz do usuário é adicionada ao grupo 'áudio'. E o teste do alto-falante está sendo executado como root. Alguém pode sugerir como consertar isso?