Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Nov 1996 12:29:29 +0100
From:      Roland Karlsson <roland@cslab.ericsson.se>
To:        hannu@voxware.pp.fi, www@freebsd.org
Subject:   BUG: Clipping ulaw in OSS (VoxWare)
Message-ID:  <199611131129.MAA13810@loranga>
Resent-Message-ID: <Pine.BSI.3.95.961113102053.6310G@fallout.campusview.indiana.edu>

next in thread | raw e-mail | index | archive | help

Hi,

There is an error in the VoxWare (now OSS) ulaw driver for /dev/audio
in FreeBSD 2.1.0.  The conversion table (sys/i386/sound/ulaw.h) has to
high gain and is clipping the signal.  The conversion is also to 8 bit
linear (sys/i386/sound/audio.c).  Converting to 16 bit linear is to
prefer as this will give lower quantization noise.

I think that we understand the code enough to make a quick hack that
will help us.  But maybe there already is a fix for the bug.  Even if
not, it is of course better if a real fix is made.  The main problem
with doing the fix seems to be that the conversion from ulaw to linear
is done "in place" in the DMA buffer.

Roland

-------------------------------------

A description on how we found the problem:

When we played a Sun ulaw audio file ...
      "http://www.ericsson.se/cslab/biingg.au"
.. it sounded just awful.  Lots of distortion.  It sounded just as if
we were listening to an overloaded clipped signal.  We tried ...
       % cat biingg.au > /dev/audio
       % sox -V biingg.au -r 8000 -t raw -U - > /dev/audio
... and both sounded terrible.  But if we made ...
       % sox -V biingg.au -r 8000 -t raw -b -u - > /dev/dsp
... there was no problem

Looking at the code we found the clipping table.  We replaced the
table with a real ulaw table, installed the driver and rebooted.  The
sound was now without clipping, but there were lots of quantization
hizz.  Then we looked for how the conversion was made.  We found that
the conversion was made "in place" in the DMA buffer.  A major hack
was then needed, and then we did not want to mess around with the
driver code.

-------------------------------------




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