Comments (16)
I don't believe you can open the same port twice
from rtmidi.
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.
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.
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.
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.
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.
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.
On osx it works without any issue :-) even from single bundle I can open more connections to the same port.
from rtmidi.
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.
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.
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.
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.
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.
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.
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.
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)
- Need help on the RtMidi library implementation in Visual Studio Code HOT 1
- Question: how do I add WEB_MIDI_API to my cmake subfolder file?
- RtMidi cannot create ports past a certain limit HOT 10
- iOS status and how-to HOT 4
- Central List of Wrapper Libraries / Projects Using RtMidi?
- Does rtmidi support midi 2.0? HOT 16
- How to detect, that a MIDI-IN is already used by another app? HOT 4
- Compilation error HOT 1
- Checksum change for rtmidi-6.0.0.tar.gz HOT 2
- rtmidi doesn't find jack in a non standard path. (Or the default pipewire path)
- Note On with velocity 0 is sent as Note Off on macOS HOT 9
- Has the uploaded release been changed intentionally? HOT 1
- MidiInWinMM :: closePort might return without calling LeaveCriticalSection HOT 2
- Cmake version requirement
- Can't send over RTMIDI_API_WINDOWS_MM HOT 2
- Needs Better Install Tutorial HOT 3
- configure: error: No known system type found for MIDI support!
- are Virtual Ports supported under Windows HOT 4
- midiOutUnprepareHeader intermittently hangs on Windows during repeated large sysex sends HOT 1
- Different MIDI device names on different platforms HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rtmidi.