Linux used to mixing

作者: hearer 2007-10-13 21:31:09
This one seems to stump most linux newbies..."Why can't I hear sounds from two applications at once?" This is because your sound card requires something called "software mixing." Thankfully, ALSA provides software mixing, so this shouldn't be very hard.

The first thing to do is install the package libesd-alsa0. Use synaptic, a sudo apt-get install, or whatever. Its available in the Ubuntu repositories.

Then, create the following file using "sudo gedit" or your favorite text editor, and save it as /etc/asound.conf. (Make sure you use sudo, you need root priviledges to do this.)

pcm.card0 {
type hw
card 0
}

pcm.!default {
type plug
slave.pcm "dmixer"

}

pcm.dmixer {
type dmix
ipc_key 1025
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
periods 128
rate 44100
}
bindings {
0 0
1 1
}
}

(the above file should work with most sound cards...I've tried it with 3 different ones with success. I can't guarantee it'll work in all cases, though.)

Next, execute a "sudo gedit /etc/esound/esd.conf" and change the file to the following:

[esd]
auto_spawn=1
spawn_options=-terminate -nobeeps -as 2 -d default
spawn_wait_ms=100
# default options are used in spawned and non-spawned mode
default_options=

Next, go to your Sound control panel in Gnome and enable sound server startup. After this, go to your Multimedia Systems Selector control panel and set it to either ALSA or ESD. Then, reboot your computer.

After doing this, you can set any application to use alsa or ESD, and you'll hear multiple sounds at once! No more problems playing games that use ALSA and hearing sounds from a Gnome app that uses ESD...

If someone has problem with no sound in mozilla/firefox/epiphany with this setup on hoary, I've found that firefox seeks for libesd.so.1 at startup while there is only libesd.so.0.
sudo ln -s /usr/lib/libesd.so.0 /usr/lib/libesd.so.1 should solve the problem.

相关资讯