Lsusb on linux showing the wrong device

Hey there,

I just stumbled upon this:
Whenever I type in lsusb on my computer with the fairphone connected in mtp mode, it gives me this:
ID 05c6:6764 Qualcomm, Inc. A0001 Phone [OnePlus One]

First question:
Does someone else experience this? I’m curious…

Second question:
Does someone know if this could cause problems when trying to set up the mtp connection? (It’s currently not working for me and I’m trying to resolve why.)

Greetings,
Dabuh

Not happening on Debian Testing. I don’t have the [device name] part at all.

Edit: yes, I can see those suggestions. USB IDs for Android phones change according to which mode you select in the phone itself. As I have ADB enabled, none of those IDs were given device suggestions, but with ADB disabled I now see them.

I see the same under Debian 9 stretch (stable) and MTP works fine.

ID 05c6:6764 Qualcomm, Inc. A0001 Phone [OnePlus One]

Maybe this ID is set somewhere in the LineageOS sources?

While in fastboot mode and while booting, I see this:

Bus 001 Device 009: ID 18d1:d00d Google Inc.

On Ubuntu 16.4 LTS it also shows:
ID 05c6:6764 Qualcomm, Inc. A0001 Phone [OnePlus One]

With FP OS, the USB ID changes depending on the mode in use and whether USB debugging is enabled or not. Thus it looks like this ID is set in software and when not set, defaults to a generic Qualcomm one.

Getting a USB vendor ID from USB-IF costs money, so I can understand manufacturers just use Qualcomm IDs (whether Qualcomm agrees with that is another matter). Apparently OnePlus is doing just that and as a result, someone added the OnePlus One to the USB ID database.

1 Like

Linux has a simple database of USB IDs and the corresponding device/manufacturer. Either the database is simply wrong, or FP2 is reusing the ID of a OnePlus device.

Anyways, as already said, this should not impact functionality.

1 Like

I remember from that time that I had to manually config UDEV in Ubuntu/Trisquel that 18d1 is Google’s USB ID — Android deviced use it in fastboot mode, maybe in recovery too. And 05c6 is Qualcomm’s — just as @AlbertJP said.

So yeah, this confirms @ben’s theory that whatever database all your lsusb use is wrong.

This made me curious, so I found out: lsbutils is from the package usbutils which says in its ``README.Debian`:

The USB ID’s database (/var/lib/usbutils/usb.ids) comes from
http://www.linux-usb.org/usb.ids. In case one of your USB devices
does not appear in the database you can submit the USB ID’s and the
corresponding description via The USB ID Repository
– Aurelien Jarno aurel32@debian.org Sun, 25 Apr 2010 11:55:31 +0200

With sudo update-usbids you can overwrite the /var/lib/usbutils/usb.ids file that came with the package with the latest one from http://www.linux-usb.org/usb.ids

Currently however, this gives the wrong result because the latest list contains

05c6  Qualcomm, Inc.
    [...]
    6764  A0001 Phone [OnePlus One]

So what should be the correct description be? For now I just added a comment at USB Devices that at least the FP2 uses the same ID.

1 Like

That is indeed where the ID in lsusb comes from. However it appears to me that the maintainer of the usb.ids file is often too busy with other things and many submissions on the web interface are not accepted, so I think it is better if we suggest our own name. Snapdragon 801 could be a good idea, that’s the Qualcomm chip in both the OnePlus One and the FP2.

edit: just see you already did a suggestion for Android Phone (I should know how this page works, because I maintain the PCI ID database using the same software… but its UI keeps confusing me).

What about a “Generic Snapdragon 801 Android” device? We still assume that only Snapdragon 801 devices share this USB id, but it’s better than what is current there.

I suppose the second part of the ids (the “device” parte) is shared between Android phones, so it probably means the name should be “Generic Snapdragon Android” device, instead. I have a barely-working spare Snapdragon 400 device somewhere, I’ll try to see its USB ids and compare.

Edit: got it. It’s running an old CyanogenMod Marshmallow ROM because LineageOS wasn’t booting, oddly.

Phone Mode lsusb Note
Motorola Moto E charge only 22b8:2e82 shared with MTP storage
Motorola Moto E MTP storage 22b8:2e82
Motorola Moto E PTP transfer 22b8:2e83
Motorola Moto E charge only (ADB enabled) 22b8:2e76 shared with MTP storage (ADB enabled)
Motorola Moto E MTP storage (ADB enabled) 22b8:2e76
Motorola Moto E PTP transfer (ADB enabled) 22b8:2e84 PTP transfer +1

It uses a Motorola USB ID, but maybe we can observe some patterns? At least, last number(s) of the device id may be shared between Android devices

Edit 2: I couldn’t resist — Markdown tables are lovely. FP2 running LineageOS 7.1.2 (2018-01-09)

Phone Mode lsusb Note
Fairphone FP2 charge only 05c6:6764 shared with MTP storage
Fairphone FP2 MTP storage 05c6:6764
Fairphone FP2 PTP transfer 05c6:6771
Fairphone FP2 MIDI input 05c6:6776
Fairphone FP2 charge only (ADB enabled) 05c6:6769 (not a typo, I double-checked)
Fairphone FP2 MTP storage (ADB enabled) 05c6:6765 MTP storage +1
Fairphone FP2 PTP transfer (ADB enabled) 05c6:6772 PTP transfer +1
Fairphone FP2 MIDI input (ADB enabled) 05c6:6777 MIDI input +1
1 Like

Apparently you got the default IDs of Qualcomm from your LineageOS results, but no confirmation yet whether they are used for any other SoC than the Snapdragon 801.

For reference these are the results for the default Android 6 OS:

Phone Mode lsusb
Fairphone FP2 charge only 2ae5:90de
Fairphone FP2 MTP storage 2ae5:f003
Fairphone FP2 PTP transfer 2ae5:904d
Fairphone FP2 MIDI input 05c6:90ba
Fairphone FP2 USB tethering 2ae5:f00e
Fairphone FP2 Mass storage 2ae5:f000
Fairphone FP2 charge only (ADB enabled) disconnects and refuses to charge
Fairphone FP2 MTP storage (ADB enabled) 2ae5:9039
Fairphone FP2 PTP transfer (ADB enabled) 2ae5:904e
Fairphone FP2 MIDI input (ADB enabled) 05c6:90bb
Fairphone FP2 USB tethering (ADB enabled) 2ae5:9024
Fairphone FP2 Mass storage (ADB enabled) 2ae5:9015 according to keesj

I think you need a data scientist to see any relations in the data… I don’t see them yet.

Edit: I have added the IDs of the USB tethering mode and the mass storage (passing through SD card to computer) mode. I don’t have an SD card at hand to test the ADB + Mass storage ID.

3 Likes

That’s the Fairphone vendor id. I can see in The USB ID Repository that @keesj — former engineer at Fairphone — actually submitted it back in 2015. Should that be used in LineageOS too? I don’t know. Let’s ask @chrmhoffmann about that.

Edit: seems to be a quick patch to the root.qcom.usb.rc file: LineageOS/android_device_fairphone_FP2 - root.qcom.usb.rc

You only need to know some hexadecimal (base 16). Each two digit pair is a byte.

From here I can see in your table that last bytes for PTP tranfer and MIDI input ids (two last digits for each) have a relation of x to x + 1 with their ADB-enabled counterparts. In other words: 4e = 4d + 1, and bb = ba + 1.

Yes, I observe that relation too and am aware of the way hex works, but I don’t see how the charging ID is related to MTP, PTP etc.

1 Like

I have just added the mass storage and tethering modes to the table as well.

1 Like

I never thought to get this many replies on such a question but that’s fairphone community for us :grin:
Thank you all!

2 Likes

Ahhhh, you triggered a community to fix a free database! :grin:

Indeed ! For the record, when installing UbuntuTouch on FP2, this is the identifiant displayed, and one has to add it to the ~/.android/adb_usb.ini (see wiki) to be able to connect with adb !

1 Like

On a related note, if you are having trouble accessing FP2 with Lineage from Ubuntu via adb, add the following to “/etc/udev/rules.d/51-android.rules”

SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666"; GROUP="plugdev"

Not: When the lineage os build changes the vendor, you would need to change this line to.

Yes, it works, but this gives “world” write access to your phone.

2 Likes

Wait, it should be only plugdev. What am I doing wrong?