Re: sound output with libao
I should mention I'm using 2.4.24-ben1, rsync'd last weekend, against
libao 0.8.4-1.1 from unstable.
This one time, at band camp, Jamie Wilkinson wrote:
> if (ioctl(internal->fd,SNDCTL_DSP_STEREO,&tmp) < 0) {
There's an ioctl called before this one: SNDCTL_DSP_GETBLKSIZE. This
was added in 0.8.4 presumably to get the maxiuumum size the driver could
handle, before that libao just assumed a buffer size.
So, with that GTBLKSIZE commented out, and the buffer size variable
initialised to some value, all the other ioctls suceed -- leading me to
my hypothesis: the GETBLKSIZE ioctl in dmasound_core.c is busted.
>So, why would shared_... decide that the ioctl is failing?
The ioctls fail if the sound queue is locked, with the call to
queues_are_quiescent. That in turn looks at the value of
write_sq.locked, which the GETBLKSIZE ioctl sets to 1 when it calls
sq_setup.
There's an interesting comment in sq_setup:
sq->locked = 1 ; /* don't think we have a race prob. here _check_ */
about line 453.
I'm no kernel hacker, so correct me if i'm wrong, but maybe this leads
to the cause? There certainly is a problem if GETBLKSIZE is called
before any other ioctls.
The only time sq.locked gets reset is in sq_reset_output and
sq_reset_input.
--
jaq@debian.org http://people.debian.org/~jaq
Reply to: