Advanced Linux Sound Architecture (简体中文)

From ArchWiki
Revision as of 06:42, 27 December 2005 by Wd (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n links end

这篇文章将讲述如何使Alsa在2.4和2.6内核中正常使用。同时请参考allow multiple programs to play sound at once

本文基于Arjan Timmerman的Alsa设置指南: http://www.soulfly.nl/~arjan/archlinux/alsa-setup.html 其他附加消息: http://bbs.archlinux.org/viewtopic.php?t=2544 如果你使用的是配置了Creative Labs Sound Blaster Live! card声卡的Dell电脑,你需要手动编译ALSA。

安装

  • 2.4和2.6内核都需要做的:
 # pacman -Sy alsa-lib alsa-utils


  • 只需要2.4内核做的:
 # pacman -S alsa-driver
 # depmod -a


  • 推荐但不是必须的操作:
 # pacman -S alsa-oss


Note that the 'alsa-driver' package includes the necessary modules based on the Arch stock kernel! If you compiled your own 2.4 kernel, these will most likely not work, and you should compile a new 'alsa-driver' package with ABS while running your custom kernel, and install the resulting package instead.

Configuration

Note: If hotplug detects your soundcard correctly, you don't need to load the modules manually. If that's the case you only need to do step 3 (and 4). If you are unsure if your soundcard is detected, as root type "lsmod". You should see several modules loaded that starts with "snd-".

  • Load modules:
 # modprobe snd-NAME-OF-MODULE
 # modprobe snd-pcm-oss


  • Unmute Soundcard
 # amixer set Master 75 unmute
 # amixer set PCM 75 unmute


Or you can do this graphically using 'alsamixer'
NOTE When using 'alsamixer', be sure to unmute (push M) as well as bring volumes up.


  • Test on a wave file on your system:
 # aplay mywav.wav


  • Add snd-pcm-oss and 'snd-NAME-OF-MODULE' to the list of MODULES in '/etc/rc.conf'

Still Getting No Sound?

Even though your drivers are installed correctly, and your volume is right, and nothing is muted, you might not hear anything! Adding the following line to /etc/modprobe.conf fixes this problem (with the via82xx driver, at least).

options snd-NAME-OF-MODULE ac97_quirk=0


Setup Permissions

  • Add your user to the audio group:
 # gpasswd -a USERNAME audio


  • Log your user out and back in to ensure the audio group is loaded.

Restore Alsa Mixer settings at Startup

  • Run 'alsactl' once to create '/etc/asound.state'
 alsactl store


  • Edit '/etc/rc.conf' and add 'alsa' to the list of daemons to start on bootup


Getting SPDIF output

  • (from gralves from the gentoo forums)
  • In Gnome Volume Control, under the Options tab, change the IEC958 to PCM. This option can be enabled in the preferences.
  • If you don't have Gnome Volume Control installed,
    • Edit /etc/asound.state. This file is where alsasound store your mixer settings.
    • Find a line that says : 'IEC958 Playback Switch'. Near it you will find a line saying value:false. Change it to value:true
    • Now find this line: 'IEC958 Playback AC97-SPSA' and change value to 0.
    • Restart alsa.


KDE settings

  • Start up KDE:
 # startx


  • Setup the volumes as you want them for this user (each user has their own settings):
 # alsamixer


  • KDE 3.3 Go to the K Menu > Multimedia > KMix
    • Choose Settings > Configure KMix...
    • Un-check the option "Restore volumes on logon"
    • Press OK, and you should be all set. Now your volumes will be the same from the command line or within KDE.