Go Back   Cockos Incorporated Forums > REAPER Forums > MIDI Hardware, Control Surfaces, and OSC

Reply
 
Thread Tools Display Modes
Old 01-27-2020, 02:25 AM   #81
Jorgen
Human being with feelings
 
Jorgen's Avatar
 
Join Date: Feb 2009
Location: Stockholm, Sweden
Posts: 5,465
Default

Brilliant. Thank you.
Jorgen is offline   Reply With Quote
Old 02-01-2020, 07:22 PM   #82
gaiamuse
Human being with feelings
 
Join Date: Mar 2013
Posts: 14
Default

Hi
I disabled the kontrol m32 keyboard for midiOut in the midi device settings so only the kontrol m32 keyboard is the only device enabled for midiIN - this enabled the track mode in 0.96 version. All the modes work now with a few extended features.
The auto button does not light up so that is disabled so won't be able to toggle between trim & latch mode. However I'm so pleased that the basics plus a few extras work with the m32. Also can update to latest version.

Many thanks for all your work.

cheers
gaiamuse
gaiamuse is offline   Reply With Quote
Old 02-20-2020, 07:40 PM   #83
Locodarwin
Human being with feelings
 
Join Date: Oct 2009
Location: Portland, OR
Posts: 3
Default Very thankful

So I picked up the S49 and installed your little plugin. It works beautifully and really opens this keyboard up for Reaper. Excellent work!
Locodarwin is offline   Reply With Quote
Old 02-22-2020, 05:24 AM   #84
cjewellstudios
Human being with feelings
 
Join Date: Sep 2017
Posts: 998
Default

Sorry if I missed this in the thread or its obvious:

What is the limited functionality of the A series compared to the s mk2 in terms of the features you've added here? All I can see is that the A and M series have "limited functionality.
cjewellstudios is offline   Reply With Quote
Old 02-22-2020, 01:20 PM   #85
brummbear
Human being with feelings
 
brummbear's Avatar
 
Join Date: May 2016
Location: out west
Posts: 301
Default

Aside from the keyboard‘s different hardware capabilities (compare buttons and screens w S series) NI apparently introduced some subtle differences in the MIDI message protocol. As a result the display peak meter calibration may not be spot on ( on S series I calibrated the dB values on the screens to reflect Reaper‘s meters exactly), and changing the volume in 0.1dB / 1dB steps with the 4D encoder may not be working correctly in Mixer View. Also automation and quantize could potentially not be supported in all aspects. Since I do not have an A or M series keyboard I cannot test or adjust the code with these ones.

But all the basics should work incl instance focus.
brummbear is offline   Reply With Quote
Old 02-23-2020, 07:46 AM   #86
cjewellstudios
Human being with feelings
 
Join Date: Sep 2017
Posts: 998
Default

Quote:
Originally Posted by brummbear View Post
Aside from the keyboard‘s different hardware capabilities (compare buttons and screens w S series) NI apparently introduced some subtle differences in the MIDI message protocol. As a result the display peak meter calibration may not be spot on ( on S series I calibrated the dB values on the screens to reflect Reaper‘s meters exactly), and changing the volume in 0.1dB / 1dB steps with the 4D encoder may not be working correctly in Mixer View. Also automation and quantize could potentially not be supported in all aspects. Since I do not have an A or M series keyboard I cannot test or adjust the code with these ones.

But all the basics should work incl instance focus.

Perfect!

Im going to pick up an A49 soon. Thank you.
cjewellstudios is offline   Reply With Quote
Old 03-20-2020, 03:22 PM   #87
terminar
Human being with feelings
 
Join Date: Feb 2020
Posts: 82
Default OSX port

Hi,

for those who wants to use reaKontrol on OSX (like me) - it's possible now.

I made a small "port" this evening, code is available as pull request (https://github.com/brummbrum/reaKontrol/pull/42).
The resulting shared library for Reaper can be found here:

https://stash.reaper.fm/38633/reaper_kontrol.dylib

Bye
Björn

Last edited by terminar; 03-21-2020 at 03:24 AM.
terminar is offline   Reply With Quote
Old 03-23-2020, 09:58 AM   #88
brummbear
Human being with feelings
 
brummbear's Avatar
 
Join Date: May 2016
Location: out west
Posts: 301
Default

Hi Björn,
Very cool - a lot of people have requested this. I currently don’t have much time but will merge it on Github as soon as I find the time to verify that everything remains clean when compiling for Windows.
Thanks!
brummbear is offline   Reply With Quote
Old 03-24-2020, 01:19 PM   #89
terminar
Human being with feelings
 
Join Date: Feb 2020
Posts: 82
Default OSX

You're welcome, if needed I can give further "support/testing" on OSX for reaKontrol.
Regarding the changes - it should work but next time i can also try to compile it on Windows.

Just interested, are there any additional ideas about reaKontrol for the future?
I saw some small possibilities for bugfixes and refactoring (e.g. a more "stable" device detection", code split into a little more readable functions/files - but that's more or less cosmetic style.

That stuff (reaper + reaKontrol + the hardware, I own a S61) really interests me, it can be a great platform. The work jcsteh and you did is awesome!
I wanted to take a look at qKontrol how the images are passed to the displays. And - do you know if it's possible to also get control over the "machine" only controls (scene, pattern, track)? I haven't looked at it in detail yet. Currently I am just tinkering and learning.

I had a _great_ "first" evaluation weekend with Reaper, reaKontrol and the Machine2 software. It completely killed my learning workflow with Ableton live light (because it.... just worked without limitations)..
terminar is offline   Reply With Quote
Old 03-24-2020, 01:41 PM   #90
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
Default

Quote:
Originally Posted by terminar View Post
Just interested, are there any additional ideas about reaKontrol for the future?
Support for MK1 devices
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 03-24-2020, 05:58 PM   #91
alecgargett
Human being with feelings
 
Join Date: Jul 2019
Posts: 12
Default Nektar vs ReaKontrol

Quote:
Originally Posted by EnGee View Post
Thank you so much I have KK M32 and it works great
I notice you use a Nektar P4 too?

Do you have (or does anyone else have) an opinion on whether I should get a Nektar LX61 or a Kontrol A61 and use ReaKontrol?

Pros and cons of each?

I don't use Native Instruments for most things but I do use it sometimes and I could use it more.

I'm also considering the T6 or P6 but they don't seem worth the extra money for me at this stage unless there is something I'm missing.

Edit: I have posted this question as a new thread here: https://forum.cockos.com/showthread.php?t=233261

Last edited by alecgargett; 03-24-2020 at 06:14 PM.
alecgargett is offline   Reply With Quote
Old 03-25-2020, 08:13 PM   #92
brummbear
Human being with feelings
 
brummbear's Avatar
 
Join Date: May 2016
Location: out west
Posts: 301
Default

Quote:
Originally Posted by terminar View Post
Just interested, are there any additional ideas about reaKontrol for the future?
I saw some small possibilities for bugfixes and refactoring (e.g. a more "stable" device detection", code split into a little more readable functions/files - but that's more or less cosmetic style.
As you already mention I have put some smaller ideas / improvements into comments. And yes, some of the coding style is a bit ugly (but it is very efficient in terms of CPU usage)... I have a few additional functions in mind. Just a bit pre-mature and, oh, lack of time.

Quote:
I wanted to take a look at qKontrol how the images are passed to the displays.
Yeah, I looked into this very briefly too. Evaluating/sending HID messages is very tempting indeed! Especially for the currently unused buttons:

Quote:
And - do you know if it's possible to also get control over the "machine" only controls (scene, pattern, track)? I haven't looked at it in detail yet. Currently I am just tinkering and learning.
These are exactly the ones I would be keen on too. Even more than the displays or the light guide. If I have had more time I would have sniffed the USB traffic already w Wireshark to figure out how to control these. The reason why they are high on my wishlist is simple: I would like to tie more Reaper functions to the keyboard but we are running out of available buttons (even with extended Edit mode). Thus, if you have time to tinker around a little I would be interested to understand how we could make these buttons work.

In general my philosophy is to keep things lean and not overload the extension with too much stuff though (also to keep CPU to the absolute minimum). The basics should follow 1:1 NI design intent as per user manual. Also, I would not want the extension to manipulate the MIDI from the other MIDI ports of the keyboard. It is just too easy to break things for users who have developed their habits around the normal MIDI message behavior, JSFX and what not which rely on the unchanged flow of MIDI data between keyboard and DAW / KK-Software. For those who want tons of extras there is DrivenbyMoss which I think is another great extension - just too heavy for my use case.

Quote:
I had a _great_ "first" evaluation weekend with Reaper, reaKontrol and the Machine2 software. It completely killed my learning workflow with Ableton live light (because it.... just worked without limitations)..
I can only agree with that. The KK S-series keyboard + Maschine + ReaKontrol + conversion of all/most of your presets to NKS leads to an incredibly smooth workflow. Regarding Ableton: Add the Playtime Extension from Helgoboss together with a Launchpad to the above setup and you have an even more flexible non linear workflow in my opinion than Ableton incl Push has to offer.
brummbear is offline   Reply With Quote
Old 03-26-2020, 05:10 AM   #93
terminar
Human being with feelings
 
Join Date: Feb 2020
Posts: 82
Default

Quote:
Originally Posted by brummbear View Post
If I have had more time I would have sniffed the USB traffic already w Wireshark to figure out how to control these.
Finished (first shot). I fired up wireshark and maschine 2, started capturing and gave power to my S61. And (that's much more important) i can see the traffic from the S61 with 3 different sources and different protocol stuff (USB,SYSEX,USBHID). I'll take a look tomorrow at the captured data further (and recreate new logs pressing the buttons a specific amount to identify them in the dump). If you'll give me some contact data i can provide you the dump.

Quote:
Originally Posted by brummbear View Post
Thus, if you have time to tinker around a little I would be interested to understand how we could make these buttons work.
Time? No - same problem like you But i'll try.

Quote:
Originally Posted by brummbear View Post
In general my philosophy is to keep things lean and not overload the extension with too much stuff though (also to keep CPU to the absolute minimum). The basics should follow 1:1 NI design intent as per user manual.
Great, my personal interest + requirements are a bit additional, i want to get some workflow like in Maschine 2 + Ableton but with Reaper and the KK (and my APC Key25 and whatever will follow like Maschine MK3 vs. Push2). My general Lua foo is also trained since *some* years and i'll also try to take a further look at the Reascript stuff. It's like Christmas for me currently getting into this.

Quote:
Originally Posted by brummbear View Post
keyboard and DAW / KK-Software. For those who want tons of extras there is DrivenbyMoss which I think is another great extension - just too heavy for my use case.
I know the following is not rational but rather subjective: I tried DrivenbyMoss (and in general i love it) but - i HATE Java. Just kidding, i can live with that but i had some problems configuring DrivenbyMoss.
It was sort of disturbing to deactivate the KK stuff in the Midi devices, configure somewhere in the OSC section, then my KK wasn't found until i searched the manual, provide the "correct" name and so on. I like some sort of "zero touch" and auto configuration if possible. It doesn't work and feel well for me with D4M yet. Then i tried/ported reaKontrol and it just worked. That (and additionally it's C++ code which provides easier way to tinker with it) catched me.

Quote:
Originally Posted by brummbear View Post
Regarding Ableton: Add the Playtime Extension from Helgoboss together with a Launchpad to the above setup and you have an even more flexible non linear workflow in my opinion than Ableton incl Push has to offer.
Hm, tried Playtime and found it "limitating" and irritating - but maybe i have to read more documentation. Regarding "workflow" and where i want to go: I'm currently constructing my first "bedroom producer studio" to do stuff, mainly for myself. I learned really much the last months about the DAW world and about current devices (and due to the situation that Thomann is nearby i also had a look at much devices). I was playing Piano for a long time (and also a long time ago), i heared the Komplete 12 Piano instruments and the other stuff and then tested the S61, that was the kickstart.

In some of the next month i wanted to buy the Push2 with Ableton Suite (currently i am really limited to 8track light version). I really like Ableton and that was my first choice but as the time goes by I'm shattered between some Reaper-Maschine2-Ableton-Push2 decision. The really first productive thing i was "proud of" that got finished last weekend was created with Reaper+reaKontrol+Maschine2 when i realized how Maschine 2 really works (and when i discovered retrigger). I don't like that the patterns can't be played to the end when switching (like with retrigger on scenes) or as with Ableton. BUT - The work with Track-Pattern-Scene in Maschine 2 + Reaper was great and productive. That's why i'm back thinking about Maschine MK3 instead of Push2. BUT - that's out of the scope of this topic.

Yes, in general the "Ableton" stuff can be done e.g. with Super8 (but limited to 8 pads?) and/or Playtime (but also limited regarding hardware device support) in Reaper. And now you know my interest in reaKontrol - try to extend it for the workflow in my head that's not fully there yet.
And yes, music can be made with every software and device but i'm just a little weird and picky - things have to feel right for me, that's the main part of my situation.

Whatever, back to reaKontrol: I'll try to take a look at the dumps the next days. If you are interested, PM about contact information (mail, upload possibility, maybe github?) because I don't think that sharing such "development data" like pcap dumps and logs within this forum topic is the best idea. Some logs/dumps *may* contain hardware, system and personal specific information i don't want to be spread over the internet.
terminar is offline   Reply With Quote
Old 03-30-2020, 02:24 AM   #94
terminar
Human being with feelings
 
Join Date: Feb 2020
Posts: 82
Default Direct USB vs. IPC?

Quote:
Originally Posted by brummbear View Post
Thus, if you have time to tinker around a little I would be interested to understand how we could make these buttons work.
[...cut...]

The basics should follow 1:1 NI design intent as per user manual.
I took a further look at the stuff from two different viewpoints this weekend:
- what happens via USB?
- how is Machine accessing the hardware? (regarding NI design intent)

Accessing the buttons via hardware via USB should be possible but with a constraint: The NI system services (on OSX it's NIHardwareAgent and NIHostIntegrationAgent, should be something like that also on Windows as system service) are using the hardware/the USB exclusively. The services needs to be killed to access via USB. That's also done in qKontrol.
qKontrol also stops the support and integration of the Maschine2 software by killing the service processes.

I found some nice github repository from Sam Lerner who tried to reverse engineer the connection between Maschine2 and his Mikro MK2 (https://github.com/SamL98/NIProtocol), he also wrote an article about it: https://medium.com/@lerner98/rage-ag...e-3357be1abc48

In short: Maschine2 instances are talking to the agent services via IPC and several instances may connect to it. That makes sence because if several instances of Maschine2-VST's are used, they maybe need to connect in parallel to support the "instance control switching" stuff. The HardwareAgent and HostIntegration (not sure yet what the HostIntegration does) services are some abstraction not only for the "Maschine" type of hardware or "Komplete Kontrol" but also for "Traktor".

I tried the stuff from the repository with some modifications but i wasn't able to use it yet. Maybe NI has changed the protocol stuff or this is reverse engineered too tightened to the messages regarding the Maschine Mikro MK2.

My first conclusion:
- it will be much easier to use the stuff via USB directly (but)
- using USB directly will 'kill' the native stuff which is really nice
- The agent provide support for multiple instances (maybe possible: have reaKontrol mimic as Maschine2 instance in parallel to real Maschine2 instances and get full hardware support "natively" via IPC)
- The agents/services exists on windows and linux
- NI seems to use os dependent IPC stuff wrapping their commands on an abstraction layer
- the work from Sam Lerner may be a good start but more complex reverse engineering needs to be done for the KK hardware.

Bye
Björn
terminar is offline   Reply With Quote
Old 03-30-2020, 05:50 PM   #95
brummbear
Human being with feelings
 
brummbear's Avatar
 
Join Date: May 2016
Location: out west
Posts: 301
Default

Interesting stuff!

My thinking (updated after tinkering):
- NIHardwareService (= NIHardwareAgent on OSX): used to communicate via HID and proprietary USB protocols with multiple (older?) HW controller models. SW applications communicate via NIHardwareService with the HW controller.

-NIHostIntegrationAgent: used to communicate via HID and proprietary USB protocols (Flashing, image transfer...) with multiple newer HW controller models (such as KK keyboards Mk1 and 2, Maschine Mk1-3, etc). Exposes OSC and MIDI ports to applications like the Maschine SW (stand alone, VST, AU) and the Komplete Kontrol SW (stand alone, VST, AU). Realizes NI's OSC protocol, the CC based MIDI protocol via the Bome MIDI device "Komplete Kontrol DAW -1" and also the MCU SysEx based MIDI protocol.

To stay compatible with NI's architecture (as explained earlier this is a prerequiste for ReaKontrol) these services have to be running and should not be killed.

=> the best way could be to communicate via OSC for those functions/buttons that are not available via the MIDI CC protocol. I have a hunch that DrivenbyMoss communicated via OSC through NIHostIntegrationAgent (aka "NIHIA") in earlier releases before it shifted course and now uses MIDI too. The older code might be a good starting point how to hook into NIHIA, i.e. which ports and what messages... and that should not interfere with the existing MIDI channel. Both communication paths should be able to coexist happily next to each other in the same extension.

EDIT: Just gave it a quick look. Indeed DBM used to communicate exclusively via OSC with the Mk2 keyboard. From version 4.03 on gradually MIDI was introduced, at some point OSC vanished entirely for the Mk2. Here is a link for the OSC commands, ports etc:
https://github.com/git-moss/DrivenBy...ntrol/osc/mkii

EDIT2: Cockos OSCII-Bot could also come in handy to send/receive/sniff OSC messages. NI's OSC protocol version 1.6 apparently used ports 7577 & 7578 whereas older protocols ports 7575 and 7576. Maybe NI has in the meantime even changed ports again, but that could be simple to find out by simply incrementing the above ports.

EDIT3: Just tried out of curiosity something. Turns out that on Windows NIHardwareService can be killed and does not affect ReaKontrol functionality => NIHostIntegrationAgent (NIHIA) seems to communicate directly with HW (not via NIHardwareService).

EDIT4: My version of NIHIA uses UDP ports 7575 and 7579 (and two dynamically assigned ports, e.g. 51379 and 54894). Constantly sends from those dynamically assigned ports "/scan/ping" to ports 7576 and 7580. Maybe it is waiting for a "/scan/pong" to establish a communication...?

PS: pull request merged, thanks again

Last edited by brummbear; 04-01-2020 at 01:11 AM.
brummbear is offline   Reply With Quote
Old 03-31-2020, 03:17 AM   #96
moss
Human being with feelings
 
moss's Avatar
 
Join Date: Mar 2007
Location: Germany
Posts: 1,539
Default

Quote:
Originally Posted by brummbear View Post
Interesting stuff!

My thinking (updated after tinkering):
- NIHardwareService (= NIHardwareAgent on OSX): used to communicate via HID and proprietary USB protocols with multiple (older?) HW controller models. SW applications communicate via NIHardwareService with the HW controller.

-NIHostIntegrationAgent: used to communicate via HID and proprietary USB protocols (Flashing, image transfer...) with multiple newer HW controller models (such as KK keyboards Mk1 and 2, Maschine Mk1-3, etc). Exposes OSC and MIDI ports to applications like the Maschine SW (stand alone, VST, AU) and the Komplete Kontrol SW (stand alone, VST, AU). Realizes NI's OSC protocol, the CC based MIDI protocol via the Bome MIDI device "Komplete Kontrol DAW -1" and also the MCU SysEx based MIDI protocol.

To stay compatible with NI's architecture (as explained earlier this is a prerequiste for ReaKontrol) these services have to be running and should not be killed.

=> the best way could be to communicate via OSC for those functions/buttons that are not available via the MIDI CC protocol. I have a hunch that DrivenbyMoss communicated via OSC through NIHostIntegrationAgent (aka "NIHIA") in earlier releases before it shifted course and now uses MIDI too. The older code might be a good starting point how to hook into NIHIA, i.e. which ports and what messages... and that should not interfere with the existing MIDI channel. Both communication paths should be able to coexist happily next to each other in the same extension.

EDIT: Just gave it a quick look. Indeed DBM used to communicate exclusively via OSC with the Mk2 keyboard. From version 4.03 on gradually MIDI was introduced, at some point OSC vanished entirely for the Mk2. Here is a link for the OSC commands, ports etc:
https://github.com/git-moss/DrivenBy...ntrol/osc/mkii

EDIT2: Cockos OSCII-Bot could also come in handy to send/receive/sniff OSC messages. NI's OSC protocol version 1.6 apparently used ports 7577 & 7578 whereas older protocols ports 7575 and 7576. Maybe NI has in the meantime even changed ports again, but that could be simple to find out by simply incrementing the above ports.

EDIT3: Just tried out of curiosity something. Turns out that on Windows NIHardwareService can be killed and does not affect ReaKontrol functionality => NIHostIntegrationAgent (NIHIA) seems to communicate directly with HW (not via NIHardwareService).

EDIT4: My version of NIHIA uses UDP ports 7575, 7579, 51379 and 54894. Constantly pings(scans) from port 51379 -> ports 7580 and from port 54894 -> port 7576

PS: pull request merged, thanks again
The OSC protocol is deprecated and therefore might be removed in the future. The switch to MIDI was made since this is available in all hosts.

NIHardwareService: Talks to the totally stupid hardware
NIHostIntegrationAgent: Implements a protocol for the DAW to talk to the hardware via NIHardwareService. Up to my knowledge only used by the Kontrol MkII

I looked into the Usb protocol in the past but gave up on this because if you need to kill the hardware service you will loose all the patch browsing which is the only big benefit you get from using the NI hardware.
moss is online now   Reply With Quote
Old 03-31-2020, 04:51 AM   #97
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
Default

Woah, thanks terminar und brummbear for diving so deeply into this!
Since Machine MK2 is from 2012, is it correct to assume that it is using the same protocol as the MK1 keyboards?
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 03-31-2020, 03:16 PM   #98
terminar
Human being with feelings
 
Join Date: Feb 2020
Posts: 82
Default

Quote:
Originally Posted by brummbear View Post
- NIHardwareService (= NIHardwareAgent on OSX): used to communicate via HID and proprietary USB protocols with multiple (older?) HW controller models. SW applications communicate via NIHardwareService with the HW controller.

EDIT3: Just tried out of curiosity something. Turns out that on Windows NIHardwareService can be killed and does not affect ReaKontrol functionality => NIHostIntegrationAgent (NIHIA) seems to communicate directly with HW (not via NIHardwareService).
That may not be the full answer and may depend on the used hardware. I know from the the NIProtocol article that at least for the Maschine MkII the NIHardwareAgent is taking over the USB HID connection to the Maschine MkII (can anybody test that with an MkIII?). The USB-MIDI can be used by any program in parallel.

The MIDI-USB Connection is a different endpoint (I identified at least 3 or 4 USB endpoints on my K MkII, I have to take a look at my notes). The firmware update doesn‘t seem to be done over the USB-HID or USB-MIDI connection but over the third (or forth) endpoint: USB-DFU.

That USB-HID connection seems only to be used for the specific „maschine“ buttons (and maybe display updates?) we talked about on my MkII (SCENE, PATTERN, TRACK, ...) which can‘t be used via MIDI.

Something to test (will do tomorrow): Use the USB-MIDI with reaper and load „Maschine2“ as VST into Reaper. When my assumption is correct you will be able to use MIDI in Reaper and the SCENE Buttons and stuff within the „Maschine2 VST“ (which should use the IPC connection over NIHardwareAgent + USB-HID). BUT - when you are killing the NIHardwareAgent you shouldn‘t be able to use Maschine2 anymore (SCENE buttons, displays) BUT MIDI within reaper should still work. When i‘m right we just need to create an additional fake connection from reaKontrol to the NIHardwareAgent (additionally to the MIDI) and masquerade reaKontrol as Machine2 instance itself.

On the USB dump test while having Machine2 started I‘ve seen that when I pressed the SCENE button, i saw data on the USB-HID (not the USB-MIDI). Also there was an USB bulk transfer when i first pressed SCENE (and the displays were redrawn) after the two IN data packets. That happens every time when i switched (2 IN data packets, maybe press and release + several OUT messages with bulk data transfer) from SCENE to PATTERN (and TRACKS). Interestingly, if I only pressed SCENE for the first time (2x IN + bulk OUT) and then again pressed SCENE then only the 2x IN messaged appeared (no bulk OUT). But the display also doesn‘t need to be refreshed in this case. As mentioned in one of the last posts i haven‘t looked at the dumps in detail yet but ist may make sence.

Quote:
Originally Posted by moss
NIHardwareService: Talks to the totally stupid hardware
NIHostIntegrationAgent: Implements a protocol for the DAW to talk to the hardware via NIHardwareService. Up to my knowledge only used by the Kontrol MkII
Ah! Then the "Bome ... virtual Komplete DAW - 1" device is created/controlled by the NIHostIntegration? Which maybe talks to NIHardware via IPC? Just thinking loud...
Something new to test - kill the NIHostAgent and check if the DAW -1 device still works.
I am not yet sure how the IPC system works that NI is using between the Machine2 software instances and the Agents but i still think there is a chance to get more „Kontrol“ over the hardware talking to the *Agents via IPC (additionally to the USB-MIDI connections which are just working now).

BTW, a bit offtopic but - I also found references within the NIHardwareAgent for other NI devices (like TRAKTOR). It wouldn't surprise me if the Traktor software also talks to the NIHardware service via IPC for specific stuff.....

Last edited by terminar; 03-31-2020 at 03:41 PM.
terminar is offline   Reply With Quote
Old 03-31-2020, 11:07 PM   #99
brummbear
Human being with feelings
 
brummbear's Avatar
 
Join Date: May 2016
Location: out west
Posts: 301
Default

Tested with a Maschine Mikro Mk2 controller and a KK S88 MK2 keyboard on Windows 10:

Tests with a) Maschine Stand Alone SW, b) Komplete Kontrol Stand Alone SW and c) Reaper hosting both Komplete Kontrol VST and Maschine VST.

Results:

* NIHardwareService: In charge of the entire communication between Maschine Mikro Mk2 controller and Maschine SW (stand alone and VST)

* NIHostIntegrationAgent: In charge of the entire communication between KK S88 MK2 keyboard and Komplete Kontrol SW (stand alone and VST) and Maschine SW (stand alone and VST)

This can easily be tested by killing one or the other service:

* Killing NIHardwareService simply knocks out the Maschine contoller but keeps KK keyboard entirely unaffected (all functions, not just MIDI work fine. That is why ReaKontrol is also not affected).

* Killing NIHostIntegrationAgent simply knocks out the KK keyboard but keeps the Maschine controller entirely unaffected (all functions work fine).

Note: Since the Maschine SW can communicate with both, Maschine Controller and KK keyboard it also communicates via both NIHardwareService and NIHostIntegrationAgent. I.e. if you kill just one of the two services Maschine SW keeps on running fine - only you can use just one of the two controllers.
In contrast, Komplete Kontrol SW only communicates with the KK keyboard and hence only communicates via NIHostIntegrationAgent.

All of the above is confirmed when checking corresponding HW references within the two services:

NIHardwareService:
Audio Kontrol 1
Kore Controller 1
Kore Controller 2
Maschine MK1
Maschine MK2
Maschine MK3
Maschine Jam
Rig Kontrol 2
Rig Kontrol 3
Traktor Kontrol D2
Traktor Kontrol Fl
Traktor Kontrol Z1
Traktor Kontrol Z2
Traktor Kontrol S2
Traktor Kontrol S22 MK2
Traktor Kontrol S22 MK3
Traktor Kontrol S3
Traktor Kontrol S4
Traktor Kontrol S4 MK2
Traktor Kontrol S4 MK3
Traktor Kontrol S5
Traktor Kontrol S8
Traktor Kontrol X1
Traktor Kontrol X1 MK2

NIHostIntegrationAgent:
Komplete Kontrol S series MK1
Komplete Kontrol S series MK2
Komplete Kontrol A series
Komplete Kontrol M series
Maschine MK1
Maschine MK2
Maschine MK3
Maschine Jam

Conclusion:
To figure out how to get control over the missing Maschine specific buttons on the KK keyboard (and later on maybe also displays, lightguide etc) we need to understand how the Maschine SW communicates with NIHostIntegrationAgent.

ToDo:
It is quite probable that NI did not re-invent the wheel and uses the same or very similar IPC communication between the Maschine SW and NIHostIntegrationAgent as already reverse engineered for NIHardwareService (= NIHardwareAgent) by Sam Lerner using HookCase on OSX.
On Windows it appears that the IPC method used could be Winsock (Windows Sockets 2), possibly using the ports mentioned above. But it could also be other ports, as the ones above are or were used for OSC messages.

Last edited by brummbear; 04-01-2020 at 01:13 AM.
brummbear is offline   Reply With Quote
Old 04-01-2020, 12:54 AM   #100
brummbear
Human being with feelings
 
brummbear's Avatar
 
Join Date: May 2016
Location: out west
Posts: 301
Default

Quote:
Originally Posted by moss View Post
The OSC protocol is deprecated and therefore might be removed in the future. The switch to MIDI was made since this is available in all hosts.
Thank you, Jürgen, for chiming in! When you say deprecated:

Do you know if this is true also for host integration with Ableton Live?

The reason why I am asking: I remember that in the early days the host integration with Live was based on OSC and you can still see all the OSC references inside of NIHIA (e.g. by checking out the strings with process explorer or a hex monitor).
brummbear is offline   Reply With Quote
Old 04-01-2020, 03:18 AM   #101
terminar
Human being with feelings
 
Join Date: Feb 2020
Posts: 82
Default ZMQ?

Quote:
Originally Posted by brummbear View Post
Results:

* NIHostIntegrationAgent: In charge of the entire communication between KK S88 MK2 keyboard and Komplete Kontrol SW (stand alone and VST) and Maschine SW (stand alone and VST)
Confirmed. My assumption was wrong. I killed the NIHardwareAgent and it was still possible to use my KKMk2 but killing NIHostAgent totally destroyed the connections.

Quote:
Originally Posted by brummbear View Post
All of the above is confirmed when checking corresponding HW references within the two services:

NIHardwareService:
Maschine MK3
Are You sure? I only found references until Maschine MK2 (and Mikro MK2).
Regarding the namespaces i identified "NI::NHL2::SERVER" which maybe seem to represent the hardware controll side. There are also definitions in "NI::NHL2::<MaschineMK3|MaschineMK2, ....>" but this just seem to be some structs or general information. My "dumps":


NIHardwareAgent:
* NI::NHL2::SERVER::AudioKontrol1
* NI::NHL2::SERVER::FX2Controller
* NI::NHL2::SERVER::FX2ERP
* NI::NHL2::SERVER::FX2Pedal

* NI::NHL2::SERVER::KompleteKontrolMK1
* NI::NHL2::SERVER::KORE
* NI::NHL2::SERVER::Kore1Kontrol
* NI::NHL2::SERVER::Kore2Kontrol

* NI::NHL2::SERVER::MaschineJam
* NI::NHL2::SERVER::MaschineMikroMK1
* NI::NHL2::SERVER::MaschineMikroMK2
* NI::NHL2::SERVER::MaschineMK1
* NI::NHL2::SERVER::MaschineMK2
* NI::NHL2::SERVER::MaschineStudio

* NI::NHL2::SERVER::RigControl2
* NI::NHL2::SERVER::RigControl3

* NI::NHL2::SERVER::TraktorKontrolD2
* NI::NHL2::SERVER::TraktorKontrolF1
* NI::NHL2::SERVER::TraktorKontrolS2 MK1
* NI::NHL2::SERVER::TraktorKontrolS2 MK2
* NI::NHL2::SERVER::TraktorKontrolS2 MK3
* NI::NHL2::SERVER::TraktorKontrolS3
* NI::NHL2::SERVER::TraktorKontrolS4 MK1
* NI::NHL2::SERVER::TraktorKontrolS4 MK2
* NI::NHL2::SERVER::TraktorKontrolS4 MK3
* NI::NHL2::SERVER::TraktorKontrolS5
* NI::NHL2::SERVER::TraktorKontrolX1 MK1
* NI::NHL2::SERVER::TraktorKontrolX1 MK2
* NI::NHL2::SERVER::TraktorKontrolZ1
* NI::NHL2::SERVER::TraktorKontrolZ2

But:
NIHostAgent

* NI::NHL2::SERVER::KompleteKontrolA
* NI::NHL2::SERVER::KompleteKontrolM
* NI::NHL2::SERVER::KompleteKontrolMK1
* NI::NHL2::SERVER::KompleteKontrolMK2

* NI::NHL2::SERVER::MaschineMikroMK3
* NI::NHL2::SERVER::MaschineMK3
* NI::NHL2::SERVER::MaschinePlus

and some other interesting namespace which may cover Jürgens information about the DAW stuff:
* NI::dawcontrol::generic_daw::KKA1M1GenericDAWContr oller
* NI::dawcontrol::logic::KKA1M1LogicController
* NI::dawcontrol::cubase::KKS1Cubase….
* NI::dawcontrol::hw::komplete_kontrol::mk1::Kontrol S_MK1
* NI::dawcontrol::hw::komplete_kontrol::mk1::Kontrol S_MK2
* ...

BTW, what is the "MaschinePlus"??? New device incoming?

Quote:
Originally Posted by brummbear View Post
Conclusion:
To figure out how to get control over the missing Maschine specific buttons on the KK keyboard (and later on maybe also displays, lightguide etc) we need to understand how the Maschine SW communicates with NIHostIntegrationAgent.
Yep!

Quote:
Originally Posted by brummbear View Post

ToDo:
It is quite probable that NI did not re-invent the wheel and uses the same or very similar IPC communication between the Maschine SW and NIHostIntegrationAgent as already reverse engineered for NIHardwareService (= NIHardwareAgent) by Sam Lerner using HookCase on OSX.
Yes, i hope so. I'll try to get HookCase running on my system the next days and tinker with it and then try to debug the NIHostAgent connection. That also explains why the code from Sam doesn't worked that weekend when i tried it. I have also a different hope. I saw references to ZMQ in both Agents on OSX. Maybe this is used by NI cross platform (because ZMQ is) and we can use it. ZMQ is really fast and is a good selection for a message bus system (if they really did it).

Quote:
Originally Posted by brummbear View Post
On Windows it appears that the IPC method used could be Winsock (Windows Sockets 2), possibly using the ports mentioned above. But it could also be other ports, as the ones above are or were used for OSC messages.
Can you isolate if it's maybe ZMQ also on Windows?
Quote (because easier to copy/paste): "ZeroMQ supports common messaging patterns (pub/sub, request/reply, client/server and others) over a variety of transports (TCP, in-process, inter-process, multicast, WebSocket and more), making inter-process messaging as simple as inter-thread messaging. This keeps your code clear, modular and extremely easy to scale."

Maybe really far-fetched hint: in a job offer for a "Senior Software Engineer C++" on linkedin (which isn't available anymore but a cached google search result) they searched for knowledge in: "interacting with HTTP APIs; Network programming (cpprest, zeroMQ); Library development."

Last edited by terminar; 04-01-2020 at 04:34 AM.
terminar is offline   Reply With Quote
Old 04-01-2020, 03:26 AM   #102
terminar
Human being with feelings
 
Join Date: Feb 2020
Posts: 82
Default

Quote:
Originally Posted by brummbear View Post
The reason why I am asking: I remember that in the early days the host integration with Live was based on OSC and you can still see all the OSC references inside of NIHIA (e.g. by checking out the strings with process explorer or a hex monitor).
Hm, just thinking but - now based on MIDI/SysEx?

https://github.com/gluon/AbletonLive...ol_base.py#L23
terminar is offline   Reply With Quote
Old 04-01-2020, 09:18 AM   #103
brummbear
Human being with feelings
 
brummbear's Avatar
 
Join Date: May 2016
Location: out west
Posts: 301
Default

Quote:
Can you isolate if it's maybe ZMQ also on Windows?
Yesterday, when I used netstat to check the ports that Maschine SW is using I indeed found tons of open local socket pairs (those would be worth sniffing w Wireshark and then dissecting to find ZMQ like data structures). Also, the threading of NIHIA shows tons of subthreads (some of them consuming CPU when sending/receiving data). Hence, I believe that ZMQ is a very good guess of yours, smells like it...
brummbear is offline   Reply With Quote
Old 04-01-2020, 03:23 PM   #104
jasondejardin
Human being with feelings
 
Join Date: Sep 2019
Posts: 2
Default

Sorry to just jump into the fray here. I just want to have the ability to have transport control with my S49Mk2 running Reaper 6.04 on OSX 10.15.2. Any easy suggestions would be great! I am not skilled in the more esoteric coding/compiling fields being discussed in this thread so be gentle please. Thanks so much!
jasondejardin is offline   Reply With Quote
Old 04-01-2020, 04:01 PM   #105
brummbear
Human being with feelings
 
brummbear's Avatar
 
Join Date: May 2016
Location: out west
Posts: 301
Default

Quote:
Originally Posted by jasondejardin View Post
Sorry to just jump into the fray here. I just want to have the ability to have transport control with my S49Mk2 running Reaper 6.04 on OSX 10.15.2. Any easy suggestions would be great! I am not skilled in the more esoteric coding/compiling fields being discussed in this thread so be gentle please. Thanks so much!
Two options for OSX users (Windows users can simply follow the information provided in the first post of this thread):

1. Install ReaKontrol (you get transports control plus much more, see manual). OSX version available on Reaper Stash, see https://forum.cockos.com/showpost.ph...9&postcount=87

2. If you want for some reason to deprive yourself of the additional functionality and only have basic transport control you can simply use MCU functionality (comes natively with Reaper and the keyboard). Search this forum or read the Reaper manual how to enable Mackie Control.
brummbear is offline   Reply With Quote
Old 04-02-2020, 01:38 AM   #106
terminar
Human being with feelings
 
Join Date: Feb 2020
Posts: 82
Default

Quote:
Originally Posted by brummbear View Post
1. Install ReaKontrol (you get transports control plus much more, see manual). OSX version available on Reaper Stash, see https://forum.cockos.com/showpost.ph...9&postcount=87
Brummbear, are you interested in additional text and screenshots for the manual regarding the installation on OSX? In general, how do we want to handle the OSX binary stuff? I can support them in my fork of the repository but i think that's too fragmented (?).
terminar is offline   Reply With Quote
Old 04-02-2020, 08:50 AM   #107
brummbear
Human being with feelings
 
brummbear's Avatar
 
Join Date: May 2016
Location: out west
Posts: 301
Default

Quote:
Originally Posted by terminar View Post
Brummbear, are you interested in additional text and screenshots for the manual regarding the installation on OSX?
Sure, I will PM you on this one

Quote:
In general, how do we want to handle the OSX binary stuff? I can support them in my fork of the repository but i think that's too fragmented (?).
Maybe ReaPack is the best way of doing this. For Windows binaries I am already doing this and think it is the most convenient and safest way. Would also allow you to stay in full control of binary releases as I cannot follow up on anything required for Mac OSX versions etc
brummbear is offline   Reply With Quote
Old 04-05-2020, 09:19 AM   #108
Opcode 7
Human being with feelings
 
Join Date: Mar 2017
Posts: 79
Default

I've been trying to get this to work for almost a year, to no avail. I see you released a new version in January, so I tried again. With this update, I am now getting a message saying "Komplete Kontrol Keyboard Detected but failed to connect"

I have a KK-S-88-MK2, latest firmware (0.5.9), latest Komplete Kontrol (2.3.0) --- and my keyboard's smart control and everything works with Ableton Live, and standalone Komplete Kontrol application. Komplete Kontrol VST within REAPER also works.

Do you know how I can troubleshoot this? Of course I've restarted the service already, and my computer, etc. I've been trying for months.
Opcode 7 is offline   Reply With Quote
Old 04-05-2020, 10:22 AM   #109
brummbear
Human being with feelings
 
brummbear's Avatar
 
Join Date: May 2016
Location: out west
Posts: 301
Default

Quote:
Originally Posted by Opcode 7 View Post
I've been trying to get this to work for almost a year, to no avail. I see you released a new version in January, so I tried again. With this update, I am now getting a message saying "Komplete Kontrol Keyboard Detected but failed to connect"

I have a KK-S-88-MK2, latest firmware (0.5.9), latest Komplete Kontrol (2.3.0) --- and my keyboard's smart control and everything works with Ableton Live, and standalone Komplete Kontrol application. Komplete Kontrol VST within REAPER also works.

Do you know how I can troubleshoot this? Of course I've restarted the service already, and my computer, etc. I've been trying for months.
Hmmm, this is hard to figure out from a distance...

What I can tell for sure is that the problem on your PC is that NIHIA does not respond back to ReaKontrol with a handshake message (because that is what triggers the error message you mention above).

These are the steps for troubleshooting (also in latest manual):
1. Start your PC
2. Switch on keyboard
3. Start Reaper, wait until error message pops up
Do NOT quit Reaper, do NOT press Retry
4. Restart NIHIA (via Task Manager or via the script that I published on Github)
5. Now press Retry in the error message Window
6. Wait up to 10s. Keyboard should now connect and you see the small helptext about success above Reaper's transport bar (as per manual).

Did you follow exactly these steps?

If even the above does not help I suspect something else on your PC is using NIHIA in the background and thus inhibits NIHIA to communicate with ReaKontrol. Do you have anything running in the background that would send or receive MIDI data to/from “Komplete Kontrol DAW - 1”? Did you disable “Komplete Kontrol DAW - 1” within Reaper as per manual (this is recommended to avoid accidentally sending e.g. MIDI clock to NIHIA).
brummbear is offline   Reply With Quote
Old 04-05-2020, 11:00 AM   #110
Opcode 7
Human being with feelings
 
Join Date: Mar 2017
Posts: 79
Default

Thanks for the reply!

I got the error message to go away by forcibly reinstalling the NIHostIntegration agent! Restarting over the course of the past year never did anything, even with your instructions =(

I suspected it was outdated because the exe date was from 2018. When I forcibly reinstalled it, now it says from January 2020, so I suspect somehow my old agent was causing issues.

EDIT: Everything's working as expected now. Holy shit! THANK YOU SO MUCH! For taking the time to make this, and respond, etc. If anyone else is running into this issue, where restarting the NIHostIntegration dosn't do anything --- try running the "NI Uninstall RegTool_64bit.exe" utility to remove "NIHostIntegrationAgent", then re-install Komplete Kontrol / Controller Editor, and this did the trick.
Attached Images
File Type: png devices.PNG (39.1 KB, 359 views)
Opcode 7 is offline   Reply With Quote
Old 04-05-2020, 11:32 AM   #111
brummbear
Human being with feelings
 
brummbear's Avatar
 
Join Date: May 2016
Location: out west
Posts: 301
Default

Glad you figured it out. Yes, ReaKontrol does everything that NI is offering for Ableton integration plus a few things more. PS: I use Ableton too but now actually prefer Platime within Reaper over it. Takes a bit of tweaking but leads to a very smooth workflow incl live looping...
brummbear is offline   Reply With Quote
Old 04-05-2020, 02:41 PM   #112
Opcode 7
Human being with feelings
 
Join Date: Mar 2017
Posts: 79
Default

This makes me so happy! I tried looking on the github -- but couldn't find any --- is there any outstanding issues / things you'd like to implement?
Opcode 7 is offline   Reply With Quote
Old 04-07-2020, 09:22 PM   #113
dbrozz
Human being with feelings
 
Join Date: Apr 2014
Posts: 62
Default

Maybe I'm just being dumb but.. I'm having a hard time understanding what this adds for me as a Komplete Kontrol A61 user..

I currently can use the transport controls (play, rec, stop etc) and a few other things on the A61 with the stock firmware in Reaper. I can also obviously use all of the built in functionality with any plugin with the NKS standard compatability.

So I installed the .dll to my UserPlugins folder, somewhat expecting to now be able to automate selected (non Kontrol) tracks using the knobs (for example, knob 1 assigned to volume, knob 2 panning, etc) but did not find that the case.

I also kind of thought the other unlit buttons on the keyboard would have come alive allowing me to use the tempo, undo and quantize buttons etc. Also not the case.

Could someone explain what I'm missing here? I think a quick video from the creator would help a bunch as well if it's not asking too much. Either way though, thanks for your efforts in making Reaper even better!

EDIT: Yeah I am actually having technical issues. After reading some of the other posts, I've got a similar problem. I put the .dll file into the correct UserPlugins folder and booted up Reaper, but had nothing new light up - which indicates to me that something isn't right. I also followed all of the other installation instructions, restarted the NIHIA service and rebooted my computer but.. nothing. Hoping I can get this working. Might try a fresh reset of the entire controller!

EDIT 2: Okay, I've gotten it to work (it's awesome!!) using ReaPack, HOWEVER - it will not initiate upon launching Reaper as described. I have to manually go into Task Manager services and restart the NIHIA each time in order to get things working correctly. This is kind of a pain in the ass.. any suggestions for troubleshooting it and getting it to start up correctly? I'm on Windows 10. Cheers!

Last edited by dbrozz; 04-09-2020 at 12:45 PM.
dbrozz is offline   Reply With Quote
Old 04-07-2020, 10:11 PM   #114
jasondejardin
Human being with feelings
 
Join Date: Sep 2019
Posts: 2
Default

Brummbear, thank you for the response and for the links. I downloaded the file from the original link that terminar had posted but didn't know what to do with file at first. Your relink reminded me that I had to set that straight and figure it out.

https://forum.cockos.com/showpost.ph...9&postcount=87

ReaKontrol for OSX 10.15.2 is working well so far for me. Thanks for the help!
jasondejardin is offline   Reply With Quote
Old 04-09-2020, 12:52 PM   #115
dbrozz
Human being with feelings
 
Join Date: Apr 2014
Posts: 62
Default

Okay, I've gotten it to work (it's awesome!!) using ReaPack, HOWEVER - it will not initiate upon launching Reaper as described. I have to manually go into Task Manager services and restart the NIHIA each time in order to get things working correctly.

This is kind of a pain in the ass.. any suggestions for troubleshooting it and getting it to start up correctly? I'm on Windows 10. Cheers!

EDIT: Now it is actually crashing Reaper when I restart the NIHIA service. So I essentially can not get the functionality now.
Reinstalled Komplete Kontrol, and back to square 1. I can get it working by restarting NIHIA every time I open up Reaper. But it wont kick in on it's own as I understand it is supposed to.

Last edited by dbrozz; 04-09-2020 at 01:58 PM.
dbrozz is offline   Reply With Quote
Old 04-09-2020, 04:33 PM   #116
brummbear
Human being with feelings
 
brummbear's Avatar
 
Join Date: May 2016
Location: out west
Posts: 301
Default

Quote:
Originally Posted by dbrozz View Post
This is kind of a pain in the ass.. any suggestions for troubleshooting it and getting it to start up correctly? I'm on Windows 10. Cheers!
I would try to do a clean re-install of KK drivers (download from NI website) or the whole package incl KK application (via Native Access). NIHIA seems to be flakey for some Windows users, could also be the Bome virtual MIDI driver used by NI. After a clean re-install the issue should be gone.
brummbear is offline   Reply With Quote
Old 04-09-2020, 07:47 PM   #117
dbrozz
Human being with feelings
 
Join Date: Apr 2014
Posts: 62
Default

Quote:
Originally Posted by brummbear View Post
I would try to do a clean re-install of KK drivers (download from NI website) or the whole package incl KK application (via Native Access). NIHIA seems to be flakey for some Windows users, could also be the Bome virtual MIDI driver used by NI. After a clean re-install the issue should be gone.
hey brummbear,

I did a full re-install of Komplete Kontrol via Native Access. No luck!

Like I said, I can get it to work, but only by restarting NIHIA after booting up Reaper.
dbrozz is offline   Reply With Quote
Old 04-09-2020, 10:09 PM   #118
brummbear
Human being with feelings
 
brummbear's Avatar
 
Join Date: May 2016
Location: out west
Posts: 301
Default

Quote:
Originally Posted by dbrozz View Post
Like I said, I can get it to work, but only by restarting NIHIA after booting up Reaper.
Hmmm, that is pretty annoying indeed - sorry to hear that you have this problem.

Two ideas:
1) Maybe there is a similar issue that Opcode 7 encountered on his Windows PC (see posts above). It could be resolved by using NI's uninstall tool "NI Uninstall RegTool_64bit.exe" before re-installing KK (and with it NIHIA). Don't ask me why such a tool would exist in the first place... but apparently NI has seen the need for it.
You may also want to check the Windows Event Viewer -> Windows Log. If you find errors coming from NIHostIntegration Agent that is another indication that the installation is not clean. The NI forum is full of people complaining about NIHIA issues (resulting in the DAW integration not working). The advice seems to be always to uninstall and then re-install. Another advice is to try a different USB port on your computer.

2) Is there anything running on your PC (maybe in the background) that would talk to NIHIA, e.g. send or receive MIDI data to/from “Komplete Kontrol DAW - 1”?

Last edited by brummbear; 04-09-2020 at 11:22 PM.
brummbear is offline   Reply With Quote
Old 04-10-2020, 12:19 PM   #119
dbrozz
Human being with feelings
 
Join Date: Apr 2014
Posts: 62
Default

Quote:
Originally Posted by brummbear View Post
Hmmm, that is pretty annoying indeed - sorry to hear that you have this problem.

Two ideas:
1) Maybe there is a similar issue that Opcode 7 encountered on his Windows PC (see posts above). It could be resolved by using NI's uninstall tool "NI Uninstall RegTool_64bit.exe" before re-installing KK (and with it NIHIA). Don't ask me why such a tool would exist in the first place... but apparently NI has seen the need for it.
You may also want to check the Windows Event Viewer -> Windows Log. If you find errors coming from NIHostIntegration Agent that is another indication that the installation is not clean. The NI forum is full of people complaining about NIHIA issues (resulting in the DAW integration not working). The advice seems to be always to uninstall and then re-install. Another advice is to try a different USB port on your computer.

2) Is there anything running on your PC (maybe in the background) that would talk to NIHIA, e.g. send or receive MIDI data to/from “Komplete Kontrol DAW - 1”?
So for 1) I tried the NI Uninstall RegTool and uninstalled NIHIA, Komplete Kontrol like Opcode 7 recommended. No luck. Reinstalled them and still same scenario. Nothing pops up in the Event Viewer as an error on NIHIA's part.

2) Not that I am aware of. I cant think of what would be interfering.

I do think it's just that for whatever reason, NIHIA jumps on first before ReaKontrol can get it's hold on the keyboard.. A bit frustrated but at least it works when I restart NIHIA
dbrozz is offline   Reply With Quote
Old 04-13-2020, 02:01 PM   #120
terminar
Human being with feelings
 
Join Date: Feb 2020
Posts: 82
Default Connected.

@brummbear some "development" update.

I have found a stable way to connect to the NIHIA on OSX with the mach ports IPC.
Sam did well with the NIProtocol stuff but had some wrong assumptions.
There is no complex handshaking with several tries.
Every hardware device of NI has its own ID (e.g. 0x1610 for KK2). As I thought, some (the newer) devices
are handled by the NIHIA, the other (old) devices are handled by the NIHA.
The protocol/connection stuff is the same (and it seems in General it hasn't changed) since 2012.
Also I tracked down that the Maschine2-SW and KompleteKontrol-SW behave nearly the same.

Of course the detailed commands are different for the devices after the initial connection (due to different features) but I haven't been deeper into this yet.

The protocol is like:
- if not started, start NIHIA and NIHA
- connect to the correct IPC NIHIA/NIHA port for the hardware (hardcoded list)
- send some ping or version request message (optional?)
- request device IPC pair (*request +,*notification) port names
- create dev *notification port.
- send acknowledgement to NIHIA/NIHA with the *notification port

From now on, device changes (serial, on/off messages) will be sent to the dev *notification port.
The first state can (and should) be triggered by some IPC command (maybe state or device request)
which will answer with a serial number and "on" state. If the device is connected or disconnected, there will be a message send automatically.

Next:
If the device is on, a new request/notification name pair can be requested with the serial number catched from the notification port. That is for the control of the specific device (I think display messages, special buttons, ...)
A new notification port needs to be created with the name.

Then 2 pairs should be "connected":
- devicetype (0x1610 request/notification "channels" for join+leave messages
- device (with serial) request/notification "channels"

That's where I am now. I have the "connected" pairs, get device joins/leaves and some messages I haven't looked at yet.

Maybe time for a breakdown.
I think it's possible to do a connection from reaKontrol in C/C++ (my Code is currently in C).

Next thing to check: what is used on windows?
It is possible that the connection handshake is done equal but with a different IPC. Windows doesn't support mach ports but maybe on Windows, the simple Message Pipes are used (zmq seems to be used for something different). It may be reasonable that the data which is transferred via IPC is exactly the same.

I have to install the KompleteKontrol or Maschine2 software on a Windows system and then I'll take a look.

It's getting really interesting.
terminar is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.