# WASAPI: Not just for 2 channels anymore

**URL:** <https://forum.juce.com/t/wasapi-not-just-for-2-channels-anymore/6472>\
**Category:** Windows\
**Created:** [February 23, 2011, 7:51pm UTC](https://forum.juce.com/t/wasapi-not-just-for-2-channels-anymore/6472 "2011-02-23T19:51:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheVinn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thevinn/32/806_2.png) [@TheVinn](https://forum.juce.com/u/TheVinn)\
**Post date:** [February 23, 2011, 7:51pm UTC](https://forum.juce.com/t/wasapi-not-just-for-2-channels-anymore/6472/1 "2011-02-23T19:51:20Z")

</div>

Alright upon further investigation I believe that the following is true:

- Under WASAPI, each stereo pair belonging to a hardware device appears as its own audio endpoint
- Juce currently only implements one audio endpoint for output, and one endpoint for input

Therefore

- Juce cannot output more than 2 channels at a time in WASAPI

I poked around the WASAPI calls and traced these values for the first endpoint in my Fireface 400 setup:

GetValue (PKEY\_Device\_FriendlyName,…) == "Speakers (RME Fireface 400)"  
GetValue (PKEY\_Device\_DeviceDesc,…) == “Speakers”

and

GetValue (PKEY\_DeviceInterface\_FriendlyName,…) == “RME Fireface 400”

So here is what I am thinking needs to be done, so far:

1. Change WASAPIAudioIODeviceType to allow for an array of active endpoints for both input and output
2. Modify scanForDevices() to identify unique instances of the PKEY\_DeviceInterface\_FriendlyName and treat the whole set of endpoints as a single device
3. Add code to build a list of input or output channels for a given PKEY\_DeviceInterface\_FriendlyName by enumerating all the endpoints, collecting the ones that match
4. Change the input and output channel names to use PKEY\_Device\_DeviceDesc instead of PKEY\_Device\_FriendlyName

How does this sound Jules?

Is there anyone with knowledge that can chime in and let me know if I’m going in the right direction? I don’t want to waste my time on a dead end because this WASAPI COM interface is really bulky and clumsy to work with…

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 24, 2011, 1:19pm UTC](https://forum.juce.com/t/wasapi-not-just-for-2-channels-anymore/6472/2 "2011-02-24T13:19:37Z")

</div>

Yeah, that does sound like you’re thinking in the right direction. Making it handle multiple in + out devices could be quite a complicated process though, which is probably why I didn’t do it like that originally!

---

<div class="post-metadata">

**Author:** ![otristan](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@otristan](https://forum.juce.com/u/otristan)\
**Post date:** [February 24, 2011, 2:09pm UTC](https://forum.juce.com/t/wasapi-not-just-for-2-channels-anymore/6472/3 "2011-02-24T14:09:00Z")

</div>

I would check PortAudio implementation if I were you.

[http://www.portaudio.com/](http://www.portaudio.com/)

---

<div class="post-metadata">

**Author:** ![TheVinn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thevinn/32/806_2.png) [@TheVinn](https://forum.juce.com/u/TheVinn)\
**Post date:** [February 24, 2011, 2:19pm UTC](https://forum.juce.com/t/wasapi-not-just-for-2-channels-anymore/6472/4 "2011-02-24T14:19:40Z")

</div>

[quote=“otristan”]I would check PortAudio implementation if I were you.

[http://www.portaudio.com/](http://www.portaudio.com/)[/quote]

LOL its funny that you mention that because…the portaudio developers were asking the same question as me, on their mailing list! How the heck to enumerate the channels for a given device in WASAPI? But I’m going to have a look at it, thanks.

---

<div class="post-metadata">

**Author:** ![TheVinn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thevinn/32/806_2.png) [@TheVinn](https://forum.juce.com/u/TheVinn)\
**Post date:** [February 24, 2011, 7:22pm UTC](https://forum.juce.com/t/wasapi-not-just-for-2-channels-anymore/6472/5 "2011-02-24T19:22:01Z")

</div>

DirectSound suffers the same problem, it treats each stereo pair as a different device, so no multichannel output ☹
