From the ALSA wiki
- 1 Download
- 2 Configure build environment
- 3 Compile and install alsa-drivers
- 4 Compile and install alsa-lib
- 5 Compile and install alsa-utils
- 8 Misc
- 9 Low latency ymfpci cards
- 10 Authors
Configure build environment
Create a directory, copy and unpack source:
ln -s /usr/src/alsa-0.9.0rc2/ /usr/src/alsa
cp /directory/where/you/put/alsa-*.bz2 /usr/src/alsa
bunzip2 -v alsa-*.bz2
tar -xvf alsa-lib-0.9.0rc2.tar
tar -xvf alsa-utils-0.9.0rc2.tar
tar -xvf alsa-driver-0.9.0rc2.tar
Make sure "make install" can find System.map: I am using the Debian make-kpkg system for compiling and installing my kernels. It does not leave System.map in the kernel source directory. It was necessary for me to create two symlinks in order for the alsa-driver "make install" procedure to find my System.map.
ln -s System.map-`uname -r` System.map
ln -s /boot/System.map System.map
Before I made these links "make install" for the drivers would fail at
the depmod stage with an error like this (with
`uname -r` here
standing in for the current running kernel):
depmod -a -F /lib/modules/`uname -r`/build/System.map `uname -r`
depmod: Can't read /lib/modules/`uname -r`/build/System.map
I don't think this step is needed if you compiled your kernel with the more traditional "make dep; make clean; make bzImage; make install; make modules; make modules_install" chain of commands.
Compile and install alsa-drivers
Read the INSTALL file. Make sure your kernel has sound support turned on. You also need to have your configured kernel sources installed. If you want to pass some options to configure, ./configure --help will show you what's available. I chose to use the defaults:
Build the modules and install them in /lib/modules/`uname -r`/kernel/sound/:
Create device nodes in /dev/snd/. (Actually, links to /proc/asound/dev/:
The INSTALL file tells you to edit /etc/modules.conf. On Debian this file is generated by the update-modules utility based on files in /etc/modutils/. I added the following lines to /etc/modutils/aliases then ran update-modules:
alias char-major-116 snd
alias snd-card-0 snd-ymfpci
Load the modules into the running kernel:
Compile and install alsa-lib
This is necessary in order to build and install the alsa-utils.
Compile and install alsa-utils
Alsa-utils includes alsactl, alsamixer, amixer and aplay. They are useful tools for testing and working with your soundcard.
Testing record and playback
I tested recording first through a cheap microphone that plugs directly into the mic input with a mini-jack and then with a hand-held cassette recorder/player plugged into the line input via a mini-jack patch cable. I also tested playback.
Prepare the soundcard for recording from the microphone:
Alsamixer displays an ncurses interface to the various devices within the soundcard. You can select devices using the left and right arrow keys or n and p for (n)ext and (p)revious. Level for the selected device can be adjusted with the up and down arrow keys or w and x. Mute status can be toggled with the m key. Capture status can be toggled with the space bar.
All devices were muted the levels set to zero. Then 'Capture' and 'ADC' were unmuted and turned all the way up.
Added by jago25_[email protected] -
- 'ADC' - will output any input coming in on the the 'line in' port
- 'ADC Capture' - record settings for the 'line in' port
- The left 'Digital' - also has to be turned up to record from line in.
(Line in port capture works but I am unable to get the Mic in port to capture. Need fuller/cleaner explaination of what does what)
arecord -d 30 -f cd -t wav test.wav
This records a file named test.wav of (t)ype wav in cd (f)ormat for a (d)uration of 30 seconds.
Prepare the soundcard for playback:
Except for Master, PCM and Wave, I muted, turned off capture and set the level to zero for all devices. Master, PCM and Wave were unmuted and set to the maximum "green" level.
aplay -f cd test.wav
Prepare the soundcard for duplex recording from line input:
Except for Master, PCM, Capture and ADC, I muted, turned off capture and set the level to zero for all devices. Master, PCM and Wave were unmuted and set to the maximum "green" level. This allows the input to play through the speakers while it is recording.
arecord -d 30 -f cd -t wav testline.wav
Set up the soundcard and test playback the same way as above.
Storing and restoring mixer settings
alsactl allows you to store the current mixer settings to a file and then restore those settings at a later time. For each mixer scenario described above you can store the settings in a file and then use that file to set the soundcard:
Set the devices via alsamixer for recording from the mic as described above.
alsactl -f micrecord.conf store
Set the devices via alsamixer for recording from line input as descrbed above.
alsactl -f linerecord.conf store
Set the devices via alsamixer for playback as described above.
alsactl -f micrecord.conf store
Then you can switch between the different scenarios without using alsamixer:
alsactl -f foo.conf restore
Set default levels to be used on boot up:
See the .asoundrc Wiki page for more info about ALSA configuration.
The Gentoo Linux Distribution also has good help for installing and setting up Alsa on thier website:
Top of website, gentoo.org -> Documentation -> Desktop Configuration Guide -> Alsa
Low latency ymfpci cards
- Because the ymfpci is a bit weak, even in Asio with Windows in order to use a ymfpci soundcard with jack
and generally do anything useful you need to set the period size. For example:
jackd -d alsa -d default -r 44100 -p 512 -n 3
The key setting here is:
This gives you a latency of \~74ms. Using
/dev/rtc and other kernel
latency settings / patches should help.
- PatrickShirkey 20020311
(majority of work)
- jago25_98 20040129
(a few small additions)
Retrieved from "http://alsa.opensrc.org/GuillemotMaxisoundFortissimo"