USB audio device with multiple playback and capture streams

Discussions about USB Audio on XMOS devices
MehdiH
New User
Posts: 2
Joined: Tue Jul 01, 2025 9:32 am

USB audio device with multiple playback and capture streams

Post by MehdiH »

Hi,

I am very new to XMOS development and using one of the sample audio applications in sw_usb_audio-_sw_9_0_0 on XMOS-XK-AUDIO-316 dev-board (running 2AMi8o8xxxxxx binary). Connecting the board to a Linux machine, I am getting 1 USB audio card with 4-in and 4-out channels. Looking at: ‘/proc/asound/card1/’ I can see: pcm0c, pcm0p and stream0. This is as expected.

My aim is to get 4 playback and 4 capture endpoints on the same USB device. For example, if I use ‘aplay -l’, then I should see device 0-3 under the same audio card (e.g. card1 with stream0-3). I just need mono input and a single output on each device.
If I am right, this means the USB device advertises multiple alternate interface settings and separate audio streaming endpoints, which ALSA maps as separate sub-devices.
Searching through the forum I saw this post (by jamesg): 'https://www.xcore.com/viewtopic.php?t=7186' that looks like a similar requirement, but I am not sure if that got anywhere.

I like to know if anyone has tried this, or think this is possible (e.g. by update to xua_config.h) or even supported in lib_xua and if so, how much effort would be needed.

Any help would be greatly appreciated,
Thank you
User avatar
Ross
Verified
XCore Legend
Posts: 1207
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

This is not supported, only one active stream in each direction is supported - i.e. one streaming interface for recording and playback . The interface alternates for each one are used to change the characteristics of those streams (bit depth, channel count etc)
Technical Director @ XMOS. Opinions expressed are my own
MehdiH
New User
Posts: 2
Joined: Tue Jul 01, 2025 9:32 am

Post by MehdiH »

Hi Ross,

Thank you for letting me know.
User avatar
Ross
Verified
XCore Legend
Posts: 1207
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

I’m sure a code could handle it, it’s just not I the default offering.

If you go down the implementation route I would make them all synced to one clock domain - there could be driver implications other wise. A sync mode device would probably be easiest.
Technical Director @ XMOS. Opinions expressed are my own