From alsa-devel-owner@alsa.jcu.cz  Wed Feb  3 08:09:43 1999
Received: from mgate2.uni-hannover.de (root@mgate2.uni-hannover.de [130.75.2.5])
	by marvin.jcu.cz (8.9.1a/8.9.1) with ESMTP id IAA19471
	for <alsa-devel@alsa.jcu.cz>; Wed, 3 Feb 1999 08:08:08 +0100
Received: from helios.tnt.uni-hannover.de by mgate2.uni-hannover.de 
          with LocalSMTP (PP) with ESMTP; Wed, 3 Feb 1999 08:07:29 +0100
Received: from sokrates.tnt.uni-hannover.de (pahl@sokrates.tnt.uni-hannover.de [130.75.31.157]) 
          by helios.tnt.uni-hannover.de (8.8.8/8.8.8) with ESMTP id IAA23578;
          Wed, 3 Feb 1999 08:07:28 +0100 (MET)
Received: (from pahl@localhost) by sokrates.tnt.uni-hannover.de (8.8.8/8.8.8) 
          id IAA19690; Wed, 3 Feb 1999 08:07:28 +0100
Date: Wed, 3 Feb 1999 08:07:28 +0100
Message-Id: <199902030707.IAA19690@sokrates.tnt.uni-hannover.de>
From: Martin Pahl <pahl@tnt.uni-hannover.de>
To: Jaroslav Kysela <perex@jcu.cz>, alsa-devel@alsa.jcu.cz
Subject: Question to dma-buf allocation
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: text/plain; charset=US-ASCII
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

Ok, my ZA2-driver still does not work. I've a working driver outside
ALSA and the only difference I see, is the allocation of DMA-buffer. 

In my old driver I used

za2_dma_buf = (unsigned long) kmalloc(131048, GFP_DMA);
 
to allocate the DMA-buffer.

Now I use the ALSA-code:

        if (snd_dma2[dev] >= 0) {
                if ((err = snd_register_dma_channel(card,
                                                    "ZA2 - DMA2",
                                                    snd_dma2[dev],
                                                    SND_DMA_TYPE_ISA,
                                                    snd_dma2_size[dev],
                                                    possible_dmas,
                                                    &acard->dma2ptr)) < 0) 

and

        if ((err=snd_pcm1_dma_alloc(pcm1, SND_PCM1_PLAYBACK,
                                    codec->dma_out16ptr, "ZA2 (playback)"))<0)

to actually allocate a DMA-buffer. snd_pcm1_dma_alloc uses
snd_malloc_pages, which uses __get_free_pages to allocate
memory-pages. Is there any difference between those
calls? __get_free_pages seems to return virtual pages because the
buffer-adress is converted with virt_to_bus in snd_dma_program. 

Another problem could be the DMA-buffer-blocksize. How often must an
interrupt be generated from the sound card. 

I really need more information about the driver interface of ALSA. The
documentation available is a good start but it's outdated and it's
hard to get all information out of the source.

Martin Pahl

-- 
Martin Pahl                                email: pahl@tnt.uni-hannover.de  

Institut fuer Theoretische Nachrichtentechnik und Informationsverarbeitung
Universitaet Hannover                 http://www.tnt.uni-hannover.de/~pahl

