Slight PortAudio disappointment

It disappointingly looks like the PortAudio library does not support opening a free range of audio channels from the audio hardware. I bumped into this issue as I was about to look into making HourGlass support outputting its audio to user selectable channels. It’s only possible to tell PortAudio to open for example 4 channels of output and those will be the 4 first outputs of the hardware. It’s not possible to ask it to open 2 outputs that would end up  at, say, the outputs 5 and 6 of the hardware. This might have been a reasonable design choice in PortAudio as for example multiclient ASIO isn’t to my knowledge a common feature in audio interfaces. It seems however my hardware would support this (so that for example I can make Cockos Reaper output into the ASIO channels 3/4 and HourGlass into the ASIO channels 1/2), but there isn’t much flexibility in PortAudio to deal with this. At the moment I am unfortunately stuck with PortAudio to handle the I/O with the audio hardwares as making my own implementations for ASIO, MME, WASAPI and CoreAudio would be too much error prone work. But perhaps in the future PortAudio is changed to support this use scenario better or I will bother to deal with the operating system audio services with my own code…

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

3 Responses to Slight PortAudio disappointment

  1. If you want to open up outputs 5 and 6, just open up channels 0-6 and send silence to the first 4. That’s how Mixxx does it with PortAudio. (It’s worth downloading it and seeing how much channel routing it can do, all with PortAudio.)

    Definitely bring the issue up on the PortAudio mailing list though if you’ve got a problem with it. The developers are pretty good at explaining why things are the way they are and when they’re wrong, they listen.

    • xenakios says:

      Yes, I thought about the solution of opening many channels and sending silence to some of them. Unfortunately I think this would in most cases reserve those channels completely, negating the original purpose of having more flexible multiclient usage of the audio hardware. (It happens at least with my EMU card under ASIO usage. It supports multiple applications using ASIO but only so that each application uses dedicated ASIO channels.) Thanks for the suggestions!

      • Hmmm, OK, good to know. I guess we didn’t run into this issue with Mixxx because you’re usually not multi-tasking when you’re DJing (or at least you’re not supposed to be). 🙂

        If WASAPI (through PortAudio) is an option for you, there’s a way you can turn on and off exclusive mode with that. I don’t know if it’s per-channel exclusivity or per-device exclusivity or what, but just throwing it out there as another option.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s