After some googling I finally found out how to make most linux apps be more cooperative WRT sound (meaning they should not hijack the soundcard for themselves like win95 back in the days). The really simple solution I used was to have the following in my /etc/asound.conf:
Code:
pcm.!default {
type plug
slave.pcm "swmixer"
}
pcm.swmixer {
type dmix
ipc_key 1234
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
}
Works well for most apps (VLC, gstreamer, xine, ...)
Anyway, Java ignores this. If I have a Java applet with sound, subsequent sound playback will fail (e.g. opening a movie with VLC after loading a page with an applet with sound). The other way around also fails (the applet will fail while playing a movie).
I am not sure exactly what's going on, but it seems Java is using the OSS emulation layer (lsof showed java_vm opened /dev/dsp). I did rmmod snd_pcm_oss and then java_vm opened /dev/snd/pcmC0D0p instead, this is the same device as e.g. VLC will open, but it still won't cooperate. This is rather annoying and I would like to fix it somehow. Anyone?