USB Audio 2.0: Device to host volume control

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
osch
Member
Posts: 9
Joined: Sun Sep 03, 2017 10:12 pm

USB Audio 2.0: Device to host volume control

Postby osch » Fri Apr 20, 2018 12:24 pm

Hi! I am working on a custom board used for USB audio(reference design 6.15.2).
I want to be able to use the device to control Windows volume using absolute values. I have gotten it to work the other way around with the "OUTPUT_VOLUME_CONTROL" and that works great, but now i want to control it the other way like i said.

Currently i have just tried to hack up something over HID that does a number of increments/decrements based on what volume is chosen on the device,
but this doesnt work too great in all situations, so i would like to be able to send absolute volume levels to the host somehow. We are using USB audio class 2.0 on the custom device.

Does anyone have experience doing this(Or know if it is even possible)? Any help would be appreciated.
User avatar
infiniteimprobability
XCore Legend
Posts: 1031
Joined: Thu May 27, 2010 10:08 am

Postby infiniteimprobability » Mon Apr 23, 2018 2:25 pm

The answer will probably be in the depths of the UAC2 spec but *I think* that what you are asking is not supported. Everything is host-centric and so the host is not expecting or checking the volume for device side changes.
Sure, you could close the loop using HID.. That would make sense.
Possibly implement an interrupt endpoint to notify the host of a change?

Can you describe what you mean by absolute volume? You mean a multipiler (if so what format?) or a dB?
osch
Member
Posts: 9
Joined: Sun Sep 03, 2017 10:12 pm

Postby osch » Tue Apr 24, 2018 11:15 am

infiniteimprobability wrote:The answer will probably be in the depths of the UAC2 spec but *I think* that what you are asking is not supported. Everything is host-centric and so the host is not expecting or checking the volume for device side changes.
Sure, you could close the loop using HID.. That would make sense.
Possibly implement an interrupt endpoint to notify the host of a change?

Can you describe what you mean by absolute volume? You mean a multipiler (if so what format?) or a dB?


I have been looking more into endpoints and usb communications but i found it hard to start with.
Our product has a volume range of 0-100 "%" totally independent of xmos. Xmos just sends raw data via i2s and we do all the volume control further down the line. What i mean by absolute volume is that i want windows to be able to read this volume over USB somehow and adjust the slider in windows (which also shows 0-100) so that the volume on the product and in windows would be the same. I have already modified the Volume range that the xmos communicates with windows so i get the 0-100 values when adjusting the windows slider, but now i am trying to get it to work the other way around.

We had to adjust the MIN and MAX volume in devicedefines.h like this to get the volume from windows to "show up" as the correct values when moving the slider on Windows/Mac.
#ifndef MIN_VOLUME
#define MIN_VOLUME (0x0000)
#endif
#ifndef MAX_VOLUME
#define MAX_VOLUME (0x0064)
#endif

When experimenting with the HID-loop i found that i can probably get it to work like that, so i wont need to send absolute values, it just is a bit more fiddly.

Who is online

Users browsing this forum: No registered users and 6 guests