Re: Soundblaster getting 2 DMA channels?

Mike A. Harris (mharris@ican.net)
Wed, 29 Jul 1998 05:23:07 -0400 (EDT)


On Tue, 28 Jul 1998, Yves Colombani wrote:

> >The SB16 needs two DMA channels. A 8 bit one (1 or 3) is required for
> >8 bit operation and a 16 bit one (5, 6 or 7) for the 16 bit mode. In theory
> >it's possible to use just one (8 bit) DMA channel by answering the 8 bit
> >one when the configuration program asks for the 16 bit one. This may work
> >in some systems but is likely to cause terrible noise on some other systems.
>
> I have a SB (Vibra) 16 Pnp which requires two 8 bit DMA (cf doc of the card).
> The Linux driver is expecting one 8 and one 16... and it complains each time
> the sound module is loaded:
> >SB16: Bad or missing 16 bit DMA channel
>
> ..but works just fine (with 8 and 16 bit sound)!
> I think it uses only the first DMA channel (8bit) as explained in the 'Readme'.
>
> What doing with the second DMA channel ???

Well, all that I can say is that I have an official Creative Labs
Orange and Blue boxed Sound Blaster 16 basic edition - no OEM
version/clone/whatever. In other words - the real McCoy. If you
look in any of the books, docs or any other info available
anywhere it states that it needs 2 DMA channels and 1 IRQ.

The standard default settings for most SB16's (from the factory)
are:

IRQ=5 (Although Linux defaults to 7 for some reason and I change
it to 5 in menuconfig)
DMA8=1
DMA16=5

This is how it always has been on my system in about 6 different
OS's with a multitude of different software, games, etc...

The card works fine in DOS/Win/Win95/WinNT/Linux/whatever - no
problem. However, I just noticed that the Linux bootup messages
are saying that there is an SB16 on port 0x330 using DMA 0.
Isn't DMA 0 used for RAM refresh or something? It most certainly
isn't used on my SB16 unless there is some hidden DMA on the
SB16 that only the Linux gods know about.

Just to illustrate my confusion a bit more:

2 root@red:/usr/src/redhat/SPECS# cat /proc/dma
1: Sound Blaster8
4: cascade
5: Sound Blaster16

Here you see that my SB16 is using DMA 1 and 5. DMA 0 is nowhere
in sight.

2 root@red:/usr/src/redhat/SPECS# cat /proc/ioports
0000-001f : dma1
0020-003f : pic1
0040-005f : timer
0060-006f : keyboard
0080-009f : dma page reg
00a0-00bf : pic2
00c0-00df : dma2
00f0-00ff : npu
0170-0177 : ide1
01f0-01f7 : ide0
0220-022f : sound blaster
02f8-02ff : serial(auto)
0300-030f : 3c509
0330-0333 : SB MIDI
0376-0376 : ide1
0378-037f : plip1
0388-038b : OPL3/OPL2
03c0-03df : vga+
03e8-03ef : serial(set)
03f0-03f5 : floppy
03f6-03f6 : ide0
03f7-03f7 : floppy DIR
03f8-03ff : serial(auto)

Here you can see that my SB16 is using 0x330 for SB MIDI. Since
when does MIDI use DMA? Don't read me wrong though - I don't
know if MIDI does infact use DMA or not, but it certainly doesn't
use DMA0 because it isn't listed in /proc/dma, and I've never
heard of a SB using 3 DMA channels before ever.

Either way, there must be a bug somewhere. If the SB16 *DOES*
use dma 0 for MIDI, then it should list in /proc/dma.

Here is my last bootup message:

Jul 26 08:18:57 red kernel: tty00 at 0x03f8 (irq = 4) is a 16550A
Jul 26 08:18:57 red kernel: tty01 at 0x02f8 (irq = 3) is a 16550A
Jul 26 08:18:57 red kernel: tty02 at 0x03e8 (irq = 4) is a 16550A
Jul 26 08:18:57 red kernel: Sound initialization started
Jul 26 08:18:57 red kernel: <Sound Blaster 16 (4.5)> at 0x220 irq
5 dma 1,5
Jul 26 08:18:57 red kernel: <Sound Blaster 16> at 0x330 irq 5 dma
0
Jul 26 08:18:57 red kernel: <Yamaha OPL3 FM> at 0x388
Jul 26 08:18:57 red kernel: Sound initialization complete
Jul 26 08:18:57 red kernel: hda: QUANTUM FIREBALL SE4.3A, 4110MB
w/80kB Cache, C

So, I'm sure that it is somehow possible for DMA0 to be used,
otherwise I can't see how the message got in the kernel to start
with.

So if that is true, then it should also be selectable in kernel
config to use a different DMA channel, and it should also appear
under /proc/dma.

Just on a hunch, I decided to play a midi file while catting
/proc/dma to see if it appears there while midi is working:

3 root@red:/stuff/linux/REDHAT-CD-TREE# ps ; cat /proc/dma
PID TTY STAT TIME COMMAND
319 a0 S 0:00 gpm -t MouseMan
423 1 S 0:00 /bin/login -- root
425 3 S 0:00 /bin/login -- root
426 4 S 0:00 /bin/login -- root
427 5 S 0:00 /bin/login -- root
428 6 S 0:00 (mingetty)
477 1 S 0:00 -bash
630 5 S 0:00 -bash
948 3 S 0:00 -bash
1156 4 S 0:00 -bash
13527 2 S 0:00 -bash
17769 3 S 0:00 ping -i 600 198.133.36.9
17821 p0 S 0:00 bash -rcfile .bashrc
17830 2 S 0:00 playmidi /stuff/dream-theatre/pmu.mid
17833 3 R 0:00 ps
1: Sound Blaster8
4: cascade
5: Sound Blaster16

No DMA 0. Is MIDI at 0x330 the actual outgoing MIDI port? If
so, then I've mistaken what is meant by MIDI. Even then, I've
never seen a SB listed as using 3 DMA channels, and I don't want
mine to be using 3 channels if I can prevent it. I don't use the
MIDI port on the SB16 anyways...

At any rate, if DMA 0 is used, it should display in /proc/dma.

Any comments/suggestions/patches/flames/money/perogies are more
than welcome. ;o)

TIA

--
Mike A. Harris  -  Computer Consultant  -  Linux advocate

Escape from the confines of Microsoft's operating systems and push your PC to it's limits with LINUX - a real OS. http://www.redhat.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html