https://wiki.archlinux.org/api.php?action=feedcontributions&user=Cqpanxu&feedformat=atomArchWiki - User contributions [en]2024-03-29T02:34:22ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Irssi_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=119399Irssi (简体中文)2010-10-18T12:32:20Z<p>Cqpanxu: /* 命令 */</p>
<hr />
<div>[[Category:简体中文]]<br />
{{i18n|Irssi}}<br />
{{DISPLAYTITLE:Irssi (简体中文)}}<br />
<br />
=简介=<br />
[http://www.irssi.org/ Irssi]是一个ncurse界面的控制台irc程序。<br />
<br />
* 安装源里的irssi<br />
# pacman -S irssi<br />
<br />
* 配置文件在 ~/.irssi/config,通常无需修改,可用下列命令指定配置文件:<br />
$ irssi --config=FILE<br />
<br />
运行程序<br />
$ irssi<br />
<br />
=手动连接=<br />
* 连接服务器<br />
/connect irc.frenode.net<br />
<br />
*加入頻道<br />
/join #archlinux<br />
<br />
=自动连接=<br />
*添加网络<br />
/network add -nick YOURNICKNAME Freenode<br />
/network add -nick YOURNICKNAME OFTC<br />
*添加服务器<br />
/server add -auto -network Freenode irc.freenode.net<br />
/server add -auto -network OFTC irc.oftc.net<br />
*添加想要自动加入的频道<br />
/channel add -auto #archlinux Freenode<br />
/channel add -auto #arch-cn OFTC<br />
下次启动时,就会自动连接freenode和oftc,并分别加入其中的archlinux和arch-cn频道。使用Alt+数字键切换。<br />
<br />
=操作=<br />
*使用Alt+数字键,可在不同频道间切换<br />
{{Keypress|Alt}}+{{Keypress|1}}返回主界面<br />
{{Keypress|Alt}}+{{Keypress|2}}返回#archlinux<br />
<br />
=命令=<br />
;/wc :離開頻道,返回主畫面<br />
;/quit :退出<br />
;/channel list :显示保存的频道<br />
;/server list :显示保存的服务器<br />
;/network list :显示保存的网络</div>Cqpanxuhttps://wiki.archlinux.org/index.php?title=Irssi_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=119398Irssi (简体中文)2010-10-18T12:31:27Z<p>Cqpanxu: /* 安装 */</p>
<hr />
<div>[[Category:简体中文]]<br />
{{i18n|Irssi}}<br />
{{DISPLAYTITLE:Irssi (简体中文)}}<br />
<br />
=简介=<br />
[http://www.irssi.org/ Irssi]是一个ncurse界面的控制台irc程序。<br />
<br />
* 安装源里的irssi<br />
# pacman -S irssi<br />
<br />
* 配置文件在 ~/.irssi/config,通常无需修改,可用下列命令指定配置文件:<br />
$ irssi --config=FILE<br />
<br />
运行程序<br />
$ irssi<br />
<br />
=手动连接=<br />
* 连接服务器<br />
/connect irc.frenode.net<br />
<br />
*加入頻道<br />
/join #archlinux<br />
<br />
=自动连接=<br />
*添加网络<br />
/network add -nick YOURNICKNAME Freenode<br />
/network add -nick YOURNICKNAME OFTC<br />
*添加服务器<br />
/server add -auto -network Freenode irc.freenode.net<br />
/server add -auto -network OFTC irc.oftc.net<br />
*添加想要自动加入的频道<br />
/channel add -auto #archlinux Freenode<br />
/channel add -auto #arch-cn OFTC<br />
下次启动时,就会自动连接freenode和oftc,并分别加入其中的archlinux和arch-cn频道。使用Alt+数字键切换。<br />
<br />
=操作=<br />
*使用Alt+数字键,可在不同频道间切换<br />
{{Keypress|Alt}}+{{Keypress|1}}返回主界面<br />
{{Keypress|Alt}}+{{Keypress|2}}返回#archlinux<br />
<br />
=命令=<br />
;/wc :離開頻道,返回主畫面<br />
;/quit i :退出irss<br />
;/channel list :显示保存的频道<br />
;/server list :显示保存的服务器<br />
;/network list :显示保存的网络</div>Cqpanxuhttps://wiki.archlinux.org/index.php?title=Irssi_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=119397Irssi (简体中文)2010-10-18T12:28:40Z<p>Cqpanxu: /* 操作 */</p>
<hr />
<div>[[Category:简体中文]]<br />
{{i18n|Irssi}}<br />
{{DISPLAYTITLE:Irssi (简体中文)}}<br />
<br />
=安装=<br />
[http://www.irssi.org/ Irssi]是一个ncurse界面的控制台irc程序。<br />
<br />
* 安装源里的irssi<br />
# pacman -S irssi<br />
<br />
* 配置文件在 ~/.irssi/config,通常无需修改,可用下列命令指定配置文件:<br />
$ irssi --config=FILE<br />
<br />
运行程序<br />
$ irssi<br />
<br />
=手动连接=<br />
* 连接服务器<br />
/connect irc.frenode.net<br />
<br />
*加入頻道<br />
/join #archlinux<br />
<br />
=自动连接=<br />
*添加网络<br />
/network add -nick YOURNICKNAME Freenode<br />
/network add -nick YOURNICKNAME OFTC<br />
*添加服务器<br />
/server add -auto -network Freenode irc.freenode.net<br />
/server add -auto -network OFTC irc.oftc.net<br />
*添加想要自动加入的频道<br />
/channel add -auto #archlinux Freenode<br />
/channel add -auto #arch-cn OFTC<br />
下次启动时,就会自动连接freenode和oftc,并分别加入其中的archlinux和arch-cn频道。使用Alt+数字键切换。<br />
<br />
=操作=<br />
*使用Alt+数字键,可在不同频道间切换<br />
{{Keypress|Alt}}+{{Keypress|1}}返回主界面<br />
{{Keypress|Alt}}+{{Keypress|2}}返回#archlinux<br />
<br />
=命令=<br />
;/wc :離開頻道,返回主畫面<br />
;/quit i :退出irss<br />
;/channel list :显示保存的频道<br />
;/server list :显示保存的服务器<br />
;/network list :显示保存的网络</div>Cqpanxuhttps://wiki.archlinux.org/index.php?title=Irssi_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=119396Irssi (简体中文)2010-10-18T12:28:11Z<p>Cqpanxu: Created page with "Category:简体中文 {{i18n|Irssi}} {{DISPLAYTITLE:Irssi (简体中文)}} =安装= [http://www.irssi.org/ Irssi]是一个ncurse界面的控制台irc程序。 * 安装源..."</p>
<hr />
<div>[[Category:简体中文]]<br />
{{i18n|Irssi}}<br />
{{DISPLAYTITLE:Irssi (简体中文)}}<br />
<br />
=安装=<br />
[http://www.irssi.org/ Irssi]是一个ncurse界面的控制台irc程序。<br />
<br />
* 安装源里的irssi<br />
# pacman -S irssi<br />
<br />
* 配置文件在 ~/.irssi/config,通常无需修改,可用下列命令指定配置文件:<br />
$ irssi --config=FILE<br />
<br />
运行程序<br />
$ irssi<br />
<br />
=手动连接=<br />
* 连接服务器<br />
/connect irc.frenode.net<br />
<br />
*加入頻道<br />
/join #archlinux<br />
<br />
=自动连接=<br />
*添加网络<br />
/network add -nick YOURNICKNAME Freenode<br />
/network add -nick YOURNICKNAME OFTC<br />
*添加服务器<br />
/server add -auto -network Freenode irc.freenode.net<br />
/server add -auto -network OFTC irc.oftc.net<br />
*添加想要自动加入的频道<br />
/channel add -auto #archlinux Freenode<br />
/channel add -auto #arch-cn OFTC<br />
下次启动时,就会自动连接freenode和oftc,并分别加入其中的archlinux和arch-cn频道。使用Alt+数字键切换。<br />
<br />
=操作=<br />
*是用Alt+数字键,可在不同频道间切换<br />
{{Keypress|Alt}}+{{Keypress|1}}返回主界面<br />
{{Keypress|Alt}}+{{Keypress|2}}返回#archlinux<br />
<br />
=命令=<br />
;/wc :離開頻道,返回主畫面<br />
;/quit i :退出irss<br />
;/channel list :显示保存的频道<br />
;/server list :显示保存的服务器<br />
;/network list :显示保存的网络</div>Cqpanxuhttps://wiki.archlinux.org/index.php?title=User_talk:Cqpanxu&diff=43602User talk:Cqpanxu2008-06-24T02:32:16Z<p>Cqpanxu: New page: Welcome to Chongqing,China.</p>
<hr />
<div>Welcome to Chongqing,China.</div>Cqpanxuhttps://wiki.archlinux.org/index.php?title=Advanced_Linux_Sound_Architecture&diff=43594Advanced Linux Sound Architecture2008-06-24T01:45:37Z<p>Cqpanxu: /* Alsamixer does not run */</p>
<hr />
<div>[[Category:Sound (English)]]<br />
[[Category:Audio/Video (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|ALSA}}<br />
{{i18n_entry|Español|ALSA (Español)}}<br />
{{i18n_entry|Deutsch|ALSA Einrichten}}<br />
{{i18n_entry|Italiano|ALSA (Italiano)}}<br />
{{i18n_entry|Nederlands|ALSA instellen}}<br />
{{i18n_entry|Русский|ALSA_(Russian)}}<br />
{{i18n_entry|Slovensky|Nastavenie ALSA}}<br />
{{i18n_entry|Česky|ALSA (Česky)}}<br />
{{i18n_entry|中文(简体)|设置ALSA}}<br />
{{i18n_entry|עברית|הגדרת ALSA}}<br />
{{i18n_entry|Рolski|ALSA Setup (Polski)}}<br />
{{i18n_entry|Português do Brasil|Instalação ALSA}}<br />
{{i18n_entry|ไทย|ALSA Setup (ไทย)}}<br />
{{i18n_links_end}}<br />
<br />
= Introduction =<br />
The Advanced Linux Sound Architecture (ALSA) is a Linux kernel component intended to provide device drivers for sound cards.<br />
<br />
See [[OSS]] if you are looking for alternatives.<br />
<br />
This document tells how to get ALSA working with 2.6 kernels. Also see how to <br />
[[Allow_multiple_programs_to_play_sound_at_once|allow multiple programs to play sound at once]].<br />
<br />
=Installation=<br />
<br />
==Kernel drivers==<br />
<br />
ALSA has been included in the 2.6 kernels and is included in all arch '''kernel26*''' packages. If you build a custom kernel, do not forget to enable the correct ALSA driver.<br />
<br />
All necessary modules should be detected and loaded automatically by udev. No special configuration has to be done unless you use ISA cards. '''NEVER''' use alsaconf if you have a PCI or ISAPNP sound card, as the entries alsaconf adds to the modprobe.conf file might break udev's autodetection.<br />
<br />
==Userspace utilities==<br />
<br />
* Required for native ALSA programs and administration<br />
# pacman -Sy alsa-lib alsa-utils<br />
* Recommended if you want to use applications with OSS sound support in combination with dmix:<br />
# pacman -S alsa-oss<br />
<br />
All ALSA programs will most likely have alsa-lib as a dependency.<br />
<br />
=Configuration=<br />
<br />
==Making sure the sound modules are loaded==<br />
<br />
You can assume that udev will autodetect your sound properly, including the OSS compatibility modules. You can check this with the command<br />
<br />
$ lsmod|grep '^snd'<br />
snd_usb_audio 69696 0 <br />
snd_usb_lib 13504 1 snd_usb_audio<br />
snd_rawmidi 20064 1 snd_usb_lib<br />
snd_hwdep 7044 1 snd_usb_audio<br />
snd_seq_oss 29412 0 <br />
snd_seq_midi_event 6080 1 snd_seq_oss<br />
snd_seq 46220 4 snd_seq_oss,snd_seq_midi_event<br />
snd_seq_device 6796 3 snd_rawmidi,snd_seq_oss,snd_seq<br />
snd_pcm_oss 45216 0 <br />
snd_mixer_oss 15232 1 snd_pcm_oss<br />
snd_intel8x0 27932 0 <br />
snd_ac97_codec 87648 1 snd_intel8x0<br />
snd_ac97_bus 1792 1 snd_ac97_codec<br />
snd_pcm 76296 4 snd_usb_audio,snd_pcm_oss,snd_intel8x0,snd_ac97_codec<br />
snd_timer 19780 2 snd_seq,snd_pcm<br />
snd 43776 12 snd_usb_audio,snd_rawmidi,snd_hwdep,snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_intel8x0,snd_ac97_codec,snd_pcm,snd_timer<br />
snd_page_alloc 7944 2 snd_intel8x0,snd_pcm<br />
<br />
If the output looks similar, your sound drivers have been successfully autodetected (note that in this case, snd_intel8x0 and snd_usb_audio are the drivers for the hardware devices). You might also want to check the directory '''/dev/snd''' for the right device files:<br />
<br />
$ ls -l /dev/snd/<br />
total 0<br />
crw-rw---- 1 root audio 116, 0 Apr 8 14:17 controlC0<br />
crw-rw---- 1 root audio 116, 32 Apr 8 14:17 controlC1<br />
crw-rw---- 1 root audio 116, 24 Apr 8 14:17 pcmC0D0c<br />
crw-rw---- 1 root audio 116, 16 Apr 8 14:17 pcmC0D0p<br />
crw-rw---- 1 root audio 116, 25 Apr 8 14:17 pcmC0D1c<br />
crw-rw---- 1 root audio 116, 56 Apr 8 14:17 pcmC1D0c<br />
crw-rw---- 1 root audio 116, 48 Apr 8 14:17 pcmC1D0p<br />
crw-rw---- 1 root audio 116, 1 Apr 8 14:17 seq<br />
crw-rw---- 1 root audio 116, 33 Apr 8 14:17 timer<br />
<br />
If you have at least the devices '''controlC0''' and '''pcmC0D0p''' or similar, then your sound modules have been detected and loaded properly.<br />
<br />
<br />
If this is not the case, your sound modules have not been detected properly. '''If you want any help on IRC or the forums, please post the output of the above commands.''' To solve this, you can try loading the modules manually:<br />
<br />
* Locate the module for your soundcard: [http://www.alsa-project.org/main/index.php/Matrix:Main ALSA Soundcard Matrix] The module will be prefixed with 'snd-' (for example: 'snd-via82xx').<br />
* Load modules:<br />
# modprobe snd-NAME-OF-MODULE<br />
# modprobe snd-pcm-oss<br />
* Check for the device files in '''/dev/snd''' (see above) and/or try if '''alsamixer''' or '''amixer''' have reasonable output.<br />
* Add '''snd-NAME-OF-MODULE''' and '''snd-pcm-oss''' to the list of MODULES in '''/etc/rc.conf''' to ensure they are loaded next time (make sure '''snd-NAME-OF-MODULE''' is before '''snd-pcm-oss''').<br />
<br />
==Unmuting the channels and testing the sound card==<br />
<br />
In this section, we assume that you are logged in as root. If you want to perform these steps as an unprivileged user, you have to skip to the next section ''Setup Permissions'' first.<br />
<br />
* Unmute Soundcard<br />
<br />
The current version of ALSA installs with all channels '''muted by default''', so even if installation completes successfully and all devices are working properly you will hear no sound. You will need to unmute the channels manually. It is recommended to use '<code>alsamixer</code>' to accomplish this. From the alsamixer text ui, the label "MM" below a channel indicates that the channel is muted, and "00" indicates that it is open. Press the 'm' key to toggle MM/00. Use arrow-keys left and right to navigate through the channels and the arrow-keys up and down to adjust the volume. Such things as Master and PCM and possibly Speaker will need to unmuted for your sound to work.<br><br><br />
'''NOTE:''' When using '''<code>amixer</code>''', be sure to '''unmute''' as well as bring volumes up to a specific level in percent, i.e you need to use that % sign. '''<code>amixer</code>''' understands the percent sign (%), not numbers. If you use a number (say, 90) then '''<code>amixer</code>''' will take it as 100%, which can harm your speakers.<br />
<br />
# amixer set Master 90% unmute<br />
# amixer set PCM 85% unmute<br />
<br />
* Try to play a WAV file<br />
<br />
# aplay mywav.wav<br />
<br />
'''NOTE:''' Some cards (well, at least Soundblaster Audigy LS) needs to have digital output muted/turned off in order to hear analog sound.<br />
<br />
* [[Allow multiple programs to play sound at once]]<br />
<br />
==Setup Permissions==<br />
<br />
To be able to use the sound card as a user, follow these steps:<br />
<br />
* Add your user to the audio group:<br />
# gpasswd -a USERNAME audio<br />
<br />
* Log your user out and back in to ensure the audio group is loaded.<br />
<br />
==Restore ALSA Mixer settings at startup==<br />
<br />
* Run 'alsactl' once to create '<code>/etc/asound.state</code>'<br />
<br />
alsactl store<br />
<br />
* Edit '/etc/rc.conf' and add 'alsa' to the list of daemons to start on boot-up. This will store the mixer settings on every shutdown and restore them when you boot.<br />
<br />
==Getting SPDIF output==<br />
<br />
(from gralves from the Gentoo forums)<br />
* In GNOME Volume Control, under the Options tab, change the IEC958 to PCM. This option can be enabled in the preferences.<br />
* If you don't have GNOME Volume Control installed,<br />
** Edit /etc/asound.state. This file is where alsasound stores your mixer settings.<br />
** Find a line that says: 'IEC958 Playback Switch'. Near it you will find a line saying value:false. Change it to value:true.<br />
** Now find this line: 'IEC958 Playback AC97-SPSA'. Change its value to 0.<br />
** Restart ALSA.<br />
<br />
Alternative way to enable SPDIF output automatically on login (tested on SoundBlaster Audigy):<br />
* add following lines to /etc/rc.local:<br />
<br />
# Use COAX-digital output<br />
amixer set 'IEC958 Optical' 100 unmute<br />
amixer set 'Audigy Analog/Digital Output Jack' on<br />
<br />
You can see the name of your card's digital output with:<br />
<br />
amixer scontrols<br />
<br />
==KDE Settings==<br />
* Start up KDE:<br />
# startx<br />
<br />
* Set up the volumes as you want them for this user (each user has their own settings):<br />
# alsamixer<br />
<br />
log out and log back in as user xyz to get sound to work (I had to kill x logout then log back in as user xyz, then start x and open firefox and bam audio working on youtube)<br />
<br />
* <b>KDE 3.3</b> Go to K Menu > Multimedia > KMix<br />
** Choose Settings > Configure KMix...<br />
** Uncheck the option "Restore volumes on logon"<br />
** Press OK, and you should be all set. Now your volumes will be the same from the command line or within KDE.<br />
<br />
==System-Wide Equalizer==<br />
Note: This method requires the use of a ladspa plugin which might use quite a bit of cpu when sound plays. In addition, this was made with stereophonic sound (e.g. headphones) in mind.<br />
<br />
* you will need, in addition to the aforementioned userspace utilities, alsa-plugins<br />
pacman -S alsa-plugins<br />
* get the ladspa and swh-plugins packages too if you don't already have them<br />
pacman -S ladspa swh-plugins<br />
* if you haven't already created either an ~/.asoundrc or a /etc/asound.conf file, then create either one<br />
vim ~/.asoundrc<br />
* insert the following into your alsa configuration file (~/.asoundrc or /etc/asound.conf)<br />
pcm.eq {<br />
type ladspa<br><br />
# The output from the EQ can either go direct to a hardware device<br />
# (if you have a hardware mixer, e.g. SBLive/Audigy) or it can go<br />
# to the software mixer shown here.<br />
#slave.pcm "plughw:0,0"<br />
slave.pcm "plug:dmix"<br><br />
# Sometimes you may need to specify the path to the plugins,<br />
# especially if you've just installed them. Once you've logged<br />
# out/restarted this shouldn't be necessary, but if you get errors<br />
# about being unable to find plugins, try uncommenting this.<br />
#path "/usr/lib/ladspa"<br><br />
plugins [<br />
{<br />
label mbeq<br />
id 1197<br />
input {<br />
#this setting is here by example, edit to your own taste<br />
#bands: 50hz, 100hz, 156hz, 220hz, 311hz, 440hz, 622hz, 880hz, 1250hz, 1750hz, 25000hz,<br />
#50000hz, 10000hz, 20000hz<br />
controls [ -5 -5 -5 -5 -5 -10 -20 -15 -10 -10 -10 -10 -10 -3 -2 ]<br />
}<br />
}<br />
]<br />
}<br><br />
# Redirect the default device to go via the EQ - you may want to do<br />
# this last, once you're sure everything is working. Otherwise all<br />
# your audio programs will break/crash if something has gone wrong.<br><br />
pcm.!default {<br />
type plug<br />
slave.pcm "eq"<br />
}<br><br />
# Redirect the OSS emulation through the EQ too (when programs are running through "aoss")<br><br />
pcm.dsp0 {<br />
type plug<br />
slave.pcm "eq"<br />
}<br />
<br />
*reload your alsa settings (as root)<br />
/etc/rc.d/alsa restart<br />
<br />
*you should be good to go (if not, ask in the forum)<br />
<br />
<br />
=Troubleshooting=<br />
==Still Getting No Sound?==<br />
<br />
Remember, ALSA installs with all channels '''muted by default''' (see previous section, [[ALSA#Unmuting_the_channels_and_testing_the_sound_card|unmuting your soundcard]]). However, if you're sure nothing is muted, that your drivers are installed correctly, and that your volume is right, but you still do not hear anything, then try adding the following line to <code>/etc/modprobe.conf</code> which should fix the problem:<br />
<br />
options snd-NAME-OF-MODULE ac97_quirk=0<br />
<br />
The above fix has been observed to work with <code>via82xx</code><br />
options snd-NAME-OF-MODULE ac97_quirk=1<br />
The above fix has been reported to work with <code>snd_intel8x0</code><br />
<br />
==No Sound with Onboard Intel Sound Card==<br />
<br />
There may be an issue with two conflicting modules loaded, namely <code>snd_intel8x0</code> and <code>snd_intel8x0m</code>. In this case, edit <code>rc.conf</code> and in the MODULES array blacklist the latter one so that it reads <code>!snd_intel8x0m</code> afterwards.<br />
<br />
==Poor Sound Quality?==<br />
<br />
If you experience poor sound quality, try setting the PCM volume (in alsamixer) to a level such that gain is 0.<br />
<br />
==Pops when Starting and Stopping Playback?==<br />
<br />
Some modules can power off your sound card when not in use. this can make an audible noise when powering down your sound card. If you find this annoying try "modinfo snd-MY-MODULE", and look for a module option that adjusts or disables this feature. <br />
<br />
for example: to disable the power saving mode using snd-hda-intel add "options snd-hda-intel power_save=0" in /etc/modprobe.conf. or try it with "modprobe snd-hda-intel power_save=0"<br />
<br />
==Alsamixer does not run==<br />
If running alsamixer does not work and you wind up with the following error<br />
alsamixer: function snd_ctl_open failed for default: No such device or directory<br />
<br />
You should first check /etc/group to ensure that your current user is in the 'audio' group.<br />
<br />
Then you might need to re-install your kernel. Run 'pacman -S kernel26' or whichever patchset you prefer to use. Also, please make sure you are a member of the audio group.<br />
<br />
= External Resources =<br />
More info can be found here<br />
* [http://alsa.opensrc.org/index.php/Main_Page Unofficial ALSA Wiki]<br />
* [http://alsa.opensrc.org/index.php/Aadebug A simple shell script to aid ALSA audio debugging]<br />
* [http://bbs.archlinux.org/viewtopic.php?id=36815 HOWTO: Compile driver from svn]<br />
* [http://gentoo-wiki.com/HOWTO_Set_up_a_system-wide_equaliser_with_ALSA_and_LADSPA HOWTO Set up a system-wide equaliser with ALSA and LADSPA]</div>Cqpanxuhttps://wiki.archlinux.org/index.php?title=Advanced_Linux_Sound_Architecture&diff=43593Advanced Linux Sound Architecture2008-06-24T01:44:30Z<p>Cqpanxu: /* Alsamixer does not run */</p>
<hr />
<div>[[Category:Sound (English)]]<br />
[[Category:Audio/Video (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|ALSA}}<br />
{{i18n_entry|Español|ALSA (Español)}}<br />
{{i18n_entry|Deutsch|ALSA Einrichten}}<br />
{{i18n_entry|Italiano|ALSA (Italiano)}}<br />
{{i18n_entry|Nederlands|ALSA instellen}}<br />
{{i18n_entry|Русский|ALSA_(Russian)}}<br />
{{i18n_entry|Slovensky|Nastavenie ALSA}}<br />
{{i18n_entry|Česky|ALSA (Česky)}}<br />
{{i18n_entry|中文(简体)|设置ALSA}}<br />
{{i18n_entry|עברית|הגדרת ALSA}}<br />
{{i18n_entry|Рolski|ALSA Setup (Polski)}}<br />
{{i18n_entry|Português do Brasil|Instalação ALSA}}<br />
{{i18n_entry|ไทย|ALSA Setup (ไทย)}}<br />
{{i18n_links_end}}<br />
<br />
= Introduction =<br />
The Advanced Linux Sound Architecture (ALSA) is a Linux kernel component intended to provide device drivers for sound cards.<br />
<br />
See [[OSS]] if you are looking for alternatives.<br />
<br />
This document tells how to get ALSA working with 2.6 kernels. Also see how to <br />
[[Allow_multiple_programs_to_play_sound_at_once|allow multiple programs to play sound at once]].<br />
<br />
=Installation=<br />
<br />
==Kernel drivers==<br />
<br />
ALSA has been included in the 2.6 kernels and is included in all arch '''kernel26*''' packages. If you build a custom kernel, do not forget to enable the correct ALSA driver.<br />
<br />
All necessary modules should be detected and loaded automatically by udev. No special configuration has to be done unless you use ISA cards. '''NEVER''' use alsaconf if you have a PCI or ISAPNP sound card, as the entries alsaconf adds to the modprobe.conf file might break udev's autodetection.<br />
<br />
==Userspace utilities==<br />
<br />
* Required for native ALSA programs and administration<br />
# pacman -Sy alsa-lib alsa-utils<br />
* Recommended if you want to use applications with OSS sound support in combination with dmix:<br />
# pacman -S alsa-oss<br />
<br />
All ALSA programs will most likely have alsa-lib as a dependency.<br />
<br />
=Configuration=<br />
<br />
==Making sure the sound modules are loaded==<br />
<br />
You can assume that udev will autodetect your sound properly, including the OSS compatibility modules. You can check this with the command<br />
<br />
$ lsmod|grep '^snd'<br />
snd_usb_audio 69696 0 <br />
snd_usb_lib 13504 1 snd_usb_audio<br />
snd_rawmidi 20064 1 snd_usb_lib<br />
snd_hwdep 7044 1 snd_usb_audio<br />
snd_seq_oss 29412 0 <br />
snd_seq_midi_event 6080 1 snd_seq_oss<br />
snd_seq 46220 4 snd_seq_oss,snd_seq_midi_event<br />
snd_seq_device 6796 3 snd_rawmidi,snd_seq_oss,snd_seq<br />
snd_pcm_oss 45216 0 <br />
snd_mixer_oss 15232 1 snd_pcm_oss<br />
snd_intel8x0 27932 0 <br />
snd_ac97_codec 87648 1 snd_intel8x0<br />
snd_ac97_bus 1792 1 snd_ac97_codec<br />
snd_pcm 76296 4 snd_usb_audio,snd_pcm_oss,snd_intel8x0,snd_ac97_codec<br />
snd_timer 19780 2 snd_seq,snd_pcm<br />
snd 43776 12 snd_usb_audio,snd_rawmidi,snd_hwdep,snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_intel8x0,snd_ac97_codec,snd_pcm,snd_timer<br />
snd_page_alloc 7944 2 snd_intel8x0,snd_pcm<br />
<br />
If the output looks similar, your sound drivers have been successfully autodetected (note that in this case, snd_intel8x0 and snd_usb_audio are the drivers for the hardware devices). You might also want to check the directory '''/dev/snd''' for the right device files:<br />
<br />
$ ls -l /dev/snd/<br />
total 0<br />
crw-rw---- 1 root audio 116, 0 Apr 8 14:17 controlC0<br />
crw-rw---- 1 root audio 116, 32 Apr 8 14:17 controlC1<br />
crw-rw---- 1 root audio 116, 24 Apr 8 14:17 pcmC0D0c<br />
crw-rw---- 1 root audio 116, 16 Apr 8 14:17 pcmC0D0p<br />
crw-rw---- 1 root audio 116, 25 Apr 8 14:17 pcmC0D1c<br />
crw-rw---- 1 root audio 116, 56 Apr 8 14:17 pcmC1D0c<br />
crw-rw---- 1 root audio 116, 48 Apr 8 14:17 pcmC1D0p<br />
crw-rw---- 1 root audio 116, 1 Apr 8 14:17 seq<br />
crw-rw---- 1 root audio 116, 33 Apr 8 14:17 timer<br />
<br />
If you have at least the devices '''controlC0''' and '''pcmC0D0p''' or similar, then your sound modules have been detected and loaded properly.<br />
<br />
<br />
If this is not the case, your sound modules have not been detected properly. '''If you want any help on IRC or the forums, please post the output of the above commands.''' To solve this, you can try loading the modules manually:<br />
<br />
* Locate the module for your soundcard: [http://www.alsa-project.org/main/index.php/Matrix:Main ALSA Soundcard Matrix] The module will be prefixed with 'snd-' (for example: 'snd-via82xx').<br />
* Load modules:<br />
# modprobe snd-NAME-OF-MODULE<br />
# modprobe snd-pcm-oss<br />
* Check for the device files in '''/dev/snd''' (see above) and/or try if '''alsamixer''' or '''amixer''' have reasonable output.<br />
* Add '''snd-NAME-OF-MODULE''' and '''snd-pcm-oss''' to the list of MODULES in '''/etc/rc.conf''' to ensure they are loaded next time (make sure '''snd-NAME-OF-MODULE''' is before '''snd-pcm-oss''').<br />
<br />
==Unmuting the channels and testing the sound card==<br />
<br />
In this section, we assume that you are logged in as root. If you want to perform these steps as an unprivileged user, you have to skip to the next section ''Setup Permissions'' first.<br />
<br />
* Unmute Soundcard<br />
<br />
The current version of ALSA installs with all channels '''muted by default''', so even if installation completes successfully and all devices are working properly you will hear no sound. You will need to unmute the channels manually. It is recommended to use '<code>alsamixer</code>' to accomplish this. From the alsamixer text ui, the label "MM" below a channel indicates that the channel is muted, and "00" indicates that it is open. Press the 'm' key to toggle MM/00. Use arrow-keys left and right to navigate through the channels and the arrow-keys up and down to adjust the volume. Such things as Master and PCM and possibly Speaker will need to unmuted for your sound to work.<br><br><br />
'''NOTE:''' When using '''<code>amixer</code>''', be sure to '''unmute''' as well as bring volumes up to a specific level in percent, i.e you need to use that % sign. '''<code>amixer</code>''' understands the percent sign (%), not numbers. If you use a number (say, 90) then '''<code>amixer</code>''' will take it as 100%, which can harm your speakers.<br />
<br />
# amixer set Master 90% unmute<br />
# amixer set PCM 85% unmute<br />
<br />
* Try to play a WAV file<br />
<br />
# aplay mywav.wav<br />
<br />
'''NOTE:''' Some cards (well, at least Soundblaster Audigy LS) needs to have digital output muted/turned off in order to hear analog sound.<br />
<br />
* [[Allow multiple programs to play sound at once]]<br />
<br />
==Setup Permissions==<br />
<br />
To be able to use the sound card as a user, follow these steps:<br />
<br />
* Add your user to the audio group:<br />
# gpasswd -a USERNAME audio<br />
<br />
* Log your user out and back in to ensure the audio group is loaded.<br />
<br />
==Restore ALSA Mixer settings at startup==<br />
<br />
* Run 'alsactl' once to create '<code>/etc/asound.state</code>'<br />
<br />
alsactl store<br />
<br />
* Edit '/etc/rc.conf' and add 'alsa' to the list of daemons to start on boot-up. This will store the mixer settings on every shutdown and restore them when you boot.<br />
<br />
==Getting SPDIF output==<br />
<br />
(from gralves from the Gentoo forums)<br />
* In GNOME Volume Control, under the Options tab, change the IEC958 to PCM. This option can be enabled in the preferences.<br />
* If you don't have GNOME Volume Control installed,<br />
** Edit /etc/asound.state. This file is where alsasound stores your mixer settings.<br />
** Find a line that says: 'IEC958 Playback Switch'. Near it you will find a line saying value:false. Change it to value:true.<br />
** Now find this line: 'IEC958 Playback AC97-SPSA'. Change its value to 0.<br />
** Restart ALSA.<br />
<br />
Alternative way to enable SPDIF output automatically on login (tested on SoundBlaster Audigy):<br />
* add following lines to /etc/rc.local:<br />
<br />
# Use COAX-digital output<br />
amixer set 'IEC958 Optical' 100 unmute<br />
amixer set 'Audigy Analog/Digital Output Jack' on<br />
<br />
You can see the name of your card's digital output with:<br />
<br />
amixer scontrols<br />
<br />
==KDE Settings==<br />
* Start up KDE:<br />
# startx<br />
<br />
* Set up the volumes as you want them for this user (each user has their own settings):<br />
# alsamixer<br />
<br />
log out and log back in as user xyz to get sound to work (I had to kill x logout then log back in as user xyz, then start x and open firefox and bam audio working on youtube)<br />
<br />
* <b>KDE 3.3</b> Go to K Menu > Multimedia > KMix<br />
** Choose Settings > Configure KMix...<br />
** Uncheck the option "Restore volumes on logon"<br />
** Press OK, and you should be all set. Now your volumes will be the same from the command line or within KDE.<br />
<br />
==System-Wide Equalizer==<br />
Note: This method requires the use of a ladspa plugin which might use quite a bit of cpu when sound plays. In addition, this was made with stereophonic sound (e.g. headphones) in mind.<br />
<br />
* you will need, in addition to the aforementioned userspace utilities, alsa-plugins<br />
pacman -S alsa-plugins<br />
* get the ladspa and swh-plugins packages too if you don't already have them<br />
pacman -S ladspa swh-plugins<br />
* if you haven't already created either an ~/.asoundrc or a /etc/asound.conf file, then create either one<br />
vim ~/.asoundrc<br />
* insert the following into your alsa configuration file (~/.asoundrc or /etc/asound.conf)<br />
pcm.eq {<br />
type ladspa<br><br />
# The output from the EQ can either go direct to a hardware device<br />
# (if you have a hardware mixer, e.g. SBLive/Audigy) or it can go<br />
# to the software mixer shown here.<br />
#slave.pcm "plughw:0,0"<br />
slave.pcm "plug:dmix"<br><br />
# Sometimes you may need to specify the path to the plugins,<br />
# especially if you've just installed them. Once you've logged<br />
# out/restarted this shouldn't be necessary, but if you get errors<br />
# about being unable to find plugins, try uncommenting this.<br />
#path "/usr/lib/ladspa"<br><br />
plugins [<br />
{<br />
label mbeq<br />
id 1197<br />
input {<br />
#this setting is here by example, edit to your own taste<br />
#bands: 50hz, 100hz, 156hz, 220hz, 311hz, 440hz, 622hz, 880hz, 1250hz, 1750hz, 25000hz,<br />
#50000hz, 10000hz, 20000hz<br />
controls [ -5 -5 -5 -5 -5 -10 -20 -15 -10 -10 -10 -10 -10 -3 -2 ]<br />
}<br />
}<br />
]<br />
}<br><br />
# Redirect the default device to go via the EQ - you may want to do<br />
# this last, once you're sure everything is working. Otherwise all<br />
# your audio programs will break/crash if something has gone wrong.<br><br />
pcm.!default {<br />
type plug<br />
slave.pcm "eq"<br />
}<br><br />
# Redirect the OSS emulation through the EQ too (when programs are running through "aoss")<br><br />
pcm.dsp0 {<br />
type plug<br />
slave.pcm "eq"<br />
}<br />
<br />
*reload your alsa settings (as root)<br />
/etc/rc.d/alsa restart<br />
<br />
*you should be good to go (if not, ask in the forum)<br />
<br />
<br />
=Troubleshooting=<br />
==Still Getting No Sound?==<br />
<br />
Remember, ALSA installs with all channels '''muted by default''' (see previous section, [[ALSA#Unmuting_the_channels_and_testing_the_sound_card|unmuting your soundcard]]). However, if you're sure nothing is muted, that your drivers are installed correctly, and that your volume is right, but you still do not hear anything, then try adding the following line to <code>/etc/modprobe.conf</code> which should fix the problem:<br />
<br />
options snd-NAME-OF-MODULE ac97_quirk=0<br />
<br />
The above fix has been observed to work with <code>via82xx</code><br />
options snd-NAME-OF-MODULE ac97_quirk=1<br />
The above fix has been reported to work with <code>snd_intel8x0</code><br />
<br />
==No Sound with Onboard Intel Sound Card==<br />
<br />
There may be an issue with two conflicting modules loaded, namely <code>snd_intel8x0</code> and <code>snd_intel8x0m</code>. In this case, edit <code>rc.conf</code> and in the MODULES array blacklist the latter one so that it reads <code>!snd_intel8x0m</code> afterwards.<br />
<br />
==Poor Sound Quality?==<br />
<br />
If you experience poor sound quality, try setting the PCM volume (in alsamixer) to a level such that gain is 0.<br />
<br />
==Pops when Starting and Stopping Playback?==<br />
<br />
Some modules can power off your sound card when not in use. this can make an audible noise when powering down your sound card. If you find this annoying try "modinfo snd-MY-MODULE", and look for a module option that adjusts or disables this feature. <br />
<br />
for example: to disable the power saving mode using snd-hda-intel add "options snd-hda-intel power_save=0" in /etc/modprobe.conf. or try it with "modprobe snd-hda-intel power_save=0"<br />
<br />
==Alsamixer does not run==<br />
If running alsamixer does not work and you wind up with the following error<br />
alsamixer: function snd_ctl_open failed for default: No such device<br />
<br />
You should first check /etc/group to ensure that your current user is in the 'audio' group.<br />
<br />
Then you might need to re-install your kernel. Run 'pacman -S kernel26' or whichever patchset you prefer to use. Also, please make sure you are a member of the audio group.<br />
<br />
= External Resources =<br />
More info can be found here<br />
* [http://alsa.opensrc.org/index.php/Main_Page Unofficial ALSA Wiki]<br />
* [http://alsa.opensrc.org/index.php/Aadebug A simple shell script to aid ALSA audio debugging]<br />
* [http://bbs.archlinux.org/viewtopic.php?id=36815 HOWTO: Compile driver from svn]<br />
* [http://gentoo-wiki.com/HOWTO_Set_up_a_system-wide_equaliser_with_ALSA_and_LADSPA HOWTO Set up a system-wide equaliser with ALSA and LADSPA]</div>Cqpanxuhttps://wiki.archlinux.org/index.php?title=User:Cqpanxu&diff=43478User:Cqpanxu2008-06-22T11:06:23Z<p>Cqpanxu: </p>
<hr />
<div>Hello, it's 潘旭(Xu Pan) from Chongqing,China.</div>Cqpanxuhttps://wiki.archlinux.org/index.php?title=User:Cqpanxu&diff=43476User:Cqpanxu2008-06-22T11:00:23Z<p>Cqpanxu: New page: It's 潘旭(Xu Pan) from Chongqing,China.</p>
<hr />
<div>It's 潘旭(Xu Pan) from Chongqing,China.</div>Cqpanxu