Bug 22874

Summary: newpcm CS461x sound problems
Product: Base System Reporter: larse <larse>
Component: kernAssignee: greid
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
full-duplex-blocking-audio-test3.c none

Description larse 2000-11-15 19:20:01 UTC
Every once in a few hours of audio playback, newpcm will choke and sound
output will be scratchy/hissing from then on until I reboot the machine. Sounds
kinda like when you had dust collected on the needle of your record player
back when we were still using them.

I've not been able to reproduce this consistently (i.e. it chokes at a
certain time in one sound file, after a reboot that same file will play
fine.)

Here's my info:

[larse@hbo: ~] cat /dev/sndstat 
FreeBSD Audio Driver (newpcm) Nov 10 2000 12:59:49
Installed devices:
pcm0: <CS461x PCM Audio> at irq 5 (1p/1r channels duplex)

[larse@hbo: ~] uname -a
FreeBSD hbo.isi.edu 4.2-BETA FreeBSD 4.2-BETA #68: Fri Nov 10
13:00:17 PST 2000     larse@hbo.isi.edu:/usr/src-idprio/sys/compile/IDPRIO 
i386

Sorry I can't be more specific; if I had to guess I'd say some internal
newpcm struct gets bashed by a rare pointer error...
Comment 1 oh 2000-11-19 11:45:56 UTC
This driver also fails to work in full duplex mode, blocking or
non-blocking, on Lars' machine.  Lars reported that rat did not work
with this driver and so we've conducted a few experiments (rat problems
mostly caused card by not supporting 8kHz sampling and newpcm accepting
and reporting this as an acceptable rate, rat driver interface fixed and
patch submitted to check rate bounds in dsp.c).  

The attached test program results in read buffer overruns, causing dump
messages on syslog, at the lowest supported sampling rate (11025kHz). 
Lars observes:

> [larse@hbo: ~] ./a.out -r 11025
> Device Caps:
>        Sample rates: 11025 -- 48000 Hz
>        Formats: 0x90000010
>        DMA buffer size: 65536 bytes
>        Mixers: 0x00000001 Inputs: 0x017049f1
>         Levels: 100 (left), 100 (right)
> Set play rate 11025 fmt 16
> Set record rate 11025 fmt 16
> Got play rate 11025 fmt 16
> Got record rate 11025 fmt 16
> Block size requested 1024, play 1024, rec 1024
> Output buffer status: frags 2 frags total 2 fragsize 1024 bytes 2048
> Input buffer status: frags 0 frags total 2 fragsize 1024 bytes 0
> |^C
>
> Saw this in syslog during that run:
> Nov 17 10:14:10 hbo /kernel: pcm0: record overrun, dumping 22528 bytes
> Nov 17 10:14:26 hbo last message repeated 16 times

Kind Regards
- Orion
Comment 2 Doug Barton freebsd_committer freebsd_triage 2000-11-19 17:49:04 UTC
Responsible Changed
From-To: freebsd-bugs->cg


Cameron is responsible for pcm.
Comment 3 greid freebsd_committer freebsd_triage 2001-07-13 02:23:33 UTC
State Changed
From-To: open->feedback

Is this still a problem with more recent sources? 


Comment 4 greid freebsd_committer freebsd_triage 2001-07-13 02:23:33 UTC
Responsible Changed
From-To: cg->greid

I'll handle feedback.
Comment 5 greid freebsd_committer freebsd_triage 2001-07-19 22:59:33 UTC
State Changed
From-To: feedback->closed

Originator reports problem is no longer present in >= 4.2