We have code working on Mac OS 10.6 with a kernel mode IOAudio driver that appears as the default audio device. this driver is based on the AudioReflectordriver sample code provided by Apple.
The code works. In this driver, we track each output sample based on the process that generated it. Essentially, when we get an output sample to be sent to the output device, we know the context we are in so we can do a proc_selfpid() in kernel mode to get the PID of the process (and the address space) injecting the packet.
The same code does not work on 10.7. In 10.7, the packets are always injected in the context of coreaudiod irrespective of who the original producer of the sample is. So the proc_selfpid() always points to core audio daemon.
We have been looking at various alternatives to get around this restriction for 10.7.
In particular, I am looking at developing a user mode audio HAL plug-in. I quickly prototyped this using the SampleHardwarePlugIn from Apple, copied it to /Library/Audio/Plug-ins/HAL and saw that it is being loaded in the address space of each process that tries to use it. This is a good sign.
But we want to extend this plug-in to talk to our audio driver and send the samples to the currently existing code in the kernel mode because it has the infrastructure built-in already and we can reuse that without big reengineering.
has anyone reimplemented the SHP plug-in to talk to an audio driver executing in kernel mode?.
We only need this solution for 10.7 because we can reuse our current infrastructure for 10.6 and earlier.
Any suggestions on how this can be done?.
Thx,
Ramakrishna Saripalli
Ramakrishna Saripalli
(The one and only one. May peace be with you)