NetBSD Problem Report #18066

Received: (qmail 12740 invoked by uid 605); 25 Aug 2002 21:07:37 -0000
Message-Id: <200208252107.g7PL7Ui01602@guam.araneus.fi>
Date: Sun, 25 Aug 2002 14:07:30 -0700 (PDT)
From: gson@gson.org
Sender: gnats-bugs-owner@netbsd.org
Reply-To: gson@gson.org
To: gnats-bugs@gnats.netbsd.org
Subject: Clicking noise when recording audio using autri driver
X-Send-Pr-Version: 3.95

>Number:         18066
>Category:       kern
>Synopsis:       Clicking noise when recording audio using autri driver
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 25 21:08:00 +0000 2002
>Closed-Date:    Wed Feb 02 10:39:03 +0000 2005
>Last-Modified:  Wed Feb 02 11:07:54 +0000 2005
>Originator:     Andreas Gustafsson
>Release:        NetBSD 1.6F
>Organization:
Speaking for myself.
>Environment:
System: NetBSD guam.araneus.fi 1.6F NetBSD 1.6F (GUAM) #0: Thu Aug 22 18:59:53 PDT 2002 gson@guava.araneus.fi:/usr/src/sys/arch/i386.sp/compile/GUAM i386
Architecture: i386
Machine: i386
>Description:

My Toshiba Libretto L2 laptop has audio hardware which probes as follows:

  autri0 at pci0 dev 6 function 0: Acer Labs M5451 AC-Link Controller Audio Device (rev. 0x01)
  autri0: interrupting at irq 10
  autri0: Asahi Kasei AK4543 codec; headphone, 18 bit DAC, 18 bit ADC, AKM 3D
  audio0 at autri0: full duplex, mmap, independent
  midi0 at autri0: 4DWAVE MIDI UART

When I record audio using the command

  audiorecord -c 1 -e linear -P 16 -s 48000 recording.wav

the audio in the resulting wav file is interrupted by loud clicks
several times a second.

By examining the wav file using WaveSurfer (now in pkgsrc as
audio/wavesurfer), I found that the clicks occur 2400 samples apart,
which corresponds to the block size of 4800 bytes reported by
audioctl.  Each click consists of four samples of signal from several
hundred milliseconds back, presumably from the previous cycle through
the circular recording buffer.  Note that since the clicks consist of
previously recorded signal, a recording of silence will not exhibit
audible clicks.

A waveform display of a typical click can be seen at
http://www.araneus.fi/gson/netbsd/bugs/autri-click/click.gif,
and the recording being displayed is at
http://www.araneus.fi/gson/netbsd/bugs/autri-click/recording.wav.
The test signal was a repeating 2-second logarithmic sweep from
20 Hz to 20 kHz.

>How-To-Repeat:

Connect an audio source to the input of sound hardware similar to the
above, record some audio using

  audiorecord -c 1 -e linear -P 16 -s 48000 recording.wav

and play back the resulting wav file.  Notice the clicks.

>Fix:

Not known.
>Release-Note:
>Audit-Trail:

From: IWAMOTO Toshihiro <iwamoto@sat.t.u-tokyo.ac.jp>
To: netbsd-bugs@netbsd.org
Cc: gnats-bugs@gnats.netbsd.org, gson@gson.org
Subject: Re: kern/18066: Clicking noise when recording audio using autri driver
Date: Mon, 26 Aug 2002 15:00:56 +0900

 At Sun, 25 Aug 2002 14:07:30 -0700 (PDT),
 gson@gson.org wrote:
 > By examining the wav file using WaveSurfer (now in pkgsrc as
 > audio/wavesurfer), I found that the clicks occur 2400 samples apart,
 > which corresponds to the block size of 4800 bytes reported by
 > audioctl.  Each click consists of four samples of signal from several
 > hundred milliseconds back, presumably from the previous cycle through
 > the circular recording buffer.  Note that since the clicks consist of
 > previously recorded signal, a recording of silence will not exhibit
 > audible clicks.
 > 
 > A waveform display of a typical click can be seen at
 > http://www.araneus.fi/gson/netbsd/bugs/autri-click/click.gif,

 This seems to be quite similar to kern/16385 in two points:
  - the shape of clicking noise
  - no noise when recording silence,
 although the clicks weren't periodical in my case.

 So I guess the bug is in the common audio layer, not in autri or
 uaudio.

 --
 IWAMOTO Toshihiro

From: Martin Weber <Ephaeton@gmx.net>
To: IWAMOTO Toshihiro <iwamoto@sat.t.u-tokyo.ac.jp>
Cc: netbsd-bugs@netbsd.org, gnats-bugs@gnats.netbsd.org, gson@gson.org
Subject: Re: kern/18066: Clicking noise when recording audio using autri driver
Date: Mon, 26 Aug 2002 08:12:18 +0200

 On Mon, Aug 26, 2002 at 03:00:56PM +0900, IWAMOTO Toshihiro wrote:
 > [...]
 > This seems to be quite similar to kern/16385 in two points:
 >  - the shape of clicking noise
 >  - no noise when recording silence,
 > although the clicks weren't periodical in my case.
 > 
 > So I guess the bug is in the common audio layer, not in autri or
 > uaudio.

 Hmm, maybe totally unrelated, but if I use cdplay(1)[1], I can hear
 the interrupts of my mouse moving and of my keyboard as a 
 faint clicking/noise in the output... Now this isn't perfectly
 audio layer [output is the CD's phone-link], but maybe somehow
 related ? [*audio-illiterate*]

 -Martin

 [1] cdplay 1.20 2002/06/11 06:06:18 itojun Exp on 1.6E under X windows 4

From: matthew green <mrg@eterna.com.au>
To: Martin Weber <Ephaeton@gmx.net>
Cc: netbsd-bugs@netbsd.org, gnats-bugs@gnats.netbsd.org, gson@gson.org,
  IWAMOTO Toshihiro <iwamoto@sat.t.u-tokyo.ac.jp>
Subject: re: kern/18066: Clicking noise when recording audio using autri driver 
Date: Mon, 26 Aug 2002 16:23:32 +1000


    Hmm, maybe totally unrelated, but if I use cdplay(1)[1], I can hear
    the interrupts of my mouse moving and of my keyboard as a 
    faint clicking/noise in the output... Now this isn't perfectly
    audio layer [output is the CD's phone-link], but maybe somehow
    related ? [*audio-illiterate*]


 this sounds more like bad audio hardware - cross signals, and such.
 ie, mouse activity signals on the motherboard cause the audio to
 pick them up and lose... i've seen this multiple in cases.


 .mrg.
From: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/18066: Clicking noise when recording audio using autri driver
Date: Mon, 29 Nov 2004 16:05:27 +0200 (EET)

 The following patch fixes the clicks for me.  I will keep testing
 things for a while longer, and if it doesn't break anything and no one
 objects, I will commit it and close the PR.
 -- 
 Andreas Gustafsson, gson@gson.org

 Index: autri.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/pci/autri.c,v
 retrieving revision 1.22
 diff -u -r1.22 autri.c
 --- autri.c	9 Nov 2004 16:28:14 -0000	1.22
 +++ autri.c	29 Nov 2004 14:00:04 -0000
 @@ -1244,6 +1244,7 @@
  			else
  				ctrl |= AUTRI_CTRL_MUTEVOL;
  			attribute = 0;
 +			cso = dmalen - 1;
  		}

  		eso = dmalen - 1;

State-Changed-From-To: open->closed
State-Changed-By: gson@netbsd.org
State-Changed-When: Wed, 02 Feb 2005 10:39:03 +0000
State-Changed-Why:
Applied the patch.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.