<div dir="ltr">libusb has a debug verbosity level which currently is set to 3 (i.e., very verbose) in the device open function.<div>There is a define in libusbx.pas that you can change to shut off debug messages.<div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 29, 2019 at 12:03 PM James Richters <<a href="mailto:james@productionautomation.net">james@productionautomation.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Now I have a new strange issue. I've been working with my sample program here: <a href="https://github.com/Zaaphod/libusbxhid/blob/WHB04B-4/whb04b.pas" rel="noreferrer" target="_blank">https://github.com/Zaaphod/libusbxhid/blob/WHB04B-4/whb04b.pas</a> <br>
<br>
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: <a href="https://github.com/Zaaphod/libusbxhid/blob/System_Specific_Bug/bugtest.pas" rel="noreferrer" target="_blank">https://github.com/Zaaphod/libusbxhid/blob/System_Specific_Bug/bugtest.pas</a><br>
<br>
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:<br>
<br>
libusb: error [init_device] device 'USB\VID_2109&PID_2812&ASMEDIAUSBD_HUB\00000830' is no longer connected!<br>
libusb: error [init_device] device 'USB\VID_1778&PID_0224\40000030' is no longer connected!<br>
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.<br>
libusb: error [init_device] device 'USB\VID_1058&PID_10B8\57583631413934354E345939' is no longer connected!<br>
<br>
<br>
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. <br>
So I have two questions:<br>
1. any idea why these errors are being generated and how to fix it?<br>
2. Is there a way to turn off libusb errors, info and warnings?<br>
<br>
All systems are windows 10 Pro 64 bit, program was compiled for windows 64bit as well.<br>
<br>
Here is the complete output with debug info:<br>
<br>
K:\ProAuto>bugtest.exe<br>
libusb: error [init_device] device 'USB\VID_2109&PID_2812&ASMEDIAUSBD_HUB\00000830' is no longer connected!<br>
libusb: error [init_device] device 'USB\VID_1778&PID_0224\40000030' is no longer connected!<br>
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.<br>
libusb: error [init_device] device 'USB\VID_1058&PID_10B8\57583631413934354E345939' is no longer connected!<br>
Looking for $10CE, $EB93: DEBUG Found 20 devices attached<br>
DEBUG 1038:1310, bus: 7, address: 6<br>
DEBUG 1002:4399, bus: 10, address: 0<br>
DEBUG 1B21:1142, bus: 3, address: 0<br>
DEBUG 046D:C31C, bus: 7, address: 3<br>
DEBUG 1B21:1142, bus: 1, address: 0<br>
DEBUG 2109:0812, bus: 1, address: 1<br>
DEBUG 2109:2812, bus: 7, address: 2<br>
DEBUG 1002:4397, bus: 6, address: 0<br>
DEBUG 1002:4397, bus: 5, address: 0<br>
DEBUG 0A12:0001, bus: 5, address: 1<br>
DEBUG 2109:2811, bus: 7, address: 9<br>
DEBUG 1002:4397, bus: 9, address: 0<br>
DEBUG 0C45:7403, bus: 7, address: 4<br>
DEBUG 1002:4396, bus: 8, address: 0<br>
DEBUG 1002:4396, bus: 7, address: 0<br>
DEBUG 0E50:0002, bus: 7, address: 7<br>
DEBUG 1B21:1142, bus: 2, address: 0<br>
DEBUG 1002:4396, bus: 4, address: 0<br>
DEBUG 1A40:0101, bus: 7, address: 1<br>
DEBUG 2109:2812, bus: 7, address: 5<br>
DEBUG Index of device 4302:60307=-1<br>
DEBUG Freeing device list with 20 devices<br>
DEBUG USB device list freed. good boy!<br>
FALSE<br>
libusb: error [init_device] device 'USB\VID_2109&PID_2812&ASMEDIAUSBD_HUB\00000830' is no longer connected!<br>
libusb: error [init_device] device 'USB\VID_1778&PID_0224\40000030' is no longer connected!<br>
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.<br>
libusb: error [init_device] device 'USB\VID_1058&PID_10B8\57583631413934354E345939' is no longer connected!<br>
Looking for $10CE, $EB93: DEBUG Found 20 devices attached<br>
DEBUG 1038:1310, bus: 7, address: 6<br>
DEBUG 1002:4399, bus: 10, address: 0<br>
DEBUG 1B21:1142, bus: 3, address: 0<br>
DEBUG 046D:C31C, bus: 7, address: 3<br>
DEBUG 1B21:1142, bus: 1, address: 0<br>
DEBUG 2109:0812, bus: 1, address: 1<br>
DEBUG 2109:2812, bus: 7, address: 2<br>
DEBUG 1002:4397, bus: 6, address: 0<br>
DEBUG 1002:4397, bus: 5, address: 0<br>
DEBUG 0A12:0001, bus: 5, address: 1<br>
DEBUG 2109:2811, bus: 7, address: 9<br>
DEBUG 1002:4397, bus: 9, address: 0<br>
DEBUG 0C45:7403, bus: 7, address: 4<br>
DEBUG 1002:4396, bus: 8, address: 0<br>
DEBUG 1002:4396, bus: 7, address: 0<br>
DEBUG 0E50:0002, bus: 7, address: 7<br>
DEBUG 1B21:1142, bus: 2, address: 0<br>
DEBUG 1002:4396, bus: 4, address: 0<br>
DEBUG 1A40:0101, bus: 7, address: 1<br>
DEBUG 2109:2812, bus: 7, address: 5<br>
DEBUG Index of device 4302:60307=-1<br>
DEBUG Freeing device list with 20 devices<br>
DEBUG USB device list freed. good boy!<br>
FALSE<br>
libusb: error [init_device] device 'USB\VID_2109&PID_2812&ASMEDIAUSBD_HUB\00000830' is no longer connected!<br>
libusb: error [init_device] device 'USB\VID_1778&PID_0224\40000030' is no longer connected!<br>
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.<br>
libusb: error [init_device] device 'USB\VID_1058&PID_10B8\57583631413934354E345939' is no longer connected!<br>
Looking for $10CE, $EB93: DEBUG Found 20 devices attached<br>
DEBUG 1038:1310, bus: 7, address: 6<br>
DEBUG 1002:4399, bus: 10, address: 0<br>
DEBUG 1B21:1142, bus: 3, address: 0<br>
DEBUG 046D:C31C, bus: 7, address: 3<br>
DEBUG 1B21:1142, bus: 1, address: 0<br>
DEBUG 2109:0812, bus: 1, address: 1<br>
DEBUG 2109:2812, bus: 7, address: 2<br>
DEBUG 1002:4397, bus: 6, address: 0<br>
DEBUG 1002:4397, bus: 5, address: 0<br>
DEBUG 0A12:0001, bus: 5, address: 1<br>
DEBUG 2109:2811, bus: 7, address: 9<br>
DEBUG 1002:4397, bus: 9, address: 0<br>
DEBUG 0C45:7403, bus: 7, address: 4<br>
DEBUG 1002:4396, bus: 8, address: 0<br>
DEBUG 1002:4396, bus: 7, address: 0<br>
DEBUG 0E50:0002, bus: 7, address: 7<br>
DEBUG 1B21:1142, bus: 2, address: 0<br>
DEBUG 1002:4396, bus: 4, address: 0<br>
DEBUG 1A40:0101, bus: 7, address: 1<br>
DEBUG 2109:2812, bus: 7, address: 5<br>
DEBUG Index of device 4302:60307=-1<br>
DEBUG Freeing device list with 20 devices<br>
DEBUG USB device list freed. good boy!<br>
FALSE<br>
Heap dump by heaptrc unit of K:\ProAuto\bugtest.exe<br>
685 memory blocks allocated : 33042/37272<br>
685 memory blocks freed : 33042/37272<br>
0 unfreed memory blocks : 0<br>
True heap size : 163840 (128 used in System startup)<br>
True free heap : 163712<br>
<br>
When I run it on any other computer I get:<br>
I:\Programming\Gcode\bug>bugtest.exe<br>
Looking for $10CE, $EB93: DEBUG Found 17 devices attached<br>
DEBUG 8086:A36D, bus: 1, address: 0<br>
DEBUG 8087:0AAA, bus: 1, address: 8<br>
DEBUG 05E3:0612, bus: 1, address: 18<br>
DEBUG 0424:2734, bus: 1, address: 42<br>
DEBUG 1D50:6015, bus: 1, address: 14<br>
DEBUG 05E3:0743, bus: 1, address: 22<br>
DEBUG 1B1C:0C15, bus: 1, address: 9<br>
DEBUG 05E3:0610, bus: 1, address: 21<br>
DEBUG 05E3:0610, bus: 1, address: 6<br>
DEBUG 04E8:61F5, bus: 1, address: 1<br>
DEBUG 1B1C:0C10, bus: 1, address: 7<br>
DEBUG 0424:274C, bus: 1, address: 43<br>
DEBUG 1B1C:1B4F, bus: 1, address: 41<br>
DEBUG 1A40:0101, bus: 1, address: 2<br>
DEBUG 0C45:7403, bus: 1, address: 26<br>
DEBUG 0E50:0002, bus: 1, address: 60<br>
DEBUG 10C4:EA60, bus: 1, address: 4<br>
DEBUG Index of device 4302:60307=-1<br>
DEBUG Freeing device list with 17 devices<br>
DEBUG USB device list freed. good boy!<br>
FALSE<br>
Looking for $10CE, $EB93: DEBUG Found 17 devices attached<br>
DEBUG 8086:A36D, bus: 1, address: 0<br>
DEBUG 8087:0AAA, bus: 1, address: 8<br>
DEBUG 05E3:0612, bus: 1, address: 18<br>
DEBUG 0424:2734, bus: 1, address: 42<br>
DEBUG 1D50:6015, bus: 1, address: 14<br>
DEBUG 05E3:0743, bus: 1, address: 22<br>
DEBUG 1B1C:0C15, bus: 1, address: 9<br>
DEBUG 05E3:0610, bus: 1, address: 21<br>
DEBUG 05E3:0610, bus: 1, address: 6<br>
DEBUG 04E8:61F5, bus: 1, address: 1<br>
DEBUG 1B1C:0C10, bus: 1, address: 7<br>
DEBUG 0424:274C, bus: 1, address: 43<br>
DEBUG 1B1C:1B4F, bus: 1, address: 41<br>
DEBUG 1A40:0101, bus: 1, address: 2<br>
DEBUG 0C45:7403, bus: 1, address: 26<br>
DEBUG 0E50:0002, bus: 1, address: 60<br>
DEBUG 10C4:EA60, bus: 1, address: 4<br>
DEBUG Index of device 4302:60307=-1<br>
DEBUG Freeing device list with 17 devices<br>
DEBUG USB device list freed. good boy!<br>
FALSE<br>
Looking for $10CE, $EB93: DEBUG Found 17 devices attached<br>
DEBUG 8086:A36D, bus: 1, address: 0<br>
DEBUG 8087:0AAA, bus: 1, address: 8<br>
DEBUG 05E3:0612, bus: 1, address: 18<br>
DEBUG 0424:2734, bus: 1, address: 42<br>
DEBUG 1D50:6015, bus: 1, address: 14<br>
DEBUG 05E3:0743, bus: 1, address: 22<br>
DEBUG 1B1C:0C15, bus: 1, address: 9<br>
DEBUG 05E3:0610, bus: 1, address: 21<br>
DEBUG 05E3:0610, bus: 1, address: 6<br>
DEBUG 04E8:61F5, bus: 1, address: 1<br>
DEBUG 1B1C:0C10, bus: 1, address: 7<br>
DEBUG 0424:274C, bus: 1, address: 43<br>
DEBUG 1B1C:1B4F, bus: 1, address: 41<br>
DEBUG 1A40:0101, bus: 1, address: 2<br>
DEBUG 0C45:7403, bus: 1, address: 26<br>
DEBUG 0E50:0002, bus: 1, address: 60<br>
DEBUG 10C4:EA60, bus: 1, address: 4<br>
DEBUG Index of device 4302:60307=-1<br>
DEBUG Freeing device list with 17 devices<br>
DEBUG USB device list freed. good boy!<br>
FALSE<br>
Heap dump by heaptrc unit of I:\Programming\Gcode\bug\bugtest.exe<br>
595 memory blocks allocated : 28731/32376<br>
595 memory blocks freed : 28731/32376<br>
0 unfreed memory blocks : 0<br>
True heap size : 163840 (160 used in System startup)<br>
True free heap : 163680<br>
<br>
James<br>
_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.org</a><br>
<a href="https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal" rel="noreferrer" target="_blank">https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a><br>
</blockquote></div>