pacmd용 Pulseaudio 데몬이 실행되고 있지 않습니다.

pacmd용 Pulseaudio 데몬이 실행되고 있지 않습니다.

현재 맞춤형 Atmel SAMA5D2 기반 보드에서 HSP Bluetooth 프로필을 작동시키려고 합니다. Buildroot-2017-08로 만든 사용자 정의 Linux를 사용하고 있습니다.

펄스오디오를 구성하려고 합니다. pulseaudio 패키지는 buildroot의 패키지이며 "시스템 데몬으로 시작"을 선택했습니다.

시스템이 부팅될 때 pulseaudio가 실행 중인 것 같습니다.

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

하지만 데몬과 통신을 시도하면 실패합니다.

# 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

다음 환경 변수를 내보내면 메시지가 변경된다는 것을 깨달았습니다.

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

이 폴더에 액세스할 수 있는 권한은 다음과 같습니다.

# 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

이 질문에서펄스 오디오 문제 - pavucontrol 및 pacmd가 펄스 오디오에 연결되지 않았습니다.디렉토리에 대한 권한을 변경해 보았지만 아무 것도 변경되지 않았습니다.

# 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

로그를 보면 뭔가 문제가 있는 것 같은데, 큰 문제인지는 모르겠습니다.

# 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

또한 내 대상에 다른 사용자가 없기 때문에 펄스 오디오를 루트로 실행할 수 있는 옵션이 없습니다.


편집하다:

상세 모드(-vvv)에서 pulseaudio를 다시 시작한 후 잘못된 연결 데이터로 인해 문제가 발생한 것 같습니다.

# 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.

펄스 그룹에 루트 사용자를 추가한 후에도 문제가 여전히 존재합니다.


편집 2:

펄스 그룹의 구성원이 파일을 읽고 쓰고 실행할 수 있도록 프로세스 액세스 권한을 변경하면 이제 데몬과 통신할 수 있지만 작동할 수 없기 때문에 일부 상황이 해결된 것 같습니다.

# 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.

답변1

마지막으로 이는 구성 파일 문제인 것 같습니다.

펄스 그룹의 구성원이 파일에 액세스할 수 있도록 umask 줄을 에서 in umask 077으로 변경했습니다.umask 007/etc/init.d/S50pulseaudio

콘텐츠 /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 $?

이것이 정상이라고 생각하면 pacmd시스템 전체에서 pulseaudio를 실행하고 있기 때문에 액세스할 수 없습니다.

관련 정보