[fpc-pascal] USB Human Interface Devices
James Richters
james at productionautomation.net
Thu Aug 29 18:03:19 CEST 2019
Now I have a new strange issue. I've been working with my sample program here: https://github.com/Zaaphod/libusbxhid/blob/WHB04B-4/whb04b.pas
And it's been working just fine for me.. just some minor little tweaks and adding new functionality.. etc.. I was just about to start to merge this into my large project when I sent the sample program to my dad... on his system he just gets a screen full of errors... but on mine, it's nice and clean. I don't understand what is happening.. I reduced my test program down to the most basic sample that demonstrates the issue here: https://github.com/Zaaphod/libusbxhid/blob/System_Specific_Bug/bugtest.pas
All this program does is checks to see if a specific device exists.. this program works perfectly on 4 computers and has no issue, but on one of my dad's computers I get the following errors:
libusb: error [init_device] device 'USB\VID_2109&PID_2812&ASMEDIAUSBD_HUB\00000830' is no longer connected!
libusb: error [init_device] device 'USB\VID_1778&PID_0224\40000030' is no longer connected!
libusb: info [cache_config_descriptors] could not access configuration descriptor 0 (dummy) for 'USB\VID_2109&PID_2811\5&34472DFD&0&4': [31] A device attached to the system is not functioning.
libusb: error [init_device] device 'USB\VID_1058&PID_10B8\57583631413934354E345939' is no longer connected!
I don't know why Libusb is reporting this, no one tried to open anything so who cares if some devices are not connected, and how does it know they were connected at one time... this is not even an error.. if it's not connected, just ignore it, nobody cares about that device anyway.
So I have two questions:
1. any idea why these errors are being generated and how to fix it?
2. Is there a way to turn off libusb errors, info and warnings?
All systems are windows 10 Pro 64 bit, program was compiled for windows 64bit as well.
Here is the complete output with debug info:
K:\ProAuto>bugtest.exe
libusb: error [init_device] device 'USB\VID_2109&PID_2812&ASMEDIAUSBD_HUB\00000830' is no longer connected!
libusb: error [init_device] device 'USB\VID_1778&PID_0224\40000030' is no longer connected!
libusb: info [cache_config_descriptors] could not access configuration descriptor 0 (dummy) for 'USB\VID_2109&PID_2811\5&34472DFD&0&4': [31] A device attached to the system is not functioning.
libusb: error [init_device] device 'USB\VID_1058&PID_10B8\57583631413934354E345939' is no longer connected!
Looking for $10CE, $EB93: DEBUG Found 20 devices attached
DEBUG 1038:1310, bus: 7, address: 6
DEBUG 1002:4399, bus: 10, address: 0
DEBUG 1B21:1142, bus: 3, address: 0
DEBUG 046D:C31C, bus: 7, address: 3
DEBUG 1B21:1142, bus: 1, address: 0
DEBUG 2109:0812, bus: 1, address: 1
DEBUG 2109:2812, bus: 7, address: 2
DEBUG 1002:4397, bus: 6, address: 0
DEBUG 1002:4397, bus: 5, address: 0
DEBUG 0A12:0001, bus: 5, address: 1
DEBUG 2109:2811, bus: 7, address: 9
DEBUG 1002:4397, bus: 9, address: 0
DEBUG 0C45:7403, bus: 7, address: 4
DEBUG 1002:4396, bus: 8, address: 0
DEBUG 1002:4396, bus: 7, address: 0
DEBUG 0E50:0002, bus: 7, address: 7
DEBUG 1B21:1142, bus: 2, address: 0
DEBUG 1002:4396, bus: 4, address: 0
DEBUG 1A40:0101, bus: 7, address: 1
DEBUG 2109:2812, bus: 7, address: 5
DEBUG Index of device 4302:60307=-1
DEBUG Freeing device list with 20 devices
DEBUG USB device list freed. good boy!
FALSE
libusb: error [init_device] device 'USB\VID_2109&PID_2812&ASMEDIAUSBD_HUB\00000830' is no longer connected!
libusb: error [init_device] device 'USB\VID_1778&PID_0224\40000030' is no longer connected!
libusb: info [cache_config_descriptors] could not access configuration descriptor 0 (dummy) for 'USB\VID_2109&PID_2811\5&34472DFD&0&4': [31] A device attached to the system is not functioning.
libusb: error [init_device] device 'USB\VID_1058&PID_10B8\57583631413934354E345939' is no longer connected!
Looking for $10CE, $EB93: DEBUG Found 20 devices attached
DEBUG 1038:1310, bus: 7, address: 6
DEBUG 1002:4399, bus: 10, address: 0
DEBUG 1B21:1142, bus: 3, address: 0
DEBUG 046D:C31C, bus: 7, address: 3
DEBUG 1B21:1142, bus: 1, address: 0
DEBUG 2109:0812, bus: 1, address: 1
DEBUG 2109:2812, bus: 7, address: 2
DEBUG 1002:4397, bus: 6, address: 0
DEBUG 1002:4397, bus: 5, address: 0
DEBUG 0A12:0001, bus: 5, address: 1
DEBUG 2109:2811, bus: 7, address: 9
DEBUG 1002:4397, bus: 9, address: 0
DEBUG 0C45:7403, bus: 7, address: 4
DEBUG 1002:4396, bus: 8, address: 0
DEBUG 1002:4396, bus: 7, address: 0
DEBUG 0E50:0002, bus: 7, address: 7
DEBUG 1B21:1142, bus: 2, address: 0
DEBUG 1002:4396, bus: 4, address: 0
DEBUG 1A40:0101, bus: 7, address: 1
DEBUG 2109:2812, bus: 7, address: 5
DEBUG Index of device 4302:60307=-1
DEBUG Freeing device list with 20 devices
DEBUG USB device list freed. good boy!
FALSE
libusb: error [init_device] device 'USB\VID_2109&PID_2812&ASMEDIAUSBD_HUB\00000830' is no longer connected!
libusb: error [init_device] device 'USB\VID_1778&PID_0224\40000030' is no longer connected!
libusb: info [cache_config_descriptors] could not access configuration descriptor 0 (dummy) for 'USB\VID_2109&PID_2811\5&34472DFD&0&4': [31] A device attached to the system is not functioning.
libusb: error [init_device] device 'USB\VID_1058&PID_10B8\57583631413934354E345939' is no longer connected!
Looking for $10CE, $EB93: DEBUG Found 20 devices attached
DEBUG 1038:1310, bus: 7, address: 6
DEBUG 1002:4399, bus: 10, address: 0
DEBUG 1B21:1142, bus: 3, address: 0
DEBUG 046D:C31C, bus: 7, address: 3
DEBUG 1B21:1142, bus: 1, address: 0
DEBUG 2109:0812, bus: 1, address: 1
DEBUG 2109:2812, bus: 7, address: 2
DEBUG 1002:4397, bus: 6, address: 0
DEBUG 1002:4397, bus: 5, address: 0
DEBUG 0A12:0001, bus: 5, address: 1
DEBUG 2109:2811, bus: 7, address: 9
DEBUG 1002:4397, bus: 9, address: 0
DEBUG 0C45:7403, bus: 7, address: 4
DEBUG 1002:4396, bus: 8, address: 0
DEBUG 1002:4396, bus: 7, address: 0
DEBUG 0E50:0002, bus: 7, address: 7
DEBUG 1B21:1142, bus: 2, address: 0
DEBUG 1002:4396, bus: 4, address: 0
DEBUG 1A40:0101, bus: 7, address: 1
DEBUG 2109:2812, bus: 7, address: 5
DEBUG Index of device 4302:60307=-1
DEBUG Freeing device list with 20 devices
DEBUG USB device list freed. good boy!
FALSE
Heap dump by heaptrc unit of K:\ProAuto\bugtest.exe
685 memory blocks allocated : 33042/37272
685 memory blocks freed : 33042/37272
0 unfreed memory blocks : 0
True heap size : 163840 (128 used in System startup)
True free heap : 163712
When I run it on any other computer I get:
I:\Programming\Gcode\bug>bugtest.exe
Looking for $10CE, $EB93: DEBUG Found 17 devices attached
DEBUG 8086:A36D, bus: 1, address: 0
DEBUG 8087:0AAA, bus: 1, address: 8
DEBUG 05E3:0612, bus: 1, address: 18
DEBUG 0424:2734, bus: 1, address: 42
DEBUG 1D50:6015, bus: 1, address: 14
DEBUG 05E3:0743, bus: 1, address: 22
DEBUG 1B1C:0C15, bus: 1, address: 9
DEBUG 05E3:0610, bus: 1, address: 21
DEBUG 05E3:0610, bus: 1, address: 6
DEBUG 04E8:61F5, bus: 1, address: 1
DEBUG 1B1C:0C10, bus: 1, address: 7
DEBUG 0424:274C, bus: 1, address: 43
DEBUG 1B1C:1B4F, bus: 1, address: 41
DEBUG 1A40:0101, bus: 1, address: 2
DEBUG 0C45:7403, bus: 1, address: 26
DEBUG 0E50:0002, bus: 1, address: 60
DEBUG 10C4:EA60, bus: 1, address: 4
DEBUG Index of device 4302:60307=-1
DEBUG Freeing device list with 17 devices
DEBUG USB device list freed. good boy!
FALSE
Looking for $10CE, $EB93: DEBUG Found 17 devices attached
DEBUG 8086:A36D, bus: 1, address: 0
DEBUG 8087:0AAA, bus: 1, address: 8
DEBUG 05E3:0612, bus: 1, address: 18
DEBUG 0424:2734, bus: 1, address: 42
DEBUG 1D50:6015, bus: 1, address: 14
DEBUG 05E3:0743, bus: 1, address: 22
DEBUG 1B1C:0C15, bus: 1, address: 9
DEBUG 05E3:0610, bus: 1, address: 21
DEBUG 05E3:0610, bus: 1, address: 6
DEBUG 04E8:61F5, bus: 1, address: 1
DEBUG 1B1C:0C10, bus: 1, address: 7
DEBUG 0424:274C, bus: 1, address: 43
DEBUG 1B1C:1B4F, bus: 1, address: 41
DEBUG 1A40:0101, bus: 1, address: 2
DEBUG 0C45:7403, bus: 1, address: 26
DEBUG 0E50:0002, bus: 1, address: 60
DEBUG 10C4:EA60, bus: 1, address: 4
DEBUG Index of device 4302:60307=-1
DEBUG Freeing device list with 17 devices
DEBUG USB device list freed. good boy!
FALSE
Looking for $10CE, $EB93: DEBUG Found 17 devices attached
DEBUG 8086:A36D, bus: 1, address: 0
DEBUG 8087:0AAA, bus: 1, address: 8
DEBUG 05E3:0612, bus: 1, address: 18
DEBUG 0424:2734, bus: 1, address: 42
DEBUG 1D50:6015, bus: 1, address: 14
DEBUG 05E3:0743, bus: 1, address: 22
DEBUG 1B1C:0C15, bus: 1, address: 9
DEBUG 05E3:0610, bus: 1, address: 21
DEBUG 05E3:0610, bus: 1, address: 6
DEBUG 04E8:61F5, bus: 1, address: 1
DEBUG 1B1C:0C10, bus: 1, address: 7
DEBUG 0424:274C, bus: 1, address: 43
DEBUG 1B1C:1B4F, bus: 1, address: 41
DEBUG 1A40:0101, bus: 1, address: 2
DEBUG 0C45:7403, bus: 1, address: 26
DEBUG 0E50:0002, bus: 1, address: 60
DEBUG 10C4:EA60, bus: 1, address: 4
DEBUG Index of device 4302:60307=-1
DEBUG Freeing device list with 17 devices
DEBUG USB device list freed. good boy!
FALSE
Heap dump by heaptrc unit of I:\Programming\Gcode\bug\bugtest.exe
595 memory blocks allocated : 28731/32376
595 memory blocks freed : 28731/32376
0 unfreed memory blocks : 0
True heap size : 163840 (160 used in System startup)
True free heap : 163680
James
More information about the fpc-pascal
mailing list