I am working on an Audio Class 2.0 design and would like to implement Volume and Mute control using the UAC2 Feature Units. I can use the macros to add the Feature Units:
Code: Select all
#define INPUT_VOLUME_CONTROL (1)
#define OUTPUT_VOLUME_CONTROL (1)
#define OUT_VOLUME_IN_MIXER (1)
#define IN_VOLUME_IN_MIXER (1)
I would like Device to Host communication too though, e.g. to allow a hardware volume slider on the device being perfectly ganged to the Host PC slider.
From what I've read, the way to do this is to use interrupts to tell the USB Audio driver to retrieve the state of the Volume/Mute which has changed locally. Right now I'm having trouble with this but am unsure if it is a firmware (xmos) or software (driver) issue.
In usb_buffer.xc, I'm now sending these interrupt messages to XUD_Manager:
Code: Select all
unsigned char g_intData[8] =
{
0, // bInfo: Class-specific, caused by interface
1, // bAttribute: CUR
0, // wValue: CN/ MCN
0, // wValue: CS
0, // wIndex: interface
0, // wIndex: ID of entity causing interrupt - this will get modified;
0, // Spare
0, // Spare
};
USB Audio Class 2.0 Spec - Appendix A.17.7
FU_CONTROL_UNDEFINED 0x00
FU_MUTE_CONTROL 0x01
FU_VOLUME_CONTROL 0x02
but I don't get reliable results. Right now I have a situation where I send interrupt requests every 10 seconds, for the first 2 or 3mins I get no response from the Thesycon Driver. but then I might get responses to 4 or 5 interrupts and then nothing again for a while.
Anyone got any tips for this kind of thing?
I have tried using HID but found that Windows only applies HID to the output playback stream. For me it is important to Mute the microphone and would really like it to be picked up by the PC. Microsoft do imply that their driver will pick up interrupt messages for Volume and Mute on the Feature Units so I'm a bit stumped why nothing's happening.
References:
http://xcore.com/viewtopic.php?f=8&t=6806
https://docs.microsoft.com/en-us/window ... io-drivers
https://developer.apple.com/library/arc ... CH1-TNTAG8