SBC driver

Hans Petter Selasky hselasky at c2i.net
Fri Dec 22 03:31:17 PST 2006


Hi,

I installed FreeBSD 6.2 BETA3 on a box with a soundcard that is detected as 
"sbc0:". After some while of playing sound, it suddenly turns into white 
noise. I think this is because of some buffer underrun, hence the computer is 
not so fast, and it is running KDE, and the byte sync is lost.

In the following piece of code:

int
sndbuf_dmaptr(struct snd_dbuf *b)
{
        int i;

        KASSERT(b, ("sndbuf_dmaptr called with b == NULL"));
        KASSERT(sndbuf_getflags(b) & SNDBUF_F_DMA, ("sndbuf_dmaptr called on 
non-ISA buffer"));

        if (!sndbuf_runsz(b))
                return 0;
        i = isa_dmastatus(b->dmachan);
        KASSERT(i >= 0, ("isa_dmastatus returned %d", i));
        return b->bufsize - i;
}

Can it be a good idea to align "i" for 16-bit stereo?

        i = isa_dmastatus(b->dmachan) & ~3;

Or even a little bit more:

        i = isa_dmastatus(b->dmachan) & ~7;

So that one doesn't write 1 byte, then it underruns, and then one write 3 
bytes at the new position?

Yours
--HPS


More information about the freebsd-multimedia mailing list