[lug] Capturing a data stream

Ed Meyer edmeyer at smartsbroadcast.com
Wed Oct 8 21:46:26 MDT 2003


Hey everybody,

Its been a while since I've had to post a question - but that doesn't mean I
haven't learned a lot from lurking on this list.  My current dilemma has me
quite stumped but since everything is possible in Linux I'm sure I'm just
looking easily through the answer.

Is there a way to capture a stream of data as its heading to a device to
divert it?  In particular - I'm working for a company which makes products
for the broadcast (radio) market and we want to be able to capture the data
stream heading for the audio card and divert it for analysis / debugging /
monitoring.  At this point I can fork the stream when its generated - but
that interrupts the stream while the process passing data to the audio card
shifts into a different mode.  Also, I'm not always the one controlling the
application talking to the audio card.  It could be coming from several
different applications.  So far my theory I could just cat the data out of
/dev/dsp1 doesn't appear to be true.  My other thoughts lead me to think I
might have to read the memory address where the data is buffering as it
enters the DSP - but this seems dangerous to me and since I'm not much of a
low level developer - rather beyond my abilities.

Audio passes to the audio card from our application, vgetty, internet
streams, and sometimes, the files themselves are merely cat'd right onto the
device (if the files are uncompressed and reside locally on the drive).  We
need to be able to tap into and listen to whats going on the air and my
theory was to capture the data stream hitting the dsp and then pipe it
through some form of compression (probably ogg) and back up the ssh tunnel
so we can hear it.

I've been googling for anything remotely similar and haven't had any luck.
If this is well beyond the scope of these discussions - I understand.  I'm
really just looking for a pointer to how the streams are really passed
around the os layer.

Thanks!
Ed Meyer
Smarts Broadcast Systems
Emmetsburg, IA






More information about the LUG mailing list