
After lot's of searching, reading, testing, and trial and error, at last I have reached to a working asoundrc config for alsa.
If you don't know what the file is used for here's a heads up:
alsa usually works out of the box, but can be configured to do more sophisticated stuff using a configuration file:
/etc/asound.conf --- system global configuration file
$HOME/.asoundrc --- per user configuration
So why use it? Here's what I use it for; I hate esd and artsd ( the servers that are supposed to allow you to use your sound card in different programs at the same time ).
Not all programs support them, they introduce latency in the sound, and you have to configure each program to use the sound server.
GNOME uses esd, KDE uses artsd, and it is very confusing to when programs just stop producing sound.
Sometimes you have to run esd over artsd to support some programs ( or the other way round ) which introduces more latency and uses more resources.
Now the alsa library is powerful enough to consolidate these functions and make it transparent.
Using the following instructions I have produced sound from mplayer, realplayer, rhythmbox, and esd ( for Gnome''s bells and whistles ), while recording voice at the same time ( either using arecord or gnome-sound-recorder or gnomemeeting's mic test ). Yes full duplex ! I even got wine to work but not sure it will work for you.
First a little disclaimer, it's best you put this file in $HOME/.asoundrc, and if anything goes wrong like the sound stopped working just remove it. Don't blame me for anything it works for me it might or might not work for you.
That said, I'd be glad to help you reach a config that works, since I am originally trying to make a file that works on all computers ( for the LiveCD of course ).
Instructions :
I am using :
*kernel 2.6.10rc2-mm3 : IMHO not necessary as long as you get latest ALSA.
*latest ALSA driver and libraries ( currently 1.0.7 )
*cut and paste inside the dotted line and save it to $HOME/.asoundrc
*RealPlayer needs to be run using "aoss realplayer"
*esd needs to be compiled with alsa support ( dunno about artsd ).
*any program that asks for the alsa device name to use, choose default.
*mplayer can use either "-ao alsa" or "-ao sdl"
*sdl programs like games, usually work just fine
*change wine/winex config to use alsa driver
*the config file is all you need, just change the rates according to your sound card. Mine is a normal 44100Hz, yours could be 48000 ( especially the builtin AC'97 crads ):
--------------------------------------------------------------------------------
pcm.card0 {
type hw
card 0
mmap_emulation true
}
pcm.!output {
type dmix
ipc_key 1234
ipc_key_add_uid 1
slave {
pcm "card0"
period_time 0
period_size 1024
buffer_size 8192
rate 44100
}
bindings {
0 0
1 1
}
}
#
# DSNOOP output device
#
pcm.!input {
type dsnoop
ipc_key 4321
ipc_key_add_uid 1
slave {
pcm "card0"
period_time 0
period_size 1024
rate 44100
}
}
#
# ASYM duplex device
#
pcm.!duplex {
type asym
playback.pcm "output"
capture.pcm "input"
}
#
# Make the duplex device default
#
pcm.!default {
type plug
slave.pcm "duplex"
}
#
# OSS Compability
pcm.!dsp0 {
type plug
slave.pcm "duplex"
}
ctl.!mixer0 {
type hw
card 0
}
----------------------------------------------------------------------------
if it works, Enjoy. Otherwise tough :)
Comments
I'm having some troubles with
I'm having some troubles with alsa. I can get sound out of xmms only if I select the oss plugin, I was using alsa in xmms before... frasi amore
Thanks
This worked with my on board VIA 8235.
Just needed to change the rate to 48000.
I'm having some troubles with
I'm having some troubles with alsa. To start off my card is an Creative Labs SB Audigy. I got sound with totem and pidgin, but xmms gives me an error.An other problem that I have, is that tremulous has no sound..
reply
Hi,
I'm having some troubles with alsa. I can get sound out of xmms only if I select the oss plugin, I was using alsa in xmms before...
reply
I'm having some troubles with alsa. To start off my card is an Creative Labs SB Audigy. I got sound with totem and pidgin, but xmms gives me an error.An other problem that I have, is that tremulous has no sound..
I had no sound in Flash for
I had no sound in Flash for weeks (Ubuntu 64), this script worked for me (i just had to change "card 0" to "card 1".
Thanks !
Good, but
I think your problem is different. Probably you have two sound cards and their alsa modules are loaded in the wrong order. You can check this by doing :
{{{
cat /proc/asound/cards
}}}
The default sound card should be slot 0. You can either fix this by forcing module loading order, or fixing modprobe aliases. Look in /etc/modprobe.d/alsa-base for details.
You can also use pulseaudio which would allow you to switch output device on the fly.
most amazing script ever -
most amazing script ever - it really opened new windows in my ears with this GREAT script in my old slackwarelinux box.
listening currently 2 internet radio stations with amarok(xine) and xmms while watching(and hearing) internet tv in kmplayer(xine) at the same time.
GOD bless ya!
Greetings from eStonia!
mosh 3aref 2a2olak eah
walhi ya3ne ana mosh 3aref 2a2olak eakh .... rabena ykhalek le al linuxawaya dayman keda ya rab... ana ay ekhtra3 manf3sh ma3aya 3'er al code dah :)
thx bro
Post new comment