Skip to content

Commit e77aa4b

Browse files
committed
ALSA: seq: Drop UMP events when no UMP-conversion is set
When a destination client is a user client in the legacy MIDI mode and it sets the no-UMP-conversion flag, currently the all UMP events are still passed as-is. But this may confuse the user-space, because the event packet size is different from the legacy mode. Since we cannot handle UMP events in user clients unless it's running in the UMP client mode, we should filter out those events instead of accepting blindly. This patch addresses it by slightly adjusting the conditions for UMP event handling at the event delivery time. Fixes: 329ffe1 ("ALSA: seq: Allow suppressing UMP conversions") Link: https://lore.kernel.org/[email protected] Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 6d1f866 commit e77aa4b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

sound/core/seq/seq_clientmgr.c

+9-3
Original file line numberDiff line numberDiff line change
@@ -678,12 +678,18 @@ static int snd_seq_deliver_single_event(struct snd_seq_client *client,
678678
dest_port->time_real);
679679

680680
#if IS_ENABLED(CONFIG_SND_SEQ_UMP)
681-
if (!(dest->filter & SNDRV_SEQ_FILTER_NO_CONVERT)) {
682-
if (snd_seq_ev_is_ump(event)) {
681+
if (snd_seq_ev_is_ump(event)) {
682+
if (!(dest->filter & SNDRV_SEQ_FILTER_NO_CONVERT)) {
683683
result = snd_seq_deliver_from_ump(client, dest, dest_port,
684684
event, atomic, hop);
685685
goto __skip;
686-
} else if (snd_seq_client_is_ump(dest)) {
686+
} else if (dest->type == USER_CLIENT &&
687+
!snd_seq_client_is_ump(dest)) {
688+
result = 0; // drop the event
689+
goto __skip;
690+
}
691+
} else if (snd_seq_client_is_ump(dest)) {
692+
if (!(dest->filter & SNDRV_SEQ_FILTER_NO_CONVERT)) {
687693
result = snd_seq_deliver_to_ump(client, dest, dest_port,
688694
event, atomic, hop);
689695
goto __skip;

0 commit comments

Comments
 (0)