Linux

查找正確的 CMUS alsa 設備配置以進行音量控制

  • December 27, 2020

我有一個安裝了 IQAudio DAC+ 帽子的樹莓派,執行 Volumio linux 發行版。

該卡運作良好。我已將設置dsp.alsa.device設置為device:1,這會通過 DAC 帽正確輸出音頻。

但是 CMUS 音量控制不起作用。

我想我必須在 CMUS中設置mixer.alsa.channel和。mixer.alsa.device現在,他們被設置為

mixer.alsa.channel     PCM
mixer.alsa.device      default

我使用什麼設備名稱和通道名稱?

我試過這些組合:

mixer.alsa.channel     PCM
mixer.alsa.device      default:1

mixer.alsa.channel     Digital
mixer.alsa.device      default:1

mixer.alsa.channel     PCM
mixer.alsa.device      IQAudioIODac

mixer.alsa.channel     Digital
mixer.alsa.device      IQAudioIODac

mixer.alsa.channel     PCM
mixer.alsa.device      default:CARD=IQaudIODAC

mixer.alsa.channel     Digital
mixer.alsa.device      default:CARD=IQaudIODAC

但是 CMUS 總是給出錯誤資訊Error: can't change volume: mixer is not open

我應該使用不同的 CMUS 設置嗎?

這是我的輸出aplay -l

card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
 Subdevices: 6/7
 Subdevice #0: subdevice #0
 Subdevice #1: subdevice #1
 Subdevice #2: subdevice #2
 Subdevice #3: subdevice #3
 Subdevice #4: subdevice #4
 Subdevice #5: subdevice #5
 Subdevice #6: subdevice #6
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 1: IQaudIODAC [IQaudIODAC], device 0: IQaudIO DAC HiFi pcm512x-hifi-0 []
 Subdevices: 1/1
 Subdevice #0: subdevice #0

這是我的輸出aplay -L

hw:CARD=ALSA,DEV=0
   bcm2835 ALSA, bcm2835 ALSA
   Direct hardware device without any conversions
hw:CARD=ALSA,DEV=1
   bcm2835 ALSA, bcm2835 IEC958/HDMI
   Direct hardware device without any conversions
plughw:CARD=ALSA,DEV=0
   bcm2835 ALSA, bcm2835 ALSA
   Hardware device with all software conversions
plughw:CARD=ALSA,DEV=1
   bcm2835 ALSA, bcm2835 IEC958/HDMI
   Hardware device with all software conversions
default:CARD=IQaudIODAC
   IQaudIODAC, 
   Default Audio Device
sysdefault:CARD=IQaudIODAC
   IQaudIODAC, 
   Default Audio Device
dmix:CARD=IQaudIODAC,DEV=0
   IQaudIODAC, 
   Direct sample mixing device
dsnoop:CARD=IQaudIODAC,DEV=0
   IQaudIODAC, 
   Direct sample snooping device
hw:CARD=IQaudIODAC,DEV=0
   IQaudIODAC, 
   Direct hardware device without any conversions
plughw:CARD=IQaudIODAC,DEV=0
   IQaudIODAC, 
   Hardware device with all software conversions

我讓它工作的方式是我使用了 setmixer.alsa.device=hw:1

如果您輸入alsamixer,點擊F6並選擇您的音效卡,然後F6再次“輸入您的設備名稱”,它應該會顯示正確的混音器設置名稱。

對於我在 rpi3 上的 USB 音頻加密狗,這些設置有效:

set dsp.alsa.device=hw:1

set mixer.alsa.channel=hw:1

set mixer.alsa.device=USB Mixer

set output_plugin=alsa

僅供參考,我從 cmd 獲得了混音器設備名稱alsamixer info

引用自:https://unix.stackexchange.com/questions/437955