Odd code in sound/pcm/channel.c, help with PR?

George Hartzell hartzell at alerce.com
Wed Apr 19 03:27:57 UTC 2006


I'm trying to get some traction and get sound to work on my ASUS
A8V-MX.  I keep ending up with

  pcm0:play:0::dsp0.0: play interrupt timeout, channel dead

on my console.

I've filed a PR with more details:

  http://www.freebsd.org/cgi/query-pr.cgi?pr=95949

I've been looking around, trying to understand what might be going on.
I came across the following piece of code in
/usr/src/sys/device/sound/pcm/channel.com, around line 320

timeout = (hz * sndbuf_getblksz(bs)) / (sndbuf_getspd(bs) * sndbuf_getbps(bs));
if (timeout < 1)
        timeout = 1;
timeout = 1;
ret = chn_sleep(c, "pcmwr", timeout);
if (ret == EWOULDBLOCK) {
        count -= timeout;
        ret = 0;
} else if (ret == 0)
        count = hz;

It's funny that it goes to the trouble to figure out a timeout value
then seems to unconditionally set it to 1.

Removing that line doesn't seem to fix my problem, but it still seems
weird.


And, while I've got your attention, can anyone suggest where I might
look to understand why the buffer doesn't seem to be being emptied?

Thanks,

g.


More information about the freebsd-multimedia mailing list