wllinux 2011-04-11
关于Linux编译声卡驱动:
惠普笔记本刚买来时,安装Debian 5,通常会遇到两个问题。一个是无线网卡驱动没有安装,一个是“带上耳机可以听歌,但是喇叭无法发声”。
对于前面一个问题,请参照文章 GNU小本无线上网-BCM4312驱动安装
第二个问题,大部分是由于Debian 5的声卡驱动版本号太低,所以只要下载最新的声卡驱动,编译安装就能解决问题。
步骤如下:
1. 到alsa主页下载最新驱动,并解压到当前目录
网址http://www.alsa-project.org,下载
alsa-driver-1.0.21.tar.bz2
alsa-lib-1.0.21a.tar.bz2
alsa-utils-1.0.21.tar.bz2
$ pwd /home/c-aries/download/alsa $ ls alsa-driver-1.0.21.tar.bz2 alsa-lib-1.0.21a.tar.bz2 alsa-utils-1.0.21.tar.bz2 $ tar xf alsa-driver-1.0.21.tar.bz2 $ tar xf alsa-utils-1.0.21.tar.bz2 $ tar xf alsa-lib-1.0.21a.tar.bz2 $ ls -F alsa-driver-1.0.21/ alsa-lib-1.0.21a/ alsa-utils-1.0.21/ alsa-driver-1.0.21.tar.bz2 alsa-lib-1.0.21a.tar.bz2 alsa-utils-1.0.21.tar.bz2 $
2. 安装必需的软件包,关闭声卡,
$ sudo apt-get install build-essential ncurses-dev gettext xmlto linux-headers-`uname -r` libncursesw5-dev $ sudo /etc/init.d/alsa-utils stop
3. 软链接相关的函数库
编译出错时才运行如下命令,如报错
checking for new_panel in -lpanelw... no
configure: error: panelw library not found
链接命令:
$ sudo ln -s libpanelw.so.5 /usr/lib/libpanelw.so $ sudo ln -s libformw.so.5 /usr/lib/libformw.so $ sudo ln -s libmenuw.so.5 /usr/lib/libmenuw.so $ sudo ln -s libncursesw.so.5 /lib/libncursesw.so
4. 依次编译,安装alsa-driver,alsa-lib,alsa-utils
$ pwd /home/c-aries/download/alsa/alsa-driver-1.0.21 $ ./configure $ make $ sudo make install $ pwd /home/c-aries/download/alsa/alsa-lib-1.0.21a $ ./configure $ make $ sudo make install #需要编译安装了alsa-driver和alsa-lib后才能编译alsa-utils,否则运行configure时会报错 $ pwd /home/c-aries/download/alsa/alsa-utils-1.0.21 $ ./configure $ make $ sudo make install
5. 重启系统,查看声卡驱动版本号
$ cat /proc/asound/version Advanced Linux Sound Architecture Driver Version 1.0.21. Compiled on Dec 9 2009 for kernel 2.6.26-2-686 (SMP). $
6. 配置声卡,调节音量