number of MIDI devices appears limited to 16 - how to raise?

Questions about Wine on Linux
Locked
GoaSkin
Newbie
Newbie
Posts: 3
Joined: Tue Jun 19, 2012 3:22 pm

number of MIDI devices appears limited to 16 - how to raise?

Post by GoaSkin »

Hello,

I want to use some Windows music production applications via WINE under Linux including the standalone synthesizers that come with Native Instruments Komplete (Absynth, FM8, Massive etc.).

All the software runs well using the latest staging version from the WINE repositories but in the MIDI properties of the programs, there always appear only the first 16 MIDI ports which are listed if you run 'aconnect -l' on the shell. In my case, the 16 ports you can choose in the WINE applications are the MIDI though port and the first 15 channels of my iConnectivity MIO10 multiport MIDI interface. Neither the 16th port of the MIO10 is selectable, nor my master keyboard and all my synthesizers which are directly connected via USB. When I turn off the MIO 10, some of the other devices appear with the remaining restriction of 16 ports.

Is there a way to to configure WINE to report more than 16 MIDI devices to the application or is it required to patch and recompile WINE for that?
GoaSkin
Newbie
Newbie
Posts: 3
Joined: Tue Jun 19, 2012 3:22 pm

Re: number of MIDI devices appears limited to 16 - how to raise?

Post by GoaSkin »

I dived a little bit into the WINE source and found out that the WINE midi mapper seems to be restricted to 16 midi ports.

In the file midimap.c, a MIDI port array is defined with a length of 16.

Code: Select all


typedef struct tagMIDIMAPDATA
 {
 struct tagMIDIMAPDATA*      self;
 MIDIOUTPORT*        ChannelMap[16];
 MIDIOPENDESC        midiDesc;
 WORD                wCbFlags;
 } MIDIMAPDATA;
In continuation, there are various for-loops that also assume 16 entries in the array. Each MIDI port can handle 16 MIDI channels but the maximum numbers of MIDI ports isn't 16.
dreamer
Newbie
Newbie
Posts: 4
Joined: Thu Jul 23, 2020 4:41 am

Re: number of MIDI devices appears limited to 16 - how to raise?

Post by dreamer »

And I thought I was the only one. This is something I run it to regularly as well.

Sounds like a bug to me. Somebody probably thought "oh nobody will ever have more than 16 ports", but since many devices expose more than 1 port (one of my interfaces has 8 i/o) you very quickly can run out.

It's an arbitrary limitation and someone should make a bug-report about this ;)
(I may do this later if I can't find one)
dreamer
Newbie
Newbie
Posts: 4
Joined: Thu Jul 23, 2020 4:41 am

Re: number of MIDI devices appears limited to 16 - how to raise?

Post by dreamer »

Finally got off my ass and posted: https://bugs.winehq.org/show_bug.cgi?id=50703

(this kind of shows how often I need wine to do anything with midi, but it's annoying every single time ..)
droopy
Level 1
Level 1
Posts: 7
Joined: Thu Apr 01, 2021 1:07 pm

Re: number of MIDI devices appears limited to 16 - how to raise?

Post by droopy »

16 Ports are quite a lot since each port can have up to 16 channels to send and recive data on.

The reason for 16 ports are I would guess the intention to follow the midi standard. f*cking up a standard are never a good thing. Usually it is enough with 3-4 ports and the use the channels to separate the data sent/recived.

You can have 6-7 instruments on the same port as long as they have separate channels.

In Midi 2.0 there are even more space then the midi 1.0 offer.

So 16 ports are most surely NOT a bug but a way to implement the midi standard.
Locked