Cinder-PortAudio: PortAudio as an alternative audio backend


#1

Hi all,

I’d like to announce that we have made public cinderblock and new audio backend for ci::audio that wraps PortAudio:

The main motivation for adding PortAudio as a possible backend is to gain support for Windows / Steinberg ASIO drivers, which have a long a much longer history with audio interface vendors over the native Windows WASAPI drivers. Moreover, we have an upcoming project that uses Dante equipment, which only supports ASIO on Windows. As such, we’ve only tested this so far on Windows, but PortAudio supports many other OSes and backends and enabling those would mostly be a matter of setting up the project configuration.

Using Cinder-PortAudio is straightforward: once the cinderblock is setup in your project, you make one call before any other audio calls:


audio::ContextPortAudio::setAsMaster();

There is also a basic sample and TinderBox template included in the repo.

Why isn’t Cinder-PortAudio included in core? The main reason is that when originally writing ci::audio, we chose to use platform specific APIs directly to minimize thirdparty code and remove the extra layers between the user’s application and whatever OS specific audio backend exists. That said, portaudio supports almost all popular OSes and backends out there, so it can be a nice solution if cinder core doesn’t yet provide support for one of those, for example if you need JACK support in linux or ASIO on windows.

Furthermore, while enabling ASIO is straightforward, you still need to personally agree to Steinberg’s licensing agreement and install the sdk into the right location, so we can’t use ASIO as an audio backend by default. For more directions on how to set up ASIO, please see this section of the readme.

Lastly, I also want to send a big thanks to Rare Volume, who helped to fund this development with the aim of providing it to the larger Cinder community.

cheers,
Rich Eakin


#2

Thanks again for this work Rich - ASIO support in particular is really key for Cinder, and has come up in project work for us quite a bit lately in the context of compatibility with Dante networks in particular.

Looking forward to using this.


#3

Where were you 2 years ago? :wink:

Thanks for the hard work, PortAudio seems to cover a lot of bases, which is especially helpful for those of us who suck at audio programming, namely myself.

Cheers,

A.


#4

@lithium.snepo hey I mentioned then that if it were my project then I would take the portaudio route and that’s what I did. :smile:

@petros recently added support for CMake, so now this should be usable on all Posix systems. Thanks Petros! If anyone can test and report back issues or success we’d be grateful.

cheers,
Rich