Forwarded message: -------------------Date: Wed, 19 Jan 2000 09:00:05 -0800
From: email@example.com (David Ashley)
Subject: Duplex in audio
No response on the sdl dev list. To set full duplex audio on linux you need
to query the capabilities of the board, and you’ll get a bit set if the
full duplex works. You open the /dev/dsp in O_RDWR mode. You could add
a field to SDL_AudioSpec, say duplex. Also an audio callback for when data is
ready to be read, with the same arguments as the fill audio callback routine,
only data is present there ready to be used.
I’ve had to do a dummy read of one fragment’s worth of audio data to get the
driver to begin notifying me that audio data is ready. I used the select
function to see if audio data is ready so there is no waiting. On some drivers
the select won’t work until I “prime” it with an initial read of the file
handle. From then on select informs me when there is more data to be read.
Lots of sound driver problems come to light when opened in full duplex mode.
For example the awe64 board, otherwise very high quality, starts producing
pretty awful noise on the audio output. Some boards, like the VIBRA16, will
report full duplex capable (actually the linux driver reports that), but when
you try to use it you get audio input but audio output is silent.
Other times you get dma timeouts printed as kernel messages, if the dma
channels are not set up right. IE this is generally an untested situation
and so driver bugs are there that were never tested.
Still, full duplex is something people will probably want so you should
think about it. I can look into making patches to SDL/linux to handle it
but I’m lost on the other versions.
------------------- end forwarded message.