git: 0f4d4d5a722e - releng/15.2 - snd_uaudio: Fix the MIDI TX round-robin

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Wed, 25 Nov 2026 22:11:14 UTC
The branch releng/15.2 has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=0f4d4d5a722e2560250943cc395ad08b04ee6af7

commit 0f4d4d5a722e2560250943cc395ad08b04ee6af7
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-11-17 08:12:28 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2026-11-25 22:09:11 +0000

    snd_uaudio: Fix the MIDI TX round-robin
    
    Nothing advances curr_cable, so umidi_bulk_write_callback() only
    services cable 0, which is a problem on MIDI devices with more than one
    jack.
    
    Approved by:    re (cperciva)
    Fixes:          039477d3e7e7 ("snd_uaudio: Simplify chan->curr_cable calculation in uaudio_bulk_write_callback()")
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 day
    
    (cherry picked from commit f58613868b50dfd6c2adc7128ea60d7b276fdbf1)
    (cherry picked from commit 6f80968093eccb5f9de1cfffd5a45c2163b605b4)
---
 sys/dev/sound/usb/uaudio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c
index 1c364ce44232..854f007a21fb 100644
--- a/sys/dev/sound/usb/uaudio.c
+++ b/sys/dev/sound/usb/uaudio.c
@@ -5945,7 +5945,8 @@ tr_setup:
 				}
 			}
 
-			chan->curr_cable %= chan->max_emb_jack;
+			chan->curr_cable = (chan->curr_cable + 1) %
+			    chan->max_emb_jack;
 
 			if (chan->curr_cable == start_cable) {
 				if (tr_any == 0)