[alsa-devel] [PATCH 3/3] ALSA: pcm: conditionally avoid mmap of control data
Takashi Sakamoto
o-takashi at sakamocchi.jp
Tue May 16 07:57:30 CEST 2017
On May 16 2017 14:46, Takashi Iwai wrote:
> In this case, the problem is that the mmap control allows the appl_ptr
> being changed silently without interaction with the driver. If the
> driver requires some explicit action for changing the appl_ptr, it
> won't work.
I think 'struct snd_pcm_ops.pointer' is available for this purpose, too.
static snd_pcm_sframes_t snd_pcm_playback_rewind(...)
{
...
hw_avail = snd_pcm_playback_hw_avail(runtime);
(->struct snd_pcm_ops.pointer())
...
(rewind PCM frames)
...
+ substream->ops->pointer(...);
(->struct snd_pcm_ops.pointer())
...
}
If drivers need to handle event to update the appl_ptr, it records value
of the appl_ptr, then compare it to current value to get the updates.
I note that the callback is done in both of process/irq contexts.
On May 16 2017 14:46, Takashi Iwai wrote:
> Worthless is a too strong word, but I agree that more clarification
> would be more helpful.
Sorry to use such strong expression. I'll care of it.
Regards
Takashi Sakamoto
More information about the Alsa-devel
mailing list