ALSA - Using dmyx/dsnoop/asym

Paul van Schayck <[email protected]> Fri, 11 Jun 2004 23:34:57 +0200
Newsgroups gmane.comp.emulators.winex.devel
Organization None
Message-ID <[email protected]>
Hey,

In the June development report you were asking for feedback on the ALSA 
driver.

Some sound cards and most USB soundcards/headset only have one playback 
and record channel. But most people want to play more then one sound at 
the same time.
ALSA has a system of plugins to allow all kind of stuff with sound 
channels. One of those things is allowing multiple streams being played 
at the same time. This is done trough dmix[1] (for playback), dsnoop 
(for record) and asym[2] (for both).
This is all set trough the ~./asoundrc file, I've attached my file below 
inline.

But here my knowledge of ALSA ends a bit. When already running XMMS and 
then trying to run WineX with a game ends with:
ALSA lib pcm_hw.c:1055:(snd_pcm_hw_open) open /dev/snd/pcmC0D0p failed: 
Device or resource busy
A second XMMS will succeed.

With my best knowledge I suspect winealsa is directly using hw:0,0 and 
not !default. Maybe there should be a .config setting allowing to set 
that. But maybe it's even a deeper problem.

ALSA plugins are used by many people and it would be a miss in the ALSA 
driver if you're not able to use the features OSS didn't offer.

Kind Regards,
Paul van Schayck

[1] http://alsa.opensrc.org/index.php?page=DmixPlugin
[2] http://alsa.opensrc.org/index.php?page=asym


# asym per default
pcm.!default {
     type plug
     slave.pcm "asymer"
}

# for the aoss script
pcm.dsp0 {
     type plug
     slave.pcm "asymer"
}

# asym plugin magic
pcm.asymer {
     type asym
     playback.pcm "dmixer"
     capture.pcm "dsnooper"
}

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

# record channel
pcm.dsnooper  {
     type dsnoop
     ipc_key 1024
     slave {
         pcm "hw:0,0"
         period_time 0
         period_size 1024
         buffer_size 8192
         #periods 128
         rate 44100
     }
     bindings {
         0 0
         1 1
     }
}

# sound mixer
ctl.mixer0 {
     type hw
     card 0
}