Subject: kern/30185: sb driver doesn't work in 2.0
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <GeorgePS@XMission.com>
List: netbsd-bugs
Date: 05/10/2005 04:55:00
>Number:         30185
>Category:       kern
>Synopsis:       sb driver doesn't work in 2.0
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 10 04:55:00 +0000 2005
>Originator:     George Peter Staplin
>Release:        2.0
>Organization:
>Environment:
NetBSD famcomputer 2.0 NetBSD 2.0 (FAMCOMP) #0: Sat Mar 19 20:36:41 GMT 2005  gps@magichimo.localdomain:/usr/src/sys/arch/i386/compile/FAMCOMP i386

>Description:
Audio doesn't play with the sb device driver and an SB Vibra 16.  I hear a brief noise and then the process gets stuck in aud_dr until some time later when audioplay exits.  I've tried different wav files with the same result.  I also tried a SoundBlaster AWE-32 and found the same problem.  I've tried different card slots on the same motherboard too.

With a -DAUDIO_DEBUG kernel I get this:
$ audioplay test.wav

This is the output from xconsole:
audio_open: flags=0x2 sc=0xc0cd7800 hdl=0xc0ccca00
audio_initbufs: mode=0x5
audio_init_ringbuffer: blksize=2192
audio_init_ringbuffer: blksize=2192
audio_open: done sc_mode = 0x5
audio_ioctl(136,'A',21)
AUDIO_GETINFO
audio_ioctl(136,'A',21) result 0
audio_ioctl(136,'A',22)
AUDIO_SETINFO mode=0x5
audio: Setting play params sr=22050, enc=6, chan=1, prec=16
audio_initbufs: mode=0x5
audio_init_ringbuffer: blksize=2192
audio_init_ringbuffer: blksize=2192
audio_ioctl(136,'A',22) result 0
audiostartp: start=0xc555a000 used=4750(hi=63568) mmapped=0
audio_ioctl(0,'A',23)
AUDIO_DRAIN
audio_drain: enter busy=1 used=4750
audio_drain: used=4750, drops=0

About 20-30 seconds later this output appears in xconsole:

audio_sleep: woke up st=35
audio_ioctl(0,'A',23) result 35
audio_ioctl(0,'A',24)
AUDIO_FLUSH
audio_initbufs: mode=0x5
audio_init_ringbuffer: blksize=2192
audio_init_ringbuffer: blksize=2192
audiostartp: start=0xc555a000 used=0(hi=63568) mmapped=0
audio_ioctl(0,'A',24) result 0
audio_ioctl(136,'A',22)
AUDIO_SETINFO mode=0x5
audio: Setting play params sr=22050, enc=6, chan=1, prec=16
audio_initbufs: mode=0x5
audio_init_ringbuffer: blksize=2192
audio_init_ringbuffer: blksize=2192
audio_ioctl(136,'A',22) result 0
audio_close: sc=0xc0cd7800
audio_close: done

Then audioplay returns with:
audioplay: audio drain ioctl failed: Resource temporarily unavailable

If needed I can get more info about the card from the dmesg.  It seems that my dmesg is full of the audio debug output now, so I can't get it just now.
>How-To-Repeat:
Use audioplay to play a wav file.
>Fix: