* New ALSA Driver
@ 2005-03-08 20:46 K.Fetscher
2005-03-08 20:59 ` Lee Revell
2005-03-08 21:26 ` James Courtier-Dutton
0 siblings, 2 replies; 3+ messages in thread
From: K.Fetscher @ 2005-03-08 20:46 UTC (permalink / raw)
To: alsa-devel
Hi,
I wan't to program an ALSA driver for my custom ARM based Cirrus-EP9312 board.
The driver starts with the initialisation of the hardware, with
snd_card_new(...), snd_pcm_new(...), the request for the DMA-Controller,
programming snd_pcm_set_ops(...) and
snd_pcm_lib_preallocate_pages_for_all(...).
After that, I can see the card in the /proc/asound/card0/... filesystem.
When I start playing a song with aplay, ALSA calls hw_params(..), prepare(..)
and trigger(..) with command SNDRV_PCM_TRIGGER_START. After that, all stops
until I make a CTRL C (after that, it terminates with hw_free and close). Is
it correct, that runtime->dma_addr is 0 (runtime->size is 1000 and
runtime->period is 400) ?
I have looked into some drivers for the parameters of
snd_pcm_lib_preallocate_pages_for_all(...). There are different types for the
DMA type and I don't know, which is the correct type (at the moment, I use
SNDRV_DMA_TYPE_CONTINUOUS).
Thanks
Klaus
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: New ALSA Driver
2005-03-08 20:46 New ALSA Driver K.Fetscher
@ 2005-03-08 20:59 ` Lee Revell
2005-03-08 21:26 ` James Courtier-Dutton
1 sibling, 0 replies; 3+ messages in thread
From: Lee Revell @ 2005-03-08 20:59 UTC (permalink / raw)
To: K.Fetscher; +Cc: alsa-devel
On Tue, 2005-03-08 at 21:46 +0100, K.Fetscher@t-online.de wrote:
> When I start playing a song with aplay, ALSA calls hw_params(..), prepare(..)
> and trigger(..) with command SNDRV_PCM_TRIGGER_START. After that, all stops
> until I make a CTRL C (after that, it terminates with hw_free and close). Is
> it correct, that runtime->dma_addr is 0 (runtime->size is 1000 and
> runtime->period is 400) ?
>
No. It sounds like the DMA is not being properly started in the
trigger() callback.
Can you post a link to your code? It's impossible to say what could be
wrong without seeing the source.
Lee
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: New ALSA Driver
2005-03-08 20:46 New ALSA Driver K.Fetscher
2005-03-08 20:59 ` Lee Revell
@ 2005-03-08 21:26 ` James Courtier-Dutton
1 sibling, 0 replies; 3+ messages in thread
From: James Courtier-Dutton @ 2005-03-08 21:26 UTC (permalink / raw)
To: K.Fetscher; +Cc: alsa-devel
K.Fetscher@t-online.de wrote:
> Hi,
>
> I wan't to program an ALSA driver for my custom ARM based Cirrus-EP9312 board.
>
> The driver starts with the initialisation of the hardware, with
> snd_card_new(...), snd_pcm_new(...), the request for the DMA-Controller,
> programming snd_pcm_set_ops(...) and
> snd_pcm_lib_preallocate_pages_for_all(...).
>
> After that, I can see the card in the /proc/asound/card0/... filesystem.
>
>
> When I start playing a song with aplay, ALSA calls hw_params(..), prepare(..)
> and trigger(..) with command SNDRV_PCM_TRIGGER_START. After that, all stops
> until I make a CTRL C (after that, it terminates with hw_free and close). Is
> it correct, that runtime->dma_addr is 0 (runtime->size is 1000 and
> runtime->period is 400) ?
>
>
> I have looked into some drivers for the parameters of
> snd_pcm_lib_preallocate_pages_for_all(...). There are different types for the
> DMA type and I don't know, which is the correct type (at the moment, I use
> SNDRV_DMA_TYPE_CONTINUOUS).
>
> Thanks
>
> Klaus
>
It is difficult to answer your questions without seeing the source code
itself.
One thing to note is that the DMA has two different addresses:
runtime->dma_addr is the physical memory address. i.e. the address to
give to the sound card hardware.
runtime->dma_area is the virtual address. i.e. the address the kernel
CPU writes to.
I only know how x86 CPUs work, so ARM might be different in this respect.
James
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-03-08 21:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-08 20:46 New ALSA Driver K.Fetscher
2005-03-08 20:59 ` Lee Revell
2005-03-08 21:26 ` James Courtier-Dutton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.