Port-i386 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

auich 4, microphone input current state of devel/implementation etc.

        I have a Dell Latitude D610  running NetBSD_6.0_BETA2.

bash$ uname -a
NetBSD peano.jtcl.org 6.0_BETA2 NetBSD 6.0_BETA2 (Peano3) #0: Sun May 27 
07:11:01 CDT 2012  
jtowler%peano.jtcl.org@localhost:/usr/src/sys/arch/i386/compile/Peano3 i386

That system is built from cvs srcs for tag netbsd-6 as of that date.

I have since needed to speed up and implement audio proc. both file i/o
and recording via microphone for NLP, including ASR and acoustic
phonetics purposes primarily.  Benefits of int'l radio broadcasts for my
non-English languages usage and cultural interests as well as any such
ordinary uses are also involved and pluses but not the reason for the
time priority of this project.

from dmesg the relevant hardware found

auich0 at pci0 dev 30 function 2: i82801FB (ICH6) AC-97 Audio
auich0: interrupting at ioapic0 pin 16
auich0: ac97: SigmaTel STAC9750/51 codec; headphone, 20 bit DAC, 20 bit ADC, 
aTel 3D
auich0: ac97: ext id 0x605<AC97_22,AMAP,SPDIF,VRA>
vendor 0x8086 product 0x266d (modem communications, revision 0x03) at pci0 dev 
30 function 3 not configured
ichlpcib0 at pci0 dev 31 function 0: vendor 0x8086 product 0x2641 (rev. 0x03)
timecounter: Timecounter "ichlpcib0" frequency 3579545 Hz quality 1000
ichlpcib0: 24-bit timer
ichlpcib0: TCO (watchdog) timer configured.

did man -k audio | less
man audioplay, audiorecord

have sox, and some other tools from pkgsrc built and installed

tried the basic
audiorecord <unspec_options_not_listed> -p mic mytest.wav
and spoke a <= 30 s data sample into a recently acquired microphone via
the builtin microphone input for the D610 with matching plug

file was created but no speech was heard,

using sox play, the display shows verbose elts of the data sample as
time elts as it tries to play:  from that, it tried to play something,
and using audioplay or sox play on a file from the Corpus of Israeli
Hebrew collection does play, did before, and the linguistic data set is
as a speaker of Hebrew, verified as being an audio sample of sound that
is  linguistic data, is Hebrew, and could be from such a corpus data

Playing an mp3 file of a PBS TV news show works no problem, as do audio
srcs of music from network files or purchased audio CDs.  

Playing audio works.   Given linguistic audio data, as played, the sound
parsed and understood as language is verified.

Checked dmesg above, and the manuals and  specs from Dell for the

Audio is an AC '97 system, with as detected auich[0-9] as hardware

Checked the man page in and around this, and it documents that that
is not yet implemented as of NetBSD 5.1.2, but this is for netbsd-6 cvs

bash-4.2$ man auich
AUICH(4)                NetBSD Kernel Interfaces Manual               AUICH(4)

     auich -- Intel I/O Controller Hub integrated AC'97 audio device driver

     auich* at pci? dev ? function ?
     audio* at audiobus?

     The auich device driver supports the integrated AC'97 audio controller of
     the Intel I/O Controller Hub.  Supported chipsets include the i82801AA
     (ICH), i82801AB (ICH0), i82801BA (ICH2), i82440MX, i82801CA (ICH3),
     i82801DB (ICH4), i82801EB (ICH5), i82801FB (ICH6), i82801GB/GR (ICH7),
     and Intel 6300ESB.  The driver also supports SiS 7012, nForce MCP,
     nForce2 MCP-T, nForce3 MCP-T, nForce3 250 MCP-T, nForce4, and AMD 8111.

     ac97(4), audio(4), pci(4)

     The auich device driver appeared in NetBSD 1.6.

     The `microphone' input DMA channel is not currently supported.

NetBSD 5.1.2                    March 14, 2006         

So, this functional failure is documented.

I poked around in the tree cp'd to /usr/src

and found


read the files, read the comments

in which is listed that microphone input for auich is TODO.

I read, got the cited hardware manuals and read.

Saw that through defines etc, where it lists in the hardware manuals the
instructions and machine code for the  mic, these are in the auich code.

Checked mailing list archives for mention, and read some postings about
this from 200[0-35], and somewhere in this it says that the driver code
was last worked on in 2008.

I have a real-time application for the NLP/ASR usage for a pressing
legal problem, and to generate the next result in acquiring the provables
evidence, the time frame has moved up to take up time for other
processes which will not be due to produce results for 1 or more days.

So, I went back to the src tree and rethought and reread.  I understood
that the collection of fns in the auich.c code builds a mid-level
language/interface which then get fed/called with the (more) device
independent fns for ultimately the audio driver.

The playing of audio data works, the defines for MIC, MICIN are there,
the logical structure of src to sink as an i/o buffer etc problem with
variances for real-time speed, rate, etc is understood even though I
have not programmed an audio chip yet or written such a driver, and not
yet as writing code understand how the details of DMA functions, though
I roughly recall when it was published as a feature in e.g. Byte as the
PC market built from i286 roughly to i486 etc.  So this detail can be
added as needed as well.

Checking the cvsweb interface without resetting the tag to netbsd-6
showed work on auich{.c,*.} dated within the last 10 days.  Also shows
who in the know has worked on this apart from the src

The annotated auich.c with diffs shows that the comment about microphone
input being a TODO project is dated from around 2000.

There is prior work, I am new to this type of programming.  I read the
hardware manuals,  the elements are there in the auich.c code with the
i/o hardware work done for the modem interfaces of the chips etc. just
not for the microphone.  I am not yet willing for reasons of data
integrity and functionality of needed tools to just
run -current which by tag nos is no exactly what was defined for
netbsd-6.  I want to focus that implementing/porting energy for specific
tools that are in my research interest areas.

Neither OpenBSD or FreeBSD have this driver in their code bases.

Net searches indicate that Linux, D610's running Debian, with alsa, and
a mentioned driver code for this chip, out of the box after installing
alsa, does work. (Tux laptop implementation notes archive) It is not
Wintel bound for functionality of this audio chip set.  An existing
system with a differing version of Open Source, and everything known or
reported about code quality including why when moving from SunOS in 1997
to an open source Un*x, after testing, I chose NetBSD, with other things
found out via practice over that time.  The right solution, by that, is
not as simple as searching and grabbing their code.

Given that two trials of straight application of hardware, system
sofware, and man page directions don't work for this, and the man page
which by version number might be out of date for netbsd-6, and the src

What is the current state of accomplishing this TODO project( auich.c,
microphone input using builting audio chip not the USB port)?  Is it as
simple as slipping the #define MIC, MICIN etc. to the branch on input
type sections of the C code of the driver (if it was that easy, why
doesn't it work already?)?  What prior work of the total problem has
been worked on, and where should I start in to make this go?

John R. Towler

Home | Main Index | Thread Index | Old Index