taskovskig
Posts: 3
Joined: Wed Mar 15, 2017 8:53 am

Maximum number of MIDI USB devices

Wed Mar 15, 2017 9:04 am

Hi there,

Yesterday I acquired Rasp Pi 3, installed Raspbian, and started my long lusted midi sequencer project. At the end of the day, I need to connect 11 USB MIDI devices using powered MIDI hubs. Note that I have done this on regular PC using Ubuntu. No problems there. When I try to replicate my setup from Ubuntu to Raspbian, it turns out that I can not connect more than 7 external devices (total of eight including the stock 'Midi Through Port-0'). Each new MIDI USB device is recognized, but the dmesg output is:

[ 681.974078] snd-usb-audio 1-1.4.3:1.0: cannot find the slot for index -1 (range 0-7), error: -19
[ 681.974103] usb 1-1.4.3: cannot create card instance 7
[ 681.974480] snd-usb-audio 1-1.4.3:1.1: cannot find the slot for index -1 (range 0-7), error: -19
[ 681.974502] usb 1-1.4.3: cannot create card instance 7

no matter the 9-th device I connect. Any useful info regarding this issue will be highly appreciated.

Thanks in advance

taskovskig
Posts: 3
Joined: Wed Mar 15, 2017 8:53 am

Re: Maximum number of MIDI USB devices

Thu Mar 16, 2017 2:35 pm

It seems that new kernel will solve the problem. Default Raspbian kernel conf has this line:

Code: Select all

# CONFIG_SND_DYNAMIC_MINORS is not set
Just follow the instructions for kernel building here:
https://www.raspberrypi.org/documentati ... iguring.md
https://www.raspberrypi.org/documentati ... uilding.md
During the configuration, make sure to have this 2 lines in .config (or via menuconfig)

Code: Select all

CONFIG_SND_DYNAMIC_MINORS=y
CONFIG_SND_MAX_CARDS=16
After booting to the new kernel, the maximum number of USB sound devices that can be connected is 15 (there's one default MIDI Through port). You can check this by:

Code: Select all

$ sudo modprobe snd-usb-audio
$ cat /sys/module/snd_usb_audio/parameters/index
-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
Previously, with the old kernel it was:

Code: Select all

$ cat /sys/module/snd_usb_audio/parameters/index
-2,-1,-1,-1,-1,-1,-1,-1
I've built the new kernel, and the Pi3 successfully booted. I'll post the results tonight.

AndyBorek
Posts: 1
Joined: Sun May 12, 2019 10:12 am

Re: Maximum number of MIDI USB devices

Sun May 12, 2019 10:40 am

You saved my life. I could not understand the reason why my n-th midi device is not recognized (where n > 7). Based on your description I successfully rebuilt the kernel and increased the number of cards to 32(!!!) just in case my inventory grows due to severe GAS.

These devices are happily connected at the same time:
  • Novation Circuit
  • AKAI APC 40
  • 2 x Roland UM3G 3IN/3OUT USB Midi Hub
  • 1 x Roland UM1 1IN/1OUT USB Midi
  • Modal CraftSynth
  • Modal CraftRhythm
  • Novation LaunchControl XL
  • Digidesign MBox
Added a midi.conf to /etc/modprobe.d/

Code: Select all

##############################x
# Midi alsa configurations

options snd-seq-dummy ports=32

This one creates 32 Midi Through Port in Alsa. I'll use that as a kind of IAC emulation to create internal Midi buses for future Mididings manipulation.

taskovskig
Posts: 3
Joined: Wed Mar 15, 2017 8:53 am

Re: Maximum number of MIDI USB devices

Sun May 12, 2019 7:13 pm

Glad you managed to solve your problem. Cheers.

Return to “Raspbian”