From owner-freebsd-questions Wed Nov 13 07:21:15 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA22730 for questions-outgoing; Wed, 13 Nov 1996 07:21:15 -0800 (PST) Received: from fallout.campusview.indiana.edu (fallout.campusview.indiana.edu [149.159.1.1]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id HAA22707 for ; Wed, 13 Nov 1996 07:21:04 -0800 (PST) Received: from localhost (jfieber@localhost) by fallout.campusview.indiana.edu (8.7.6/8.7.3) with ESMTP id KAA08943 for ; Wed, 13 Nov 1996 10:21:00 -0500 (EST) X-Received: from belize.ucs.indiana.edu (belize.ucs.indiana.edu [129.79.10.64]) by fallout.campusview.indiana.edu (8.7.6/8.7.3) with ESMTP id GAA08503 for ; Wed, 13 Nov 1996 06:29:54 -0500 (EST) X-Received: from ophelia.ucs.indiana.edu (root@ophelia.ucs.indiana.edu [129.79.10.44]) by belize.ucs.indiana.edu (8.7.3/8.7.3/1.12IUPO) with ESMTP id GAA12543 for ; Wed, 13 Nov 1996 06:29:53 -0500 (EST) X-Received: from belize.ucs.indiana.edu (belize.ucs.indiana.edu [129.79.10.64]) by ophelia.ucs.indiana.edu (8.7.6/8.7/regexp($Revision: 1.3 $) with ESMTP id GAA24879 for ; Wed, 13 Nov 1996 06:29:52 -0500 (EST) X-Received: from halloran-eldar.lcs.mit.edu (halloran-eldar.lcs.mit.edu [18.26.0.159]) by belize.ucs.indiana.edu (8.7.3/8.7.3/1.12IUPO) with SMTP id GAA23119 for ; Wed, 13 Nov 1996 06:29:51 -0500 (EST) X-Received: from freefall.FreeBSD.ORG by halloran-eldar.lcs.mit.edu; (5.65v3.2/1.1.8.2/19Aug95-0530PM) id AA16269; Wed, 13 Nov 1996 06:29:46 -0500 X-Received: from glacier.wise.edt.ericsson.se (glacier-ext.wise.edt.ericsson.se [193.180.251.38]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id DAA09641 for ; Wed, 13 Nov 1996 03:29:38 -0800 (PST) X-Received: from super.du.etx.ericsson.se (root@super.du.etx.ericsson.se [150.236.14.16]) by glacier.wise.edt.ericsson.se (8.7.5/8.7.3/glacier-0.9) with ESMTP id MAA14983; Wed, 13 Nov 1996 12:29:35 +0100 (MET) X-Received: from loranga (roland@loranga.du.etx.ericsson.se [150.236.14.87]) by super.du.etx.ericsson.se (8.7.5/8.7.3/erix-1.1) with SMTP id MAA22307; Wed, 13 Nov 1996 12:29:32 +0100 (MET) X-Received: by loranga (SMI-8.6/client-1.4) id MAA13810; Wed, 13 Nov 1996 12:29:29 +0100 Date: Wed, 13 Nov 1996 12:29:29 +0100 Message-Id: <199611131129.MAA13810@loranga> From: Roland Karlsson To: hannu@voxware.pp.fi, www@freebsd.org Subject: BUG: Clipping ulaw in OSS (VoxWare) ReSent-Date: Wed, 13 Nov 1996 10:20:54 -0500 (EST) ReSent-From: John Fieber ReSent-To: questions@freebsd.org ReSent-Message-ID: Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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. -------------------------------------