Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hey there Im toty and Im new in this forum as with linux in general. Im messing around with a Pi3
but my main doubts are about lsubs output in general, so if any mod wants to move it to embedded subforum please, be my guest!
Anyway, I'm studying to take the LPIC 1 and want to fully understand each line.
As a newbie I had to read a lot to know what a bus, host controllers, host controller drivers etc are!
In spite all this I still have a few questions I hope you guys could answer.
So this is the output of lsusb without flags:
Code:
toty@raspberrypi:/home/toty $ lsusb
Bus 001 Device 009: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
Bus 001 Device 006: ID 14cd:1212 Super Top microSD card reader (SY-T18)
Bus 001 Device 005: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 010: ID 04d9:0171 Holtek Semiconductor, Inc.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
So my Pi 3 has 4 external usb ports, 1 ethernet port and 1 hdmi port.
For what I've learned so far I do see that my Pi has only 1 bus. Right now I've plugged in 4 devices
1) Why if the first 4 lines correspond to 4 usb devices attached Ethernet adapter is listed as a usb device too?
2) What does last line refer to?
Now those questions are about lsusb output, let's check out lsusb -t output:
Code:
toty@raspberrypi:/home/toty $ lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
|__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
|__ Port 2: Dev 10, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 2: Dev 10, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 2: Dev 10, If 2, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 3: Dev 5, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 3: Dev 5, If 1, Class=Wireless, Driver=btusb, 12M
|__ Port 4: Dev 6, If 0, Class=Mass Storage, Driver=usb-storage, 480M
|__ Port 5: Dev 9, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
3) Why my keyboard (device #10) appears listed in 3 different lines?
4) I know this two lines:
Code:
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
correspond to the last two lines of previous output and I know that because of dev numbers also now with lsusb -t I can tell for what I've read that dev 1 is a root hub (an internal hub which has lots of usb ports) is an abstraction layer that governs the real ports. Am I right?
5) So in that case what is Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M ?
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
Quote:
Originally Posted by ultra_reader
Hey there Im toty and Im new in this forum as with linux in general. Im messing around with a Pi3
but my main doubts are about lsubs output in general, so if any mod wants to move it to embedded subforum please, be my guest!
Anyway, I'm studying to take the LPIC 1 and want to fully understand each line.
As a newbie I had to read a lot to know what a bus, host controllers, host controller drivers etc are!
In spite all this I still have a few questions I hope you guys could answer.
...
2) What does last line refer to?
I'd say your keyboard or mouse.
Quote:
Now those questions are about lsusb output, let's check out lsusb -t output:
Code:
toty@raspberrypi:/home/toty $ lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
|__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
|__ Port 2: Dev 10, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 2: Dev 10, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 2: Dev 10, If 2, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 3: Dev 5, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 3: Dev 5, If 1, Class=Wireless, Driver=btusb, 12M
|__ Port 4: Dev 6, If 0, Class=Mass Storage, Driver=usb-storage, 480M
|__ Port 5: Dev 9, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
3) Why my keyboard (device #10) appears listed in 3 different lines?
4) I know this two lines:
Code:
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
correspond to the last two lines of previous output and I know that because of dev numbers also now with lsusb -t I can tell for what I've read that dev 1 is a root hub (an internal hub which has lots of usb ports) is an abstraction layer that governs the real ports. Am I right?...
AFAIK, The USB hub is just what it says, a hub for all of the USB ports attached to it. The USB hub could have several different ports on it.
If you look at what I've highlighted in bold, you'll notice that there's a different "If" number for each of, what appear to be the same device. I'm not an expert on USB, but this may explain more - but that's just what I can see. It seems to me (I could be wrong) that the "If" stands for "Interface". Hopefully the link I gave you can explain it more to you.
AFAIK, The USB hub is just what it says, a hub for all of the USB ports attached to it. The USB hub could have several different ports on it.
If you look at what I've highlighted in bold, you'll notice that there's a different "If" number for each of, what appear to be the same device. I'm not an expert on USB, but this may explain more - but that's just what I can see. It seems to me (I could be wrong) that the "If" stands for "Interface". Hopefully the link I gave you can explain it more to you.
About my last line questions:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
For what I can tell so far that line refers to a hub controller. lusb lists one for each usb bus you have, in my case the Pi has only 1 bus.
Thx for this but didn't help too much to know those IF are interfaces. In fact when listing each usb separately none of them show IF at all:
toty@raspberrypi:/home/toty/Documents $ lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
|__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
|__ Port 3: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 3: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M
|__ Port 4: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, 480M
Just in case I plugged in my keyboard which appears to have 3 IF (0, 1, 2):
Code:
toty@raspberrypi:/home/toty/Documents $ lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
|__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
|__ Port 2: Dev 6, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 2: Dev 6, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 2: Dev 6, If 2, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 3: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 3: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M
|__ Port 4: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, 480M
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
Quote:
Originally Posted by ultra_reader
...
So my last question still remains... but now it's more specific Why my keyboard is listed under 3 different interfaces?
thank you all!!!!
I downloaded a nifty little program called usbview written by Greg Kroah-Hartman, yes, the same guy that works with Linus himself, and I think I can confirm that "If" must stand for "Interface" - as I suspected.
Now, take a look at my "lsusb -t" output:
Code:
[james@localhost ~]$ lsusb -t
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
|__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
|__ Port 2: Dev 3, If 0, Class=Mass Storage, Driver=uas, 5000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
|__ Port 2: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 12M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
|__ Port 2: Dev 4, If 0, Class=Vendor Specific Class, Driver=, 480M
|__ Port 3: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 4: Dev 6, If 1, Class=Wireless, Driver=btusb, 12M
|__ Port 4: Dev 6, If 2, Class=Vendor Specific Class, Driver=, 12M
|__ Port 4: Dev 6, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 4: Dev 6, If 3, Class=Application Specific Interface, Driver=, 12M
|__ Port 5: Dev 7, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 5: Dev 7, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
Now we are only interested in my output in bold. Now that is my USB keyboard in bold. It has two "interfaces" - "If 0" and "If 1", so, if you take a look at my screenshot, you can see that the "If" does indeed (AFAICS) confirm that it means "interfaces".
I must thank you for the question, as I may not and probably would not have even learned this.
I got some help from a guy over reddit and he told me this:
Quote:
About those 3 keyboard lines: which ducky keyboard do you have? The ducky one I have can emulate a mouse using it's numpad, which might explain a second line in lsusb as it would be recognized as a keyboard and a mouse; the third listing might come from emulating "n-key-rollover" as the usb standard is limited to 6-key-rollover and registering multiple keyboard devices is a common strategy to push that limit I think.
So I thought of checking out dmesg and guess what?
Code:
[ 1417.768139] usb 1-1.2: new full-speed USB device number 6 using dwc_otg
[ 1417.900138] usb 1-1.2: New USB device found, idVendor=04d9, idProduct=0171
[ 1417.900153] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 1417.900162] usb 1-1.2: Product: USB-HID Keyboard
[ 1417.903571] input: USB-HID Keyboard as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:04D9:0171.0001/input/input6
[ 1417.969023] hid-generic 0003:04D9:0171.0001: input,hidraw0: USB HID v1.11 Keyboard [USB-HID Keyboard] on usb-3f980000.usb-1.2/input0
[ 1417.971466] hid-generic 0003:04D9:0171.0002: hiddev96,hidraw1: USB HID v1.11 Device [USB-HID Keyboard] on usb-3f980000.usb-1.2/input1
[ 1417.977653] input: USB-HID Keyboard as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.2/0003:04D9:0171.0003/input/input7
[ 1418.038744] hid-generic 0003:04D9:0171.0003: input,hidraw2: USB HID v1.11 Mouse [USB-HID Keyboard] on usb-3f980000.usb-1.2/input2
[ 1418.558209] Under-voltage detected! (0x00050005)
[ 1424.798242] Voltage normalized (0x00000000)
Take a look at those 3 lines in bold!!
Im still trying to get what USB HID v1.11 Device [USB-HID Keyboard] on usb-3f980000.usb-1.2/input1 translates to... but 0 is keyboard and 2 is mouse!
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
Quote:
Originally Posted by ultra_reader
@jsbjsb001
I got some help from a guy over reddit and he told me this:
Quote:
About those 3 keyboard lines: which ducky keyboard do you have? The ducky one I have can emulate a mouse using it's numpad, which might explain a second line in lsusb as it would be recognized as a keyboard and a mouse; the third listing might come from emulating "n-key-rollover" as the usb standard is limited to 6-key-rollover and registering multiple keyboard devices is a common strategy to push that limit I think.
So I thought of checking out dmesg and guess what?
Code:
[ 1417.768139] usb 1-1.2: new full-speed USB device number 6 using dwc_otg
[ 1417.900138] usb 1-1.2: New USB device found, idVendor=04d9, idProduct=0171
[ 1417.900153] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 1417.900162] usb 1-1.2: Product: USB-HID Keyboard
[ 1417.903571] input: USB-HID Keyboard as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:04D9:0171.0001/input/input6
[ 1417.969023] hid-generic 0003:04D9:0171.0001: input,hidraw0: USB HID v1.11 Keyboard [USB-HID Keyboard] on usb-3f980000.usb-1.2/input0
[ 1417.971466] hid-generic 0003:04D9:0171.0002: hiddev96,hidraw1: USB HID v1.11 Device [USB-HID Keyboard] on usb-3f980000.usb-1.2/input1
[ 1417.977653] input: USB-HID Keyboard as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.2/0003:04D9:0171.0003/input/input7
[ 1418.038744] hid-generic 0003:04D9:0171.0003: input,hidraw2: USB HID v1.11 Mouse [USB-HID Keyboard] on usb-3f980000.usb-1.2/input2
[ 1418.558209] Under-voltage detected! (0x00050005)
[ 1424.798242] Voltage normalized (0x00000000)
Take a look at those 3 lines in bold!!
Im still trying to get what USB HID v1.11 Device [USB-HID Keyboard] on usb-3f980000.usb-1.2/input1 translates to... but 0 is keyboard and 2 is mouse!
I think you have answered your own question. You have three 'interfaces', so, 'input1', 'input2', etc... look at the answer you got from reddit. Three things the system sees your keyboard as...
It sounds about right to me. Remember to mark what you found helpful, it helps others to know that the post(s) have helped.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.