Hi,
I need to create separate virtual ALSA devices for the left and right channel 
of a USB sound card. I do that with the following config:

pcm_slave.xxx_slave {
  pcm "hw:CARD=xxx,DEV=0"
  channels 2
  rate 8000
  buffer_size 2048
  period_size 40
}

pcm.xxx_l {
  type dshare
  ipc_key 12345
  slave xxx_slave
  bindings.0 0
  hint.description "left channel"
}

pcm.xxx_r {
  type dshare
  ipc_key 12345
  slave xxx_slave
  bindings.0 1
  hint.description "right channel"
}

(For completeness I should note that via some udev configuration I make sure 
that no matter which audio device is plugged on the USB port, it will always be 
named "xxx"). This works fine with most USB audio devices. And if no USB audio 
device is plugged, I get an error from snd_pcm_open(), which is great too.

However, now I have a USB audio device, which only supports a single audio 
channel (mono). When I open the left channel virtual device (e.g. with the 
command: aplay -D xxx_l foo.wav), this also works fine. But when I do the same 
command with the right channel, I get a segmentation fault. After some 
investigation it seems that the snd_pcm_open() function does not return an 
error in this case, as I would expect. The segmentation fault happens later, 
when the (obviously invalid) PCM is being used.

This is a huge problem for me. I need to find out why snd_pcm_open() doesn't 
return an error, if I try to open it on a non-existing channel. Right now I'm 
trying to understand snd_pcm_dshare_open(). Maybe somebody has an idea what 
exactly to look for and can point me in the right direction? Any hint would be 
highly appreciated!

BR, Georg
 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to