From alsa-devel-owner@alsa.jcu.cz  Sun Aug 23 16:59:58 1998
Received: from altrade.nijmegen.inter.nl.net (altrade.nijmegen.inter.nl.net [193.67.237.6])
	by marvin.jcu.cz (8.8.8/8.8.8) with ESMTP id QAA14451
	for <alsa-devel@jcu.cz>; Sun, 23 Aug 1998 16:56:57 +0200
Received: from obelix.fvdpol.inter.nl.net by altrade.nijmegen.inter.nl.net
	via bd99-25.Breda.NL.net [193.79.246.250] with ESMTP for <alsa-devel@jcu.cz>
	id QAA21133 (8.8.8/3.28); Sun, 23 Aug 1998 16:56:52 +0200 (MET DST)
Received: (from frank@localhost) by obelix.fvdpol.inter.nl.net (8.8.7/8.7.3) id QAA11848 for alsa-devel@jcu.cz; Sun, 23 Aug 1998 16:56:46 +0200
From: Frank van de Pol <F.K.W.van.de.Pol@inter.nl.net>
Message-Id: <199808231456.QAA11848@obelix.fvdpol.inter.nl.net>
Subject: Re: Detecting ADC Overload
To: alsa-devel@jcu.cz
Date: Sun, 23 Aug 1998 16:56:46 +0200 (MET DST)
In-Reply-To: <35DD5726.64DA8B1D@ife.ee.ethz.ch> from "Thomas Sailer" at Aug 21, 98 01:16:54 pm
Content-Type: text
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

Thomas Sailer wrote:
> 
> Maximilian Bisani wrote:
> 
> >  - Is there a better way to detect ADC overloading, than looking for
> >    peak values?
> 
> Some codec chips (for example AD184x, CS423x) have a separate overload
> bit (which is even somewhat sticky, AFAIR), but I don't know if
> ALSA propagates this to user land...
> 

I hacked readout of this overload bit (GUS MAX, CS4231a codec, register I11,
bits ORL0-ORL1, ORR0-ORR1) into the OSS/Free sources (just give a printk on
overload). Using this same feature on ALSA seems to be a good plan (if not
already supported - I thought it didn't).

One easy approach could be to add a "overload" field to the device's
/proc/sound/cardx/pcmx file with an counter that is incremented on overload,
similar to the over/underrun counters. Other 'status' information (hardware
dependent) can be added in a similar way. 

Frank.

+---- --- -- -  -   -    - 
|Frank van de Pol                  -o)
|F.K.W.van.de.Pol@inter.NL.net     /\\
|                                 _\_v
|Linux - Why use Windows, since there is a door?
|
|ALSA Sequencer: http://www.inter.nl.net/users/F.K.W.van.de.Pol/alsa/

