This is the code used in this video https://developer.apple.com/videos/play/wwdc2019/702/https://github.com/knightsc/USBApp.git
Post
Replies
Boosts
Views
Activity
The code for the example in the video is available at https://developer.apple.com/videos/play/wwdc2019/702/https://github.com/knightsc/USBApp.git
See https://stackoverflow.com/questions/61545594/how-should-newuserclient-be-implemented?noredirect=1&lq=1
I have the same issue.
I have also seen this on Big Sur 11.3 (20E5172i). Which version are you using?
I have the same issue. Did you make any progress with this?
I am also interested in knowing more about this.
What I have tried so far is
In Process A:
os_workgroup_t wgi = AudioWorkIntervalCreate("myWorkGroup", os_clockid_t::OS_CLOCK_MACH_ABSOLUTE_TIME, nullptr);
if (mach_port_t mp = 0; os_workgroup_copy_port(wgi_, &mp) == 0) {
// mach_port_t is an unsigned int, here I send value of `mp` to process B.
}
In Process B:
// Received value of `mp` from Process A, then...
const auto handle = os_workgroup_create_with_port("hello", mp);
I always get a nullptr in handle.
In the scenario where I am seeing this have multiple programs that are started at the same time, and each of them is calling AudioWorkIntervalCreate. When the deadlock appears I can see multiple programs being stuck with the same stacktrace. If I kill one of them, many of the remaining ones gets out of the deadlock, so I am guessing that this is some kind of deadlock inbetween the multiple apps.
All of the programs use that same name for the workgroup as in:
AudioWorkIntervalCreate("myWorkGroup", os_clockid_t::OS_CLOCK_MACH_ABSOLUTE_TIME, nullptr);
Does this name need to be system wide unique?