8 device limit for USB MIDI devices?

I notice that when I connect several USB MIDI devices to Zynthian, some devices are not getting recognized. The kernel log shows this:
snd-usb-audio 1-1.2.3:1.0: cannot find the slot for index -1 (range 0-7), error: -19
If this is the case, then I wonder if this limit can be removed ?
MIDI is usually not very bandwidth and CPU intensive and in my opinion it should not cause problems on a Pi4.

I remember reading about this limitation in the raspberry pi forums and a user compiled a kernel with a higher limit (32 in his case).
I’m not sure if this is somehow impacting performance (or maybe it could break some config) but it would be nice to be able to use more than 7 USB devices (the RPi counts as one too).

https://www.raspberrypi.org/forums/viewtopic.php?t=177458

2 Likes

Good catch @STM. I believe we use a stock kernel. (@jofemodo can confirm.) To fix this looks like compiling our own kernel and maintaining this and encouraging Raspbian maintaners to adjust the setting in their kernel.

4 Likes

I’m guessing It will be because Raspberry Pi OS also has to support running on the pi1 which had a severely limited usb device enumeration.

I’m guessing MIDI is not primary use for RPi so no one responsible for kernel build configuration had thought about it. Changing it within buildtools is possible and pretty straightforward. If I can suggest, compile all MIDI stuff to kernel itself, snd_seq_dummy also.

I filed a bug report on GitHub: Please remove limitation to only 8 USB MIDI devices · Issue #4179 · raspberrypi/linux · GitHub
Please leave encouraging comments to the kernel maintainers there. Thanks !

2 Likes

Ooo, we probably need to test this on Official Raspberry Pi
OS too as zynthian doesn’t use the most recent kernel.

Hello :slight_smile:
Any evolution on this issue ?

This happened:
image

Really tempted by the sudo rpi-update pulls/5637 :wink:

1 Like

Hi @Koshdukai !

Welcome to zynthianland!
Did you reach the limit? Could you give more details about your setup and use-case?
Anyway, next SD- image is based in bullseye-64bits and probably will solve this. I have to confirm.

Regards,

1 Like

I have experience with limit of USB sound card (8) on standart raspberry os (32bit). PatchBox OS is without problem becouse use specialy compiled kernel with limit up to 32 USB sound cards.

Hi @jofemodo, thanks :slight_smile:

Yes, quite easily in fact due to some of the MIDI controllers having multiple MIDI USB ports where the more extreme example is the Arturia MiniLab mk3 with 4 USB MIDI ports (MIDI, DIN THRU, MCU/HUI and ALV)

Other 2nd gen Arturia Keylab also have 2 MIDI USB ports (the 2nd being a DAW oriented port).

So, simply plugging 2 Keylabs and a MiniLab3 will immediately take over 8 ports.

In my actual setup I’m trying to have a rack of 6 controllers, a USB Audio interface and an TE OP-1.


The 6th and the TE OP-1 are left out due to this limitation.

I’m able to still use the 6th controller through DIN MIDI into one of the recognized controllers but the OP-1 is USB only so… no deal on that one unless unplugging one of the 5 recognized USB MIDI controllers.

Zynthian takes care of 90% of the sampler/synth output through the USB Audio interface

Channel 11 would be used to play the TE OP-1 which outputs its audio into the MOD-UI through the USB Audio interface’s IN.

Right now, if I want to plug a KeyStep PRO to play 4 of the MIDI Channels I have to physically unplug one of the controllers to “make room” in the Zynthian “USB MIDI space” :confused:

1 Like

Hi to all,

Since a new toy arrived today, I decided to test the limits of Zynthian. I physically connected 5 USB devices, namely Behringer sound card, 2x MIdihub from Blokas, USBMIDIKLIK 4x4 (two boards config) from TheKikGen Labs, and ESI midi cable convertor USB-DIN.

View of midi ports in web-config:

and midi settings for one channel:

It can be seen here that the capture screen does not show all midi inputs.

Personally, I don’t take this disproportion as a big mistake, I don’t really intend to use Midihubs and USBMIDIKLIK 4x4 connected to the Zynthian, I just wanted to know how the Zynthian will behave when it gets such a portion of midi inputs available.

Hmmm… interesting! That is a lot of MIDI ports :smile:. I wonder if some have the same device name which would confuse the current stable build. Do they all appear in amidi -l and jack_lsp?

I have to admit that this particular Zynthian is running on the testing version.
here is amidi -l

Dir Device    Name
IO  hw:0,0,0  UMC404HD 192k MIDI 1
IO  hw:1,0,0  Midihub MH-32VN1E5 MIDI 1
IO  hw:1,0,1  Midihub MH-32VN1E5 MIDI 2
IO  hw:1,0,2  Midihub MH-32VN1E5 MIDI 3
IO  hw:1,0,3  Midihub MH-32VN1E5 MIDI 4
IO  hw:2,0    f_midi
IO  hw:3,0,0  Midihub MH-3F0AVKY MIDI 1
IO  hw:3,0,1  Midihub MH-3F0AVKY MIDI 2
IO  hw:3,0,2  Midihub MH-3F0AVKY MIDI 3
IO  hw:3,0,3  Midihub MH-3F0AVKY MIDI 4
IO  hw:4,0,0  USB MIDIKliK 4x4 MIDI 1
IO  hw:4,0,1  USB MIDIKliK 4x4 MIDI 2
IO  hw:4,0,2  USB MIDIKliK 4x4 MIDI 3
IO  hw:4,0,3  USB MIDIKliK 4x4 MIDI 4
IO  hw:4,0,4  USB MIDIKliK 4x4 MIDI 5
IO  hw:4,0,5  USB MIDIKliK 4x4 MIDI 6
IO  hw:4,0,6  USB MIDIKliK 4x4 MIDI 7
IO  hw:4,0,7  USB MIDIKliK 4x4 MIDI 8
IO  hw:4,0,8  USB MIDIKliK 4x4 MIDI 9
IO  hw:4,0,9  USB MIDIKliK 4x4 MIDI 10
IO  hw:4,0,10  USB MIDIKliK 4x4 MIDI 11
IO  hw:4,0,11  USB MIDIKliK 4x4 MIDI 12
IO  hw:4,0,12  USB MIDIKliK 4x4 MIDI 13
IO  hw:4,0,13  USB MIDIKliK 4x4 MIDI 14
IO  hw:4,0,14  USB MIDIKliK 4x4 MIDI 15
IO  hw:4,0,15  USB MIDIKliK 4x4 MIDI 16
IO  hw:5,0,0  ESI MIDIMATE eX MIDI 1
IO  hw:5,0,1  ESI MIDIMATE eX MIDI 2

jack_lsp

system:capture_1
system:capture_2
system:capture_3
system:capture_4
system:playback_1
system:playback_2
system:playback_3
system:playback_4
system:midi_capture_1
system:midi_playback_1
system:midi_capture_29
system:midi_capture_30
system:midi_capture_31
system:midi_capture_32
system:midi_capture_4
system:midi_playback_4
ttymidi:MIDI_in
ttymidi:MIDI_out
a2j:Midi Through [14] (capture): Midi Through Port-0
a2j:Midi Through [14] (playback): Midi Through Port-0
ZynMidiRouter:ch0_out
ZynMidiRouter:ch1_out
ZynMidiRouter:ch2_out
ZynMidiRouter:ch3_out
ZynMidiRouter:ch4_out
ZynMidiRouter:ch5_out
ZynMidiRouter:ch6_out
ZynMidiRouter:ch7_out
ZynMidiRouter:ch8_out
ZynMidiRouter:ch9_out
ZynMidiRouter:ch10_out
ZynMidiRouter:ch11_out
ZynMidiRouter:ch12_out
ZynMidiRouter:ch13_out
ZynMidiRouter:ch14_out
ZynMidiRouter:ch15_out
ZynMidiRouter:main_out
ZynMidiRouter:mod_out
ZynMidiRouter:midi_out
ZynMidiRouter:net_out
ZynMidiRouter:step_out
ZynMidiRouter:ctrl_out
ZynMidiRouter:dev0_out
ZynMidiRouter:dev1_out
ZynMidiRouter:dev2_out
ZynMidiRouter:dev3_out
ZynMidiRouter:dev4_out
ZynMidiRouter:dev5_out
ZynMidiRouter:dev6_out
ZynMidiRouter:dev7_out
ZynMidiRouter:dev8_out
ZynMidiRouter:dev9_out
ZynMidiRouter:dev10_out
ZynMidiRouter:dev11_out
ZynMidiRouter:dev12_out
ZynMidiRouter:dev13_out
ZynMidiRouter:dev14_out
ZynMidiRouter:dev15_out
ZynMidiRouter:dev0_in
ZynMidiRouter:dev1_in
ZynMidiRouter:dev2_in
ZynMidiRouter:dev3_in
ZynMidiRouter:dev4_in
ZynMidiRouter:dev5_in
ZynMidiRouter:dev6_in
ZynMidiRouter:dev7_in
ZynMidiRouter:dev8_in
ZynMidiRouter:dev9_in
ZynMidiRouter:dev10_in
ZynMidiRouter:dev11_in
ZynMidiRouter:dev12_in
ZynMidiRouter:dev13_in
ZynMidiRouter:dev14_in
ZynMidiRouter:dev15_in
ZynMidiRouter:net_in
ZynMidiRouter:seq_in
ZynMidiRouter:step_in
ZynMidiRouter:ctrl_in
ZynMaster:midi_in
ZynMaster:midi_out
zynmixer:input_moduia
zynmixer:input_moduib
zynmixer:output_moduia
zynmixer:output_moduib
zynmixer:input_01a
zynmixer:input_01b
zynmixer:input_02a
zynmixer:input_02b
zynmixer:input_03a
zynmixer:input_03b
zynmixer:input_04a
zynmixer:input_04b
zynmixer:input_05a
zynmixer:input_05b
zynmixer:input_06a
zynmixer:input_06b
zynmixer:input_07a
zynmixer:input_07b
zynmixer:input_08a
zynmixer:input_08b
zynmixer:input_09a
zynmixer:input_09b
zynmixer:input_10a
zynmixer:input_10b
zynmixer:input_11a
zynmixer:input_11b
zynmixer:input_12a
zynmixer:input_12b
zynmixer:input_13a
zynmixer:input_13b
zynmixer:input_14a
zynmixer:input_14b
zynmixer:input_15a
zynmixer:input_15b
zynmixer:input_16a
zynmixer:input_16b
zynmixer:input_17a
zynmixer:input_17b
zynmixer:return_a
zynmixer:return_b
zynmixer:output_a
zynmixer:output_b
zynmixer:send_a
zynmixer:send_b
zynseq:input
zynseq:output
zynseq:metronome
audioplayer:in
audioplayer:out_01a
audioplayer:out_01b
zynsmf:midi_out
zynsmf:midi_in
fluidsynth:midi_00
fluidsynth:l_00
fluidsynth:r_00
fluidsynth:l_01
fluidsynth:r_01
fluidsynth:l_02
fluidsynth:r_02
fluidsynth:l_03
fluidsynth:r_03
fluidsynth:l_04
fluidsynth:r_04
fluidsynth:l_05
fluidsynth:r_05
fluidsynth:l_06
fluidsynth:r_06
fluidsynth:l_07
fluidsynth:r_07
fluidsynth:l_08
fluidsynth:r_08
fluidsynth:l_09
fluidsynth:r_09
fluidsynth:l_10
fluidsynth:r_10
fluidsynth:l_11
fluidsynth:r_11
fluidsynth:l_12
fluidsynth:r_12
fluidsynth:l_13
fluidsynth:r_13
fluidsynth:l_14
fluidsynth:r_14
fluidsynth:l_15
fluidsynth:r_15
fluidsynth:fx_l_00
fluidsynth:fx_r_00
fluidsynth:fx_l_01
fluidsynth:fx_r_01
zynaddsubfx:out-L
zynaddsubfx:out-R
zynaddsubfx:part0/out-L
zynaddsubfx:part0/out-R
zynaddsubfx:part1/out-L
zynaddsubfx:part1/out-R
zynaddsubfx:part2/out-L
zynaddsubfx:part2/out-R
zynaddsubfx:part3/out-L
zynaddsubfx:part3/out-R
zynaddsubfx:part4/out-L
zynaddsubfx:part4/out-R
zynaddsubfx:part5/out-L
zynaddsubfx:part5/out-R
zynaddsubfx:part6/out-L
zynaddsubfx:part6/out-R
zynaddsubfx:part7/out-L
zynaddsubfx:part7/out-R
zynaddsubfx:part8/out-L
zynaddsubfx:part8/out-R
zynaddsubfx:part9/out-L
zynaddsubfx:part9/out-R
zynaddsubfx:part10/out-L
zynaddsubfx:part10/out-R
zynaddsubfx:part11/out-L
zynaddsubfx:part11/out-R
zynaddsubfx:part12/out-L
zynaddsubfx:part12/out-R
zynaddsubfx:part13/out-L
zynaddsubfx:part13/out-R
zynaddsubfx:part14/out-L
zynaddsubfx:part14/out-R
zynaddsubfx:part15/out-L
zynaddsubfx:part15/out-R
zynaddsubfx-01:midi_input
Black_Pearl_Drumkit-00:control
Black_Pearl_Drumkit-00:outL
Black_Pearl_Drumkit-00:outR
MIDI_Note_to_CC-01:midiin
MIDI_Note_to_CC-01:midiout
MIDI_Thru-00:midiin
MIDI_Thru-00:midiout
MIDI_Note_to_CC-00:midiin
MIDI_Note_to_CC-00:midiout
Moony_A1_x_A1-00:event_in_1
Moony_A1_x_A1-00:event_out_1
QMidiArp LFO:MidiIn
QMidiArp LFO:MidiOut
jackrtpmidid:rtpmidi_in
jackrtpmidid:rtpmidi_out
system:midi_playback_29
system:midi_playback_30
system:midi_playback_31
system:midi_playback_32
system:midi_capture_33
system:midi_capture_34
system:midi_capture_35
system:midi_capture_36
system:midi_playback_33
system:midi_playback_34
system:midi_playback_35
system:midi_playback_36
system:midi_capture_37
system:midi_capture_38
system:midi_capture_39
system:midi_capture_40
system:midi_capture_41
system:midi_capture_42
system:midi_capture_43
system:midi_capture_44
system:midi_capture_45
system:midi_capture_46
system:midi_capture_47
system:midi_capture_48
system:midi_capture_49
system:midi_capture_50
system:midi_capture_51
system:midi_capture_52
system:midi_playback_37
system:midi_playback_38
system:midi_playback_39
system:midi_playback_40
system:midi_playback_41
system:midi_playback_42
system:midi_playback_43
system:midi_playback_44
system:midi_playback_45
system:midi_playback_46
system:midi_playback_47
system:midi_playback_48
system:midi_playback_49
system:midi_playback_50
system:midi_playback_51
system:midi_playback_52
system:midi_capture_53
system:midi_capture_54
system:midi_playback_53
system:midi_playback_54

Add a bug report. It seems unlikely that many will hit this issue but I will try to find time to build a device that emulates such a large quantity of MIDI ports (or maybe even finish building my MIDI router that has sat idle for many months) and diagnose this.

1 Like

I add bug report

Thanks @Toff. I investigated by first building some MidiKlik 4x modules, each with 16 MIDI ports and saw the issue. We limit the quantity of MIDI inputs and outputs to 24. We could increase this but I am not convinced it is necessary. This was a contrived test, not a real life use case. If someone has a real need for more than 24 inputs and / or 24 outputs then they can describe it and we could consider increasing the quantity of inputs and outputs.

1 Like

Well, current stable has a limit of 16.
Chain_manager branch has an upper limit of 24. I think this should be enough for almost any real use-cases. Anyway, we could increase this limit if it’s really needed.

Regards

1 Like

Even the limit of 16 ports is reasonable. But 24 will be better.
It was just a test from my side. In real life, I will use a maximum of 5 inputs and outputs.

What ever happened to the harp…??

2 Likes