在Gentoo Linux下輕鬆安裝ALSA(轉)
在Gentoo Linux下輕鬆安裝ALSA(轉)[@more@]ALSA 是The Advanced Linux Sound Architecture的簡稱,是目前Linux下最棒的音效卡驅動之一,雖然和商業的OSS驅動相比還尚有差距,但它完全遵守GPL和LGPL版權,並準備加入Linux的 2.6核心中成為Linux音效卡驅動的標準,可謂前途無量,呵呵。言歸正轉,利用Gentoo強大的軟體包管理系統Portage,讓我們開始alsa的安裝之旅吧:)1.首先必需確認,把音效卡的支援也就是“Sound Card Support”編譯為模組加入核心,僅此而已,其他的音效卡驅動一個也不要選。2.做好了以上步驟,我們開始編譯安裝alsa-drivers.如果你用的是PCI音效卡的話,在這之前可以用以下命令察看一下它的型號:#grep audio /proc/pci知道了音效卡的型號後(如果還是不清楚的話,可以參考以下連線: ),可以直接用以下命令只編譯你音效卡的驅動,以加快編譯的速度。比如我的音效卡是CS4620的,ALSA的驅動模組為cs46xx,我就這麼做:#env ALSA_CARDS='cx46xx' emerge alsa-driver如果你有一塊以上的音效卡,可以這麼:#env ALSA_CARDS='xxxx xxxx xxxx' emerge alsa-driver如果你需要OSS相容性驅動的話,#emerge alsa-oss就可以了,不過這不在我們今天的討論範圍內。3.驅動編譯完畢後,我們來配置ALSA,讓它為我們“無私”的工作:)a.用你自己喜歡的編輯器開啟/etc/modules.d/alsa檔案,以下是我的檔案:# Alsa 0.9.X kernel modules' configuration file.# $Header: /home/cvsroot/gentoo-x86/media-sound/alsa-driver/files/alsa-modules.conf-rc,v 1.1 2002/12/21 06:31:52 agenkin Exp $# ALSA portionalias char-major-116 snd# OSS/Free portionalias char-major-14 soundcore#### IMPORTANT:## You need to customise this section for your specific sound card(s)## and then run `update-modules' command.## Read alsa-driver's INSTALL file in /usr/share/doc for more info.#### ALSA portion## alias snd-card-0 snd-cs46xx (去掉前面的兩個#號,並把snd-cs46xx改為snd-xxxx你的音效卡驅動模組)## alias snd-card-1 snd-ens1371 (如果你有一塊以上音效卡的話,修改方法同上)## OSS/Free portion## alias sound-slot-0 snd-card-0## alias sound-slot-1 snd-card-1### OSS/Free portion - card #1alias sound-service-0-0 snd-mixer-ossalias sound-service-0-1 snd-seq-ossalias sound-service-0-3 snd-pcm-ossalias sound-service-0-8 snd-seq-ossalias sound-service-0-12 snd-pcm-oss## 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-ossalias /dev/mixer snd-mixer-ossalias /dev/dsp snd-pcm-ossalias /dev/midi snd-seq-oss# Set this to the correct number of cards.options snd cards_limit=1 (這裡是設定ALSA驅動音效卡的數目,如果你有一塊以上的音效卡可以在這裡做相應修改)b.確認檔案修改無誤後,執行以下命令更新系統模組:# update-modulesc.察看/etc/devfsd.conf,確認alsa裝置的許可權設定的正確與否。# ALSA/OSS stuff# Comment/change these if you want to change the permissions on# the audio devicesLOOKUP snd MODLOAD ACTION sndLOOKUP dsp MODLOADLOOKUP mixer MODLOADLOOKUP midi MODLOADREGISTER sound/.* PERMISSIONS root.audio 660REGISTER snd/.* PERMISSIONS root.audio 660預設此檔案設定 /dev/sound許可權為 root和audio,如此一來,普通使用者要使用的話,要把他們的帳戶加入audio組。4.開始使用ALSAa.首先把alsasound加入boot執行級#rc-update add alsasound bootb.立即開始啟動ALSA,並調整音量# /etc/init.d/alsasound start此時ALSA還不能工作,因為alsa預設音量是關閉的。我們需要alsa工具來調整# emerge alsa-utils# amixer# amixer set Master 100 unmute# amixer set PCM 100 unmute#aplay xxx.wav (你可以隨便找一個wav檔案來試驗一下)如果一切順利的話,現在ALSA已經可以正常工作了:)對了,如果你使用xmms聽歌的話,記得#emerge alsa-xmms來讓xmms支援ALSA最後,要說明一下,如果你重新編譯了核心或升級了新的核心的話,你需要重新編譯alsa-driver並,僅此而已,其他的諸如alsa-oss alsa-utils都不需要重新編譯。Enjoy with Gento
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8225414/viewspace-938166/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 在 Linux 中輕鬆搜尋和安裝 Google Web 字型LinuxGoWeb
- 在Linux下安裝JDKLinuxJDK
- Nginx在Linux下的安裝NginxLinux
- 黑蘋果安裝(傻瓜式輕鬆安裝)蘋果
- 在Linux下安裝配置Cntlm代理教程Linux
- Win10雙系統安裝Gentoo-(附Networkmanagr/Gnome安裝)Win10
- 安裝 pip 輕鬆管理 PyPI 軟體包
- Jenkins部署安裝,輕鬆三步搞定Jenkins
- postgreSQL學習(一):在Linux下安裝postgreSQLSQLLinux
- 在Linux下使用Webots並安裝官方素材LinuxWeb
- yapi 在linux環境下的安裝部署APILinux
- Elasticsearch 在Linux下的安裝部署和配置ElasticsearchLinux
- 5分鐘教你在Linux下安裝VMwareLinux
- linux下安裝 openoffice 實現 office文件轉 pdfLinux
- linux下安裝snap安裝工具Linux
- mysql在linux安裝MySqlLinux
- jdk在linux下安裝、配置環境變數JDKLinux變數
- 在 Linux 上如何安裝 SoundConverter及轉換音訊Linux音訊
- 在Linux(Redhat/CentOS)下安裝MySQL之yum(rpm)線上安裝方式LinuxRedhatCentOSMySql
- 在Linux(Redhat/CentOS)下安裝MySQL之yum(rpm)離線安裝方式LinuxRedhatCentOSMySql
- Linux下安裝pymysqlLinuxMySql
- Linux下安裝jiebaLinuxJieba
- Linux下安裝GensimLinux
- Linux下SuperLU安裝Linux
- Linux下安裝GitLinuxGit
- linux下安裝pythonLinuxPython
- Linux 下安裝 ComposerLinux
- Linux下expect安裝Linux
- Linux下安裝RedisLinuxRedis
- InfluxDB Linux 下安裝Linux
- mysql linux下安裝MySqlLinux
- linux下安裝dockerLinuxDocker
- linux 下安裝 jdkLinuxJDK
- linux下nginx安裝LinuxNginx
- Linux下安裝OpenCVLinuxOpenCV
- Linux下安裝nginxLinuxNginx
- Linux 下安裝 RedisLinuxRedis
- linux下安裝elasticsearchLinuxElasticsearch
- Linux下安裝RabbitMQLinuxMQ