From yoshiaki@kt.rim.or.jp  Tue Apr  7 06:38:15 1998
Received: from mail.kt.rim.or.jp (root@mail.kt.rim.or.jp [202.247.130.53])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA25706
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 7 Apr 1998 06:38:14 -0700 (PDT)
          (envelope-from yoshiaki@kt.rim.or.jp)
Received: from singer.kt.rim.or.jp (ppp362.kt.rim.or.jp [202.247.140.62]) by mail.kt.rim.or.jp (8.8.5/3.4W3-rim1.1) with ESMTP id WAA19719; Tue, 7 Apr 1998 22:38:11 +0900 (JST)
Received: (from yoshiaki@localhost) by singer.kt.rim.or.jp (8.8.8/3.4Wbeta3-96070610) id WAA00868; Tue, 7 Apr 1998 22:35:53 +0900 (JST)
Message-Id: <199804071335.WAA00868@singer.kt.rim.or.jp>
Date: Tue, 7 Apr 1998 22:35:53 +0900 (JST)
From: yoshiaki@kt.rim.or.jp
Reply-To: yoshiaki@kt.rim.or.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: Sound-driver patch for MAD16 (OPTi 928,929)
X-Send-Pr-Version: 3.2

>Number:         6238
>Category:       kern
>Synopsis:       [sound] [patch] sound-driver patch for MAD16 (OPTi 928,929)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    sound
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr  7 06:40:01 PDT 1998
>Closed-Date:    Tue Jun 14 14:47:26 GMT 2005
>Last-Modified:  Tue Jun 14 14:47:26 GMT 2005
>Originator:     Yoshiaki Uchikawa
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
Rimnet
>Environment:
FreeBSD 3.0-CURRENT #0: Thu Mar 19 00:28:48 JST 1998
CPU: Pentium Pro (232.67-MHz 686-class CPU)
real memory  = 100663296 (98304K bytes)
avail memory = 95490048 (93252K bytes)

chip0: <Intel 82440FX (Natoma) PCI and memory controller> rev 0x02 on pci0.0.0
chip1: <Intel 82371SB PCI to ISA bridge> rev 0x01 on pci0.1.0

ncr0: <ncr 53c875 fast20 wide scsi> rev 0x03 int a irq 9 on pci0.9.0
sd0: <IBM DCAS-34330 S61A> type 0 fixed SCSI 2
sd1: <IBM DORS-32160 S82C> type 0 fixed SCSI 2
cd0: <NEC CD-ROM DRIVE:502 2.0r> type 5 removable SCSI 2
od0: <OLYMPUS MOS331 0.61> type 7 removable SCSI 2
vga0: <S3 968 graphics accelerator> rev 0x00 int a irq 255 on pci0.11.0
bktr0: <BrookTree 848> rev 0x12 int a irq 15 on pci0.13.0

>Description:

3.0-current sound-driver have MAD16 initialize routine. But, it is
can't use.

I make some patches for MAD16 initialize routine. They work fine on
my OPTi 929 Sound board. We can change I/O address using UserConfig menu.

Please merge these patches to current sound-driver.

Thank you.
>How-To-Repeat:
>Fix:
They are my patches.

 # cd /usr/src/sys/i386
 # patch -p < these-patches

In kernel config file:

  controller      snd0
  device mad0     at isa? port 0x530 irq 11 drq 0 vector adintr
  device opl0     at isa? port 0x388
  device mpu0     at isa? port 0x330 irq 6 drq 0


--- isa/sound/local.h.orig	Sat Mar  7 14:41:20 1998
+++ isa/sound/local.h	Sat Mar  7 22:09:38 1998
@@ -67,6 +67,14 @@
 #define CONFIG_CS4232
 #endif
 
+#include "mad.h"
+#if NMAD != 0
+#define CONFIG_AD1848
+#define CONFIG_MAD16
+#else
+#undef  CONFIG_MAD16
+#endif
+
 #include "sbxvi.h"
 #if NSBXVI != 0 && !defined(CONFIG_SB16)
 #define CONFIG_SB16
@@ -109,7 +117,7 @@
 #undef  CONFIG_GUS16
 /* #undef  CONFIG_MSS */
 /* #undef  CONFIG_SSCAPE */
-#undef  CONFIG_MAD16
+/* #undef  CONFIG_MAD16 */
 /* #undef  CONFIG_CS4232 */
 #undef  CONFIG_MAUI
 #undef  CONFIG_PNP
--- isa/sound/mad16_sb_midi.c.orig	Sat Mar  7 14:47:01 1998
+++ isa/sound/mad16_sb_midi.c	Sat Mar  7 14:47:13 1998
@@ -32,7 +32,7 @@
 #if defined(CONFIG_MAD16) && defined(CONFIG_MIDI)
 
 #define sbc_base mad16_sb_base
-#include <i386/isa/sound/sb_card.h>
+#include <i386/isa/sound/sbcard.h>
 
 static int      input_opened = 0;
 static int      my_dev;
--- isa/sound/soundcard.c.orig	Wed Feb 11 06:51:00 1998
+++ isa/sound/soundcard.c	Sat Mar  7 14:46:16 1998
@@ -123,6 +123,7 @@
 struct isa_driver cssdriver = {sndprobe, sndattach, "css"};
 struct isa_driver sscapedriver = {sndprobe, sndattach, "sscape"};
 struct isa_driver sscape_mssdriver = {sndprobe, sndattach, "sscape_mss"};
+struct isa_driver maddriver = {sndprobe, sndattach, "mad"};
 
 short ipri_to_irq(u_short ipri);
 
@@ -319,6 +320,8 @@
 	return (SNDCARD_TRXPRO);
     else if (driver == &trixsbdriver)
 	return (SNDCARD_TRXPRO_SB);
+    else if (driver == &maddriver)
+	return (SNDCARD_MAD16);
     else
 	return (0);
 }
--- conf/files.i386.orig	Wed Feb 25 07:08:03 1998
+++ conf/files.i386	Sat Mar  7 14:55:03 1998
@@ -227,6 +227,13 @@
 i386/isa/sound/midi_synth.c	optional	sscape	device-driver
 i386/isa/sound/midibuf.c	optional	sscape	device-driver
 i386/isa/sound/cs4232.c		optional	css	device-driver
+i386/isa/sound/sound_timer.c	optional	mad	device-driver
+i386/isa/sound/ad1848.c		optional	mad	device-driver
+i386/isa/sound/sound_timer.c    optional        mad     device-driver
+i386/isa/sound/midi_synth.c	optional	mad	device-driver
+i386/isa/sound/midibuf.c	optional	mad	device-driver
+i386/isa/sound/mad16.c		optional	mad	device-driver
+i386/isa/sound/mad16_sb_midi.c	optional	mad	device-driver
 i386/isa/spigot.c		optional	spigot	device-driver
 i386/isa/spkr.c			optional	speaker	device-driver
 i386/isa/stallion.c		optional	stl	device-driver
--- i386/userconfig.c.orig	Thu Mar 19 00:21:54 1998
+++ i386/userconfig.c	Thu Mar 19 00:27:02 1998
@@ -300,6 +300,7 @@
 {"mpu",         "Roland MPU401 MIDI",			0,		CLS_MMEDIA},
 {"sscape",      "Ensoniq Soundscape MIDI interface",	0,		CLS_MMEDIA},
 {"sscape_mss",  "Ensoniq Soundscape PCM",		0,		CLS_MMEDIA},
+{"mad",         "MAD16 and Mozart PCM",			0,		CLS_MMEDIA},
 {"uart",        "6850 MIDI UART",			0,		CLS_MMEDIA},
 {"pca",         "PC speaker PCM audio driver",		FLG_FIXED,	CLS_MMEDIA},
 {"ctx",         "Coretex-I frame grabber",		0,		CLS_MMEDIA},
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->luigi 
Responsible-Changed-By: phk 
Responsible-Changed-When: Wed Apr 15 10:51:04 PDT 1998 
Responsible-Changed-Why:  
Luigi, you're the soundman, right ? 
State-Changed-From-To: open->analyzed 
State-Changed-By: luigi 
State-Changed-When: Sat Sep 1 12:20:37 PDT 2001 
State-Changed-Why:  
I think this is obsolete, in any case, Cameron, does it 
apply to your driver ? Otherwise we can just close this PR. 


Responsible-Changed-From-To: luigi->cg 
Responsible-Changed-By: luigi 
Responsible-Changed-When: Sat Sep 1 12:20:37 PDT 2001 
Responsible-Changed-Why:  
Cameron is the maintainer of the new sound driver 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=6238 
Responsible-Changed-From-To: cg->sound 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Sep 9 19:29:30 GMT 2004 
Responsible-Changed-Why:  
With permission, reassign to mailing list alias. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=6238 
State-Changed-From-To: analyzed->closed 
State-Changed-By: arved 
State-Changed-When: Tue Jun 14 14:46:43 GMT 2005 
State-Changed-Why:  
Luigi stated in 2001 that this patch is obsolete, so close this PR 

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