LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-01-2018, 09:17 AM   #1
ultra_reader
LQ Newbie
 
Registered: Apr 2018
Posts: 22

Rep: Reputation: Disabled
Question How to understand lsusb Output?


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) sd card reader (device #6)
2) ducky mechanical keyboard (device #10)
3) bluetooth dongle (device #5)
4) logitech mouse (device #9)

So now some question arises:


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 ?

Lots of questions.

Very thanks in advanced!!!
 
Old 04-02-2018, 02:23 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
usb devices can also be internal.
i know little about the raspi3; maybe it has an internal usb network adapter?
 
1 members found this post helpful.
Old 04-02-2018, 05:04 AM   #3
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by ultra_reader View Post
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.
 
1 members found this post helpful.
Old 04-02-2018, 08:10 AM   #4
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,675

Rep: Reputation: 487Reputation: 487Reputation: 487Reputation: 487Reputation: 487
Quote:
1) Why if the first 4 lines correspond to 4 usb devices attached Ethernet adapter is listed as a usb device too?
The USB ports and the Ethernet port on the Raspberry Pi share a bus which limits the speed of the Ethernet and means that it shows up as a USB device.

Play Bonny!


Last edited by Soadyheid; 04-02-2018 at 02:40 PM.
 
1 members found this post helpful.
Old 04-02-2018, 10:14 AM   #5
ultra_reader
LQ Newbie
 
Registered: Apr 2018
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jsbjsb001 View Post
I'd say your keyboard or mouse.



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:

Code:
toty@raspberrypi:/home/toty/Documents $ lsusb -D /dev/bus/usb/001/001 | grep -Ei '(iInterface)'
      iInterface              0
toty@raspberrypi:/home/toty/Documents $ lsusb -D /dev/bus/usb/001/002 | grep -Ei '(iInterface)'
      iInterface              0
      iInterface              0
toty@raspberrypi:/home/toty/Documents $ lsusb -D /dev/bus/usb/001/003 | grep -Ei '(iInterface)'
      iInterface              0
toty@raspberrypi:/home/toty/Documents $ lsusb -D /dev/bus/usb/001/004 | grep -Ei '(iInterface)'
      iInterface              0
      iInterface              0
      iInterface              0
      iInterface              0
      iInterface              0
      iInterface              0
      iInterface              0
toty@raspberrypi:/home/toty/Documents $ lsusb -D /dev/bus/usb/001/005 | grep -Ei '(iInterface)'
      iInterface              0
And clearly one of them hast IF 1:

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 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
but nothing returns:

Code:
toty@raspberrypi:/home/toty/Documents $ lsusb -D /dev/bus/usb/001/006 | grep -Ei '(iInterface)'
      iInterface              0
      iInterface              0
      iInterface              0
So my last question still remains... but now it's more specific Why my keyboard is listed under 3 different interfaces?

thank you all!!!!
 
Old 04-02-2018, 10:16 AM   #6
ultra_reader
LQ Newbie
 
Registered: Apr 2018
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Soadyheid View Post
The USB ports and the Ethernet post on the Raspberry Pi share a bus which limits the speed of the Ethernet and means that it shows up as a USB device.

Play Bonny!

Thank you, yes they share the same bus that's what got me confused the first time!!!!
 
Old 04-02-2018, 02:33 PM   #7
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by ultra_reader View Post
...
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.
Attached Thumbnails
Click image for larger version

Name:	usb-view-iface.png
Views:	94
Size:	55.5 KB
ID:	27372  
 
1 members found this post helpful.
Old 04-02-2018, 04:02 PM   #8
ultra_reader
LQ Newbie
 
Registered: Apr 2018
Posts: 22

Original Poster
Rep: Reputation: Disabled
@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!
 
Old 04-02-2018, 04:29 PM   #9
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by ultra_reader View Post
@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.
 
1 members found this post helpful.
Old 04-02-2018, 05:22 PM   #10
ultra_reader
LQ Newbie
 
Registered: Apr 2018
Posts: 22

Original Poster
Rep: Reputation: Disabled
Thank you all!!!

Marked as solved!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Interpreting lsusb output peanutsmonkey Linux - Newbie 2 06-04-2012 02:08 AM
[SOLVED] Output from the lsusb solco Linux - Hardware 2 08-23-2011 12:12 PM
lsusb output, hotplug spikeygg Linux - Software 0 01-11-2005 11:03 PM
What does the output of lsusb mean? linuxRunner Linux - Hardware 1 08-16-2004 12:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 02:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration