Problems with OSS driver (/dev/dsp).
====================================
I am having problems with /dev/dsp programming under Linux.
I'm experimenting with Gtk/sound/threads and I am having pretty bad
problems.
I have no problems with simple things like (1) opening the device,
(2) record or play and (3) closing the device.
Those simple things work just fine.
But if I try to do anything more complex, it doesn't work.
I'm using plain RedHat 5.2 (kernel 2.0.36).
-- First problem --
I am recording an sample at 8000Hz, 8 bits, it doesn't matter if I
record in stereo or not, I get a 7-8 seconds delay after doing
ioctl(fd_dsp, SNDCTL_DSP_RESET, 0).
That is, recording stops immediately but the read(2) does not
return '-1' until 7-8 seconds after the ioctl.
The kernel logs (immediately after the ioctl):
kernel: Sound: DMA (input) timed out - IRQ/DRQ config error?
The ioctl(2) and read(2) are done in seperate threads on the same fd.
The ioctl reports no error (0 returned).
-- Second Problem --
Switching between record/play doesn't work well.
Using the simple parrot.c (no threads, no Gtk) from the package at
http://www.oreilly.com/catalog/multilinux/ {select 'examples'}
The first record/play is OK, but each record after that has an ~6 seconds
delay in front of it. That is, the driver does not start recording until
~6 seconds after the read(2) call.
The program does not close the driver in between read/writes just
calles "ioctl(fd, SOUND_PCM_SYNC, 0);" after each playback.
If anybody can get parrot.c to work I would be interested in knowing
how it was done.
--
RIKHARDUR EGILSSON - Ingnieur Systme
echo '[q]sa[ln0=aln80%Pln80/snlbx]16isb15CB32EF3AF9C0E5D7272C3AF4F2snlbxq'|dc