2003-02-06 08:42:12

by Paul Laufer

[permalink] [raw]
Subject: OSS Sound Blaster sb_card.c rewrite (PnP, module options, etc)

This is a rewrite of sound/oss/sb_card.c which handles detection of
Soundblaster ISA cards and clones. This rewrite uses the new PnP and
module APIs.

Attached are two files sb_card.c and sb_card.h that are drop in
replacements for sb_card.c. Verified to work with current bk.

Please test if you have ISA Soundblaster and clone cards and provide
feedback.

Thanks,
Paul Laufer


Attachments:
(No filename) (378.00 B)
sb_card.c (9.06 kB)
sb_card.h (5.56 kB)
Download all attachments

2003-02-08 07:42:57

by Paul Laufer

[permalink] [raw]
Subject: Re: OSS Sound Blaster sb_card.c rewrite (PnP, module options, etc)

Sorry, I sent a version of sb_card.c that was what I last minute
tested minus one change. The #include for sb_card.h should be under
the #include of pnp.h. Here is the patch. It should work after you
apply this.

Thanks for testing.

Paul

--- sb_card.c.orig 2003-02-06 00:35:10.000000000 -0800
+++ sb_card.c 2003-02-07 23:46:50.000000000 -0800
@@ -19,6 +19,7 @@
* Melo, Daniel Church, and myself.
*
* 02-05-2003 Original Release, Paul Laufer <[email protected]>
+ * 02-07-2003 Bug made it into first release. Take two.
*/

#include <linux/config.h>
@@ -31,11 +32,10 @@
#include "sound_config.h"
#include "sb_mixer.h"
#include "sb.h"
-#include "sb_card.h"
-
#ifdef CONFIG_PNP_CARD
#include <linux/pnp.h>
#endif
+#include "sb_card.h"

MODULE_DESCRIPTION("OSS Soundblaster ISA PnP and legacy sound driver");
MODULE_LICENSE("GPL");




On Fri, Feb 07, 2003 at 10:17:42PM -0500 or thereabouts, Shawn Starr wrote:
> >This is a rewrite of sound/oss/sb_card.c which handles detection of
> >Soundblaster ISA cards and clones. This rewrite uses the new PnP and
> >module APIs.
>
> >Attached are two files sb_card.c and sb_card.h that are drop in
> >replacements for sb_card.c. Verified to work with current bk.
>
> >Please test if you have ISA Soundblaster and clone cards and provide
> >feedback.
>
> >Thanks,
> >Paul Laufer
>
> I do, but it doesn't compile against 2.5.59 vanilla?
>
> In file included from sound/oss/sb_card.c:34:
> sound/oss/sb_card.h:26: elements of array `sb_pnp_card_table' have incomplete
> type
> sound/oss/sb_card.h:28: unknown field `id' specified in initializer
> sound/oss/sb_card.h:28: warning: excess elements in struct initializer
> sound/oss/sb_card.h:28: warning: (near initialization for
> `sb_pnp_card_table[0]')
> sound/oss/sb_card.h:28: unknown field `driver_data' specified in initializer
> sound/oss/sb_card.h:28: warning: excess elements in struct initializer
> sound/oss/sb_card.h:28: warning: (near initialization for
> `sb_pnp_card_table[0]')
> sound/oss/sb_card.h:28: unknown field `devs' specified in initializer
> sound/oss/sb_card.h:28: extra brace group at end of initializer
>
> etc..
>
> either my 2.5.59 is not really a vanilla or something else. I took a 2.5.58
> bz2 and patched it with 2.5.59 patch it should be fine.
>
> Or, do I need bk?
>
> Shawn.
>

2003-02-10 05:27:20

by Shawn Starr

[permalink] [raw]
Subject: Re: OSS Sound Blaster sb_card.c rewrite (PnP, module options, etc) - Failed

pnp: Calling quirk for 01:01.00
pnp: SB audio device quirk - increasing port range
pnp: Calling quirk for 01:01.02
pnp: AWE32 quirk - adding two ports
isapnp: Card 'Creative SB32 PnP'
isapnp: Card 'U.S. Robotics Sportster 33600 FAX/Voice Int'
isapnp: 2 Plug & Play cards detected total

sb: Init: Starting Probe...
pnp: the card driver 'OSS SndBlstr' has been registered
pnp: pnp: match found with the PnP card '01:01' and the driver 'OSS SndBlstr'
pnp: Automatic configuration failed for device '01:01.00' due to resource
conflicts
sb: Init: Done

01:01.00 = Creative SB32 PnP
id = CTL0031

Conflicted by: 03f8-03ff : serial
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

from 01:01.00/possible:

Dependent: 01 - Priority preferred
port 0x220-0x220, align 0x0, size 0x10, 16-bit address decoding
port 0x330-0x330, align 0x0, size 0x2, 16-bit address decoding
port 0x388-0x3f8, align 0x0, size 0x4, 16-bit address decoding <----------
irq 5 High-Edge
dma 1 8-bit byte-count compatible
dma 5 16-bit word-count compatible

Adam is working on resource conflict fixes to PnP to let us see and possibly
fix conflicts like this.

Shawn.

On Saturday 08 February 2003 2:53 am, Paul Laufer wrote:
> Sorry, I sent a version of sb_card.c that was what I last minute
> tested minus one change. The #include for sb_card.h should be under
> the #include of pnp.h. Here is the patch. It should work after you
> apply this.
>
> Thanks for testing.
>
> Paul
>

2003-02-11 06:37:06

by Paul Laufer

[permalink] [raw]
Subject: Re: OSS Sound Blaster sb_card.c rewrite (PnP, module options, etc) - Failed

Shawn, Adam,

Yes. Failing here is certainly not the right thing to do. The
soundblaster only needs 4 bytes at 0x388, which brings it from 0x388
to 0x38b, not in conflict with the ttyS0 that starts at 0x3f8.

Furthermore the soundblaster has other configurations at "priority
acceptable" with and without the OPL (0x388-0x3f8, 4 bytes).

Here are examples for the two cards I have in my system now:

# CTL0045, AWE64
Hal9000:/dev/sysfs/bus/pnp/devices/01:01.00# cat possible
Dependent: 01 - Priority preferred
port 0x220-0x220, align 0x0, size 0x10, 16-bit address decoding
port 0x330-0x330, align 0x0, size 0x2, 16-bit address decoding
port 0x388-0x3f8, align 0x0, size 0x4, 16-bit address decoding
irq 5 High-Edge
dma 1 8-bit byte-count compatible
dma 5 16-bit word-count compatible
Dependent: 02 - Priority acceptable
port 0x220-0x280, align 0x1f, size 0x10, 16-bit address decoding
port 0x300-0x330, align 0x2f, size 0x2, 16-bit address decoding
port 0x388-0x3f8, align 0x0, size 0x4, 16-bit address decoding
irq 5,7,2/9,10 High-Edge
dma 0,1,3 8-bit byte-count compatible
dma 5,6,7 16-bit word-count compatible
Dependent: 03 - Priority acceptable
port 0x220-0x280, align 0x1f, size 0x10, 16-bit address decoding
port 0x300-0x330, align 0x2f, size 0x2, 16-bit address decoding
irq 5,7,2/9,10 High-Edge
dma 0,1,3 8-bit byte-count compatible
dma 5,6,7 16-bit word-count compatible
Dependent: 04 - Priority acceptable
port 0x220-0x280, align 0x1f, size 0x10, 16-bit address decoding
irq 5,7,2/9,10 High-Edge
dma 0,1,3 8-bit byte-count compatible
dma 5,6,7 16-bit word-count compatible
Dependent: 05 - Priority acceptable
port 0x220-0x280, align 0x1f, size 0x10, 16-bit address decoding
port 0x300-0x330, align 0x2f, size 0x2, 16-bit address decoding
port 0x388-0x3f8, align 0x0, size 0x4, 16-bit address decoding
irq 5,7,2/9,10 High-Edge
dma 0,1,3 8-bit byte-count compatible
Dependent: 06 - Priority acceptable
port 0x220-0x280, align 0x1f, size 0x10, 16-bit address decoding
port 0x300-0x330, align 0x2f, size 0x2, 16-bit address decoding
irq 5,7,2/9,10 High-Edge
dma 0,1,3 8-bit byte-count compatible
Dependent: 07 - Priority acceptable
port 0x220-0x280, align 0x1f, size 0x10, 16-bit address decoding
irq 5,7,2/9,10 High-Edge
dma 0,1,3 8-bit byte-count compatible
Dependent: 08 - Priority functional
port 0x220-0x280, align 0x1f, size 0x10, 16-bit address decoding
port 0x300-0x330, align 0xf, size 0x2, 16-bit address decoding
port 0x388-0x394, align 0x3, size 0x4, 16-bit address decoding
irq 5,7,2/9,10 High-Edge
dma 0,1,3 8-bit byte-count compatible
dma 5,6,7 16-bit word-count compatible

Hal9000:/dev/sysfs/bus/pnp/devices/01:01.00# cat resources
io 0x220-0x22f
io 0x330-0x331
io 0x388-0x38b
irq 5
dma 1
dma 5

# CTL0031, AWE32
Hal9000:/dev/sysfs/bus/pnp/devices/01:02.00# cat possible
Dependent: 01 - Priority preferred
port 0x220-0x220, align 0x0, size 0x10, 16-bit address decoding
port 0x330-0x330, align 0x0, size 0x2, 16-bit address decoding
port 0x388-0x3f8, align 0x0, size 0x4, 16-bit address decoding
irq 5 High-Edge
dma 1 8-bit byte-count compatible
dma 5 16-bit word-count compatible
Dependent: 02 - Priority acceptable
port 0x220-0x280, align 0x1f, size 0x10, 16-bit address decoding
port 0x300-0x330, align 0x2f, size 0x2, 16-bit address decoding
port 0x388-0x3f8, align 0x0, size 0x4, 16-bit address decoding
irq 5,7,10 High-Edge
dma 0,1,3 8-bit byte-count compatible
dma 5,6,7 16-bit word-count compatible
Dependent: 03 - Priority acceptable
port 0x220-0x280, align 0x1f, size 0x10, 16-bit address decoding
port 0x300-0x330, align 0x2f, size 0x2, 16-bit address decoding
irq 5,7,10 High-Edge
dma 0,1,3 8-bit byte-count compatible
dma 5,6,7 16-bit word-count compatible
Dependent: 04 - Priority functional
port 0x220-0x280, align 0x1f, size 0x10, 16-bit address decoding
irq 5,7,10 High-Edge
dma 0,1,3 8-bit byte-count compatible
dma 5,6,7 16-bit word-count compatible
Dependent: 05 - Priority functional
port 0x220-0x280, align 0x1f, size 0x10, 16-bit address decoding
port 0x300-0x330, align 0x2f, size 0x2, 16-bit address decoding
port 0x388-0x3f8, align 0x0, size 0x4, 16-bit address decoding
irq 5,7,10 High-Edge
dma 0,1,3 8-bit byte-count compatible
Dependent: 06 - Priority functional
port 0x220-0x280, align 0x1f, size 0x10, 16-bit address decoding
port 0x300-0x330, align 0x2f, size 0x2, 16-bit address decoding
irq 5,7,10 High-Edge
dma 0,1,3 8-bit byte-count compatible
Dependent: 07 - Priority functional
port 0x220-0x280, align 0x1f, size 0x10, 16-bit address decoding
irq 5,7,10,11 High-Edge
dma 0,1,3 8-bit byte-count compatible

Hal9000:/dev/sysfs/bus/pnp/devices/01:02.00# cat resources
io 0x240-0x24f
io 0x300-0x301
io 0x38c-0x38f
irq 10
dma 3
dma 6


So you can see that the second card is configured correctly with OPL
IO address at 0x38c-0x38f, because the first card took 0x388-0x38b.

Adam, any insight as to what is causing Shawn's resource conflict or
why PNP isn't dropping to some priority where the OPL is not enabled?

Shawn, do you have "PNP Bios" enabled? If you turn it off does the
resource conflict go away (this happened to me before and then stopped
for reasons unknown to me).

Thanks,
Paul


On Mon, Feb 10, 2003 at 12:36:56AM -0500 or thereabouts, Shawn Starr wrote:
> pnp: Calling quirk for 01:01.00
> pnp: SB audio device quirk - increasing port range
> pnp: Calling quirk for 01:01.02
> pnp: AWE32 quirk - adding two ports
> isapnp: Card 'Creative SB32 PnP'
> isapnp: Card 'U.S. Robotics Sportster 33600 FAX/Voice Int'
> isapnp: 2 Plug & Play cards detected total
>
> sb: Init: Starting Probe...
> pnp: the card driver 'OSS SndBlstr' has been registered
> pnp: pnp: match found with the PnP card '01:01' and the driver 'OSS SndBlstr'
> pnp: Automatic configuration failed for device '01:01.00' due to resource
> conflicts
> sb: Init: Done
>
> 01:01.00 = Creative SB32 PnP
> id = CTL0031
>
> Conflicted by: 03f8-03ff : serial
> ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
>
> from 01:01.00/possible:
>
> Dependent: 01 - Priority preferred
> port 0x220-0x220, align 0x0, size 0x10, 16-bit address decoding
> port 0x330-0x330, align 0x0, size 0x2, 16-bit address decoding
> port 0x388-0x3f8, align 0x0, size 0x4, 16-bit address decoding <----------
> irq 5 High-Edge
> dma 1 8-bit byte-count compatible
> dma 5 16-bit word-count compatible
>
> Adam is working on resource conflict fixes to PnP to let us see and possibly
> fix conflicts like this.
>
> Shawn.
>
> On Saturday 08 February 2003 2:53 am, Paul Laufer wrote:
> > Sorry, I sent a version of sb_card.c that was what I last minute
> > tested minus one change. The #include for sb_card.h should be under
> > the #include of pnp.h. Here is the patch. It should work after you
> > apply this.
> >
> > Thanks for testing.
> >
> > Paul
> >
>

2003-02-12 16:05:36

by Shawn Starr

[permalink] [raw]
Subject: Re: OSS Sound Blaster sb_card.c rewrite (PnP, module options, etc)


To update you all:

Last night Adam and I were debugging the PnP and Adam squashed two bugs.
The Sound driver WORKS however, there are serious IRQ/DMA conflicts


serio: i8042 AUX port at 0x60,0x64 irq 12
input: AT Set 2 keyboard on isa0060/serio0
serio: i8042 KBD port at 0x60,0x64 irq 1
sb: Init: Starting Probe...
pnp: the card driver 'OSS SndBlstr' has been registered
pnp: pnp: match found with the PnP card '01:01' and the driver 'OSS SndBlstr'
pnp: dma 0
pnp: dma 1
pnp: res: the device '01:01.00' has been activated.
sb: PnP: Found Card Named = "Creative SB32 PnP", Card PnP id = CTL0048, Device PnP id = CTL0031
sb: PnP: Detected at: io=0x220, irq=5, dma=1, dma16=5
sb: Interrupt test on IRQ5 failed - Probable IRQ conflict
<Sound Blaster 16 (4.13)> at 0x220 irq 5 dma 1,5
sb: Turning on MPU
<Sound Blaster 16> at 0x330 irq 5
sb: Init: Done
YM3812 and OPL-3 driver Copyright (C) by Hannu Savolainen, Rob Hooft
1993-1996


2.5 uses TWO irqs for the i8042 2.4 didn't which gives me 0 irq's free.

The problem is, the ISA Modem wants to use IRQ 5

So i have multiple conflicts at the same time ;-(

2003-02-13 04:56:08

by Shawn Starr

[permalink] [raw]
Subject: Re: OSS Sound Blaster sb_card.c rewrite (PnP, module options, etc) - UPDATE


With Adam's new PnP changes, and the disabling of the OS PnP BIOS on the
IBM. I can say that your sb_card.c/h changes (with some small
modifications with the new PnP structure changes) works!

I suppose, this weekend I could see if I can get the AWE itself detected
on 2.5.60 now :-)

Shawn.

2003-02-15 19:42:58

by Paul Laufer

[permalink] [raw]
Subject: Re: OSS Sound Blaster sb_card.c rewrite (PnP, module options, etc) - UPDATE

Thats good news Shawn. Keep us updated.

Thanks,
Paul

On Thu, Feb 13, 2003 at 12:06:54AM -0500 or thereabouts, Shawn Starr wrote:
>
> With Adam's new PnP changes, and the disabling of the OS PnP BIOS on the
> IBM. I can say that your sb_card.c/h changes (with some small
> modifications with the new PnP structure changes) works!
>
> I suppose, this weekend I could see if I can get the AWE itself detected
> on 2.5.60 now :-)
>
> Shawn.
>