* memory allocate for substream->runtime->dma_area
@ 2006-03-15 3:42 boku
2006-03-15 3:43 ` boku
0 siblings, 1 reply; 10+ messages in thread
From: boku @ 2006-03-15 3:42 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 224 bytes --]
Dear all,
Could anyone tell me where the memory allocation of substream->runtime
is? I got to refine the runtime->dma_area within a specific DMA address. But
I can't find where the dma alloc is. Thanks a lot!
BR,
[-- Attachment #2: Type: text/html, Size: 305 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* memory allocate for substream->runtime->dma_area
2006-03-15 3:42 memory allocate for substream->runtime->dma_area boku
@ 2006-03-15 3:43 ` boku
2006-03-15 3:54 ` Lee Revell
2006-03-15 10:09 ` Takashi Iwai
0 siblings, 2 replies; 10+ messages in thread
From: boku @ 2006-03-15 3:43 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 225 bytes --]
Dear all,
Could anyone tell me where the memory allocation of substream->runtime
is? I got to refine the runtime->dma_area within a specific DMA address. But
I can't find where the dma alloc is. Thanks a lot!
BR,
[-- Attachment #2: Type: text/html, Size: 341 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: memory allocate for substream->runtime->dma_area
2006-03-15 3:43 ` boku
@ 2006-03-15 3:54 ` Lee Revell
[not found] ` <715d90900603142003jd1b1d00he8daf7331cc72237@mail.gmail.com>
2006-03-15 10:09 ` Takashi Iwai
1 sibling, 1 reply; 10+ messages in thread
From: Lee Revell @ 2006-03-15 3:54 UTC (permalink / raw)
To: boku; +Cc: alsa-devel
On Wed, 2006-03-15 at 11:43 +0800, boku wrote:
> Dear all,
> Could anyone tell me where the memory allocation of
> substream->runtime is? I got to refine the runtime->dma_area within a
> specific DMA address. But I can't find where the dma alloc is. Thanks
> a lot!
This question is pretty cryptic, can you describe what you are trying to
do and post a link to your code? Did you read the ALSA driver guide?
Lee
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: memory allocate for substream->runtime->dma_area
2006-03-15 3:43 ` boku
2006-03-15 3:54 ` Lee Revell
@ 2006-03-15 10:09 ` Takashi Iwai
2006-03-16 12:51 ` boku
1 sibling, 1 reply; 10+ messages in thread
From: Takashi Iwai @ 2006-03-15 10:09 UTC (permalink / raw)
To: boku; +Cc: alsa-devel
At Wed, 15 Mar 2006 11:43:51 +0800,
boku wrote:
>
> Dear all,
> Could anyone tell me where the memory allocation of substream->runtime is? I got
> to refine the runtime->dma_area within a specific DMA address. But I can't find where
> the dma alloc is. Thanks a lot!
The driver has to allocate the DMA buffer by itself.
Most drivers use the helper functions, snd_pcm_lib_preallocate_*() at
creation and snd_pcm_lib_malloc_pages() at hw_params callback, so that
the PCM middle layer takes over the jobs. But, in special cases, you
need to allocate the buffer or assign the fixed addresses by
yourself.
Anyway, better to show your code and read the documentation once, as
Lee suggested.
Takashi
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
^ permalink raw reply [flat|nested] 10+ messages in thread
* Fwd: memory allocate for substream->runtime->dma_area
[not found] ` <715d90900603152107q30b76a85l4b428167d515ee8c@mail.gmail.com>
@ 2006-03-16 5:21 ` boku
2006-03-17 0:45 ` Carlos Munoz
0 siblings, 1 reply; 10+ messages in thread
From: boku @ 2006-03-16 5:21 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 1179 bytes --]
Dear all,
Could you please tell me what the "frame" and "period" mean in alsa?
I saw snd_pcm_hardware_t struct has period_min,max, period_bytes_min,max etc
but quite confused of their meaning. So is the fifo size.
And btw, which data struct has the info of how many bits per channel for
the wav bitstream from alsa application aplay etc? Such as 16-bits, 24 or
32-bits.
Thanks for your great help~
On 3/16/06, Lee Revell <rlrevell@joe-job.com > wrote:
>
> On Wed, 2006-03-15 at 12:03 +0800, boku wrote:
> > Hi, Lee,
> > Thanks for quick response. Currently I'm designing the sound
> > driver for an ARM integrator/ap-like platform. But in the platform,
> > the audio controller is designated to move data only from a specific
> > address space. Therefore, doesn't it mean that i need to constrain the
> > runtime->dma_area to the specified address so that the AIC can start
> > to do DMA access?
> > Sorry about the code still not done and thanks in advance.
>
> Sorry I'm not really an ARM expert, but this has come up in the list
> archive before. You should look at some of the other ARM drivers in the
> tree...
>
> Lee
>
>
>
[-- Attachment #2: Type: text/html, Size: 2131 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: memory allocate for substream->runtime->dma_area
2006-03-15 10:09 ` Takashi Iwai
@ 2006-03-16 12:51 ` boku
0 siblings, 0 replies; 10+ messages in thread
From: boku @ 2006-03-16 12:51 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 913 bytes --]
Is there any example case that uses fixed address space for the DMA region?
Thanks!~
On 3/15/06, Takashi Iwai <tiwai@suse.de> wrote:
>
> At Wed, 15 Mar 2006 11:43:51 +0800,
> boku wrote:
> >
> > Dear all,
> > Could anyone tell me where the memory allocation of
> substream->runtime is? I got
> > to refine the runtime->dma_area within a specific DMA address. But I
> can't find where
> > the dma alloc is. Thanks a lot!
>
> The driver has to allocate the DMA buffer by itself.
>
> Most drivers use the helper functions, snd_pcm_lib_preallocate_*() at
> creation and snd_pcm_lib_malloc_pages() at hw_params callback, so that
> the PCM middle layer takes over the jobs. But, in special cases, you
> need to allocate the buffer or assign the fixed addresses by
> yourself.
>
> Anyway, better to show your code and read the documentation once, as
> Lee suggested.
>
>
> Takashi
>
[-- Attachment #2: Type: text/html, Size: 1262 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Fwd: memory allocate for substream->runtime->dma_area
2006-03-16 5:21 ` Fwd: " boku
@ 2006-03-17 0:45 ` Carlos Munoz
2006-03-17 1:17 ` Lee Revell
0 siblings, 1 reply; 10+ messages in thread
From: Carlos Munoz @ 2006-03-17 0:45 UTC (permalink / raw)
To: boku; +Cc: alsa-devel
boku wrote:
>
> Dear all,
> Could you please tell me what the "frame" and "period" mean in alsa?
> I saw snd_pcm_hardware_t struct has period_min,max,
> period_bytes_min,max etc but quite confused of their meaning. So is
> the fifo size.
> And btw, which data struct has the info of how many bits per
> channel for the wav bitstream from alsa application aplay etc? Such as
> 16-bits, 24 or 32-bits.
> Thanks for your great help~
>
>
> On 3/16/06, *Lee Revell* <rlrevell@joe-job.com
> <mailto:rlrevell@joe-job.com> > wrote:
>
> On Wed, 2006-03-15 at 12:03 +0800, boku wrote:
>> Hi, Lee,
>> Thanks for quick response. Currently I'm designing the sound
>> driver for an ARM integrator/ap-like platform. But in the platform,
>> the audio controller is designated to move data only from a specific
>> address space. Therefore, doesn't it mean that i need to
> constrain the
>> runtime->dma_area to the specified address so that the AIC can start
>> to do DMA access?
>> Sorry about the code still not done and thanks in advance.
>
> Sorry I'm not really an ARM expert, but this has come up in the list
> archive before. You should look at some of the other ARM drivers
> in the
> tree...
>
> Lee
>
>
>
Hi Boku,
I'm not an expert but I recently looked into this.
Frame: From the macro bytes_to_frames() I gather that a frame is a
sample. For example, if the sample size is 16 bits, the frame is also 16
bits. That means that for every 2 bytes sent, one frame is sent.
Period: It is driver dependent. It's the dma interrupt interval. It is
used to calculate latencies. For example, if a driver can only dma 1024
bytes at a time, the period will be 1024. That means during capture at
least 1024 bytes will be received before the first byte is passed to the
alsa middle layer.
I hope this helps,
Carlos
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Fwd: memory allocate for substream->runtime->dma_area
2006-03-17 0:45 ` Carlos Munoz
@ 2006-03-17 1:17 ` Lee Revell
2006-03-17 3:26 ` boku
0 siblings, 1 reply; 10+ messages in thread
From: Lee Revell @ 2006-03-17 1:17 UTC (permalink / raw)
To: Carlos Munoz; +Cc: boku, alsa-devel
On Thu, 2006-03-16 at 16:45 -0800, Carlos Munoz wrote:
> Frame: From the macro bytes_to_frames() I gather that a frame is a
> sample. For example, if the sample size is 16 bits, the frame is also
> 16 bits. That means that for every 2 bytes sent, one frame is sent.
>
It's a sample for each channel. Your example is correct for mono only.
For standard CD format (stereo, 16 bits per sample) a frame is 4 bytes.
Lee
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Fwd: memory allocate for substream->runtime->dma_area
2006-03-17 1:17 ` Lee Revell
@ 2006-03-17 3:26 ` boku
2006-03-20 14:54 ` Takashi Iwai
0 siblings, 1 reply; 10+ messages in thread
From: boku @ 2006-03-17 3:26 UTC (permalink / raw)
To: Lee Revell; +Cc: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 269 bytes --]
About the dedicated DMA space, if I use ioremap to set the DMA address space
and assign runtime->dma_area point to it, all the data access within the
address space must use ioread/write instead of direct dereference. What
should I do in this case? Thanks!~
BR,
[-- Attachment #2: Type: text/html, Size: 339 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Fwd: memory allocate for substream->runtime->dma_area
2006-03-17 3:26 ` boku
@ 2006-03-20 14:54 ` Takashi Iwai
0 siblings, 0 replies; 10+ messages in thread
From: Takashi Iwai @ 2006-03-20 14:54 UTC (permalink / raw)
To: boku; +Cc: Lee Revell, alsa-devel
At Fri, 17 Mar 2006 11:26:49 +0800,
boku wrote:
>
> About the dedicated DMA space, if I use ioremap to set the DMA address space and
> assign runtime->dma_area point to it, all the data access within the address space
> must use ioread/write instead of direct dereference. What should I do in this case?
In such a case, define copy and silence callbacks. The latter is
necessary only for playback. In addition, use snd_pcm_lib_mmap_iomem
as the mmap callback. You can find an example in nm256.c.
BTW, in nm256.c, the callbacks are ifdef'ed with i386. It's because
i386 can access ioremapped area via normal memory read/write.
Takashi
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-03-20 14:54 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-15 3:42 memory allocate for substream->runtime->dma_area boku
2006-03-15 3:43 ` boku
2006-03-15 3:54 ` Lee Revell
[not found] ` <715d90900603142003jd1b1d00he8daf7331cc72237@mail.gmail.com>
[not found] ` <1142454177.1671.38.camel@mindpipe>
[not found] ` <715d90900603151909o6bb834efv401392e5239a0435@mail.gmail.com>
[not found] ` <715d90900603152107q30b76a85l4b428167d515ee8c@mail.gmail.com>
2006-03-16 5:21 ` Fwd: " boku
2006-03-17 0:45 ` Carlos Munoz
2006-03-17 1:17 ` Lee Revell
2006-03-17 3:26 ` boku
2006-03-20 14:54 ` Takashi Iwai
2006-03-15 10:09 ` Takashi Iwai
2006-03-16 12:51 ` boku
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.