linux 声卡权限,archlinux的声卡问题如何解决
archlinux的聲卡問(wèn)題如何解決
(2006-07-30 17:33:59)
Alsa Setup
本文闡述了怎樣在2.4和2.6內(nèi)核下使Alsa正常工作。
本文參考了Arjan Timmerman的Alsa Setup howto(http://www.soulfly.nl/arjan/archlinux/alsa-setup.html)。更詳細(xì)信息見(jiàn)http://bbs.archlinux.org/viewtopic.php?t=2544.
1、安裝軟件包
a. 2.4及2.6內(nèi)核都需要:
#pacman -Sy alsa-lib alsa-utils
b. 2.4內(nèi)核需要:
#pacman -S alsa-driver
#depmod -a
c. 建議安裝但非必需:
#pacman -S alsa-oss
注意,“alsa-driver”包中含有基于Arch stock
kernel必需的模塊!如果自己編譯2.4內(nèi)核,“alsa-driver”大多不會(huì)正常工作。你應(yīng)該使用ABS建立你自己的“alsa-driver”包,并安裝此包。
2.配置Alsa
a.
確定聲卡的模塊,參見(jiàn)http://www.alsa-project.org/alsa-doc/。模塊是以"snd-"為前綴(例如:snd-via82XX)。也可以以root身份執(zhí)行"alsaconf"。
b. 裝入模塊
#modprobe snd-NAME-OF-MODULE
#modprobe snd-pcm-oss
c. 打開(kāi)音量
#amixer set Master 100 unmute
#amixer set PCM 100 unmute
或者你可以用圖形界面的"alsamixer"。
注意,使用"alsamixer",一定要在調(diào)整音量的同時(shí)打開(kāi)它(按M鍵)。
d. 找個(gè)波形文件試一試
#aplay mywav.wav
e. 在/etc/rc.conf的MODULES中加入snd-pcm-oss和'snd-NAME-OF-MODULE'
2. DevFS下設(shè)置權(quán)限
如果你使用uDev,請(qǐng)?zhí)^(guò)本節(jié),閱“uDev下設(shè)置權(quán)限”。如果你不知道用的是DevFS還是uDev,那么你用的應(yīng)該是DevFS。
a. 建立sound用戶組
#groupadd sound
b. 加入該組
#gpasswd -a USERNAME sound
c. 在'/etc/devfsd.conf'中加入以下兩行
REGISTER sound/.* PERMISSIONS root.sound 660
REGISTER snd/.* PERMISSIONS root.sound 660
d. 重啟devfs
killall -HUP devfsd
e. logout然后再login以確保sound用戶組已載入。
3. uDev下設(shè)置權(quán)限
a. 建立sound用戶組
#groupadd sound
b. 加入該組
#gpasswd -a USERNAME sound
c. 編輯'/etc/udev/permissions.d/udev.permissions'
將
#audio devices
dsp*:root:root:0660
audio*:root:root:0660
midi*:root:root:0660
mixer*:root:root:0660
sequencer*:root:root:0660
sound/*:root:root:0660
snd/*:root:root:0660
beep:root:root:0660
admm*:root:root:0660
adsp*:root:root:0660
aload*:root:root:0660
amidi*:root:root:0660
dmfm*:root:root:0660
dmmidi*:root:root:0660
sndstat:root:root:0660
改成
# audio devices
dsp*:root:sound:0660
audio*:root:sound:0660
midi*:root:sound:0660
mixer*:root:sound:0660
sequencer*:root:sound:0660
sound/*:root:sound:0660
snd/*:root:sound:0660
beep:root:sound:0660
admm*:root:sound:0660
adsp*:root:sound:0660
aload*:root:sound:0660
amidi*:root:sound:0660
dmfm*:root:sound:0660
dmmidi*:root:sound:0660
sndstat:root:sound:0660
(譯注:全改成sound用戶組)
d. 重啟uDev
/etc/start_udev
mount /dev/pts
mount /dev/shm
e. logout然后再login以確保sound用戶組已載入。
4. 啟動(dòng)
a. 執(zhí)行'alsactl'一次,生成'/etc/asound.state'
alsactl store
b. 將以下內(nèi)容保存為'/etc/rc.d/alsamixer'
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
case "$1" in
start)
stat_busy "Restoring Alsa mixer volumes"
alsactl restore
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon alsamixer
stat_done
fi
;;
stop)
stat_busy "Storing Alsa mixer volumes"
alsactl store
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon alsamixer
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage $0
{start|stop|restart}"
;;
esac
c. 將其設(shè)置為可執(zhí)行
chmod 755 /etc/rc.d/alsamixer
d. 編輯'/etc/rc.conf',將'alsamixer'加入守護(hù)進(jìn)程列表,使其在啟動(dòng)時(shí)運(yùn)行。
5. KDE設(shè)置
a. 啟動(dòng)KDE
#startx
b. 設(shè)置音量,想設(shè)多高隨你定了(每個(gè)用戶都有自己的設(shè)置)
#alsamixer
c. KDE3.2,K Menu > Settings > Control
Center > Sound & Multimedia
> Mixer
確定選中了"Load volumes on login",并保存。
d. KDE 3.3,K Menu > Multimedia >
KMix
選擇Settings > Configure KMix...
取消"Restore volumes on logon"
點(diǎn)OK,所有都設(shè)好了?,F(xiàn)在你的音量無(wú)論是在KDE或在命令行下都一樣。
只是上面的不需建立sound組,因?yàn)?.7已建了一個(gè)audio組,加入就行
其他照舊!
分享:
喜歡
0
贈(zèng)金筆
加載中,請(qǐng)稍候......
評(píng)論加載中,請(qǐng)稍候...
發(fā)評(píng)論
登錄名: 密碼: 找回密碼 注冊(cè)記住登錄狀態(tài)
昵???稱:
評(píng)論并轉(zhuǎn)載此博文
發(fā)評(píng)論
以上網(wǎng)友發(fā)言只代表其個(gè)人觀點(diǎn),不代表新浪網(wǎng)的觀點(diǎn)或立場(chǎng)。
總結(jié)
以上是生活随笔為你收集整理的linux 声卡权限,archlinux的声卡问题如何解决的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: linux nfs 多个ip,Linux
- 下一篇: linux安装grub界面,系统安装: