Multiclient Midi driver in 64Bit

Hi,

 

I finally started beta testing of my plugin and it seems to work well so far except one issue:

One beta tester told me that he receives an error message from my plugin that a Midi device cannot

be opened because it might be in use.

I am accessing Midi devices directly in my plugin and I just check the return value when opening

a device for nullptr. If so, the device has failed to open and I throw such a message.

But a multiclient driver should allow to open Midi devices twice on Windows and it does this properly

in the 32Bit version of my plugin.

So what to do here? I don't have a multiclient device to test :-) Is there a way of getting more meaningful

information from the driver about the issue, like an error code? Have some of you guys had a similar problem and

how did you fix that.

 

Any help is much appreciated!

Joerg

Mmh, nobody has similar effect?

My beta tester just mentioned that it works pretty well when in standalone so is there

anything different in accessing Midi devices directly between standalone and plugin in 64Bit?

Let the host manage the midi devices when you're not standalone and get the midi input from a midi track in the host

 

Rail

Well, unfortunately not that easy. I have to use Midi devices directly because I am sending and receiving

SysEx messages and most of the host don't support this.

 

Joerg

Sysex isn’t usually enabled by default, but the hosts do usually have Sysex support… you just need to enable it or jump through hoops…

Hosts that I have that support Sysex:

Pro Tools (enable Sysex in the MIDI Filter, off by default)
Cubase 7
Sonar

Rail

Yes I know but that doesn't necessarily mean that they pass them to a plugin or receive

it from a plugin. And even if that would work, there is just a little chance that they handle long SysEx messages (bulk dumps) properly.

Finally a few hosts would be suitable but not the one I also target, Ableton as example.  

 

Thanks anyway!

Joerg

What is the device your tester is using?

Did you try to contact the manufacturer?

Its an  ESI M8U XL (with installed ESI drivers for multi-client support).

I haven't contacted the manufacturer yet because everything works well if my app runs

standalone. Then there is no problem in opening same Midi port twice (Sharing). It only

happens if my app runs as plugin. Host is Cubase 64Bit.

 

Thanks

Joerg

 

Well, this may be because your plugin is in the same process with the host, so it basically is NOT an other client. Your plugin attempting to open a device may conflict with the host already having that device open.

That sounds reasonable and it would explain the issue. I'll ask my tester to try the same thing with an other plugin

to confirm this.

 

Thank you very much!

Joerg

That's not true.

As long as you are trying to open manually the device you are considered as another client.

Hi ke20,

 

is this an assumption or do you have multi-client driver running where you can test?

As long as you are trying to open manually the device you are considered as another client.

I may be wrong, but for a (third party) MIDI driver, it would be a very sophisticated feature to distinguish mutliple (sub)clients within the same client process. I could not test, so I may have missed something.

I might be wrong but at least this is the case with the system drivers:

- on Windows (which does not have a multiclient driver) you can not open a device as soon as it has been opened by the DAW, no matter if you are a standalone application or a plugin inside the DAW.

- on Mac OS  (which does not have a multiclient driver)  you can open a device even if it has been opened by the DAW, no matter if you are a standalone application or a plugin inside the DAW.

Finally, the beta tester came back reporting about same issue with other plugins,

not created with juce.

I did test with loopMidi, a virtual Midi cable which is multi-client capable, w/o

any problem. I know this might be handled differently but I will leave this topic

for now.

Thanks,

Joerg