Skip to content

Commit c5ab94e

Browse files
committed
ALSA: seq: Fix missing channel at encoding RPN/NRPN MIDI2 messages
The conversion from the legacy event to MIDI2 UMP for RPN and NRPN missed the setup of the channel number, resulting in always the channel 0. Fix it. Fixes: e9e0281 ("ALSA: seq: Automatic conversion of UMP events") Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 17563b4 commit c5ab94e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sound/core/seq/seq_ump_convert.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,8 @@ static int paf_ev_to_ump_midi2(const struct snd_seq_event *event,
791791

792792
/* set up the MIDI2 RPN/NRPN packet data from the parsed info */
793793
static void fill_rpn(struct snd_seq_ump_midi2_bank *cc,
794-
union snd_ump_midi2_msg *data)
794+
union snd_ump_midi2_msg *data,
795+
unsigned char channel)
795796
{
796797
if (cc->rpn_set) {
797798
data->rpn.status = UMP_MSG_STATUS_RPN;
@@ -808,6 +809,7 @@ static void fill_rpn(struct snd_seq_ump_midi2_bank *cc,
808809
}
809810
data->rpn.data = upscale_14_to_32bit((cc->cc_data_msb << 7) |
810811
cc->cc_data_lsb);
812+
data->rpn.channel = channel;
811813
cc->cc_data_msb = cc->cc_data_lsb = 0;
812814
}
813815

@@ -855,7 +857,7 @@ static int cc_ev_to_ump_midi2(const struct snd_seq_event *event,
855857
cc->cc_data_lsb = val;
856858
if (!(cc->rpn_set || cc->nrpn_set))
857859
return 0; // skip
858-
fill_rpn(cc, data);
860+
fill_rpn(cc, data, channel);
859861
return 1;
860862
}
861863

@@ -957,7 +959,7 @@ static int ctrl14_ev_to_ump_midi2(const struct snd_seq_event *event,
957959
cc->cc_data_lsb = lsb;
958960
if (!(cc->rpn_set || cc->nrpn_set))
959961
return 0; // skip
960-
fill_rpn(cc, data);
962+
fill_rpn(cc, data, channel);
961963
return 1;
962964
}
963965

0 commit comments

Comments
 (0)