# Limit on number of ALSA midi devices is causing problems

**URL:** <https://in-thread.sonic-pi.net/t/limit-on-number-of-alsa-midi-devices-is-causing-problems/5294>\
**Category:** Development \[obsolete\]\
**Created:** [March 23, 2021, 2:01pm UTC](https://in-thread.sonic-pi.net/t/limit-on-number-of-alsa-midi-devices-is-causing-problems/5294 "2021-03-23T14:01:47Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![BN1701](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@BN1701](https://in-thread.sonic-pi.net/u/BN1701)\
**Post date:** [March 25, 2021, 6:14pm UTC](https://in-thread.sonic-pi.net/t/limit-on-number-of-alsa-midi-devices-is-causing-problems/5294/9 "2021-03-25T18:14:43Z")

</div>

> [@soxsa](#):
>
> Yes, with the midi ordering thing, I’ve seen that on Windows too with VCV Rack. But in contrast, the midi device lists in Reaper DON’T rely on a number. Maybe there’s a wildcard mechanism, like within SPi itself when syncing off midi cues.

I’m a Reaper fan, too. I use it primarily on Windows, but out of interest just checked with it on Ubuntu and there are no midi device identifiers of any kind to be seen. It just lists Midi Input 1, 2, 3 … 62. (And that machine only has one device attached at the moment.) It’s obviously a work in progress and I don’t really trust it.

Of course, on Windows device identification is much more usable but I do have a vague memory of having to disable and reenable existing devices after adding other kit, presumably because the underlying USB IDs had moved. Checking all this out would be another rabbit hole, please don’t tempt me … ☹

> [@soxsa](#):
>
> Last thing - I lost track of the original story about your midi timing problems. Was that also caused by having lots of midi devices? As I mentioned, I’ve not had these problems but my usb-midi-hub has only 4 ports.

Broadly speaking, yes. There’s a timing loop in the Erlang code which fires every five seconds checking for new devices attached and this coincided with the glitches. The volume of data it retrieves from sp\_midi seemed to be the root of the problem. My final post in that [thread](https://in-thread.sonic-pi.net/t/how-to-diagnose-midi-timing-problems/5147/15) has the details. A couple of members of the core team posted to say they had picked up the problem and I’m happy to wait and see what they come up with. In the mean time I’ve turned off that bit of code, too, as I’m not changing my hardware and I have all the relevant identifiers in a text file. The rest of SPi’s midi sequencing doesn’t seem any the worse for this.

---

_[View the full topic](https://in-thread.sonic-pi.net/t/limit-on-number-of-alsa-midi-devices-is-causing-problems/5294)._
