>Can someone point me to an example alsa app doing mmap ? > >I want to convert my application from plain pcm_write to mmap mode. >I would also like to understand how you detect if a sound card can do >mmap or not. > >I help develope a multimedia application, and 6 audio channels (5.1 >sound) starts to require mmap mode on very slow PCs.
either aplay.c (simple, confusing) latency.c (simple, limited) {JACK}/alsa_driver.c (complete, confusing) might help. I think that the Jack case is the only one that handles what I would call "synchronous full duplex" (i.e. capture and playback running in sync). the others don't tend to worry about that detail, and it affects the inner loops of the code quite a bit. to find out if mmap is support, you ask use snd_pcm_hw_params_set_access (handle, params, SND_PCM_ACCESS_MMAP_NONINTERLEAVED); or snd_pcm_hw_params_set_access (handle, params, SND_PCM_ACCESS_MMAP_INTERLEAVED); if it works, then it works :) BTW, any "plug" device supports mmap mode regardless or not of the corresponding "hw" device(s) do. that's partly why JACK uses mmap mode without checking for this - if a user tries it on h/w that doesn't support it, they can just use "plughw:D,S" instead of "hw:D,S" when naming it. --p _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel