From nobody@FreeBSD.org  Wed May  1 17:53:18 2002
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 63B4737B416
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  1 May 2002 17:53:17 -0700 (PDT)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.6/8.11.6) id g420rHN35648;
	Wed, 1 May 2002 17:53:17 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200205020053.g420rHN35648@freefall.freebsd.org>
Date: Wed, 1 May 2002 17:53:17 -0700 (PDT)
From: Alan Larson <larson@paix.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: /dev/dsp and /dev/audio skip the first 3200 - 3600 samples
X-Send-Pr-Version: www-1.0

>Number:         37657
>Category:       kern
>Synopsis:       [sound] /dev/dsp and /dev/audio skip the first 3200 - 3600 samples
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-multimedia
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 01 18:00:08 PDT 2002
>Closed-Date:    Wed Dec 28 18:50:05 GMT 2005
>Last-Modified:  Wed Dec 28 18:50:05 GMT 2005
>Originator:     Alan Larson
>Release:        4.3
>Organization:
PAIX.net
>Environment:
FreeBSD alan.paix.net 4.3-RELEASE FreeBSD 4.3-RELEASE #0: Sat Apr 21 10:54:49 GMT 2001     jkh@narf.osd.bsdi.com:/usr/src/sys/compile/GENERIC  i386
>Description:
The first 3200 - 3600 samples (bytes) of output to /dev/audio or /dev/dsp
after open() are ignored.  It appears that the exact number may be a
function of the number of bytes that had been written by previous users
of the device -- possibly the remainder of bytes in a buffer.
kern/31445 reports a similar problem in 4.4, but unlike him, I see it in
4.3 as well.
His problem was that small sounds never output -- which could be a special
case of this one -- that the first 3200 samples (or so) are skipped.  Padding
buffers out further doesn't help, as the first part of the sound is still
lost.

>How-To-Repeat:
I wrote a little c program to send silence for a while, then a generated
sine wave, then about 2 seconds silence, another short sine beep, and
pad out to desired size with silence.
My beeps were 400 samples long.  If the first silent part was <= 3200
samples long, the first beep would not be heard.  Often it needed to
be 3600 or longer to hear the first beep -- the actual amount varies
as mentioend above, and is hard to determine, since one may be hearing
only part of the first beep.

>Fix:

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sound 
Responsible-Changed-By: kris 
Responsible-Changed-When: Sat Jul 12 21:52:06 PDT 2003 
Responsible-Changed-Why:  
Over to sound maintainers 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37657 
State-Changed-From-To: open->feedback 
State-Changed-By: netchild 
State-Changed-When: Sun Sep 11 13:17:26 GMT 2005 
State-Changed-Why:  
Is this still a problem in a recent -current? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37657 
State-Changed-From-To: feedback->closed 
State-Changed-By: netchild 
State-Changed-When: Wed Dec 28 18:49:12 UTC 2005 
State-Changed-Why:  
Timeout:	>3 months without feedback 

Additionally I think Luigi and Ariff worked on this and fixed 
the problem... 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37657 
>Unformatted:
