Giter Club home page Giter Club logo

Comments (16)

drewish avatar drewish commented on August 22, 2024

I don't believe you can open the same port twice

from rtmidi.

DouglasHeriot avatar DouglasHeriot commented on August 22, 2024

This works sometimes on OS X, but other times throws an error in MidiClientCreate.

I think it’s something you just shouldn’t do.

from rtmidi.

 avatar commented on August 22, 2024

Would work if I make two different dlls but the same code. We need to access the same device twice. One for editor and one for when we play game from the editor. The editor version controls audio mixer the other controls game itself?

from rtmidi.

drewish avatar drewish commented on August 22, 2024

I'm sure you could find or write something to serve as a splitter and forward messages from one input to two virtual output ports

from rtmidi.

 avatar commented on August 22, 2024

Hmm.. yes I can find... but how do I know if a specific port has been already opened?

can I check some rtmidi handles ( universal )?

from rtmidi.

drewish avatar drewish commented on August 22, 2024

There's a PR that I haven't gotten to look at yet: #30 You should give it a try and see if it works for your needs. If you do, please leave some feed back on it.

from rtmidi.

 avatar commented on August 22, 2024

Thanks... anyway I tried to make two different dlls with the same code so that I'm sure there are no problems with two processes calling the same function on different thread. BUT even with two different dlls the app simply hangs when opening same ports.

from rtmidi.

 avatar commented on August 22, 2024

On osx it works without any issue :-) even from single bundle I can open more connections to the same port.

from rtmidi.

radarsat1 avatar radarsat1 commented on August 22, 2024

Are you proposing that RtMidi should succeed in this case (which clearly doesn't work, and what would that mean semantically, anyways, to have the same port open twice..) or are you suggesting that it should protect you from doing this to avoid crashes?

from rtmidi.

 avatar commented on August 22, 2024

We are developing in Unity3D. One connection controls editor audio mixer second connection controls in game things. Anyway if I have two apps running with the same dll the later started app simply crashes. Even if I make two different dlls one of the games always crashes. Any idea how to prevent this? On osx no problem. two games both running nicely.

from rtmidi.

 avatar commented on August 22, 2024

First I will try to change polling getMessage to callback function. Then I think of mutex and lock every dll function we call.

from rtmidi.

 avatar commented on August 22, 2024

Here is perfectly working Unity3d Editor, and two compiled apps.
https://www.dropbox.com/s/lipe6um9hj4b2m2/osx.mp4?dl=0

On windows we are unable to achieve this.

Can anyone help with this code?

https://www.dropbox.com/s/u26m35wx5en5mdb/rtmidiplugin.cpp?dl=0

How we should write windows dll so that it does not crashes. ? Mutexes? When polling data or using callback?

from rtmidi.

 avatar commented on August 22, 2024

We are unable to solve this. Two different apps loading the same dll ( the dll resides in each apps path ) so the dll is loaded into each process memory space BUT whenever we are connected in one app to port lets say 0 and we try do the same in the other app the other app simple crashes.

from rtmidi.

garyscavone avatar garyscavone commented on August 22, 2024

The RtMidi code has checks for errors when instantiating. If the underlying system does not report an error in this case (opening the same device twice), then there is nothing we can do about it.

from rtmidi.

midimusic avatar midimusic commented on August 22, 2024

I know this is supposed to be closed, but it is very important on Windows. I have had
a lot of trouble with opening the same midiIn port more than once. The underlying windows
MM functions do not allow it. If a midiIn port is open you cannot open it again even
with another completely separate and different program.

Additionally RtMidi provides an error but then immediately crashes. If you uses the
Windows MM functions directly (without RtMidi) there is an error reported but NO
CRASH.

You CAN open Virtual ports such as loopBe more than once in Windows - so can you use
a virtual port to solve your problem. I use both real and virtual midi ports myself.

David.

from rtmidi.

radarsat1 avatar radarsat1 commented on August 22, 2024

The underlying windows MM functions do not allow it.

Then it is not clear what RtMidi can do about it?

Additionally RtMidi provides an error but then immediately crashes.

Thanks for pointing out the bug! It would be really cool if you could provide a fix ;)

from rtmidi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.