• AVR Freaks

Hot![SOLVED] Harmony 3 USB AUDIO+HID failing to enumerate

Author
turtlepants
New Member
  • Total Posts : 9
  • Reward points : 0
  • Joined: 2019/06/13 13:19:13
  • Location: 0
  • Status: offline
2020/08/19 20:44:20 (permalink)
0

[SOLVED] Harmony 3 USB AUDIO+HID failing to enumerate

I originally only had a USB HID device set up using H3 and it worked. I then added Audio (Headset) using H3 (see pic) and now the device shows up in the device manager as a Composite Device (which I expected) but has the following error:
 
This device cannot start. (Code 10)
STATUS_DEVICE_DATA_ERROR
 
  1. Has anyone else experienced this?
  2. What should I be looking for?
  3. Does it have to do with the device descriptor or endpoint settings?
Any help is appreciated!
post edited by turtlepants - 2020/08/20 11:14:07

Attached Image(s)

#1

4 Replies Related Threads

    turtlepants
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2019/06/13 13:19:13
    • Location: 0
    • Status: offline
    Re: Harmony 3 USB AUDIO+HID failing to enumerate 2020/08/20 08:53:25 (permalink)
    3 (1)
    So I played with USBcap on wireshark and see that the Audio IN/OUT Endpoints have a warning (see attached pics).
     
    The HID device does not have any endpoint warnings but I am not sure if this is related to the enumeration issue or something with Wireshark. Any help is appreciated!
    post edited by turtlepants - 2020/08/20 08:55:48

    Attached Image(s)

    #2
    turtlepants
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2019/06/13 13:19:13
    • Location: 0
    • Status: offline
    Re: Harmony 3 USB AUDIO+HID failing to enumerate 2020/08/20 11:09:01 (permalink)
    5 (1)
    Ok I think I got it. The descriptor interface numbers were getting set incorrectly by Harmony 3. It seemed to always default both the Audio & HID to start at 0 and Harmony disables the option to change the starting interface number. Also, the Audio Headset has 3 interfaces (control, speaker & mic) to take into account. I had to do the following changes to code for it to get enumerated correctly...
     
    usb_device_init_data.c
    // ...
    const USB_DEVICE_FUNCTION_REGISTRATION_TABLE funcRegistrationTable[2] =
    {

        /* Audio Function 0 */
        {
            // ...
            // .interfaceNumber = 1,  /* OLD Value */ 
            .interfaceNumber = 0,     /* CHANGED --> Start Audio at 0 */
            // ...
         },

         /* HID Function 0 */
        {
            // ...
            // .interfaceNumber = 0,  /* OLD Value */
            .interfaceNumber = 3,     /* CHANGED --> Start HID at 3 so it does not conflict with Audio */
            // ...
        },
    };
     
    // ...
     
    const uint8_t fullSpeedConfigurationDescriptor[]=
    {
        // ...
     
        /* Interface Descriptor */
        // ...
        USB_DESCRIPTOR_INTERFACE, // Descriptor Type is Interface descriptor
        // 0,  /* OLD Value */ 
        3,     /* CHANGED --> Update to match interfaceNumber of HID function above */
        // ...
     
        /* HID Class-Specific Descriptor */
        // ...
    };
    // ...

     
    I think this might be a bug in Harmony or maybe composite devices need manual intervention? Either way I am just happy to figure this out and hopefully someone else can now benefit from my findings. 
     
    I have more to do to handle the Audio Functions but with this fix the HID portion is working again.
    #3
    JPortici
    Super Member
    • Total Posts : 1203
    • Reward points : 0
    • Joined: 2012/11/17 06:27:45
    • Location: Grappaland
    • Status: offline
    Re: Harmony 3 USB AUDIO+HID failing to enumerate 2020/08/20 20:08:04 (permalink)
    0
    not sure if the guys will see this.. but if you raise a ticket on the github repo they will DEFINETLY look into it (probably related to older issues on MHC when they first added usb.. MHC would forget there were other interfaces, or would forget to reset the interface number so if you were playing a bit you would soon find yourself with the first interface at number 20... wouldn't get recognized)
    #4
    turtlepants
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2019/06/13 13:19:13
    • Location: 0
    • Status: offline
    Re: Harmony 3 USB AUDIO+HID failing to enumerate 2020/08/21 08:09:32 (permalink)
    5 (1)
    I did notice when I was trying to get it to work, at one point the interface numbers were getting set to 230+. That's when I started to question how it was getting set and led me down this path.
     
    When I get a chance I will raise a ticket on github.
    #5
    Jump to:
    © 2020 APG vNext Commercial Version 4.5