tillt/KompleteSynthesia

USB Error: (iokit/common) exclusive access and device already open

apexJCL opened this issue · 14 comments

System information:

  • macOS Ventura v13.0.1
  • Apple M1 Pro

Screenshot 2023-02-04 at 12 14 48

I get this error whenever I try to launch the application after the setup screens.
I've tried removing the app but to no avail.

Any clues/suggestions?

tillt commented

Are you running the latest version of Komplete Synthesia (v0.50 release)?

Assuming you are. Before starting KompleteSynthesia.app, please run the following in your terminal:

ps aux |grep NIHardware

ps aux |grep NIHost

ps aux |grep NTK

Then start KompleteSynthesia, try the same three steps again after having started KompleteSynthesia.
Let me know what you saw.

Right now I am assuming some Native Instruments service was still blocking the access to the USB interface, needed for transferring image data to those screens. KompleteSynthesia tries to identify those services when starting and tries to kill them before accessing the USB device. Maybe that fails for you somehow.

tillt commented

I did in fact already find at least one bug in the relevant code by now - namely the NTKDaemon would not be treated correctly. Is it by any chance that one that is running on your machine and blocks access?

ps aux |grep NIHardware

ps aux |grep NIHost

ps aux |grep NTK

Please let me know what those commands did when run in your Terminal.app.

It seems there's both NIHardware and NIHostIntegrationAgent processes running in the background:

➜  ~ ps aux |grep NIHardware

ps aux |grep NIHost

ps aux |grep NTK

carlos             636   0.0  0.1 409942544  22240   ??  S    Sat11AM   0:05.60 /Library/Application Support/Native Instruments/Hardware/NIHardwareAgent.app/Contents/MacOS/NIHardwareAgent
carlos           36039   0.0  0.0 408626880   1296 s000  S+    7:40AM   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox NIHardware
carlos             632   0.0  0.2 409946528  29136   ??  S    Sat11AM   0:56.89 /Library/Application Support/Native Instruments/Hardware/NIHostIntegrationAgent.app/Contents/MacOS/NIHostIntegrationAgent
carlos           36041   0.0  0.0 408626880   1296 s000  S+    7:40AM   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox NIHost
carlos           36043   0.0  0.0 408626880   1296 s000  S+    7:40AM   0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox NTK
tillt commented

Those are the problem - if you killed them manually

killall -9 NIHardwareAgent
killall -9 NIHostIntegrationAgent

then restart KompleteSynthesia -> it should be better now.

Now question is why they dont get killed by KompleteSynthesia as intended? Guess I need to do some more research...

And don't worry - killing them won't be an issue. You can either manually restart them after KompleteSynthesia was terminated, or you can just relog into your macOS user, that'll restart them as well.

For restarting them manually, run the following in your terminal:

open "/Library/Application Support/Native Instruments/Hardware/NIHostIntegrationAgent.app"
open "/Library/Application Support/Native Instruments/Hardware/NIHardwareAgent.app"

The idea was the KompleteSynthesia does exactly that.

on startup:

  • identify if any of those three processes was running
  • kill all of them

on shutdown:

  • restart those that ran when starting

In any case, thanks for letting me know about that problem, Jose - I will fix that issue, it just may take a few attempts and a bit of patience. Would be great if I found a way to reproduce it....

tillt commented

Also, please give 0.51 a try - some changes in there that might do the trick for you - without manual intervention.

I had to manually kill both processes but after doing so, it worked!

Thanks for the quick response ❤️

tillt commented

Glad that worked.

With 0.51, when starting without doing anything extra, what happens? I wonder if that process killing and waiting for it to be truly gone was doing the job now or not.

Thanks again for your help in getting this problem solved!

It is not waiting for the process to be killed, it just throws the same error as before.

I'm not too familiar with Objective-C so I can't help (for now).

tillt commented

Really, the same error?
So it says "exclusive access..." blah --- it does NOT say "Failed to terminate ..."?

Screen.Recording.2023-02-07.at.7.56.21.mp4
tillt commented

oh wow - that is very helpful indeed - I had not considered it behaving like that. We are onto something....

tillt commented

@apexJCL please give 0.52 a shot - I may have identified the problem...

Just tested and everything seems to be working just fine (both at open and closing the app).

Excellent work, highly appreciated 🙏🏼