3. 配置modprobe.conf
这里的工作是让系统在启动的时候自动加载声卡驱动,如果你的声卡以前可以被Linux系统识别,那么这个文件里会有原先驱动的配置信息,我们需要把他们全部删掉,例如我的modprobe.conf中有
alias snd-card-0 snd-intel8x0
options snd-card-0 index=0
install snd-intel8x0 /sbin/modprobe --ignore-install snd-intel8x0 &&
/usr/sbin/alsactl restore >/dev/null 2>&1 || :remove snd-intel8x0 {
/usr/sbin/alsactl store >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-intel8x0
那么需要把这几行都删除,然后加入alsa驱动的配置,不要担心复杂的参数设置,因为所有的声卡驱动模块的设置在文档中都有(还记得安装alsa-driver叫你访问的页面吗?),通过查看alsa主页上关于intel8x0的文档,我在modprobe.conf里加入了以下几行:
# ALSA portion
alias char-major-116 snd
alias snd-card-0 snd-intel8x0
# module options should go here
# OSS/Free portion
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0
# card #1
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
4. 测试新的声卡
到此,声卡驱动就安装成功了,我们现在需要重启机器让新的驱动生效(当然可以不重启,不过你得先rmmod旧驱动然后执行:modprobe snd-intel8x0;modprobe snd-pcm-oss;modprobe snd-mixer-oss;modprobe snd-seq-oss)
5.asoundrc文件
做完上面得工作仅仅是能驱动声卡而已,要做到多路音频混合输出还得在你的home目录下创建一个.asoundrc文件,内容如下,你只要把下面的内容复制下来贴到你自己的文件里即可,需要改动的只有两个地方:
pcm.intel8x0 { #<--这里的intel8x0换成你自己的驱动名字
type hw
card 0
}
ctl.intel8x0 { #<--这里的intel8x0换成你自己的驱动名字
type hw
card 0
}
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 8192
rate 44100
}
bindings {
0 0
1 1
}
}
ctl.dmixer {
type plug
slave.pcm "dmixer"
}
pcm.mixin {
type dsnoop
ipc_key 5978293 # must be unique for all dmix plugins!!!!
ipc_key_add_uid yes
slave {
pcm "hw:0,0"
channels 2
period_size 1024
buffer_size 4096
rate 44100
periods 0
period_time 0
}
bindings {
0 0
0 1
}
}
6.测试
首先运行alsamixer把各路输出的音量都打开,然后打开xmms,mplayer试试吧,可以同时出声了,呵呵,对于按照上面的步骤仍然不能和别的程序同时发声的程序可以用aoss来启动,例如realplayer可以创建一个快捷方式,执行命令是aoss realplayer这样就行了.
