All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Irfan Shaikh <irfan.shaikh@sasken.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: snd_pcm_writei VS snd_pcm_mmap_writei
Date: Fri, 19 Nov 2010 09:21:30 +0100	[thread overview]
Message-ID: <4CE6338A.3090405@ladisch.de> (raw)
In-Reply-To: <alpine.LNX.2.00.1011190808080.21207@eeebox2.perex-int.cz>

Jaroslav Kysela wrote:
> On Fri, 19 Nov 2010, Irfan Shaikh wrote:
> >         Please tell me
> >         a) Difference between working of snd_pcm_mmap_writei and snd_pcm_writei ?
> 
> The mmap functions does not require user space / kernel context switches.
> 
> >         b) Performance wise which is better ?
> > 
> >         When i use gettimeofday almost profile time comes almost same for both of them.
> 
> With current hw power, there are no major differences.

Yes, the context switches have no noticeable impact on latency or
throughput.

The only case where using the mmap functions makes sense is when the
program generates the samples on the fly and can write them directly
into the device's buffer.  If, however, the samples are already in some
other buffer and are to be copied into the device's buffer, then this is
_exactly_ the same situation as snd_pcm_writei.

If your algorithm requires that you always use snd_pcm_mmap_writei,
then you shouldn't have used mmap in the first place.


Regards,
Clemens

  reply	other threads:[~2010-11-19  8:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-19  6:52 snd_pcm_writei VS snd_pcm_mmap_writei Irfan Shaikh
2010-11-19  7:09 ` Jaroslav Kysela
2010-11-19  8:21   ` Clemens Ladisch [this message]
     [not found] <1113818692.4263864449a32@mail.e4a.it>
2005-04-18 12:08 ` snd_pcm_writei vs snd_pcm_mmap_writei Clemens Ladisch
2005-04-18 12:18   ` Dino
  -- strict thread matches above, loose matches on Subject: below --
2005-04-18  9:40 Dino
2005-04-18  9:54 ` Clemens Ladisch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CE6338A.3090405@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=irfan.shaikh@sasken.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.