We are developing a custom audio driver for a USB microphone in order to do simple processing (EQs) on the input audio stream (comparable to an APO for Windows). Our code is based on the SimpleAudioDriver example from Apple and we finally managed to override the original driver with ours (thanks again). But the I/O buffers are not streamed from/to our hardware device. In the SimpleAudioDevice.cpp file, we tried to debug the "input_buffer" (from the default example) :
auto input_buffer = reinterpret_cast<int16_t*>(ivars->m_input_memory_map->GetAddress() + ivars->m_input_memory_map->GetOffset());
And our guess is that as our device is now assign with our driver, this buffer should be filled with the audio data from our microphone but it's not. And we have the same behaviour with the output_buffer, we filled it with the default sine generator and we don't get any audio outputted on the audio device our driver is assigned to.
The documentation says that the
AudioDriverKit maps the memory of these streams to the Core Audio HAL. In an actual hardware driver, this memory needs to be the same I/O memory the system uses for DMA to hardware.
But then no more details are given. How to access this "I/O memory" and use it to process our hardware input/output stream ?
If you have any hints, please get back to us.
Thanks.