How to use macOS audio work groups with an AudioServerPlugin

65 views Asked by At

I have a USB driver for a soundcard that is built using DriverKit and a AudioServerPlugin that enables macOS to use the soundcard for audio input and output.

The AudioServerPlugin works fine using Apple Silicon, except when using a computer with a M1 Max or M1 Pro processor, when there are audible click and pops. My suspicion is that this is related to thread priority.

The driver completes OSAction objects to signal to the AudioServerPlugin that some buffer is ready to be consumed by the AudioServerPlugin. The OSAction objects are queued up by the AudioServerPlugin using IOConnectCallAsyncMethod. The AudioServerPlugin has a thread that consumes the completed event and then reads from the completed buffer, and then writes the audio data to buffers that are available to Core Audio.

I have read up on audio work groups. I wonder if I should implement something related to this, and how to do that.

Most examples around this is when a program reads or writes to a device. One can for example query the work group of a device with kAudioDevicePropertyIOThreadOSWorkgroup. I've added this property to the AudioServerPlugin, but I can't see that anyone is asking for it. Should Core Audio ask for it, or is that only a property that is asked by user apps?

0

There are 0 answers