Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ALSA: seq: Allow suppressing UMP conversions

A sequencer client like seq_dummy rather doesn't want to convert UMP
events but receives / sends as is. Add a new event filter flag to
suppress the automatic UMP conversion and applies accordingly.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20230523075358.9672-32-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+19 -8
+1
include/uapi/sound/asequencer.h
··· 347 347 #define SNDRV_SEQ_FILTER_BROADCAST (1U<<0) /* accept broadcast messages */ 348 348 #define SNDRV_SEQ_FILTER_MULTICAST (1U<<1) /* accept multicast messages */ 349 349 #define SNDRV_SEQ_FILTER_BOUNCE (1U<<2) /* accept bounce event in error */ 350 + #define SNDRV_SEQ_FILTER_NO_CONVERT (1U<<30) /* don't convert UMP events */ 350 351 #define SNDRV_SEQ_FILTER_USE_EVENT (1U<<31) /* use event filter */ 351 352 352 353 struct snd_seq_client_info {
+10 -8
sound/core/seq/seq_clientmgr.c
··· 671 671 dest_port->time_real); 672 672 673 673 #if IS_ENABLED(CONFIG_SND_SEQ_UMP) 674 - if (snd_seq_ev_is_ump(event)) { 675 - result = snd_seq_deliver_from_ump(client, dest, dest_port, 676 - event, atomic, hop); 677 - goto __skip; 678 - } else if (snd_seq_client_is_ump(dest)) { 679 - result = snd_seq_deliver_to_ump(client, dest, dest_port, 680 - event, atomic, hop); 681 - goto __skip; 674 + if (!(dest->filter & SNDRV_SEQ_FILTER_NO_CONVERT)) { 675 + if (snd_seq_ev_is_ump(event)) { 676 + result = snd_seq_deliver_from_ump(client, dest, dest_port, 677 + event, atomic, hop); 678 + goto __skip; 679 + } else if (snd_seq_client_is_ump(dest)) { 680 + result = snd_seq_deliver_to_ump(client, dest, dest_port, 681 + event, atomic, hop); 682 + goto __skip; 683 + } 682 684 } 683 685 #endif /* CONFIG_SND_SEQ_UMP */ 684 686
+8
sound/core/seq/seq_dummy.c
··· 152 152 register_client(void) 153 153 { 154 154 struct snd_seq_dummy_port *rec1, *rec2; 155 + struct snd_seq_client *client; 155 156 int i; 156 157 157 158 if (ports < 1) { ··· 165 164 "Midi Through"); 166 165 if (my_client < 0) 167 166 return my_client; 167 + 168 + /* don't convert events but just pass-through */ 169 + client = snd_seq_kernel_client_get(my_client); 170 + if (!client) 171 + return -EINVAL; 172 + client->filter = SNDRV_SEQ_FILTER_NO_CONVERT; 173 + snd_seq_kernel_client_put(client); 168 174 169 175 /* create ports */ 170 176 for (i = 0; i < ports; i++) {