mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Alyandra Zahran Nadhir <alyandra5b@gmail.com>
Cc: perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	HyeongJun An <sammiee5311@gmail.com>
Subject: Re: [PATCH 1/2] ALSA: ump: clear stale RPN selector on NRPN change
Date: Sat, 07 Nov 2026 14:51:34 +0100	[thread overview]
Message-ID: <87pkwgyck9.wl-tiwai@suse.de> (raw)
In-Reply-To: <20261107111056.667-1-alyandra5b@gmail.com>

On Sat, 07 Nov 2026 12:10:54 +0100,
Alyandra Zahran Nadhir wrote:
> 
> The legacy-to-UMP converter keeps separate RPN and NRPN selector
> flags. When a stream changes selector type without sending data first,
> both flags remain set and fill_rpn() gives RPN priority, so subsequent
> NRPN data is emitted as RPN.
> 
> Clear the previous selector flag after flushing any pending parameter
> data and before recording the newly selected parameter type.
> 
> Signed-off-by: Alyandra Zahran Nadhir <alyandra5b@gmail.com>

Thanks for the patch.

Recently there was a discussion about RPN/NRPN handling, and this
looks related:
  https://lore.kernel.org/20261104121508.3972314-1-sammiee5311@gmail.com

Adding HyeongJun to Cc.


Takashi

> ---
>  sound/core/ump_convert.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/sound/core/ump_convert.c b/sound/core/ump_convert.c
> index 0a7972d91..b112064cb 100644
> --- a/sound/core/ump_convert.c
> +++ b/sound/core/ump_convert.c
> @@ -378,6 +378,7 @@ static int cvt_legacy_cmd_to_ump(struct ump_cvt_to_ump *cvt,
>  		switch (buf[1]) {
>  		case UMP_CC_RPN_MSB:
>  			ret = fill_rpn(cc, midi2, true);
> +			cc->nrpn_set = 0;
>  			cc->rpn_set = 1;
>  			cc->cc_rpn_msb = buf[2];
>  			if (cc->cc_rpn_msb == 0x7f && cc->cc_rpn_lsb == 0x7f)
> @@ -385,6 +386,7 @@ static int cvt_legacy_cmd_to_ump(struct ump_cvt_to_ump *cvt,
>  			return ret;
>  		case UMP_CC_RPN_LSB:
>  			ret = fill_rpn(cc, midi2, true);
> +			cc->nrpn_set = 0;
>  			cc->rpn_set = 1;
>  			cc->cc_rpn_lsb = buf[2];
>  			if (cc->cc_rpn_msb == 0x7f && cc->cc_rpn_lsb == 0x7f)
> @@ -392,11 +394,13 @@ static int cvt_legacy_cmd_to_ump(struct ump_cvt_to_ump *cvt,
>  			return ret;
>  		case UMP_CC_NRPN_MSB:
>  			ret = fill_rpn(cc, midi2, true);
> +			cc->rpn_set = 0;
>  			cc->nrpn_set = 1;
>  			cc->cc_nrpn_msb = buf[2];
>  			return ret;
>  		case UMP_CC_NRPN_LSB:
>  			ret = fill_rpn(cc, midi2, true);
> +			cc->rpn_set = 0;
>  			cc->nrpn_set = 1;
>  			cc->cc_nrpn_lsb = buf[2];
>  			return ret;

  parent reply	other threads:[~2026-11-07 13:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07 11:10 Alyandra Zahran Nadhir
2026-11-07 11:10 ` [PATCH 2/2] ALSA: ump: clear stale selectors in sequencer conversion Alyandra Zahran Nadhir
2026-11-07 13:51 ` Takashi Iwai [this message]
2026-11-07 14:29   ` [PATCH 1/2] ALSA: ump: clear stale RPN selector on NRPN change HyeongJun An

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pkwgyck9.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alyandra5b@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=sammiee5311@gmail.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®