Can anyone tell me what formats /dev/dsp, /dev/dsp56k, /dev/audio, etc. expect? It seems that I can copy a WAV format file directly to /dev/dsp and get recognizable sound. I wonder just what format they actually expect.
Mike
On Mon, 25 Aug 2008 14:26:25 -0500, Mike McCarty wrote:
Can anyone tell me what formats /dev/dsp, /dev/dsp56k, /dev/audio, etc. expect? It seems that I can copy a WAV format file directly to /dev/dsp and get recognizable sound. I wonder just what format they actually expect.
/dev/audio used to accept µ-law encoding, /dev/dsp accepts raw pcm as configured via ioctl. The device doesn't evaluate any WAV header.
Michael Schwendt wrote:
On Mon, 25 Aug 2008 14:26:25 -0500, Mike McCarty wrote:
Can anyone tell me what formats /dev/dsp, /dev/dsp56k, /dev/audio, etc. expect? It seems that I can copy a WAV format file directly to /dev/dsp and get recognizable sound. I wonder just what format they actually expect.
/dev/audio used to accept µ-law encoding, /dev/dsp accepts raw pcm as configured via ioctl. The device doesn't evaluate any WAV header.
Thanks! So, if I want to use sox, I can specify the output to be /dev/dsp and raw, and the input format to be whatever corresponds.
Mike
On Mon, 25 Aug 2008 15:27:11 -0500, Mike McCarty wrote:
Michael Schwendt wrote:
On Mon, 25 Aug 2008 14:26:25 -0500, Mike McCarty wrote:
Can anyone tell me what formats /dev/dsp, /dev/dsp56k, /dev/audio, etc. expect? It seems that I can copy a WAV format file directly to /dev/dsp and get recognizable sound. I wonder just what format they actually expect.
/dev/audio used to accept µ-law encoding, /dev/dsp accepts raw pcm as configured via ioctl. The device doesn't evaluate any WAV header.
Thanks! So, if I want to use sox, I can specify the output to be /dev/dsp and raw, and the input format to be whatever corresponds.
Ask kernel devs whether you can still expect a specific raw format.
There are several parameters that must match: bits per sample, signed/unsigned samples, number of channels (mono/stereo), frequency
Btw, it's likely that /dev/dsp will go away in the future, as it's only a compatibility device file for the old OSS driver architecture (unload a kernel module, and the device file is gone). ALSA uses different device files.
Michael Schwendt wrote:
Ask kernel devs whether you can still expect a specific raw format.
There are several parameters that must match: bits per sample, signed/unsigned samples, number of channels (mono/stereo), frequency
Endianness?
Btw, it's likely that /dev/dsp will go away in the future, as it's only a compatibility device file for the old OSS driver architecture (unload a kernel module, and the device file is gone). ALSA uses different device files.
Aha. So, what do you recommend? I was using my computer to generate some reference signals for testing some other equipment.
Mike
On Mon, 25 Aug 2008 16:32:20 -0500, Mike McCarty wrote:
There are several parameters that must match: bits per sample, signed/unsigned samples, number of channels (mono/stereo), frequency
Endianness?
Add that to the list. :)
Aha. So, what do you recommend? I was using my computer to generate some reference signals for testing some other equipment.
If you use sox already, use "play", sox's player. I don't see why you insist on copying data to raw device files.
Michael Schwendt wrote:
On Mon, 25 Aug 2008 16:32:20 -0500, Mike McCarty wrote:
There are several parameters that must match: bits per sample, signed/unsigned samples, number of channels (mono/stereo), frequency
Endianness?
Add that to the list. :)
Aha. So, what do you recommend? I was using my computer to generate some reference signals for testing some other equipment.
If you use sox already, use "play", sox's player. I don't see why you insist on copying data to raw device files.
I don't insist on anything, and I'm not a regular sox user. I had a need for some reference signals, and had a computer sitting nearby, but no other signal generating equipment. A thought occurred to me that I could probably get something out of the computer with a little work. I fiddled around until I got the thing to work. That's all.
If you know better ways, I'm willing to hear them.
Mike