Skip to contentSkip to conversation

ALSA: seq: Notify client and port info changes

PATCH New Takashi Iwai 1 participant 1 message Nov 28, 2024 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: seq: Notify client and port info changes

It was supposed to be notified when a sequencer client info and a port info has changed (via SNDRV_SEQ_EVENT_CLIENT_CHANGE and SNDRV_SEQ_EVENT_PORT_CHANGE event, respectively), and there are already helper functions. But those aren't really sent from the driver so far, except for the recent support of UMP, simply due to the lack of implementations.

This patch adds the missing notifications at updating the client and the port info. The formerly added notification for UMP is dropped because it's handled now in the port info side.

---
 sound/core/seq/seq_clientmgr.c  | 7 +++++++
 sound/core/seq/seq_ump_client.c | 2 --
 2 files changed, 7 insertions(+), 2 deletions(-)
sound/core/seq/seq_clientmgr.c +7 -0
index 3930e2f9082f..fe2d7f901610 100644
@@ -1290,6 +1290,10 @@ static int snd_seq_ioctl_set_client_info(struct snd_seq_client *client,
 		client->midi_version = client_info->midi_version;
 	memcpy(client->event_filter, client_info->event_filter, 32);
 	client->group_filter = client_info->group_filter;
+
+	/* notify the change */
+	snd_seq_system_client_ev_client_change(client->number);
+
 	return 0;
 }
 
@@ -1413,6 +1417,9 @@ static int snd_seq_ioctl_set_port_info(struct snd_seq_client *client, void *arg)
 	if (port) {
 		snd_seq_set_port_info(port, info);
 		snd_seq_port_unlock(port);
+		/* notify the change */
+		snd_seq_system_client_ev_port_change(info->addr.client,
+						     info->addr.port);
 	}
 	return 0;
 }
sound/core/seq/seq_ump_client.c +0 -2
index e5d3f4d206bf..22cac6997d30 100644
@@ -272,8 +272,6 @@ static void update_port_infos(struct seq_ump_client *client)
 						new);
 		if (err < 0)
 			return;
-		/* notify to system port */
-		snd_seq_system_client_ev_port_change(client->seq_client, i);
 	}
 }
 
Signature · 1 line
2.43.0