Page 1 of 1

USB HID play/pause working one way

Posted: Sat Aug 07, 2021 2:13 pm
by en2senpai
Greetings,

Im currently working on USB Audio HID functionality of my device, and i've faced some strange behavior.

A PLAY/PAUSE functionality is working only one way (when the song is stopped - HID functionality will trigger it to start playing, but when the song is being played - HID functionality will NOT stop it as expected).

Do I need to report my changes more than one in a row ?

Here is my code snippet to test all needed functionalities (every 1000 requests from Host, device is simulating a HID action). Is this a proper way to handle this ?

Code: Select all

void UserReadHIDButtons(unsigned char hidData[])
{
    static int index = 0;

    index += 1;

    if (index == 1000)
    {
        hidData[0] = 0x02; // next track
    }
    else if (index == 2000)
    {
        hidData[0] = 0x04; // previous track
    }
    else if (index == 3000)
    {
        hidData[0] = 0x01; // play-pause
    }
    else if (index == 4000)
    {
        index = 0;
    }
}
Edit.
To test this, im using Tidal desktop app on Windows 10. Maybe this is a Tidal related issue ?