* Direct use of the DMA buffer?
@ 2012-02-19 23:11 Pavel Hofman
2012-02-20 8:11 ` Clemens Ladisch
0 siblings, 1 reply; 5+ messages in thread
From: Pavel Hofman @ 2012-02-19 23:11 UTC (permalink / raw)
To: ALSA development
Hello,
Please excuse my ignorance, but is it possible for an application to
directly use/output to the DMA buffer allocated by the kernel in
hw_params? Something like using the actual DMA buffer in the
snd_pcm_writei function, without copying the data in alsa-lib/driver PCM
midle layer (?), just managing the pointers.
Only a theoretical question though, no plans on my side :)
Thanks a lot for even a short No :-)
Best regards,
Pavel.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Direct use of the DMA buffer?
2012-02-19 23:11 Direct use of the DMA buffer? Pavel Hofman
@ 2012-02-20 8:11 ` Clemens Ladisch
2012-02-20 8:38 ` Pavel Hofman
0 siblings, 1 reply; 5+ messages in thread
From: Clemens Ladisch @ 2012-02-20 8:11 UTC (permalink / raw)
To: Pavel Hofman; +Cc: ALSA development
Pavel Hofman wrote:
> Please excuse my ignorance, but is it possible for an application to
> directly use/output to the DMA buffer allocated by the kernel in
> hw_params?
Set one of the SND_PCM_ACCESS_MMAP_* access types and then use
snd_pcm_mmap_begin/commit.
Regards,
Clemens
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Direct use of the DMA buffer?
2012-02-20 8:11 ` Clemens Ladisch
@ 2012-02-20 8:38 ` Pavel Hofman
[not found] ` <4F4210A6.8010902@perex.cz>
0 siblings, 1 reply; 5+ messages in thread
From: Pavel Hofman @ 2012-02-20 8:38 UTC (permalink / raw)
To: Clemens Ladisch; +Cc: ALSA development
Dne 20.2.2012 09:11, Clemens Ladisch napsal(a):
> Pavel Hofman wrote:
>> Please excuse my ignorance, but is it possible for an application to
>> directly use/output to the DMA buffer allocated by the kernel in
>> hw_params?
>
> Set one of the SND_PCM_ACCESS_MMAP_* access types and then use
> snd_pcm_mmap_begin/commit.
>
Clemens, thanks a lot for the information. How does it work when the
alsa-lib chain contains plugins, such as plug, rate, etc.? I would
assume the application circumvents these.
Thanks a lot.
Pavel.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Direct use of the DMA buffer?
[not found] ` <4F4210A6.8010902@perex.cz>
@ 2012-02-20 9:22 ` Jaroslav Kysela
2012-02-20 9:25 ` Pavel Hofman
1 sibling, 0 replies; 5+ messages in thread
From: Jaroslav Kysela @ 2012-02-20 9:22 UTC (permalink / raw)
To: ALSA development
Date 20.2.2012 09:38, Pavel Hofman wrote:
>
> Dne 20.2.2012 09:11, Clemens Ladisch napsal(a):
>> Pavel Hofman wrote:
>>> Please excuse my ignorance, but is it possible for an application to
>>> directly use/output to the DMA buffer allocated by the kernel in
>>> hw_params?
>>
>> Set one of the SND_PCM_ACCESS_MMAP_* access types and then use
>> snd_pcm_mmap_begin/commit.
>>
>
> Clemens, thanks a lot for the information. How does it work when the
> alsa-lib chain contains plugins, such as plug, rate, etc.? I would
> assume the application circumvents these.
Nope. The mmap commit mechanism was introduced to keep the plugin
interface functional. The direct mmap access to the DMA buffer is only
applied for the direct hw: devices. If a plugin is used inside alsa-lib,
the application talks to the plugin chain (it means that an intermediate
buffer for samples can be allocated to let things working).
Jaroslav
--
Jaroslav Kysela <perex@perex.cz>
Linux Kernel Sound Maintainer
ALSA Project; Red Hat, Inc.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Direct use of the DMA buffer?
[not found] ` <4F4210A6.8010902@perex.cz>
2012-02-20 9:22 ` Jaroslav Kysela
@ 2012-02-20 9:25 ` Pavel Hofman
1 sibling, 0 replies; 5+ messages in thread
From: Pavel Hofman @ 2012-02-20 9:25 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: alsa-devel
Dne 20.2.2012 10:21, Jaroslav Kysela napsal(a):
>>
>> Clemens, thanks a lot for the information. How does it work when the
>> alsa-lib chain contains plugins, such as plug, rate, etc.? I would
>> assume the application circumvents these.
>
> Nope. The mmap commit mechanism was introduced to keep the plugin
> interface functional. The direct mmap access to the DMA buffer is only
> applied for the direct hw: devices. If a plugin is used inside alsa-lib,
> the application talks to the plugin chain (it means that an intermediate
> buffer for samples can be allocated to let things working).
>
Jaroslav, thanks a lot for the clarification.
Pavel.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-02-20 9:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-19 23:11 Direct use of the DMA buffer? Pavel Hofman
2012-02-20 8:11 ` Clemens Ladisch
2012-02-20 8:38 ` Pavel Hofman
[not found] ` <4F4210A6.8010902@perex.cz>
2012-02-20 9:22 ` Jaroslav Kysela
2012-02-20 9:25 ` Pavel Hofman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).