Re: Soundblaster getting 3 DMA channels?

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


On 29 Jul 1998, Andrew Snare wrote:

> Me> It's meant to. The SB16 (and up) uses two DMA channels --
> Me> channel 1 is used for 8-bit data, channel 5 for 16-bit
> Me> data. Most soundcards use two channels, the better ones being
> Me> able to do simultaneous recording and playback using (I believe)
> Me> both channels at once.
>
> Mike> Sorry, I made a mistake there. I know SB gets 2 channels, I
> Mike> meant that it is getting 3 (three) channels. It gets DMA
> Mike> 0,1,5.
>
> Mike> Sorry for the confusion.
>
> I think 0 means "disabled". Some MIDI devices probably use DMA, but
> I've never heard of a SoundBlaster using DMA for MIDI stuff. I can't
> find your original mail with the error message so I haven't been able
> to grep the code and see if it's a generic message for all midi
> devices or something specific to the SoundBlaster. You might wish to
> do so. :)

Well, there is a DMA 0, so using 0 doesn't make any sense to me.

I think I found the relevant piece of code that prints the
message. It is from:

/usr/src/linux/drivers/sound/soundcard.c

===========================================

void
conf_printf (char *name, struct address_info *hw_config)
{
if (!trace_init)
return;

printk ("<%s> at 0x%03x", name, hw_config->io_base);

if (hw_config->irq)
printk (" irq %d", (hw_config->irq > 0) ? hw_config->irq : -hw_config->irq);
if (hw_config->dma != -1 || hw_config->dma2 != -1)
{
printk (" dma %d", hw_config->dma);
if (hw_config->dma2 != -1)
printk (",%d", hw_config->dma2);
}

printk ("\n");
}

void
conf_printf2 (char *name, int base, int irq, int dma, int dma2)
{
if (!trace_init)
return;

printk ("<%s> at 0x%03x", name, base);

if (irq)
printk (" irq %d", (irq > 0) ? irq : -irq);

if (dma != -1 || dma2 != -1)
{
printk (" dma %d", dma);
if (dma2 != -1)
printk (",%d", dma2);
}

printk ("\n");
}

=================================================

I'm positive that this is what displays the messages. I believe
the first function prints the first message, and the second one
prints the second message.

For reference, once again, here are the messages I get at bootup.

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

If you analyze the structure of the messages it appears that the
above code is what is displaying them. So the question is:

Does MIDI (0x330) use DMA or not? If not, then why display
anything at all? It is very misleading to display "dma 0" if
what is meant is no dma, since there IS a DMA 0 available.

If every device that didn't do DMA printed DMA 0, and a device
that used DMA 0 also printed "dma 0", then it would be very
confusing. Doesn't everyone agree?

So, I say that if this driver does not use DMA channel 0, then it
should not display the "dma 0" message on the screen at all. If
it DOES use DMA channel 0, then it should appear so in /proc/dma.

I've CC'd Alan Cox as he is maintaining 2.0.x. I couldn't find
Hannu's email address, so hopefully he will see this.

Alan, can you please comment on this code. If I am wrong, can
you briefly explain why?

Thank you.
TTYL

--
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