ALSA, multiple recording apps, device busy, dsnoop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Howdy all!

  I've been moving between OSes trying to get a solution going. We stream a 
large number of low-bitrate feeds via darkice to an icecast server (For 
fun) of public safety type stuff. I'm trying to up the density on the 
systems that feed the stuff since computing power is so fast.

I've got a system with 7 Creative / Ensoniq ES1371 cards in it.

I need to hit each card twice. My goal is to have two copies of darkice 
per card, one encoding the left feed and one into the right feed to 
different streams. The inputs are scanners (lots of them), so stereo isn't 
needed and one channel is wasted per card.

I had custom hacked darkice so that I had two copies, one broken in that 
it only does left, one for right. This worked on FreeBSD (multiple copies 
could open /dev/dsp for read without issue oddly enough) but other 
problems have me trying to use Debian. I noticed alsa can re-do the 
channels, so I decided to try this so I do not need a modified darkice 
version. (Note, in my modified version I've got the app set to leave the 
card in stereo so that both channels stay active, then when it goes to 
encode I pass Lame the mono flag, and the stream the mono flag so that it 
fits my solution. Not pretty but it works (other BSD issue causes it to 
crash every 7 hours though :-)

I've got Alsa installed, the cards all show up. I created a .asoundrc file 
that contains 7 sets of entries that look like this:

----------------------+
pcm.record_left {
     type dsnoop
     ipc_key 234884
     slave {
         pcm "hw:0,0"
         channels 2
     }
     bindings.0  0
}

pcm.record_right {
     type dsnoop
     ipc_key 2241234
     slave {
         pcm "hw:0,0"
         channels 2
     }
     bindings.0  1
}
------------------+


Then I have a darkice config for each pcm device. They increment the 
hw:0,0 up to hw:6,0. The ipc_keys are all different. The pcm.record_ part 
increments as well so there are no dupes. One darkice per entry in the 
asoundrc.

When I try to launch two copies of darkice, it fails with this:

ALSA lib pcm_dsnoop.c:558:(snd_pcm_dsnoop_open) unable to open slave

It looks as if only one slave can open the hw: device at a time. This kind 
of defeats what I'm after? I thought the point of the dsnoop was to allow 
multiple apps to read one physical hardware device?

The odd thing is SOMETIMES it works! Sometimes I will wind up with two 
copies running against 1 sound card.

(While the app is running there are Buffer overrun's scrolling down the 
screen, but I can address that later, perhaps by matching up sampling 
rates between ALSA and darkice).


-----+
audio20:/proc/asound/card0/pcm0c# cat info
card: 0
device: 0
subdevice: 0
stream: CAPTURE
id: ES1371/1
name: ES1371 DAC2/ADC
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 0
-----+
Sound cards only have one subdevice for capture from what I can tell.

Thoughts? What am I missing?


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux