Apple newbie who needs to create / fix audio driver.

Hi there.

I need to create something like this for Mac:

https://github.com/mattingalls/Soundflower/releases/

Actually, I could use this as is .. but I guess I have to compile using latest Xcode or Swift(??) and I have to fix some bugs. Namely... when you use the audio cable.. I want the input to be mixed from all sources...
The alternative is to write something new from scratching using the project as an example.

There are a few odds against me..lol
I'm new to apple everything. I'm also not an audio person. I also haven't done c++ programming in years.
But I have a strong programming background. I just need some guidance I think to get started / make sure I head down the right path.

I tried to just download the project and compile it as is using Xcode 12... on macOS Catalina 10.15.7
I'm getting a bunch of compile errors. But before I bury myself in trying to get it working, I have the following questions ( in no particular order)

  1. I'm wondering if this is the best approach? Just download and try to load in latest Xcode... see if I can compile and plough through the errors? IOkit - does that need to be downloaded separately to get the latest version? or can I assume my Mac already has it?

  2. should I create a new Xcode "IOKit Driver" project ... and then see if I can add the logic from the Soundflower project bit by bit?

  3. Also I just assumed that to modernise this project I would rebuild / use Xcode. But should I be considering swift?

I am more familiar with Visual Studio ... could that be used instead? Ultimately this code will need to be wrapped ... to make it callable from a nodejs stack. (electron and react apps)


I'm just a little lost right now .. trying to find my bearings. Any tips would be appreciated.



There are a few odds against me

Indeed. I’ll going into the details below but, in summary, your goal is very ambitious and it’s not something you should approach lightly.

Soundflower is a kernel extension, and there are a number of consequences to that:
  • You won’t be able to use Swift. Kernel extensions run within the kernel. This has a very different runtime from normal user space code and does not support Swift. Indeed, it’s possible that it never will because of the next point.

  • Apple is in the process of deprecating kernel extensions for third-party developers. See Deprecated Kernel Extensions and System Extension Alternatives. Audio KEXTs are not currently deprecated but it’s not hard to imagine that happening in the future.

  • Distributing a KEXT to other users requires special permission from Apple. See KEXT Code Signing Problems for more context. If you plan to distribute your software widely — that is, this isn’t just a hobby project — I recommend that you get this permission first because, if your application is rejected, you won’t be able to distribute your software.

  • For bring up and testing you can disable SIP, but that’s not appropriate for wider distribution.

There may be a way to implement similar functionality outside of the kernel. This would require integration with the user space audio subsystem. I can’t advise you on that front because I’m not an expert in that. I’ve changed the tags on your thread to see if we can attract the attention of some audio experts. If not, I recommend that you open a DTS tech support incident and speak to our audio specialist about your requirements.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Apple newbie who needs to create / fix audio driver.
 
 
Q