Pulseaudio daemon não está funcionando para pacmd

3

Atualmente, estou tentando fazer o perfil Bluetooth HSP funcionar em uma placa personalizada baseada no Atmel SAMA5D2. Estou usando um Linux personalizado feito de Buildroot-2017-08.

Estou no ponto em que tento configurar o pulseaudio. O pacote pulseaudio é o do buildroot e eu marquei "start as system daemon".

Quando o sistema é iniciado, o pulseaudio parece estar em execução

# ps aux | grep pulse
  174 pulse    usr/bin/pulseaudio --system --daemonize --disallow-exit --disallow-module-loading
  197 root     grep pulse

No entanto, quando tento me comunicar com o daemon, ele falha

# pacmd 
No PulseAudio daemon running, or not running as session daemon.
# pacmd info
No PulseAudio daemon running, or not running as session daemon.
# pactl info
Connection failure: Access denied

Percebi que a mensagem mudaria se eu exportasse a seguinte variável de ambiente

# export PULSE_RUNTIME_PATH="/run/pulse"
# pacmd info
Daemon not responding.
# pactl info
Connection failure: Access denied

Com relação aos direitos de acesso a esta pasta, eles estão

# ls -la /run/pulse/
total 8
drwx------ 3 root  root  120 Jan  2 05:09 .
drwxr-xr-x 6 root  root  240 Jan  2 05:09 ..
drwxr-xr-x 3 pulse pulse  60 Jan  2 05:09 .config
-rw------- 1 pulse pulse  16 Jan  2 05:09 .esd_auth
srwxrwxrwx 1 pulse pulse   0 Jan  2 05:09 native
-rw------- 1 pulse pulse   4 Jan  2 05:09 pid

A partir desta pergunta Problemas com pulseaudio - pavucontrol e pacmd não conectando ao pulseaudio Tentei alterar os direitos sobre o diretório, mas isso não mudou nada.

# ls -la /run/pulse/
total 8
drwx------ 3 pulse pulse 120 Jan  2 05:09 .
drwxr-xr-x 6 root  root  240 Jan  2 05:09 ..
drwxr-xr-x 3 pulse pulse  60 Jan  2 05:09 .config
-rw------- 1 pulse pulse  16 Jan  2 05:09 .esd_auth
srwxrwxrwx 1 pulse pulse   0 Jan  2 05:09 native
-rw------- 1 pulse pulse   4 Jan  2 05:09 pid

Parece que há alguns problemas ao analisar os registros, mas não posso dizer se isso é importante ou não.

# cat /var/log/messages | grep pulse
Jan  2 05:43:19 buildroot pulseaudio[174]: [pulseaudio] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabil.
Jan  2 05:43:19 buildroot pulseaudio[174]: [pulseaudio] main.c: OK, so you are running PA in system mode. Please note that you most likely shouldn't be doing that.
Jan  2 05:43:19 buildroot pulseaudio[174]: [pulseaudio] main.c: If you do it nonetheless then it's your own fault if things don't work as expected.
Jan  2 05:43:19 buildroot pulseaudio[174]: [pulseaudio] main.c: Please read http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/ for an exp.
Jan  2 05:43:19 buildroot pulseaudio[174]: [pulseaudio] module.c: module-detect is deprecated: Please use module-udev-detect instead of module-detect!
Jan  2 05:43:19 buildroot pulseaudio[174]: [pulseaudio] alsa-util.c: Disabling timer-based scheduling because high-resolution timers are not available from the kernel.
Jan  2 05:43:20 buildroot pulseaudio[174]: [pulseaudio] authkey.c: Failed to open cookie file '/var/run/pulse/.config/pulse/cookie': No such file or directory
Jan  2 05:43:20 buildroot pulseaudio[174]: [pulseaudio] authkey.c: Failed to load authentication key '/var/run/pulse/.config/pulse/cookie': No such file or directory
Jan  2 05:43:20 buildroot pulseaudio[174]: [pulseaudio] authkey.c: Failed to open cookie file '/var/run/pulse/.pulse-cookie': No such file or directory
Jan  2 05:43:20 buildroot pulseaudio[174]: [pulseaudio] authkey.c: Failed to load authentication key '/var/run/pulse/.pulse-cookie': No such file or directory

Além disso, não tenho escolha para executar o pulseaudio como root porque não há outro usuário no meu destino.

EDITAR:

Depois de reiniciar o pulseaudio no modo detalhado (-vvv), parece que o problema vem de um dado de conexão inválido

# pactl info -vvv
Connection failure: Access denied
# cat /var/log/messages | grep pulse | tail -n 20
Jan  2 06:27:51 buildroot pulseaudio[250]: [pulseaudio] main.c: Daemon startup successful.
Jan  2 06:27:51 buildroot pulseaudio[252]: [pulseaudio] main.c: Daemon startup complete.
Jan  2 06:27:51 buildroot pulseaudio[252]: [pulseaudio] module.c: Unloading "module-detect" (index: #0).
Jan  2 06:27:51 buildroot pulseaudio[252]: [pulseaudio] module.c: Unloaded "module-detect" (index: #0).
Jan  2 06:27:56 buildroot pulseaudio[252]: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.0.analog-stereo idle for too long, suspending ...
Jan  2 06:27:56 buildroot pulseaudio[252]: [pulseaudio] sink.c: Suspend cause of sink alsa_output.0.analog-stereo is 0x0004, suspending
Jan  2 06:27:56 buildroot pulseaudio[252]: [alsa-sink-CLASSD PCM atmel-classd-hifi-0] alsa-sink.c: Device suspended...
Jan  2 06:27:56 buildroot pulseaudio[252]: [pulseaudio] core.c: Hmm, no streams around, trying to vacuum.
Jan  2 06:28:28 buildroot pulseaudio[252]: [pulseaudio] client.c: Created 0 "Native client (UNIX socket client)"
Jan  2 06:28:28 buildroot pulseaudio[252]: [pulseaudio] protocol-native.c: Protocol version: remote 31, local 31
Jan  2 06:28:28 buildroot pulseaudio[252]: [pulseaudio] protocol-native.c: Got credentials: uid=0 gid=0 success=0
Jan  2 06:28:28 buildroot pulseaudio[252]: [pulseaudio] protocol-native.c: Denied access to client with invalid authentication data.
Jan  2 06:28:28 buildroot pulseaudio[252]: [pulseaudio] client.c: Freed 0 "Native client (UNIX socket client)"
Jan  2 06:28:28 buildroot pulseaudio[252]: [pulseaudio] protocol-native.c: Connection died.
Jan  2 06:28:43 buildroot pulseaudio[252]: [pulseaudio] client.c: Created 1 "Native client (UNIX socket client)"
Jan  2 06:28:43 buildroot pulseaudio[252]: [pulseaudio] protocol-native.c: Protocol version: remote 31, local 31
Jan  2 06:28:43 buildroot pulseaudio[252]: [pulseaudio] protocol-native.c: Got credentials: uid=0 gid=0 success=0
Jan  2 06:28:43 buildroot pulseaudio[252]: [pulseaudio] protocol-native.c: Denied access to client with invalid authentication data.
Jan  2 06:28:43 buildroot pulseaudio[252]: [pulseaudio] client.c: Freed 1 "Native client (UNIX socket client)"
Jan  2 06:28:43 buildroot pulseaudio[252]: [pulseaudio] protocol-native.c: Connection died.

Depois de adicionar o usuário root ao grupo de pulsos, o problema persiste.

EDIT 2:

Alterar os direitos de acesso ao processo para permitir que os membros do grupo de pulsos leiam / escrevam e executem arquivos parece revelar um pouco a situação, pois agora posso me comunicar com o daemon, mas não agir de acordo com ele.

# pactl info
Server String: /run/pulse/native
Library Protocol Version: 31
Server Protocol Version: 31
Is Local: yes
Client Index: 1
Tile Size: 65496
User Name: pulse
Host Name: buildroot
Server Name: pulseaudio
Server Version: 9.0
Default Sample Specification: s16le 2ch 44100Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.platform-fc048000.classd.analog-stereo
Default Source: alsa_output.platform-fc048000.classd.analog-stereo.monitor
Cookie: 6ae9:b402
# pacmd info
Daemon not responding.
    
por Arkaik 19.10.2017 / 15:50

1 resposta

1

Finalmente, parece que foi uma questão de perfil.

Acabei de alterar a linha de umask de umask 077 para umask 007 em /etc/init.d/S50pulseaudio , para que os membros do grupo de pulso possam acessar os arquivos.

Conteúdo de /etc/init.d/S50pulseaudio

#!/bin/sh
#
# Starts pulseaudio.
#


start() {
        printf "Starting pulseaudio: "
        #umask 077
        umask 007
        /usr/bin/pulseaudio --system --daemonize --disallow-exit --disallow-module-loading -vvv
        echo "OK"
}
stop() {
        printf "Stopping pulseaudio: "
        killall pulseaudio
        echo "OK"
}
restart() {
        stop
        start
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart|reload)
        restart
        ;;
  *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
esac

exit $?

Em relação ao pacmd, é normal não poder acessá-lo, pois estou executando o pulseaudio em todo o sistema.

    
por 20.10.2017 / 10:26