OS/2, eCS & ArcaOS - Technical > Applications
Hardware Explorer
Martin Iturbide:
Moderator's Note: I don't know what happened or why the first thread got locked. I had merged the two threads. Maybe it was a mistake but I will keep checking.
Wim Brul:
Hi Digi,
When I invoke Hardware Explorer 0.0.5 from System Setup then its tree view display is not stable. It sort of flashes every 2 seconds. I think it has to do with the new function "If the USB device is not found in the USB.IDS file, then the name consists of data taken from the device itself". The title of the Properties pages of such devices flash every 2 seconds too. I have several of such devices. I have attached 2 snapshots of my behringer umc204hd device. The 1st one is shown for about 2 seconds and the 2nd one (not easy to capture) is shown as a brief flash. It happens both on ArcaOS 5.0 and eComStation 2.0 with Lars Erdmann 10.232 drivers.
Wim
Lars:
I can say from my own experience that it is a bad idea in general to directly reread descriptors over and over again.
USBD.SYS caches the device and the configuration descriptor which can always be queried by USBRESMG.SYS.
If it is attempted to read a string descriptor (for example to get a manufacturer name or a device name), you need to be aware of that it often is unstable (don't ask me why) and also that there is a chance that either no string descriptor exists (string id = 0), or worse, the device descriptor reports string ids <> 0 but still has no string descriptors to offer. It's a mess, as everything else with USB.
I guess THAT is the reason why someone came up with the idea to create usb.ids and I would not be surprised if Linux ONLY uses this static info to return device and manufacturer name instead of querying string descriptors.
There is also a logical FLAW in USBRESMG.SYS in that it gets totally confused if two attached devices have the very same vendor and product id (yes, this happens, even with devices that look completely different !).
That typically leads to hangs/crashes when reading string descriptors. Would need to rewrite/change USBRESMG.SYS to also take the serial number into account (I think there even is a shitty Microsoft specific descriptor for that) to distinguish devices but oh well …
Lars
Digi:
--- Quote from: Lars on February 09, 2020, 07:39:12 pm ---I can say from my own experience that it is a bad idea in general to directly reread descriptors over and over again.
--- End quote ---
You already talked about this earlier and I took into account your advice by minimizing the use of USBRESMG. Description strings for each device in HwE are read only once and stored to avoid repeated calls. The USBRESM$ file handle also opens only once.
Thanks for the advice!
Lars:
ok, caching is the correct thing to do.
That leaves us with the remaining problem: if you have 2 devices attached that happen to have the same vendor and product ids, then USBRESMG.SYS will fail on reading the string descriptor as it will then confuse one device with the other. This is true even if you only open USBRESMG.SYS once and even if you only access one USB device at a time.
These days it might also be valuable to have a look at reading string descriptor with special string id = 0xEE. That will return Microsoft specific info (an OS identifier string) and if that works, it will open the door to other Microsoft specific descriptors, amongst those also a serial number. I seem to remember. All manufacturers will be forced to go the Microsoft way anyway (it already started with WinXP and the latest service pack).
Please note that reading the string descriptor for "device serial number" (iSerialNumber value in device descriptor) will not be possible most of the times because there are a lot of devices that do not provide a serial number in a string format (iSerialNumber = 0 for these devices).
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version