[alsa-devel] Software based mmap support and dmix
Yogesh Soni
yksoni at gmail.com
Tue May 5 00:43:31 CEST 2015
Hi all,
I am trying to have dmix plugin work ( I succeeded) with the audio card
that does not have hardware mmap support and uses pcm_indirect method to
map software buffer for mmap feature.
Most of the plugins were working quite well with mmap/pcm_indirect combo.
However, dmix plugin did not work (no sound). I debugged and realized that
appl_ptr in pcm_direct.h(snd_pcm_indirect_playback_transfer()) was always 0
and hence nothing got copied to slave pcm buffer. I then discovered that
dmix operates in freewheeling-mode..
I have made a small workaround patch (I believe it can be cleaned up) in
case of free-wheeling mode, basically using sw_ready to hold bytes that
need to be copied. I used rec->sw_ready because it looked safest to use for
this purpose. As a result of this patch, normally period_size bytes are
copied to pcm buffer every period and sound is playing smooth.
I am a noob in alsa and linux in general. So, I would like your opinion on
the patch. I would much prefer if I could write a patch that is generic and
clean enough, so that it could be used by others. New pcm-indirect.h
attached.
Thanks a lot for your help.
Regards
Yogesh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pcm-indirect.h
Type: text/x-chdr
Size: 6416 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20150504/769bbb3d/attachment-0001.bin>
More information about the Alsa-devel
mailing list