Subject: Sound problems - auich0: fifo underrun
To: None <netbsd-help@netbsd.org>
From: Luke Maurits <lmaurits@gmail.com>
List: netbsd-help
Date: 08/12/2005 16:10:51
Greetings all,

I have just installed NetBSD 2.0.2 on an i386 machine with an on-board
soundcard, which shows up in dmesg as:

auich0 at pci0 dev 31 function 5: i82801BA (ICH2) AC-97 Audio
auich0: interrupting at irq 11
auich0: ac97: Analog Devices AD1881A codec; headphone, Analog Devices Phat
Stereo
auich0: ac97: ext id 1<VRA>
auich0: measured ac97 link rate at 47268 Hz, will use 48000 Hz
audio0 at auich0: full duplex, mmap, independent

While I can play audio through the card, I am experiencing some problems.
 Sound will play just fine for around the first 30 seconds, at which point
it will begin to distort - the best way I can think to describe it is that
the music becomes "slow and choppy".  At the same time as this happens, I
receive the repeated kernel output:

auich0: fifo underrun # n

Where 'n' is '1' for the first message, '2' for the second, etc.  This
distortion/output combination continues for perhaps 5 or 10 seconds, after
which playback is fine for another 30 seconds or so, before the distortion
returns, and so on periodically.

This seems to happen for any and all audio, including that generated by
ogg123, mpg321 and mplayer.  It occurs when I use the ESD or Artsd sound
daemons, but *not* when I use OSS - everything works fine then.
Unfortunately, "just use OSS" isn't really a valid solution for me.  With
OSS I can't listen to my music while I work without losing the (important,
IMHO) ability to hear sound notifications of new emails, etc.

Debian Linux 3.1 and FreeBSD 5.4 both play music through ESD with ogg123
without this distortion on the very same machine.  This leads me to
suspect that the problem lies either with the ac97 driver in the NetBSD
kernel, or in the esound / liabo-esound / etc. code in pkgsrc (ie: perhaps
there are some patches to the "official" esd source in the pkgsrc version,
but not in FreeBSD's ports version, which are causing problems).

I've googled for "auich0: fifo underrun" - this problem seems to have been
reported a few times over the years (often on OpenBSD) but never seems to
get resolved.  Most posts go unanswered.

I'm sure you can all imagine how irritating it must be to have your music
distorting ever 30 seconds or so.  If anybody has any ideas on how I might
go about fixing this problem, I'd much appreciate hearing from them.  Just
let me know if you want more details to help figure out what's happening.


Thanks,
Luke