RtAudio or PortAudio, which one to use?

Here's a relevant thread that came up on the Linux audio devel list. The approach I'll take for my new app(s) is to code for jack and do all my debugging in linux+jack and then use RTAudio for the ports I end up releasing.

Salud!

Getting jack sample rate and buffersize with portaudio


I have been locking for the perfect match with that need for a quite long time. For now I prefer

  • port audio:

    • (+) on Windows, supports asio, DirectSound, MME, WASAPI (with header headaches)
    • (+) on Linux, supports ALSA, OSS, Pulse, JACK
    • (+) on Mac, supports Core Audio
    • (+) very active project,and some good gurus are developing it).
    • (+) used by many very successful apps + the C++ is not native but there is a binding that is integrated to the main branch (since last year i think)
    • (+) It's really reliable with libsdnfile (which is great)
    • (-) It's not native c++
    • (-) the projects, configure, integration is pretty annoying
    • (-) working well for multiple platforms (debian, osx, seven : my own experience)
    • (-) much of the documentation sucks and is mostly outdated and contradictory when googling for answers
  • rt audio

    • (+) on Windows, supports asio, DirectSound, WASAPI (as of 10-04-2014)
    • (+) on Linux, supports ALSA, OSS, Pulse, JACK
    • (+) on Mac, supports Core Audio
    • (+) native c++,
    • (+) really easy to get into it
    • (-) not so much active
    • (-) much of the documentation sucks and is mostly outdated and contradictory when googling for answers

other solutions :

  • Qt :

    • (-) heavy, not exactly what i'm looking for
    • (-) real time audio support is recent and not stable
    • (+) easy to use if you use QtCreator (and less if using QtAddon with visual, and less with xcode)
    • (+) midi integrated
  • Juce:

    • java like design
    • heavy, not exactly what i'm looking for
    • simple, and working pretty well (used professional audio)
    • midi integrated, file reading of aiff and wave, and flac

The PortAudio Java bindings are oversimplified. For example, you cannot set exclusive mode or shared mode for device access, which is a shame because it effectively steals 7ms of less latency from you -- especially if you capture microphone input (where usually no shared access is necessary) under Windows 10. If you count in output, you lose out on 14 ms RTT for monitoring your mic/stuff.

RtAudio seems to have WASAPI support now, but I'm not sure if it's better than PortAudio's. But are there Java bindings? Wasn't asked in the question, I know, but still ... :)

Another, rather new project is XtAudio. It exposes exclusive and shared access to devices as different sets of devices to the frontend and in general seems to have a better API support. Don't think it supports MIDI tho.