* Using MMAP feature
@ 2012-07-23 7:13 alberto Villa
2012-07-23 10:38 ` Clemens Ladisch
0 siblings, 1 reply; 3+ messages in thread
From: alberto Villa @ 2012-07-23 7:13 UTC (permalink / raw)
To: alsa-devel
Hello,
I'm going to use the MMAP feature of ALSA. I understood I have to use
snd_pcm_mmap_begin and snd_pcm_mmap_commit functions, but I can't
understand the meaning of some parameters in the snd_pcm_mmap_begin
function: when I call this function in order to have access to the
capture stream on a call like this:
err = snd_pcm_mmap_begin(capture, &c_area, &c_offset, &c_frames);
it keeps to return c_frames = 0: is it right ? what does this mean? is
the buffer full so that I can read samples or the available contiguous
space to be read is 0?
Thank you,
Alberto
--
Dr. Villa Alberto
Sw Engineer
SeleTech srl
via Collodi, 8 20052 Monza (MI)
tel: +39 039 5962000
fax: +39 039 9716905
email: a.villa@seletech.com
web: www.seletech.com
www.seletech.eu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Using MMAP feature
2012-07-23 7:13 Using MMAP feature alberto Villa
@ 2012-07-23 10:38 ` Clemens Ladisch
[not found] ` <500D40D5.6050606@seletech.com>
0 siblings, 1 reply; 3+ messages in thread
From: Clemens Ladisch @ 2012-07-23 10:38 UTC (permalink / raw)
To: alberto Villa; +Cc: alsa-devel
alberto Villa wrote:> Hello,
> I'm going to use the MMAP feature of ALSA.
Why do you need to do this?
> snd_pcm_mmap_begin(capture, &c_area, &c_offset, &c_frames);
>
> it keeps to return c_frames = 0: is it right ? what does this mean?
It means that there are no samples available at the moment.
(Or that you forgot to call snd_pcm_avail_update(), or that you
didn't set c_frames before the call.)
Regards,
Clemens
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Using MMAP feature
[not found] ` <500D40D5.6050606@seletech.com>
@ 2012-07-23 14:46 ` Clemens Ladisch
0 siblings, 0 replies; 3+ messages in thread
From: Clemens Ladisch @ 2012-07-23 14:46 UTC (permalink / raw)
To: alberto Villa; +Cc: alsa-devel
(please don't drop the mailing list)
(please configure your mailer to wrap lines)
alberto Villa wrote:
> Il 23/07/2012 12:38, Clemens Ladisch ha scritto:
>> alberto Villa wrote:
>>> Hello,
>>> I'm going to use the MMAP feature of ALSA.
>>
>> Why do you need to do this?
>
> I need to use MMAP because we are running on an embedded system and we
> want to optimize its operations.
What exactly do you want to optimize? In most cases, mmap is no faster
than snd_pcm_write; using mmap make sense only if the samples are
generated dynamically without storing them in a userspace buffer.
> It was necessary to use snd_pcm_wait() before snd_pcm_begin(), may be
> this the reason?
If you never wait, the buffer will be filled eventually.
Regards,
Clemens
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-07-23 14:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-23 7:13 Using MMAP feature alberto Villa
2012-07-23 10:38 ` Clemens Ladisch
[not found] ` <500D40D5.6050606@seletech.com>
2012-07-23 14:46 ` Clemens Ladisch
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.