Subject: kern/32405: Looks like SNDCTL_DSP_GETOPTR ioctl went wrong in auich(4) between 2.1 and 3.0
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <stephane.witzmann@gmail.com>
List: netbsd-bugs
Date: 12/29/2005 02:25:00
>Number:         32405
>Category:       kern
>Synopsis:       Looks like SNDCTL_DSP_GETOPTR ioctl went wrong in auich(4) between 2.1 and 3.0
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 29 02:25:00 +0000 2005
>Originator:     Stéphane Witzmann
>Release:        3.0/i386 kernel, 2.1/i386 userland
>Organization:
>Environment:
NetBSD wolfenstein 3.0 NetBSD 3.0 (GENERIC) #0: Mon Dec 19 01:04:02 UTC 2005 builds@works.netbsd.org:/home/builds/ab/netbsd-3-0-RELEASE/i386/200512182024Z-obj/home/builds/ab/netbsd-3-0-RELEASE/src/sys/arch/i386/compile/GENERIC i386

>Description:
As a first step towards upgrading from 2.1 to 3.0, I tested a GENERIC 3.0 kernel with my current 2.1 userland. Trying to play videos with xine, I noticed there was a problem with the sound: for each file, it played about 0.1s audio then nothing, while video was ok. Playing the same videos with mplayer worked, as well as playing mp3s with xmms.

I ran a few tests, compared the integrated sound card (auich) of my laptop with a usb one, with the two kernels (2.1 and 3.0), and playing with xine a/v sync options, which are the following:

- auto: auto-select best
- getodelay: uses the SNDCTL_DSP_GETODELAY ioctl
- getoptr: uses the SNDCTL_DSP_GETOPTR ioctl
- softsync: uses software synchronization with system clock
- probebuffer: probes the sound card buffer size on initialization to calculate the latency for a/v sync

Since I never got getodelay to work, auto seems to always select getoptr. With both sound card and kernels, softsync and probebuffer worked. getoptr also worked with both kernels on my usb sound card, worked with 2.1 on auich, but I got the above problem with 3.0 on auich. Didn't try another non-USB sound card since the machine is a laptop.


Here are the audio devices, according to dmesg:

auich0 at pci0 dev 31 function 5: i82801DB/DBM (ICH4/ICH4M) AC-97 Audio
auich0: interrupting at irq 5
auich0: ac97: CXT48 codec; reserved, headphone, 18 bit DAC, 18 bit ADC, no 3D stereo
auich0: ac97: ext id a04<AC97_23,AMAP,SPDIF>
audio0 at auich0: full duplex, independent

uaudio0 at uhub0 port 1 configuration 1 interface 1: M-Audio Audiophile USB (tm), rev 1.00/1.01, addr 2
uaudio0: ignored audio interface with 2 endpoints
uaudio0: ignored audio interface with 2 endpoints
uaudio0: ignored audio interface with 2 endpoints
uaudio0: ignored audio interface with 2 endpoints
uaudio0: ignored setting with type 8193 format
uaudio0: audio rev 1.00
audio1 at uaudio0: full duplex, independent

>How-To-Repeat:
Use a 3.0 kernel and play a video with xine using auto or getoptr as a/v sync method on a (or at least on my) auich sound card.

>Fix:
Use another sync method in xine, but that is only a workaround.