Devices I do not have: printers, usb wifi, more than 1 daisy chained usb hubs (could of sworn I had at least 2 external hubs but I guess not).
As always, any feedback is appreciated, this is actually a quite large change for inxi, since it's the first time in it's life it's tried to do usb without the help of lsusb (which contains enormous, about 20k items, internal databases to match product id/vendor ids to their string values). Depending on the results of tests, I may decide to get rid of lsusb for -A or -N only, if it turns out that /sys is usually to almost always close enough, because it's so radically faster to skip lsusb.
To help with testing, I made the --usb-sys flag, which if added to --usb, like so:
Code: Select all
pinxi -xxx --usb --usb-sys
The good parts are:
1. radically faster to get it straight from /sys than using lsusb, depending on the system, between 40 and 500 milliseconds faster (or more, for very old systems).
2. Since the /sys parser is integrated into the usb logic now and always runs, this allowed me to add some valuable items, like true busID-port[.port][.port] paths for Bus ID: or Hub:. Device ID is still tacked onto the end like so: busid-port:device id, allowing for easy matches with lsusb or lsusb -v output.
3. USB per device driver(s) is now supported. Since all hubs use the 'hub' driver, I don't bother listing it.
4. if a system does not have lsusb, or you cannot install it ( a remote server, for example), you will now get usb data, maybe not quite as good as lsusb based, but you will get enough to see what is going on.
5. Does a slightly better job with multi interface usb devices, and will root through all of them to construct a string version, comma separated, like: type: keyboard,mouse
6. If a serial is available, shows it, some devices have it. This info for some reason was not in lsusb. Normal filter rules apply.
7. Hub ports are now listed. Note that not all ports are external, a motherboard usb header that is not used still counts as usually 2 ports, for example, and an internal usb device, like a laptop video camera, is a on a port, but not an external one.
8. Uses a hack to get type: Network if it showed vendor defined, this is better than the lsusb method.
The bad parts:
1. tends to be less accurate, not as much vendor/product id information.
2. the information can be different, or more generic, for example, I have a laptop docking station that with lsusb was correctly identified as the dock brand/vendor, but with /sys, it only showed that it was a hub with multi TT, no indication it's a docking station, that is.
The neutral parts:
1. sometimes the regular lsusb based way is better, sometimes, but not as often, the /sys based way is better.
For -A, -N, and --usb, you can force inxi to use /sys with the additional --usb-sys flag.
If you prefer the --usb-sys output, you can add to your configuration file:
Code: Select all
USB_SYS=true
To override this config setting, you can use --usb-tool which forces inxi to use lsusb.
Since I have only a limited number of usb devices, further tests would be nice if anyone feels like running them.
If you already have pinxi installed, simply run:
Code: Select all
pinxi -U
Code: Select all
cd /usr/local/bin
wget smxi.org/pinxi
chmod +x pinxi
Code: Select all
pinxi -xxxzAN --usb
pinxi -xxxzAN --usb --usb-sys
First without --usb-sys, using lsusb as primary info.
Code: Select all
pinxi --usb -xxx
USB: Hub: 1-0:1 usb: 2.0 type: Full speed (or root) hub ports: 14 chip ID: 1d6b:0002
Hub: 1-3:85 usb: 1.1 type: Atmel 4-Port Hub ports: 4 chip ID: 03eb:0902
Device-1: C-Media Audio Adapter (Planet UP-100 Genius G-Talk) driver: cm109,snd-usb-audio usb: 1.1
type: Audio bus ID: 1-3.2:86 chip ID: 0d8c:000e
Device-2: Wacom Graphire 2 4x5 driver: usbhid,wacom usb: 1.1 type: Mouse bus ID: 1-4:2
chip ID: 056a:0011
Device-3: Verbatim driver: usb-storage usb: 2.0 type: Mass Storage bus ID: 1-7:11 chip ID: 18a5:3623
Device-4: Tangtop HID Keyboard driver: hid-generic,usbhid usb: 1.1 type: Keyboard bus ID: 1-10:3
chip ID: 0d3d:0001
Device-5: Canon CanoScan LiDE 110 usb: 2.0 type: Vendor Specific Protocol bus ID: 1-13:112
chip ID: 04a9:1909
Device-6: Apple Ethernet Adapter [A1277] driver: asix usb: 2.0 type: Vendor Specific Class
bus ID: 1-14:13 chip ID: 05ac:1402
Hub: 2-0:1 usb: 3.1 type: Full speed (or root) hub ports: 8 chip ID: 1d6b:0003
Hub: 3-0:1 usb: 2.0 type: Full speed (or root) hub ports: 2 chip ID: 1d6b:0002
Hub: 4-0:1 usb: 3.1 type: Full speed (or root) hub ports: 2 chip ID: 1d6b:0003
Hub: 5-0:1 usb: 2.0 type: Full speed (or root) hub ports: 4 chip ID: 1d6b:0002
Hub: 6-0:1 usb: 3.0 type: Full speed (or root) hub ports: 4 chip ID: 1d6b:0003
Code: Select all
USB: Hub: 1-0:1 usb: 2.0 type: Full speed (or root) Hub ports: 14 chip ID: 1d6b:0002
Hub: 1-3:85 usb: 1.1 type: Full speed (or root) Hub ports: 4 chip ID: 03eb:0902
Device-1: Generic USB Audio Device driver: cm109,snd-usb-audio usb: 1.1 type: Audio bus ID: 1-3.2:86
chip ID: 0d8c:000e
Device-2: WACOM ET-0405A-UV2.0-3 driver: usbhid,wacom usb: 1.1 type: Mouse bus ID: 1-4:2
chip ID: 056a:0011
Device-3: Verbatim STORE N GO driver: usb-storage usb: 2.0 type: Mass Storage bus ID: 1-7:11
chip ID: 18a5:3623 serial: C800431440279C23
Device-4: USBPS2 HID Keyboard / Mouse driver: hid-generic,usbhid usb: 1.1 type: Keyboard,Mouse
bus ID: 1-10:3 chip ID: 0d3d:0001
Device-5: Canon CanoScan usb: 2.0 type: <vendor specific> bus ID: 1-13:112 chip ID: 04a9:1909
Device-6: Apple USB Ethernet Adapter driver: asix usb: 2.0 type: Network bus ID: 1-14:13
chip ID: 05ac:1402 serial: 117630
Hub: 2-0:1 usb: 3.1 type: Full speed (or root) Hub ports: 8 chip ID: 1d6b:0003
Hub: 3-0:1 usb: 2.0 type: Full speed (or root) Hub ports: 2 chip ID: 1d6b:0002
Hub: 4-0:1 usb: 3.1 type: Full speed (or root) Hub ports: 2 chip ID: 1d6b:0003
Hub: 5-0:1 usb: 2.0 type: Full speed (or root) Hub ports: 4 chip ID: 1d6b:0002
Hub: 6-0:1 usb: 3.0 type: Full speed (or root) Hub ports: 4 chip ID: 1d6b:0003