Re: snd_pcm_writei VS snd_pcm_mmap_writei

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux