红联Linux门户
Linux帮助

linux下安装alsa声卡驱动以及播放mp3

发布时间:2006-09-15 11:11:12来源:红联作者:严寒
我用的linux发行版是RedHat9.0,内核版本是2.4.20-8.声卡是Intel 82801EB AC'97 Audio集成声卡,对应的模块为snd-intel8x0.
首先去ftp://ftp.alsa-project.org下载alsa-driver-1.0.7.tar.bz2,alsa-lib-1.0.7.tar.bz2,alsa-utils-1.0.7.tar.bz2,并保存到同一目录下,例如为/alsa.解压缩.
安装alsa-driver-1.0.7前要仔细阅读该目录下的INSTALL文件,比较重要的信息是:
1.You must compile the kernel with sound support (CONFIG_SOUND on 2.2/2.4 kernels) either as module or built-in.即:首先内核要支持声卡,不管是内建还是编译成模 块.可用命令modinfo soundcore查看.
2.Note that module option names were changed in 0.9.0rc4. The 'snd_' prefix was removed. You may use script in utils directory (module-options) to convert your older /etc/modules.conf to newer one. 在0.9.0rc4之后的版本模块名发生变化,需要使用alsa-driver-1.0.7/utils/module-options来转换新的/etc/modules.conf.
3.You must have full configured source for the Linux kernel which you want to use for the ALSA drivers. Note that ALSA drivers are part of the kernel, so there is necessary to resolve all symbol dependencies between the used kernel and ALSA driver code.必须要有完整的内核源码.内核源代码目录为/usr/src/linux-2.4.20-8.另外,If you have kernel source code in another directory than /usr/src/linux, use --with-kernel=.当然,也可以建立一个符号链接/usr/src/linux-->/usr/src/linux-2.4.20-8.
4.Autoloading on Older Kernels
============================

On 2.2 or 2.4 kernels, you have to set the additional aliases for
auto-loading via kmod in /etc/modules.conf:

----- /etc/modules.conf
# ALSA portion
alias char-major-116 snd
# OSS/Free portion
alias char-major-14 soundcore
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
----- /etc/modules.conf

The aliases sound-service-x-y define the add-on modules for ALSA
OSS emulation. For the second or later card, define more aliases
for mixer and pcm in addition, such as:

----- /etc/modules.conf
# OSS/Free portion - card #2
alias sound-service-1-0 snd-mixer-oss
alias sound-service-1-3 snd-pcm-oss
alias sound-service-1-12 snd-pcm-oss
----- /etc/modules.conf
对于比较老的内核版本,例如2.4以及以前的版本,要修改/etc/modules.conf文件,将上面提到的相关信息加进去.

下面就可以按照INSTALL文件中的Quick install部分进行安装:
1)./configure --with-cards=intel8x0 --with-sequencer=yes
2)make
3)make install
4)./snddevices用于在/dev下创建新的设备文件.

安装alsa-lib-1.0.7:
1)cd alsa-lib-1.0.7
2)./configure
3)make
4)make install
安装alsa-utils-1.0.7:
1)cd alsa-utils-1.0.7
2)./configure
3)make
4)make install

modprobe snd-intel8x0
modprobe snd-pcm-oss
modprobe snd-mixer-oss
modprobe snd-seq-oss
为alsa驱动程序配置声卡:
alsaconf
调节音量:
alsamixer
这时进入一个简单图形界面,利用左右方向键可以选择各选项,按上下方向键可以调整选项值,按M键可以控制打开或关闭某选项.设置好以后,按ESC退出,这时一定要使用命令alsactl store来保存刚才的设置,否则等于没有设置.

这时是不是还没有声音呢?别急,那是因为你的系统的声音还没有打开,在主菜单-->声音和视频-->音量控制,将vol和pcm拉上去,就可以听到声音啦!
是不是很想试下在linux下听mp3呢?RedHat9.0已经装了xmms,对于一个mp3文件,右键选择打开方式-->X Multimedia System,可惜的是,无法播放.因为还需要安装一个插件.到http://havardk.xmms.org/dist/xmms-1.2.7-rh8-rh9-rpm/xmms-mpg123-1.2.7-21.i386.rpm下载,并用命令rpm -ivh xmms-mpg123-1.2.7-21.i386.rpm安装即可.更多信息可见http://www.linuxsir.org/bbs/showthread.php?s=&threadid=32672
赶快把你的声卡唤醒,在linux下也好好享受音乐吧!:)
文章评论

共有 2 条评论

  1. 于 2006-11-10 14:47:51发表:

    我用了 很有帮助啊 谢谢 辛苦了

  2. 于 2006-10-12 16:04:30发表:

    虽然我没有 用但一样 要 顶的阿 !