Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Dec 2004 23:48:40 -0700
From:      Travis Poppe <tlp@LiquidX.org>
To:        freebsd-current@freebsd.org
Subject:   FreeBSD sound distortion problems with SB Live! fixed with PREEMPTION
Message-ID:  <20041207234840.7287cdf4@maya.liquidx.org>

next in thread | raw e-mail | index | archive | help
Hello all,

Back in October, I contacted the list and described a problem I was
having with FreeBSD 5.X (now 5.3-RELEASE) and sound. I will reiterate
the problem one more time for those of you who did not follow the posts.

I was using FreeBSD 5.3-BETA7 at the time (as far as I know, all of 5.x
has this problem) and have an SB Live! 5.1 which uses the emu10k1
driver. I've been told that this problem may be specific to my driver
(and possibly others).

The problem:

When playing music with XMMS after my box had been up for at least a day
or two, I'd hear these "random" skips and sound distortions that can be
described as the sound being slowed down for 1/4th of a second and then
back to normal again (a "lagged sound" skip). 

A much more severe version of this can easily be reproduced by
extracting the firefox source code from bz2 while playing music and can
be witnessed for as long as it takes to extract the archive. Note that
these are not just "skips" but complete sound distortion as well. If you
hear very minor brief skips when running this test but no distortion,
you are not witnessing the same problem.

In the previous posts to -CURRENT, I was advised to increase the sound
buffer which did HELP, but the problem was still there. Increasing the
buffer also caused de-synced sound in games. This was not a good
workaround.

Anyway, today I was playing around with a few patches derived from
DragonFly that make it possible to use high resolution VESA modes with
syscons. I was using a 1024x768 VESA text console when I noticed that if
a lot of text were to be scrolled on the screen at once, I'd hear the
same sound problem described above.

Frustrated, I began conversation on IRC and described my problem. A
friend of mine suggested something no one else had before, and that
suggestion was to enable PREEMPTION in the kernel. A GNU/Linux user in
another channel also said this to me: "Sounds like FreeBSD needs a
preemptable kernel." So, I decided to give it a try.

To my amazement, it worked completely. Enabling PREEMPTION in the kernel
completely "fixes" this problem to the fullest extent. I have not been
able to reproduce the problem since using any of the methods described
above.

I'm hoping that with this new information someone might be able to
figure out what is truly causing this problem and can come up with a
solution (or is PREEMPTION a good solution?). It seems that only a
handful of drivers (emu10k1 is the one I'm having problems with) have
this problem. For the record, I am not the only one who has reported
this problem to the lists.

Thanks all,

-Travis Poppe

P.S.

I was unsure whether or not this was best suited for freebsd-current or
freebsd-stable. My apologized if I posted to the wrong list.



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