Hi,
 
You can use SNDCTL_DSP_SETFMT to set the device to 16bit.
 
<snip>
fmt = AFMT_S16_NE;
ioctl(fh, SNDCTL_DSP_SETFMT, &fmt);
<snip>
 
Where 'fh' is the file handle to /dev/dsp returned by 'open'.
 
You should also make sure the number of channels & the speed are what you want 
rather than relying on defaults. These ioctls are SNDCTL_DSP_CHANNELS & 
SNDCTL_DSP_SPEED.
 
 
Regards
 
Phil Q
 
Phil Quiney, Senior Software Engineer
Trinity Convergence
Cambridge Business Park
Cowley Road
Cambridge CB4 0WZ, UK
T: +44(0)1223-435536
F: +44(0)1223-435560
www.trinityconvergence.com <http://www.trinityconvergence.com/> 

 

________________________________

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gabriele Filosofi
Sent: 11 September 2008 13:22
To: davinci-linux-open-source@linux.davincidsp.com
Subject: using dev/dsp along with a 16bit codec


Hi,
 
I've found that in the OSS framework the /dev/dsp device uses 8-bit unsigned 
linear encoding, while the /dev/dspW device uses 16-bit linear encoding.
Any data written to the davinci audio device should be played back with the 
on-board codec (AIC33), that is configured with 16 bit per sample. But in the 
/dev folder I don't find the /dev/dspW file! 
Also, I've found some people use 
 
fdw ( "/dev/sound/dsp", O_WRONLY);
...
write ( fdw, buffer, 64);       /* where buffer in an array of unsigned chars */
 
I'm wondering one can access a 16-bit audio codec using /dev/dsp.
If anyone knows it, can you please give some suggestions to understand it?
 
Tanks.
 
Regards,
 
Gabriele Filosofi
 
 
_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to