我需要能够设置我的ALSA流的音量(来自PCM接口的snd_pcm_t)
我写了ALSA流公共函数:
int alsa_thread_startup(const char *pdevice, const char *cdevice, int latency,
FILE *__error_fp,
int verbose);
void alsa_thread_stop(void);
是pdevice是播放设备而cdevice是捕获设备。
我看到snd_pcm_t与控制接口之间没有任何关联。我使用了错误的API吗?
amixer控制-c0(主板):
numid=9,iface=MIXER,name='Master Mono Playback Switch'
numid=10,iface=MIXER,name='Master Mono Playback Volume'
numid=1,iface=MIXER,name='Master Playback Switch'
numid=2,iface=MIXER,name='Master Playback Volume'
numid=24,iface=MIXER,name='PCM Playback Switch'
numid=25,iface=MIXER,name='PCM Playback Volume'
numid=38,iface=MIXER,name='Surround Jack Mode'
numid=7,iface=MIXER,name='Surround Playback Switch'
numid=8,iface=MIXER,name='Surround Playback Volume'
numid=3,iface=MIXER,name='Center Playback Switch'
numid=4,iface=MIXER,name='Center Playback Volume'
numid=5,iface=MIXER,name='LFE Playback Switch'
numid=6,iface=MIXER,name='LFE Playback Volume'
numid=18,iface=MIXER,name='Line Playback Switch'
numid=19,iface=MIXER,name='Line Playback Volume'
numid=20,iface=MIXER,name='CD Playback Switch'
numid=21,iface=MIXER,name='CD Playback Volume'
numid=17,iface=MIXER,name='Mic Boost (+20dB)'
numid=37,iface=MIXER,name='Mic Front Input Switch'
numid=30,iface=MIXER,name='Mic Select'
numid=15,iface=MIXER,name='Mic Playback Switch'
numid=16,iface=MIXER,name='Mic Playback Volume'
numid=13,iface=MIXER,name='Phone Playback Switch'
numid=14,iface=MIXER,name='Phone Playback Volume'
numid=22,iface=MIXER,name='Aux Playback Switch'
numid=23,iface=MIXER,name='Aux Playback Volume'
numid=29,iface=MIXER,name='Mono Output Select'
numid=26,iface=MIXER,name='Capture Source'
numid=27,iface=MIXER,name='Capture Switch'
numid=28,iface=MIXER,name='Capture Volume'
numid=31,iface=MIXER,name='IEC958 Playback Con Mask'
numid=32,iface=MIXER,name='IEC958 Playback Pro Mask'
numid=35,iface=MIXER,name='IEC958 Playback AC97-SPSA'
numid=33,iface=MIXER,name='IEC958 Playback Default'
numid=41,iface=MIXER,name='IEC958 Playback Source'
numid=34,iface=MIXER,name='IEC958 Playback Switch'
numid=40,iface=MIXER,name='IEC958 Capture Switch'
numid=11,iface=MIXER,name='Beep Playback Switch'
numid=12,iface=MIXER,name='Beep Playback Volume'
numid=39,iface=MIXER,name='Channel Mode'
numid=36,iface=MIXER,name='Duplicate Front'
numid=42,iface=MIXER,name='External Amplifier'
numid=43,iface=PCM,name='Playback Channel Map'
amixer controls -c1(saa7134):
numid=2,iface=MIXER,name='Line Volume',index=1
numid=3,iface=MIXER,name='Line Volume',index=2
numid=5,iface=MIXER,name='Line Capture Switch',index=1
numid=6,iface=MIXER,name='Line Capture Switch',index=2
numid=1,iface=MIXER,name='Video Volume'
numid=4,iface=MIXER,name='Video Capture Switch'
答案 0 :(得分:0)
PCM设备和控制接口之间没有直接连接。
是否存在仅影响PCM设备的控件是否依赖于硬件。 如果存在,则通常称为“PCM播放音量”。按名称搜索此控件。 (请注意,在所有AC'97任何一些HDA编解码器上,此控件仅影响两个前置声道。)