{"action":"created","issue":{"url":"https://api.github.com/repos/mcallegari/qlcplus/issues/907","repository_url":"https://api.github.com/repos/mcallegari/qlcplus","labels_url":"https://api.github.com/repos/mcallegari/qlcplus/issues/907/labels{/name}","comments_url":"https://api.github.com/repos/mcallegari/qlcplus/issues/907/comments","events_url":"https://api.github.com/repos/mcallegari/qlcplus/issues/907/events","html_url":"https://github.com/mcallegari/qlcplus/issues/907","id":191156447,"number":907,"title":"[MacOS] Cannot access virtual MIDI ports","user":{"login":"bome","id":771885,"avatar_url":"https://avatars.githubusercontent.com/u/771885?v=3","gravatar_id":"","url":"https://api.github.com/users/bome","html_url":"https://github.com/bome","followers_url":"https://api.github.com/users/bome/followers","following_url":"https://api.github.com/users/bome/following{/other_user}","gists_url":"https://api.github.com/users/bome/gists{/gist_id}","starred_url":"https://api.github.com/users/bome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bome/subscriptions","organizations_url":"https://api.github.com/users/bome/orgs","repos_url":"https://api.github.com/users/bome/repos","events_url":"https://api.github.com/users/bome/events{/privacy}","received_events_url":"https://api.github.com/users/bome/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-11-22T23:49:46Z","updated_at":"2016-11-28T10:26:36Z","closed_at":null,"body":"Hi, users of my software, which allows to create virtual MIDI ports, have reported that QLC+ does not work with those virtual MIDI ports. All other MIDI applications do. Looking at the source code of QLC+, I have found that the MIDI device discovery has a number of problems, causing virtual ports to not be listed:\r\n\r\nlooking at plugins/midi/macx/coremidienumerator.cpp  version 81b9dcd on 16 Dec 2013:\r\n\r\n1) line 105: MidiEnumeratorPrivate::rescan()\r\nThis method iterates Devices, then Entities, then Endpoints (Source/Destination).\r\nHowever, the Apple documentation says:\r\n> Note: If a client iterates through the devices and entities in the system, it will not\r\n> ever visit any virtual sources and destinations created by other clients.  Also, a\r\n> device iteration will return devices which are \"offline\" (were present in the past but\r\n> are not currently present), while iterations through the system's sources and\r\n> destinations will not include the endpoints of offline devices.\r\n> \r\n> Thus clients should usually use MIDIGetNumberOfSources, MIDIGetSource,\r\n> MIDIGetNumberOfDestinations and MIDIGetDestination, rather iterating through devices and\r\n> entities to locate endpoints.\r\n\r\nTherefore, the rescan() method should be changed to iterate the Sources and Destinations.\r\n\r\n2) Dependency on UniqueID\r\nThe rescan() method fails for a MIDI port if its Entity does not provide a UniqueID. After being fixed using the above proposal, the UniqueID should be retrieved from the Endpoint (the source/destination object) if there is no Entity for the Endpoint.\r\n\r\n3) Using model name as MIDI port name\r\nCoreMIDI provides 3 names for a MIDI object: the name, the model, and the DisplayName. Apple  recommends to use the DisplayName for display to the user (using kMIDIPropertyDisplayName). Only if the DisplayName is not available (e.g. OS X 10.4 or earlier), use the Model. It might be worthwhile to display the Name + Model -- unless the Model already contains the Name. Note that with the fix from 1) above, you should get the DisplayName/Model/Name from the Endpoint and not the Entity.\r\n\r\nI can provide more info if needed. Thanks for considering."},"comment":{"url":"https://api.github.com/repos/mcallegari/qlcplus/issues/comments/263235665","html_url":"https://github.com/mcallegari/qlcplus/issues/907#issuecomment-263235665","issue_url":"https://api.github.com/repos/mcallegari/qlcplus/issues/907","id":263235665,"user":{"login":"bome","id":771885,"avatar_url":"https://avatars.githubusercontent.com/u/771885?v=3","gravatar_id":"","url":"https://api.github.com/users/bome","html_url":"https://github.com/bome","followers_url":"https://api.github.com/users/bome/followers","following_url":"https://api.github.com/users/bome/following{/other_user}","gists_url":"https://api.github.com/users/bome/gists{/gist_id}","starred_url":"https://api.github.com/users/bome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bome/subscriptions","organizations_url":"https://api.github.com/users/bome/orgs","repos_url":"https://api.github.com/users/bome/repos","events_url":"https://api.github.com/users/bome/events{/privacy}","received_events_url":"https://api.github.com/users/bome/received_events","type":"User","site_admin":false},"created_at":"2016-11-28T10:26:36Z","updated_at":"2016-11-28T10:26:36Z","body":"Thanks!\r\nSeparate endpoints for IN and for OUT are expected.\r\nIt would surprise me if the order of gathering the endpoint list makes a difference for hotplugging. In my code, device scan is performed 200ms after the OS hotplug event from the OS, and then after 7 seconds again (to be sure).\r\n\r\nI cannot easily try the binary, but I'd like to review coremidienumerator.cpp if you can post your modified version (or point to your cloned repository)?\r\n"}}
{"actor":{"display_login":"bome"}}