Help in debugging an Audio Server Plugin

I followed apple's demo application to create an audio server plugin named NullAudio. However, since the code is written in C with some COM interfaces, it is hard for a Swift Programmer. So I want to attach XCode to the Null Audio Plugin to take a look at the method calls.

I googled and found the audio server plugin maybe debug in this way:

Note the BGMDevice is another audio server plugin they created.

So I followed, xcode attaches to coreaudiod process.

But any breakpoint in the code just go grey, how can I make the break point active?

Accepted Reply

Those instructions are out of date by several years. In current macOS versions, your ASP runs in its own process. Once you've installed the plugin, you should be able to find its process ID in (e.g.) Activity Monitor, by filtering on the plugin name. Then you should be able to attach directly to that process from Xcode.

  • Thanks Polyphonic, that explains Xcode marks the breakpoints as inactive ones.

Add a Comment

Replies

Those instructions are out of date by several years. In current macOS versions, your ASP runs in its own process. Once you've installed the plugin, you should be able to find its process ID in (e.g.) Activity Monitor, by filtering on the plugin name. Then you should be able to attach directly to that process from Xcode.

  • Thanks Polyphonic, that explains Xcode marks the breakpoints as inactive ones.

Add a Comment

Updated my successful debug setup, hoping to help someone sometime.

With Activity Monitor opened, one important thing to do is toggle the All Process option. Then you will see your target process. The user of this process is _coreaudiod.

Once you get the PID, you can attach it to the process with its PID. No need to kick restart the coreaudiod service.

Hello I also was testing the NullAudio example and could not get XCode to attach to the PID. I found out that I had to disable SIP (system integrity protection) to make it work successfully.