|
|

楼主 |
发表于 2007-5-9 22:13:32
|
显示全部楼层
已经自己解决了。过程复杂,方法十分简单
查了一下alsa wiki,其中CMI8738的驱动cmipci专门有一段关于中置音量调节的:
Volume Control
I found one solution to adjust the volume for all channels when using routing to map stereo to 5.1 as the dmix setup does not work with latest 1.0.11rc3 alsa release. On my CMI8738-MC6 the Master Volume only affects the front channel. Since the other channels are on "hw:0,1" and I found no way to adjust the levels on this, one can use "softvol" to do a virtual volume adjustment.
Drawback: Master Volume still does not affect all channels, but the custom "SoftMaster" item can be used to set the volume for all channels.
Here is my .asoundrc:
pcm.softvol {
type softvol
slave {
pcm "hw:0,1"
}
control {
name "SoftMaster"
}
}
pcm.dsp0 {
type plug
slave.pcm "softvol"
slave.channels 6
route_policy duplicate
}
pcm.!default {
type plug
slave.pcm "softvol"
slave.channels 6
route_policy duplicate
}
Here it is folks! A working CMI8738-mc6 config file that supports 5.1, upmixing, dmix, and now, softvol. You can control the volume of your center/lfe channels! This one enables default upmixing of 2.0->5.1 as we all real 5.1 streams to be dmixed at the same time, so you can watch a DVD in 5.1 (analog) and have other sounds still coming from all speakers.
# 6 channel dmix:
pcm.dmix6 {
type dmix
ipc_key 1024
ipc_key_add_uid false
ipc_perm 0660
slave {
pcm "hw:0,1"
rate 48000
channels 6
period_time 0
period_size 1024
buffer_time 0
buffer_size 5120
}
}
# upmixing:
pcm.ch51dup {
type route
slave.pcm dmix6
slave.channels 6
ttable.0.0 1
ttable.1.1 1
ttable.0.2 1
ttable.1.3 1
ttable.0.4 0.5
ttable.1.4 0.5
ttable.0.5 0.5
ttable.1.5 0.5
}
pcm.duplex {
type asym
playback.pcm "ch51dup" # upmix first
capture.pcm "hw:0"
}
# change default device:
pcm.!default {
type softvol
slave.pcm "duplex"
control {
name "Software Master"
card 0
}
}
# for aoss
pcm.dsp "duplex"
pcm.dsp1 "duplex"
大意是说要建立一个软混音器,以便和主声道一起调节中置的音量。看完以后,正准备建立这样的软混音器,突然灵机一动,mplayer里面不是有软混音?马上打开mplayer的gui界面,找到音频设置一段,选中enable software mixer,一试,天哪!这么简单!
而且有意思的是,从此以后,再使用totem,虽然没有设置过任何东西,但软混音器也起作用了,音量调节全部6声道联动的!也不知道mplayer给改了什么东西,估计是什么AC3解码器里给改的,否则不会影响totem的。
有类似问题的兄弟可试试看。不过,不要去调节系统的音量调节,那里没有用的,无论怎样调节还是中置和低音声道一点不变。 |
|