From rjk@grauel.com  Tue Mar 20 07:35:00 2001
Return-Path: <rjk@grauel.com>
Received: from localhost.grauel.com (usr1-3.mintel.net [63.81.123.18])
	by hub.freebsd.org (Postfix) with ESMTP id DA0FF37B71D
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 20 Mar 2001 07:34:58 -0800 (PST)
	(envelope-from rjk@grauel.com)
Received: (from rjk@localhost)
	by localhost.grauel.com (8.11.3/8.11.1) id f2KFYuC02018;
	Tue, 20 Mar 2001 10:34:56 -0500 (EST)
	(envelope-from rjk)
Message-Id: <200103201534.f2KFYuC02018@localhost.grauel.com>
Date: Tue, 20 Mar 2001 10:34:56 -0500 (EST)
From: rjk@grauel.com
Reply-To: rjk@grauel.com
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: SB16 PCI card doesn't initialize properly
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         25944
>Category:       i386
>Synopsis:       SB16 PCI card doesn't initialize properly
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    cg
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 20 07:40:06 PST 2001
>Closed-Date:    Sun Apr 8 15:20:52 PDT 2001
>Last-Modified:  Sun Apr 08 15:21:37 PDT 2001
>Originator:     Richard J Kuhns
>Release:        FreeBSD 4.3-BETA i386
>Organization:
Grauel Enterprises, Inc
>Environment:
System: FreeBSD moran.grauel.com 4.3-BETA FreeBSD 4.3-BETA #3: Tue Mar 20 08:28:09 EST 2001 rjk@moran.grauel.com:/misc/src/sys/compile/MORAN i386


>Description:
	A brand-new PCI SoundBlaster 16 card identified as follows:

from dmesg:
pcm0: <AudioPCI ES1371> port 0xe000-0xe03f irq 5 at device 9.0 on pci0

$ cat /dev/sndstat
FreeBSD Audio Driver (newpcm) Mar 18 2001 22:45:20
Installed devices:
pcm0: <AudioPCI ES1371> at io 0xe000 irq 5 (1p/1r channels duplex)

plays .au files (via cat s.au > /dev/audio) at what sounds to me like
twice the correct speed, while mp3s played via xmms play at what sounds
like 0.5 times the correct speed.  However, if I first boot Windoze, the
card seems to work perfectly until the next time I power cycle the
machine.

>How-To-Repeat:
	Turn on the machine and type "cat s.au > /dev/audio".

>Fix:

	Turn on the machine, boot Windoze, do a "Restart" and boot
FreeBSD.  From then on the sound is fine through any number of reboots until
the next power cycle.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->cg 
Responsible-Changed-By: kris 
Responsible-Changed-When: Fri Mar 23 21:25:35 PST 2001 
Responsible-Changed-Why:  
Cameron is the soundman 

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

From: "Cameron Grant" <gandalf@vilnya.demon.co.uk>
To: <freebsd-gnats-submit@FreeBSD.org>, <rjk@grauel.com>
Cc:  
Subject: Re: i386/25944: SB16 PCI card doesn't initialize properly
Date: Sat, 24 Mar 2001 17:06:38 -0000

 try this patch:
 
 Index: es137x.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/dev/sound/pci/es137x.c,v
 retrieving revision 1.13.2.5
 diff -u -b -r1.13.2.5 es137x.c
 --- es137x.c    2001/02/21 11:23:24     1.13.2.5
 +++ es137x.c    2001/02/27 08:18:52
 @@ -487,8 +487,9 @@
         es->sctrl = 0;
         /* initialize the chips */
         if (revid == 7 || revid >= 9 || (devid == ES1371_PCI_ID3 && revid ==
 2)) {
 -#define ES1371_BINTSUMM_OFF 0x07
 -               bus_space_write_4(es->st, es->sh, ES1371_BINTSUMM_OFF,
 0x20);
 +#define ES1371_BINTSUMM_OFF 0x04
 +               bus_space_write_4(es->st, es->sh, ES1371_BINTSUMM_OFF,
 0x20000000);
 +               DELAY(20000);
                 if (debug > 0) printf("es_init rev == 7 || rev >= 9\n");
         } else { /* pre ac97 2.1 card */
                 bus_space_write_4(es->st, es->sh, ES1370_REG_CONTROL,
 es->ctrl);
 
     -cg
 

From: Richard J Kuhns <rjk@grauel.com>
To: "Cameron Grant" <gandalf@vilnya.demon.co.uk>
Cc: <freebsd-gnats-submit@FreeBSD.org>, <rjk@grauel.com>
Subject: Re: i386/25944: SB16 PCI card doesn't initialize properly
Date: Sat, 24 Mar 2001 14:46:52 -0500

 I tried, and this is what I got:
 
 moran:/usr/src/sys/dev/sound/pci$ patch < /var/tmp/es.patch 
 Hmm...  Looks like a unified diff to me...
 The text leading up to this was:
 --------------------------
 |try this patch:
 |
 |Index: es137x.c
 |===================================================================
 |RCS file: /home/ncvs/src/sys/dev/sound/pci/es137x.c,v
 |retrieving revision 1.13.2.5
 |diff -u -b -r1.13.2.5 es137x.c
 |--- es137x.c    2001/02/21 11:23:24     1.13.2.5
 |+++ es137x.c    2001/02/27 08:18:52
 --------------------------
 Patching file es137x.c using Plan A...
 patch: **** malformed patch at line 14: 2)) {
 moran:/usr/src/sys/dev/sound/pci$ 
 
 -- 
 Richard Kuhns			rjk@grauel.com
 PO Box 6249			Tel: (765)477-6000 \
 100 Sawmill Road				    x319
 Lafayette, IN  47903		     (800)489-4891 /

From: Richard J Kuhns <rjk@grauel.com>
To: "Cameron Grant" <gandalf@vilnya.demon.co.uk>
Cc: <freebsd-gnats-submit@FreeBSD.org>, <rjk@grauel.com>
Subject: Re: i386/25944: SB16 PCI card doesn't initialize properly
Date: Sat, 24 Mar 2001 15:06:44 -0500

 Cameron Grant writes:
  > try this patch:
  > 
  > Index: es137x.c
  > ===================================================================
  > RCS file: /home/ncvs/src/sys/dev/sound/pci/es137x.c,v
  > retrieving revision 1.13.2.5
  > diff -u -b -r1.13.2.5 es137x.c
  > --- es137x.c    2001/02/21 11:23:24     1.13.2.5
  > +++ es137x.c    2001/02/27 08:18:52
  > @@ -487,8 +487,9 @@
  >         es->sctrl = 0;
  >         /* initialize the chips */
  >         if (revid == 7 || revid >= 9 || (devid == ES1371_PCI_ID3 && revid ==
  > 2)) {
  > -#define ES1371_BINTSUMM_OFF 0x07
  > -               bus_space_write_4(es->st, es->sh, ES1371_BINTSUMM_OFF,
  > 0x20);
  > +#define ES1371_BINTSUMM_OFF 0x04
  > +               bus_space_write_4(es->st, es->sh, ES1371_BINTSUMM_OFF,
  > 0x20000000);
  > +               DELAY(20000);
  >                 if (debug > 0) printf("es_init rev == 7 || rev >= 9\n");
  >         } else { /* pre ac97 2.1 card */
  >                 bus_space_write_4(es->st, es->sh, ES1370_REG_CONTROL,
  > es->ctrl);
 It worked!  I applied the patch manually since patch told me it was
 malformed, but after powering off and rebooting my SB16 sounds just fine.
 
 Thanks...
 -- 
 Richard Kuhns			rjk@grauel.com
 PO Box 6249			Tel: (765)477-6000 \
 100 Sawmill Road				    x319
 Lafayette, IN  47903		     (800)489-4891 /
State-Changed-From-To: open->closed 
State-Changed-By: greid 
State-Changed-When: Sun Apr 8 15:20:52 PDT 2001 
State-Changed-Why:  
Submitter reports problem has been fixed 

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