Author Topic: two registry entries for one device (windows)  (Read 865 times)

rebar

  • Member
  • ***
  • Posts: 17
two registry entries for one device (windows)
« on: September 19, 2020, 12:08:57 am »

I have come across a strange problem. I am running a USB plug/unplug enumeration test where every time I plug in the device I verify various things to make sure that the enumeration is correct. This a development test.

One of the things that I do is to use devcon.exe to verify some things about the collections. What Iím seeing is that sometimes the number after the last back-slash is changing for each of the collections (after hundreds of cycles). Further investigation shows what appears to be two entries in the registry for the same device.

\9&3406C40F is the number at the beginning of the test associated with each collection

and some time later after several hundred enumerations it night change, in this case to

\9&2D6B958A

initial enumeration
2020-09-18 16:09:22,066 main INFO =========> devcon.exe "find HID"\vid_047F* <=========
2020-09-18 16:09:22,088 main INFO HID\VID_047F&PID_015D&MI_03&COL05\9&3406C40F&0&0004  : HID-compliant device
2020-09-18 16:09:22,111 main INFO HID\VID_047F&PID_015D&MI_03&COL01\9&3406C40F&0&0000  : HID-compliant device
2020-09-18 16:09:22,124 main INFO HID\VID_047F&PID_015D&MI_03&COL02\9&3406C40F&0&0001  : HID-compliant device
2020-09-18 16:09:22,132 main INFO HID\VID_047F&PID_015D&MI_03&COL03\9&3406C40F&0&0002  : HID-compliant consumer control device
2020-09-18 16:09:22,148 main INFO HID\VID_047F&PID_015D&MI_03&COL04\9&3406C40F&0&0003  : HID-compliant device

several hundred enumerations later
2020-09-18 16:34:08,140 getDevconInfo HID\VID_047F&PID_015D&MI_03&COL01\9&2D6B958A&0&0000   :HID-compliant device
2020-09-18 16:34:08,140 getDevconInfo HID\VID_047F&PID_015D&MI_03&COL02\9&2D6B958A&0&0001   :HID-compliant device
2020-09-18 16:34:08,155 getDevconInfo HID\VID_047F&PID_015D&MI_03&COL03\9&2D6B958A&0&0002    :HID-compliant consumer control device
2020-09-18 16:34:08,155 getDevconInfo HID\VID_047F&PID_015D&MI_03&COL04\9&2D6B958A&0&0003    :HID-compliant device
2020-09-18 16:34:08,155 getDevconInfo HID\VID_047F&PID_015D&MI_03&COL05\9&2D6B958A&0&0004     :HID-compliant device

I didnít have any luck trying to understand how that number is derived. I have your book Jan, USB Complete, 3rd edition, in case anyone can point me to where thatís listed, that would be great, or help me understand what the device could report that might cause windows to create two different entries for the same device. Maybe a different device or configuration descriptor?
I've run this test for millions of cycles on other devices but I have never seen this problem before.

Any help would be very appreciated! thx!
[/size][/size]

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2959
    • Lakeview Research
Re: two registry entries for one device (windows)
« Reply #1 on: September 19, 2020, 12:17:58 am »
Does this behavior affect the device's performance? If not, just note it as a quirk of Windows?

rebar

  • Member
  • ***
  • Posts: 17
Re: two registry entries for one device (windows)
« Reply #2 on: September 19, 2020, 09:50:48 am »
I'v tested so many devices for years and not seen this until now, so that's why I'd like to know what windows sees that is making it do this. I believe that the device did something to cause this and that it's a bug in the device. I can't afford to ignore something like this without understanding it. Also, when changes are made to the device, those changes are updated in the registry, every time. If the device is coming up as another device, the most recent changes won't be detected. I'm concerned over time that even more devices could be created in the registry leading to "bad things".

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2959
    • Lakeview Research
Re: two registry entries for one device (windows)
« Reply #3 on: September 20, 2020, 02:05:07 pm »
I don't know a reason for this. If the tests are done with little delay between them, you could try extending the delay to see if that helps.

rebar

  • Member
  • ***
  • Posts: 17
Re: two registry entries for one device (windows)
« Reply #4 on: September 20, 2020, 04:43:03 pm »
I actually have a 5s settling delay after enumeration before pulling the plug. I uninstalled the device on one of the failing systems (using device manager) forcing the new hardware found wizard to run and that system is not failing now. But two other systems where I did not do an uninstall, those systems will fail after a few cycles due to the number in the collection that is changing (toggling).

My plan is to take a trace and compare the "failing" trace to the trace previous that did not fail. Hopefully I will see something that the device is reporting differently. If I figure it out, I'll post it here.

Thanks for your replies Jan!

rebar

  • Member
  • ***
  • Posts: 17
Re: two registry entries for one device (windows)
« Reply #5 on: September 21, 2020, 04:04:08 pm »
It's a device bug. The device is intermittently not reporting it's serial number so the OS creates a new entry with a different LUID (locally unique ID).

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2959
    • Lakeview Research
Re: two registry entries for one device (windows)
« Reply #6 on: September 22, 2020, 10:06:39 am »
Glad you discovered the reason. Thank you for reporting what you found.