On Apr 19, 2010, at 4:39 PM, Paul Sanders wrote: Are you sure you're not reinventing the wheel? Jack can route both to output devices and from input devices. SoundFlower can route to output devices but not (AFAICS) from input devices. As a first step, I would download both of them to see what they can do. If you need to handle input devices and want to do it at the kernel level, a way forward might be to extend SoundFlower, if you are prepared to conform to GPL.
Paul Sanders.
Thanks for the response Paul.
As far as I could tell from the Soundflower/Soundflowerbed source, it sets SoundflowerDevice as the input, and sets the output to what the user specified. An application must still have SoundflowerDevice set as output device somewhere in order to route this.
So basically the chain of this setup goes:
Application[out] ------> [in]SoundFlowerDevice[out] -------> Output Device
where at this point, the input and output are already connected, so I wouldn't be able to set SoundflowerDevice as the output from the same program. And what I need is this:
Input Device --------> [in]MyDevice ---------> [in] \ <> <> Application Output Device <----- MyDevice[out] <--------[out] /
where the application only speaks to my device driver. JackOSX implements a CoreAudio user-space driver to do what it does, and for good reasons, mine must be a kernel driver, and CoreAudio API isn't available in the kernel, it seems. So I thought this could be implemented in the clipOutputSamples() or convertInputSamples() methods of IOAudioEngine by copying from one device buffer straight across. But I don't know how to get access to the other device buffer, and I'm not too sure that it works that way anyway. My other thought was to use an IOAudioPort to create a connection between the other device and my device, but theres not really sufficient documentation on IOAudioPort for me to guess how to implement that or if that's the right train of thought. I also noticed the open() method on an IOService object, and thought maybe I could do something with that, but I'm just not sure.
All of this is just supposition. I am not 100% sure on anything I've written here except the diagram for my device.
Thanks, John |