19 Nov
2010
19 Nov
'10
8:21 a.m.
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