[PATCH v3 0/3] ALSA: opl3: Fix sequencer timer and channel lifetimes
From: Cen Zhang
Date: Sat Oct 24 2026 - 02:31:16 EST
OPL3 can receive a fixed-duration note before its timer is initialized,
and the card-owned voice array can retain channel pointers after either
sequencer port has freed its channel set. The delayed-note timer can also
remain queued after the sequencer client has been deleted.
Initialize the timer before publishing ports, key off active voices and
clear their aliases before freeing each channel set, and shut down the
shared timer after client deletion has drained both event producers.
The first two patches address existing initialization and rebind issues
identified by Sashiko. The third closes the shared timer lifetime after
all sequencer ports have been drained.
---
Cen Zhang (3):
ALSA: opl3: Initialize the timer before publishing a sequencer port
ALSA: opl3: Clear voice channels before freeing their sets
ALSA: opl3: Shut down the timer after draining sequencer ports
sound/drivers/opl3/opl3_midi.c | 14 ++++++++++++++
sound/drivers/opl3/opl3_oss.c | 1 +
sound/drivers/opl3/opl3_seq.c | 13 ++++++++-----
sound/drivers/opl3/opl3_voice.h | 1 +
4 files changed, 24 insertions(+), 5 deletions(-)
Changes in v3:
- Key off active hardware voices before retiring channel pointers and
delayed-note state in patch 2, addressing the Sashiko review.
- Move the voice cleanup helper beside snd_opl3_kill_voice() and reuse its
existing two- and four-operator note handling under voice_lock.
- Keep the code in patches 1 and 3 unchanged.
Link to v1: https://lore.kernel.org/r/pm-pmb-4552c4e605507d8d9b16-v4-213af356c0046331c8ff@xxxxxxxxx
Link to v2: https://lore.kernel.org/r/pm-pmb-4552c4e605507d8d9b16-v6-f3fa18aca2c7d18be670-0@xxxxxxxxx