I am working on a plugin based on the coreaudio user space based on the developer.apple.com/library/mac/samplecode/AudioDriverExamples/Introduction/Intro.html example
In the implementation of the plugin, I plan to receive audio data from another process, i.e. CFMessagePort
However, I received the following error in the console while trying to create the CFMessagePortCreateLocal port ...
sandboxd [251]: ([2597]) coreaudiod (2597) deny mach-register com.mycompnay.audio
I did some googlging and came to this article
QA A QA1811 technical https://developer.apple.com/library/mac/qa/qa1811/_index.html about adding AudioServerPlugIn_MachServices to plist, but still no success.
Is there anything else I need to do to make this work (e.g. adding rights, code sign), or is this not the right approach.? I'm not sure if the MesssagePort mechanism works anymore in the sandbox. Will XPC services work?
Thanks so much for your time. Any help is appreciated
update 1:
I have to create a remote port instead of the local one in the audio plug-in. Having said that, with the AudioServerPlugIn_MachServices attribute in the plist. now there is no sandboxd [559]: ([552]) coreaudiod (552) deny mach-lookup / register message in the console.
However, in my audio hal plugin (client side) I have
CFStringRef port_name = CFSTR("com.mycompany.audio.XPCService"); CFMessagePortRef port = CFMessagePortCreateRemote(kCFAllocatorDefault, port_name); the port returns 0. I tried this in another application and it works fine.
This is my server side:
CFStringRef port_name = CFSTR("com.mycompany.audio.XPCService"); CFMessagePortRef port = CFMessagePortCreateLocal(kCFAllocatorDefault, port_name, &callback, NULL, NULL); CFRunLoopSourceRef runLoopSource = CFMessagePortCreateRunLoopSource(nil, port, 0); CFRunLoopAddSource(CFRunLoopGetCurrent(), runLoopSource, kCFRunLoopCommonModes); CFRunLoopRun();
I received a console message about this.
com.apple.audio.DriverHelper [1314]: a plug-in named SimpleAudioPlugIn.driver requires a sandbox extension for the transfer service named com.mycompnay.audio.XPCService
Does anyone know why ???
update 2
I noticed that when I use debug mode with Coreaudiod, it successfully gets a reference to the mach service object. (the same thing happened when I tried to use the xpc_service method) setting up the project scheme
Is anyone ??