[linux-audio-user] How Does One get 2 8-KB Streams (/dev/dsp*2)?

From: Martin McCormick <martin@email-addr-hidden>
Date: Sun Jan 07 2007 - 05:22:07 EET

        I have ALSA on a Linux system with a 2.6.5 kernel and a
CS4236 sound card. I have written a VOX or Voice Actuated Relay
recording program that receives audio from a radio such as a
police scanner or amateur radio receiver and stores it in a file
as unsigned 8-bit audio of the type you get if you cat /dev/dsp
>somefile. My program just opens /dev/dsp and sits there looking
for samples that indicate audio being received and begins
recording until there is a period of silence at which time it
stops recording and continues to keep /dev/dsp open for more
audio.

        It occurred to me that it should be possible to open
either /dev/dsp or some other device for 2 8-K streams so that a
similar program could read them both and store audio in files
corresponding to the right and left channels of the card.
Basically, I am not sure what is the best practice for opening
the 16-bit, 8-K device. I think once that is solved, my program
could be made to act as 2 independent VOX's. While doing a
Google search, I found a OSS-sound document that is several years
out of date and mentioned such devices as /dev/dspw which is a
16-bit version of /dev/dsp but modern Linux does not appear to
have anything other than /dev/audio and /dev/dsp.

        Since this application needs to be portable, I want to
set up the opening of the 16-bit 8-K channel in a standard way.

        Thanks for any pointers on documentation you might have.
I have found the How-To document for Linux sound which mentions
the standard /dev sound devices, but it is geared more toward
helping folks get their Linux sound running rather than writing
programs using the devices.

        Many thanks.

Martin McCormick WB5AGZ Stillwater, OK
Systems Engineer
OSU Information Technology Department Network Operations Group
Received on Sun Jan 7 08:15:02 2007

This archive was generated by hypermail 2.1.8 : Sun Jan 07 2007 - 08:15:03 EET