Volume control via HID

Discussions about USB Audio on XMOS devices
Post Reply
User avatar
pangdi
Member
Posts: 10
Joined: Tue Nov 15, 2022 9:58 am

Volume control via HID

Post by pangdi »

How can I use the button control windows system's volume ?
Last edited by pangdi on Tue Nov 22, 2022 9:08 am, edited 1 time in total.


User avatar
Ross
XCore Expert
Posts: 962
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

This should be as easy as setting HID_CONTROLS to 1 and then coding in the buttons to set the correct bits of the HID report
User avatar
pangdi
Member
Posts: 10
Joined: Tue Nov 15, 2022 9:58 am

Post by pangdi »

Thanks Ross! I will try.
User avatar
pangdi
Member
Posts: 10
Joined: Tue Nov 15, 2022 9:58 am

Post by pangdi »

Ross wrote: Wed Nov 16, 2022 12:24 pm This should be as easy as setting HID_CONTROLS to 1 and then coding in the buttons to set the correct bits of the HID report
All things are ready. But it have no effect.
Attachments
Snipaste_2022-11-18_19-45-35.jpg
Snipaste_2022-11-18_19-45-35.jpg (23.76 KiB) Viewed 4095 times
Snipaste_2022-11-18_19-45-35.jpg
Snipaste_2022-11-18_19-45-35.jpg (23.76 KiB) Viewed 4095 times
User avatar
pangdi
Member
Posts: 10
Joined: Tue Nov 15, 2022 9:58 am

Post by pangdi »

I can control the volume in Win10, but when they are not synchronized. For example, the windows volume can't be raised if the xmos' volume reach the maximum. Just like xmos volume is 100, but windows volume is 80. How about the reason?

<mod edit: moved to existing thread>
User avatar
Ross
XCore Expert
Posts: 962
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

pangdi wrote: Fri Nov 18, 2022 12:46 pm
Ross wrote: Wed Nov 16, 2022 12:24 pm This should be as easy as setting HID_CONTROLS to 1 and then coding in the buttons to set the correct bits of the HID report
All things are ready. But it have no effect.

I would check that if you simply set hidData[0] = 0x8 without any other logic the volume is increased as you expect
Post Reply