[Openal-devel] Patch for ALSA capture
Jason Daly
jdaly at ist.ucf.edu
Wed Jan 24 15:57:53 PST 2007
The recent svn update I did broke audio capture for me. I think I
figured out the problem, and the attached patch is a fix for it.
Basically, the buffer size requested was based on the output device's
update rate, and not the rate specified to alcCaptureOpenDevice(). My
application was opening playback at 44100Hz, but capture was only 8000Hz
(it's low because we use capture to do a kind of voice over IP inside
the app). This resulted in a very large buffer being requested for the
rate, and the hardware was not allowing it. Ultimately, this caused the
snd_pcm_readi call in alc_backend_alsa to constantly return overrun
errors. The patch simply causes the read buffer to be based on the
capture rate. I also put in the code to account for data format and
number of channels in the buffer size calculations for both the read and
write devices.
I tested the new code on an NVIDIA MCP55, an Audigy2 and an Audigy2
Value, all under Red Hat Enterprise 4.4.
--
--"J"
"I'm a castaway stranded in a desolate land,
I can see the footprints in the virtual sand."
--Neil Peart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alc_context.c.patch
Type: text/x-patch
Size: 1722 bytes
Desc: not available
Url : http://opensource.creative.com/pipermail/openal-devel/attachments/20070124/7024c98c/alc_context.c.bin
More information about the Openal-devel
mailing list