서비스로 실행 시 기본 사운드 장치가 다름

서비스로 실행 시 기본 사운드 장치가 다름

나는 사용한다스퀴즈라이트내 노트북에서 오디오 스트림을 재생하려고요. 노트북에는 Intel 사운드 카드가 내장되어 있지만 모니터 스피커에서 사운드를 재생하려면 모니터에 대한 HDMI 연결을 사용합니다. 이것은 잘 작동하며 키보드의 미디어 버튼을 사용할 수 있습니다.
그러나 이것은 squeezelite를 백그라운드 작업으로 실행할 때만 작동합니다. squeezelite를 서비스로 실행하려고 하면 문제가 발생합니다. 그런 다음 노트북 스피커에서 소리가 재생됩니다. 그러나 squeezelite에서 사용할 사운드 장치를 지정할 수 있습니다. 일부 옵션에는 "default", "front" 및 "hdmi"가 있습니다. "default" 및 "front"는 노트북 스피커로 이동하고 "hdmi"는 모니터 스피커로 이동하지만 미디어 키는 우회합니다. 수동으로 실행하면 미디어 키가 작동하고 "default"와 "hdmi"가 모두 모니터 스피커로 이동합니다.

내 질문은: HDMI 스피커로 출력이 전송되고 미디어 키가 작동하는 상태에서 squeezelite를 서비스로 어떻게 실행할 수 있습니까?
squeezelite를 서비스(루트)로 실행하고 있기 때문에 "기본값"이 다른 의미를 가지며 미디어 키가 우회될 수 있습니까? 내 사용자로 실행하려고 했지만 start-stop-daemon작동하지 않았습니다.

내 사운드 장치 목록은 다음과 같습니다.

Output devices:
  default                        - Playback/recording through the PulseAudio sound server
  null                           - Discard all samples (playback) or generate zero samples (capture)
  pulse                          - PulseAudio Sound Server
  sysdefault:CARD=Intel          - HDA Intel, ALC272 Analog - Default Audio Device
  front:CARD=Intel,DEV=0         - HDA Intel, ALC272 Analog - Front speakers
  surround40:CARD=Intel,DEV=0    - HDA Intel, ALC272 Analog - 4.0 Surround output to Front and Rear speakers
  surround41:CARD=Intel,DEV=0    - HDA Intel, ALC272 Analog - 4.1 Surround output to Front, Rear and Subwoofer speakers
  surround50:CARD=Intel,DEV=0    - HDA Intel, ALC272 Analog - 5.0 Surround output to Front, Center and Rear speakers
  surround51:CARD=Intel,DEV=0    - HDA Intel, ALC272 Analog - 5.1 Surround output to Front, Center, Rear and Subwoofer speakers
  surround71:CARD=Intel,DEV=0    - HDA Intel, ALC272 Analog - 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
  dmix:CARD=Intel,DEV=0          - HDA Intel, ALC272 Analog - Direct sample mixing device
  dsnoop:CARD=Intel,DEV=0        - HDA Intel, ALC272 Analog - Direct sample snooping device
  hw:CARD=Intel,DEV=0            - HDA Intel, ALC272 Analog - Direct hardware device without any conversions
  plughw:CARD=Intel,DEV=0        - HDA Intel, ALC272 Analog - Hardware device with all software conversions
  hdmi:CARD=HDMI,DEV=0           - HDA ATI HDMI, HDMI 0 - HDMI Audio Output
  dmix:CARD=HDMI,DEV=3           - HDA ATI HDMI, HDMI 0 - Direct sample mixing device
  dsnoop:CARD=HDMI,DEV=3         - HDA ATI HDMI, HDMI 0 - Direct sample snooping device
  hw:CARD=HDMI,DEV=3             - HDA ATI HDMI, HDMI 0 - Direct hardware device without any conversions
  plughw:CARD=HDMI,DEV=3         - HDA ATI HDMI, HDMI 0 - Hardware device with all software conversions

어떤 아이디어가 있나요?

답변1

우리는 squeezelite 에뮬레이터에 대한 경험이 없지만 ALSA를 직접 사용하는 것으로 보입니다.

미디어 키로 ALSA를 제어하기 위해 정의할 수 있습니다.키보드 단축키sqeezelite를 실행하는 사용자의 경우(귀하의 경우 root):

amixer set Master 10%+ ## for Volume UP 10%
amixer set Master 10%- ## for Volume DOWN 10%
amixer set Master toggle ## for Mute

데스크톱 사용자 키보드 설정 또는 기타 사용자별 오디오 설정(예: 기본 오디오 장치)은 사용자 세션에서 Squeezlite를 실행한 후에만 작동합니다(예:로그인 시).

관련 정보