Created attachment 230855 [details] patch, for 13.0-Release-p4 midi_init uses 0 as auto-allocate unit number, but unit 0 is also a valid unit number. This confliction makes secondary function call to allocate another channel for unit 0 is treated as auto-allocate and returns non-0 unit as result incorrectly. Attached patch fixes this problem, auto-allocate number is changed from 0 to -1.
Created attachment 257829 [details] midi.diff ^Triage: attempt to rebase patch.
Created attachment 257830 [details] midi.diff ^Triage: attempt to rebase patch.