Playback not reporting sample rates on windows

Discussions about USB Audio on XMOS devices
breadbanana
Member
Posts: 14
Joined: Mon Apr 03, 2023 10:08 pm

Post by breadbanana »

edit: i made a typo on MaximLiadov nickname, corrected.

danielp,
I experimented a bit with the XK-AUDIO-316-MC board using the usbaudio2 driver with WASAPI:

What was your setup, how many in / outs channels? What version of xmos framework you are compiling from?
- since the device was at 44100 by default, I was able to play and record via PortAudio with WASAPI at this rate
yeah, this exactly what happening, and i realized that i cant select anything else than 16bits. so i only have 24bits 44100 and 48000
- playing or recording at any other sample rate (without a menu change) gave an invalid sample rate error
I believe that this is the expected behavior on WASAPI Shared mode
- changing the recording sample rate to something other than 44100 caused the tab containing the sample rate option on the playback device to disappear;
i observe the same behaviour
the device doesn't support separate sample rates for playback and record, so I assume this relates to them needing to be the same rate,
This make sense, as i think selecting differente framerates would cause unexpected behaviour? what would be the right behaviour in this case?
There are a few observations on different systems recorded on this issue: https://github.com/xmos/sw_usb_audio/issues/205
i believe my issue is the same. i'm trying on a window 11 machine and a windows 10 machine, both uptodated. Both machinesexhibit the same behaviour
Is this similar behaviour to what you are seeing?
I believe it is, yes.


MaximLiadov,
I like debugging firmware on Linux because the standard UAC driver logs all problems very detailed. That's why I asked you to run tdd.exe just in case. I am trying to share my experience and help
The tdd report is here: hope it helps anyhow.
I do have a machine here running lubuntu, if you want to know more about my issue, let me know what you need!
I've done a lot of bug fixes, including the descriptor section, and replaced all the old modules with the modern libraries, including USB
Let me see if i got it straight, you had a similar issue and solved by fixing something on the descriptor section? can you talk more about this? what you had done.
And about modern libraries, can you specify which ones?
JFYI, here is a link on how to read logs for Microsoft's USB Audio 2.0 class driver
this one i need to read with a bit more time on hands, looks like very interesting stuff. i will do ASAP

Seeing your screenshot made me quite happy, this means the issue might be solvable.

Can i ask which version of your sw_usb_audio you are working with? how many in/outs your device have?
Last edited by breadbanana on Mon Jan 20, 2025 10:44 pm, edited 1 time in total.
MaximLiadov
XCore Addict
Posts: 179
Joined: Mon Apr 16, 2018 9:14 am

Post by MaximLiadov »

Please do not make typos in my nickname. I'm Maxim, not Maxin.

Concering 32 bit support for your WASAPI application. Adding 32-bit playback/recording to OS settings is pretty simple.

Find and modify these lines in your version of the sample code:

devicedefines.h
STREAM_FORMAT_OUTPUT_1_RESOLUTION_BITS 32 /* change from 16 to 32 */

#define INPUT_FORMAT_COUNT 2 /* change from 1 to 2 */
STREAM_FORMAT_INPUT_1_RESOLUTION_BITS 32 /* change from 24 to 32 */

descriptors.h
.Audio_In_Format_2 =
{
.bLength = 6,
.bDescriptorType = UAC_CS_DESCTYPE_INTERFACE,
.bDescriptorSubtype = UAC_CS_AS_INTERFACE_SUBTYPE_FORMAT_TYPE,
.bFormatType = UAC_FORMAT_TYPE_I,
.bSubslotSize = HS_STREAM_FORMAT_INPUT_2_SUBSLOT_BYTES, /* 1 to 2 */
.bBitResolution = HS_STREAM_FORMAT_INPUT_2_RESOLUTION_BITS, /* 1 to 2 */
},
MaximLiadov
XCore Addict
Posts: 179
Joined: Mon Apr 16, 2018 9:14 am

Post by MaximLiadov »

To debug the firmware on Linux, you can get detailed information in /var/log/kern.log
Just look for "New USB device found, idVendor=..., idProduct=..." and see what's going on.