Hi,
On Jun 21 2017 00:33, Takashi Iwai wrote:
Hi,
this is a patchset for the issues we've discussed recently lengthily,
the explicit sync of appl_ptr by disabling the control mmap.
The first patch achieves it for a driver setting the new INFO flag.
The second patch is for a generic ABI extension I wanted to implement
for long time. It allows user-space reporting its supporting protocol
version, so that the kernel can behave differently. It's especially
useful for extending the ABI struct to use the reserved bits.
The third patch is the optimization by the second patch; it simply
skips the previous workaround when the user-space declares itself
being new enough to support the feature.
The corresponding alsa-lib patchset will follow in another thread.
thanks,
Takashi
===
Takashi Iwai (3):
ALSA: pcm: Add the explicit appl_ptr sync support
ALSA: pcm: Add an ioctl to specify the supported protocol version
ALSA: pcm: Limit the appl_ptr sync workaround only for old user-space
include/sound/pcm.h | 1 +
include/uapi/sound/asound.h | 4 +++-
sound/core/pcm_compat.c | 1 +
sound/core/pcm_native.c | 28 ++++++++++++++++++++++++++++
4 files changed, 33 insertions(+), 1 deletion(-)
I prefer this direction and support this patchset.
Reviewed-by: Takashi Sakamoto <o-takashi@xxxxxxxxxxxxx>
Tested-by: Takashi Sakamoto <o-takashi@xxxxxxxxxxxxx>
However, when running with patched alsa-lib[1], due to a commit
f8ff2f28ba49 ("ALSA: pcm: Skip ack callback without actual appl_ptr
update")[2], callback functions in driver side for .ack are not called
from ioctl handler in ALSA PCM core. When page frames for control data
of PCM substream is mapped to VMA of the application, the application
updates the value of pointer in the frame, then transfer the value via
ioctl. Comparing these two values should be the same and ALSA PCM core
skip the callback.
When considering about behaviour of old userland stuffs, it's not
necessarily easy to reduce call frequency of the callback, mmm...
[1]
http://mailman.alsa-project.org/pipermail/alsa-devel/2017-June/122066.html
[2]
https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/sound/core/pcm_lib.c?h=topic/pcm-sync-applptr&id=f8ff2f28ba49fa41a06215ac3187dede347bc9a7
Thanks
Takashi Sakamoto
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel