Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Dec 2006 11:19:18 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        freebsd-multimedia@freebsd.org
Cc:        ariff@freebsd.org
Subject:   Re: SBC driver
Message-ID:  <200612231119.20114.hselasky@c2i.net>
In-Reply-To: <200612221130.56361.hselasky@c2i.net>
References:  <200612221130.56361.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 22 December 2006 11:30, Hans Petter Selasky wrote:
> 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;
> }
>

I tried out the following patch, and it didn't work. It only made it worse. 
The sound works OK under XMMS and Amarok, but under Artsd it can suddenly all 
turn into white noise. Then in the end when the sound becomes more quiet, you 
can hear something again. So I think that there is a byte swap, in the 16-bit 
samples, or something else is wrong.

> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612231119.20114.hselasky>