From iwaki@bc.niigata-u.ac.jp  Sun Oct 21 01:26:34 2001
Return-Path: <iwaki@bc.niigata-u.ac.jp>
Received: from pikachu.bsp.bc.niigata-u.ac.jp (pikachu.bsp.bc.niigata-u.ac.jp [133.35.85.2])
	by hub.freebsd.org (Postfix) with SMTP id B093137B401
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 21 Oct 2001 01:26:33 -0700 (PDT)
Received: (qmail 8219 invoked by alias); 21 Oct 2001 17:26:24 +0900
Message-Id: <20011021082624.8212.qmail@pikachu.bsp.bc.niigata-u.ac.jp>
Date: Sun, 21 Oct 2001 17:26:24 +0900 (JST)
From: Mamoru Iwaki <iwaki@bc.niigata-u.ac.jp>
To: FreeBSD-gnats-submit@freebsd.org
Subject: newpcm does not play back the tail of sound
X-Send-Pr-Version: 3.113

>Number:         31398
>Category:       kern
>Synopsis:       [sound] newpcm does not play back the tail of sound
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-multimedia
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 21 01:30:00 PDT 2001
>Closed-Date:    Sun Nov 13 13:29:28 GMT 2005
>Last-Modified:  Sun Nov 13 13:29:28 GMT 2005
>Originator:     Mamoru Iwaki
>Release:        FreeBSD 4.4-STABLE i386
>Organization:
Niigata Univerity
>Environment:
System: FreeBSD 4.4-STABLE FreeBSD 4.4-STABLE #1: Sat Oct 20 16:05:53 JST 2001 root@:/usr/local/obj/usr/src/sys/PORTAGE300CT i386

>Description:
If you play back any sound file, you cannot hear the tail, especially
in the case that the sound file does not have enough silence.  That
is, 

% cat hoge.au > /dev/audio

does not play back the tail part.  

% cat hoge.au hoge.au > /dev/audio

plays back the first completely, but the last.  The sound file is as
follows:

% file hoge.au
ttt.au: Sun/NeXT audio data: 8-bit ISDN u-law, mono, 8012 Hz
% ls -l ttt.au
-rw-r--r--  1 iwaki  luser  6705 Aug 25  1997 hoge.au

It looks like independent of brige drivers like sbc because the
following two environments cause the same problem and others have
reported the same probrem in Japanese mailing list.  

(Desktop)
% uname -a
FreeBSD mi000.merlin.gs.niigata-u.ac.jp 4.4-STABLE FreeBSD 4.4-STABLE #0: Sat O\
ct 20 13:45:30 JST 2001     root@mi000.merlin.gs.niigata-u.ac.jp:/usr1/obj/amd/\
mi004/home2/FreeBSD-src/stable4/src/sys/MI  i386
% dmesg | grep snd
Preloaded elf module "snd_sb16.ko" at 0xc033522c.
Preloaded elf module "snd_sbc.ko" at 0xc03352cc.
Preloaded elf module "snd_pcm.ko" at 0xc033536c.
% dmesg | grep sbc
Preloaded elf module "snd_sbc.ko" at 0xc03352cc.
sbc0: <Creative SB AWE64> at port 0x220-0x22f,0x330-0x331,0x388-0x38b irq 5 drq\
 1,5 on isa0
pcm0: <SB16 DSP 4.16> on sbc0

(Notebook)
%uname -a
FreeBSD  4.4-STABLE FreeBSD 4.4-STABLE #1: Sat Oct 20 16:05:53 JST 2001     root@:/usr/local/obj/usr/src/sys/PORTAGE300CT  i386
%dmesg | grep pcm
pcm0: <OPL3-SA3 (YMF715)> at port 0x530-0x537,0x370-0x371,0xf8c-0xf94,0xe0e irq 5 drq 1 flags 0xc110 on isa0

>How-To-Repeat:
This problem does not appear in 4.3-RELEASE, but before 4.4-RELEASE,
and still exests in 4-STABLE.  

>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->cg 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Sun Oct 21 12:29:50 PDT 2001 
Responsible-Changed-Why:  

Cameron is Mr. PCM 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=31398 

From: Andriy Gapon <agapon@cv-nj.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/31398: newpcm does not play back the tail of sound
Date: Sat, 18 Oct 2003 13:52:48 -0400

 I can confirm this problem as well. It seems that wav files shorter than 4k do
 no produce any sound on playback. The matter may be not in the size, but it
 definitely correlates with it.
 Incidentally I have the same hardware as in one of the originally reported cases:
 
   >cat /dev/sndstat
 FreeBSD Audio Driver (newpcm)
 Installed devices:
 pcm0: <SB16 DSP 4.16> at io 0x220 irq 5 drq 1:5 bufsz 4096d (1p/1r/6v channels
 duplex)
 
   >dmesg | fgrep sbc
 Preloaded elf module "snd_sbc.ko" at 0xc03c3198.
 sbc0: <Creative SB AWE64 Gold> at port 0x220-0x22f,0x330-0x331,0x388-0x38b irq
 5 drq 1,5 on isa0
 sbc0: setting card to irq 5, drq 1, 5
 pcm0: <SB16 DSP 4.16> on sbc0
 
 P.S. the problem is present regardless of whether the sound drivers are loaded
 as modules or built into a kernel.
 
 -- 
 Andriy Gapon
 
 

From: Andriy Gapon <agapon@cv-nj.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/31398: newpcm does not play back the tail of sound
Date: Sat, 18 Oct 2003 17:22:19 -0400

 Correction: what I see is not exactly the same problem as originally reported.
 What I see seems to be related to SNDCTL_DSP_SYNC.
 If I do:
 
 	fd = open("dev/dsp", O_WRONLY);
 	write(fd, );
 	close(fd);
 
 then everything is ok.
 But if I do:
 
 	fd = open("dev/dsp", O_WRONLY);
 	write(fd, );
 	ioctl(fd, SNDCTL_DSP_SYNC);
 	close(fd);
 
 and if size of data written is less than 2k (maybe it has something to do with 
 being less than a half of sound buffer size), then it is lost.
 I am not sure if this is relevant, but please note that I have vchans 
 configured (see my previous followup for details).
 
 -- 
 Andriy Gapon
 
 
 
Responsible-Changed-From-To: cg->sound 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Sep 9 19:31:36 GMT 2004 
Responsible-Changed-Why:  
With permission, reassign to mailing list alias. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=31398 

From: Jean-Yves Lefort <jylefort@brutele.be>
To: freebsd-gnats-submit@FreeBSD.org, iwaki@bc.niigata-u.ac.jp
Cc:  
Subject: Re: kern/31398: [sound] newpcm does not play back the tail of sound
Date: Tue, 28 Sep 2004 05:20:21 +0200

 Same problem here. Very short sound files are not played.
 
 Note that this very same hardware always worked fine with FreeBSD 4.x
 (even with 4.4). The problem arose today, after upgrading from 4.10 to
 5.3-BETA6.
 
 $ uname -a
 FreeBSD jsite.lefort.net 5.3-BETA6 FreeBSD 5.3-BETA6 #0: Tue Sep 28 00:10:28 CEST 2004     jylefort@jsite.lefort.net:/usr/obj/usr/src/sys/JSITE  i386
 
 $ cat /dev/sndstat
 FreeBSD Audio Driver (newpcm)
 Installed devices:
 pcm0: <AudioPCI ES1373-8> at io 0x9000 irq 11 kld snd_es137x (1p/1r/4v channels duplex default)
 
 $ grep pcm /var/run/dmesg.boot
 pcm0: <AudioPCI ES1373-8> port 0x9000-0x903f at device 12.0 on pci0
 pcm0: <TriTech TR28602 AC97 Codec>
 pcm0: [GIANT-LOCKED]
 
 $ sysctl -a | grep snd
 hw.snd.targetirqrate: 32
 hw.snd.report_soft_formats: 1
 hw.snd.verbose: 1
 hw.snd.unit: 0
 hw.snd.maxautovchans: 0
 hw.snd.pcm0.buffersize: 4096
 
 -- 
 Jean-Yves Lefort
 
 jylefort@brutele.be
 http://lefort.be.eu.org/
State-Changed-From-To: open->feedback 
State-Changed-By: netchild 
State-Changed-When: Sun Sep 11 12:56:29 GMT 2005 
State-Changed-Why:  
Is this still a problem with a recent -current? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=31398 

From: Jean-Yves Lefort <jylefort@FreeBSD.org>
To: bug-followup@FreeBSD.org,iwaki@bc.niigata-u.ac.jp
Cc:  
Subject: Re: kern/31398: [sound] newpcm does not play back the tail of sound
Date: Tue, 8 Nov 2005 16:18:29 +0100

 --Signature=_Tue__8_Nov_2005_16_18_29_+0100_lMujN3.YLzh20sq3
 Content-Type: text/plain; charset=US-ASCII
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 Same with 6.0-RELEASE.
 
 --=20
 Jean-Yves Lefort
 
 jylefort@FreeBSD.org
 http://lefort.be.eu.org/
 
 --Signature=_Tue__8_Nov_2005_16_18_29_+0100_lMujN3.YLzh20sq3
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.2 (FreeBSD)
 
 iD8DBQFDcMHFyzD7UaO4AGoRAsFEAJ9Hz3REWFhUPhU+UKPK/la6uu27lwCeLkcN
 iqTkG7vgwQS9KMjJ3cyi4wE=
 =YKjy
 -----END PGP SIGNATURE-----
 
 --Signature=_Tue__8_Nov_2005_16_18_29_+0100_lMujN3.YLzh20sq3--
State-Changed-From-To: feedback->closed 
State-Changed-By: netchild 
State-Changed-When: Sun Nov 13 13:29:19 GMT 2005 
State-Changed-Why:  
Fixed in -current. 

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