From e3212d7860787a2499354ac210573d91b6574429 Mon Sep 17 00:00:00 2001 From: Kiruthika Vijayasekar Date: Tue, 25 Aug 2026 21:10:37 +0530 Subject: [PATCH] tinyalsa: fix pcm_ioctl() to dispatch through plugin ops pcm_ioctl() previously had a FIXME and always issued the ioctl directly on pcm->fd, bypassing any loaded plugin (e.g. AGM's tinyalsa plugin). Dispatch through pcm->ops->ioctl when a plugin is loaded, falling back to the direct ioctl() otherwise. Add 0002-pcm-fix-pcm_ioctl-to-dispatch-through-plugin-ops.patch and reference it from SRC_URI. Signed-off-by: Kiruthika Vijayasekar Signed-off-by: Khem Raj --- ...ioctl-to-dispatch-through-plugin-ops.patch | 36 +++++++++++++++++++ .../tinyalsa/tinyalsa_2.0.0.bb | 3 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 meta-multimedia/recipes-multimedia/tinyalsa/tinyalsa/0002-pcm-fix-pcm_ioctl-to-dispatch-through-plugin-ops.patch diff --git a/meta-multimedia/recipes-multimedia/tinyalsa/tinyalsa/0002-pcm-fix-pcm_ioctl-to-dispatch-through-plugin-ops.patch b/meta-multimedia/recipes-multimedia/tinyalsa/tinyalsa/0002-pcm-fix-pcm_ioctl-to-dispatch-through-plugin-ops.patch new file mode 100644 index 0000000000..1b7bead7e9 --- /dev/null +++ b/meta-multimedia/recipes-multimedia/tinyalsa/tinyalsa/0002-pcm-fix-pcm_ioctl-to-dispatch-through-plugin-ops.patch @@ -0,0 +1,36 @@ +From ef8edd2f8931c8f43d8f4fef836678ecf643608d Mon Sep 17 00:00:00 2001 +From: Claude +Date: Thu, 20 Aug 2026 10:41:55 +0530 +Subject: [PATCH] pcm: fix pcm_ioctl to dispatch through plugin ops + +pcm_ioctl() bypassed pcm->ops->ioctl() and called ioctl(pcm->fd, ...) +directly, per a FIXME comment noting it does not handle plugins. For +plugin-backed (virtual) pcm devices, pcm->fd is not a real character +device descriptor, so calls such as SNDRV_PCM_IOCTL_RESET or +SNDRV_PCM_IOCTL_PAUSE silently fail with -1 and never reach the +plugin's ioctl callback. + +Both hw_ops and plug_ops already implement .ioctl correctly (hw_ops +just forwards to the raw fd, so behavior for real hardware pcms is +unchanged), so dispatch pcm_ioctl() through pcm->ops->ioctl() instead. + +Upstream-Status: Inactive-Upstream [fixed independently in a later +upstream commit that changed this to pcm->ops->ioctl(pcm->data, ...)] +--- + src/pcm.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/pcm.c b/src/pcm.c +index 1b2103a..a37c383 100644 +--- a/src/pcm.c ++++ b/src/pcm.c +@@ -1806,6 +1806,8 @@ int pcm_ioctl(struct pcm *pcm, int request, ...) + arg = va_arg(ap, void *); + va_end(ap); + +- // FIXME Does not handle plugins ++ if (pcm->ops && pcm->ops->ioctl) ++ return pcm->ops->ioctl(pcm->data, request, arg); ++ + return ioctl(pcm->fd, request, arg); + } diff --git a/meta-multimedia/recipes-multimedia/tinyalsa/tinyalsa_2.0.0.bb b/meta-multimedia/recipes-multimedia/tinyalsa/tinyalsa_2.0.0.bb index a34317c819..a76e5a7447 100644 --- a/meta-multimedia/recipes-multimedia/tinyalsa/tinyalsa_2.0.0.bb +++ b/meta-multimedia/recipes-multimedia/tinyalsa/tinyalsa_2.0.0.bb @@ -9,7 +9,8 @@ LIC_FILES_CHKSUM = "file://NOTICE;md5=d2918795d9185efcbf430b9ad5cda46d" PV .= "+git" SRCREV = "f78ed25aced2dfea743867b8205a787bfb091340" SRC_URI = "git://github.com/tinyalsa/tinyalsa;branch=master;protocol=https \ - file://0001-meson-add-option-to-enable-disable-plugin-support.patch" + file://0001-meson-add-option-to-enable-disable-plugin-support.patch \ + file://0002-pcm-fix-pcm_ioctl-to-dispatch-through-plugin-ops.patch" inherit meson