OSDN Git Service

pcm:plugin: Fix sound capture via MMAP access
authorTimo Wischer <twischer@de.adit-jv.com>
Tue, 4 Apr 2017 06:30:18 +0000 (12:00 +0530)
committerTakashi Iwai <tiwai@suse.de>
Wed, 5 Apr 2017 19:39:35 +0000 (21:39 +0200)
commitcb6e96bce1c43c26d9e12d031ed1ef027140b988
tree6adbcc1b3243dc69cda36ae176dfcba2bffbb48f
parentad6957c618676d31b65d1aa38f60542795d6406b
pcm:plugin: Fix sound capture via MMAP access

Distorted sound is heard if the capture device of an ioplug plugin is used,
which is accessed through any ALSA plugin (like copy, linear, ...) via MMAP access.
E.g. aplay -> loop -> copy -> arecord -M -> aplay -> hw:0
As mentioned in the ALSA API (see pcm/pcm.c:942):
The function #snd_pcm_avail_update() have to be called
before any mmap begin+commit operation.

Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
Signed-off-by: Mounesh Sutar <sutar.mounesh@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_plugin.c