I'm using USBDriverKit to write an audio driver for a High Speed USB device.
In an attempt to understand the difference between DriverKit Extension and Kernel Extension latencies, I'm dispatching individual isochronous microframes that for this device each account for a duration 125µs, or 6 samples at 48kHz.
I don't yet know what kind of latency I'm actually getting but I was surprised to see a high CPU usage of ~11% on a 512GB M1 mac mini running Big Sur 11.6.
That's 8000 IsochIO() calls and 8000 completion callbacks per second.
Instruments.app tells me that most of my time (60%) is being spent inside mach_msg, as part of a remote procedure call.
Multiple questions occur to me:
- is this normal? should I expect lower CPU usage?
- isn't mach_msg blocking? shouldn't CPU usage be low?
- don't low latency audio folks avoid things like remote procedure calls?
- is seeking low latency throughput with USBDriverKit futile?
- does Monterey's AudioDriverKit enable lower latency, or is it a convenience API?