[PATCH 6/8] ALSA: pcm: conditionally avoid mmap of control data

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Mon Jul 12 22:56:07 CEST 2021



On 6/13/21 2:28 AM, Takashi Iwai wrote:
> On Thu, 10 Jun 2021 22:53:24 +0200,
> Pierre-Louis Bossart wrote:
>>
>> In case of mmap, by default alsa-lib mmaps both control and status data.
>>
>> If driver subscribes for application pointer update, driver needs to get
>> notification whenever appl ptr changes. With the above case driver won't
>> get appl ptr notifications.
>>
>> This patch check on a hw info flag and returns error when user land asks
>> for mmaping control & status data, thus forcing user to issue
>> IOCTL_SYNC_PTR.
>>
>> This patch was originally submitted in 2017, c.f.
>> https://lore.kernel.org/alsa-devel/1494896518-23399-4-git-send-email-subhransu.s.prusty@intel.com/
>>
>> Suggested-by: Takashi Iwai <tiwai at suse.de>
>> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
>> Reviewed-by: Kai Vehmanen <kai.vehmanen at linux.intel.com>
>> Reviewed-by: Ranjani Sridharan <ranjani.sridharan at linux.intel.com>
> 
> This kind of flag itself was what I also introduced for another
> purpose, too.  There is a WIP patch that allows the use of
> non-coherent non-contiguous buffer pages, and this flag would fit for
> that.  FWIW, the patch is found at
>   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/log/?h=topic/memalloc

Sorry Takashi, I missed your feedback on this patch.

Are you saying I should use the definition in that patch?

+#define SNDRV_DMA_TYPE_NONCONTIG	8	/* non-coherent SG buffer */

I am not quite sure if how this is related to the application using mmap or not?


More information about the Alsa-devel mailing list