Skip to content

Commit

Permalink
ALSA: seq: Add UMP group number to snd_seq_port_info
Browse files Browse the repository at this point in the history
Add yet more new filed "ump_group" to snd_seq_port_info for specifying
the associated UMP Group number for each sequencer port.  This will be
referred in the upcoming automatic UMP conversion in sequencer core.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20230523075358.9672-30-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed May 23, 2023
1 parent ff166a9 commit a3ca3b3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion include/uapi/sound/asequencer.h
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ struct snd_seq_port_info {
unsigned int flags; /* misc. conditioning */
unsigned char time_queue; /* queue # for timestamping */
unsigned char direction; /* port usage direction (r/w/bidir) */
char reserved[58]; /* for future use */
unsigned char ump_group; /* 0 = UMP EP (no conversion), 1-16 = UMP group number */
char reserved[57]; /* for future use */
};


Expand Down
9 changes: 7 additions & 2 deletions sound/core/seq/seq_ports.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,12 @@ int snd_seq_set_port_info(struct snd_seq_client_port * port,
port->time_real = (info->flags & SNDRV_SEQ_PORT_FLG_TIME_REAL) ? 1 : 0;
port->time_queue = info->time_queue;

/* direction */
/* UMP direction and group */
port->direction = info->direction;
port->ump_group = info->ump_group;
if (port->ump_group > SNDRV_UMP_MAX_GROUPS)
port->ump_group = 0;

/* fill default port direction */
if (!port->direction) {
if (info->capability & SNDRV_SEQ_PORT_CAP_READ)
Expand Down Expand Up @@ -403,8 +407,9 @@ int snd_seq_get_port_info(struct snd_seq_client_port * port,
info->time_queue = port->time_queue;
}

/* direction */
/* UMP direction and group */
info->direction = port->direction;
info->ump_group = port->ump_group;

return 0;
}
Expand Down
3 changes: 2 additions & 1 deletion sound/core/seq/seq_ports.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ struct snd_seq_client_port {
int midi_voices;
int synth_voices;

/* direction */
/* UMP direction and group */
unsigned char direction;
unsigned char ump_group;
};

struct snd_seq_client;
Expand Down

0 comments on commit a3ca3b3

Please sign in to comment.