MTP connection problem with error "libusb_open() failed!"

1,188 views
Skip to first unread message

Arwen Bu

unread,
Dec 4, 2014, 2:12:24 AM12/4/14
to chromiu...@chromium.org
Hi all,

As I got the information that chromium os can support MTP connection now,
I tried to test MTP related modules and research them.

Test environment : Release-R38-6158.B  (with some modification for my work)

But after I plugged in my android phone, it could not work.

I tried to find out what happened, so I started "mtpd" services manually.
minijail0 -u mtp -g mtp -G -- /opt/google/mtpd/mtpd -minloglevel=1

And then I plugged in in the phone, it showed,
Device 0 (VID=12d1 and PID=1051) is a Huawei Honor U8860.
libusb_open
() failed!: Permission denied
LIBMTP PANIC
: Unable to initialize device


I tried to fix this problem, so I found a solution from the network.
I added a file "51-android.rules" in /etc/udev/rules.d, and listed my phone's information in it.
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", ATTR{idProduct}=="1051", MODE="0666"

Then I restarted udev service and mtpd service, tried to connect my phone again, it worked.
Device 0 (VID=12d1 and PID=1051) is a Huawei Honor U8860.
Android device detected, assigning default bug flags


But, I tried my phone in my chromebook, it worked well without "51-android.rules".
And I searched in libmtp support list, device 12d1:1051 was already supported.

I tried another Sansung phone, it showed the same problem.
Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
libusb_open() failed!: Permission denied
LIBMTP PANIC: Unable to initialize device



I don't think it's a good idea to change "51-android.rules" each time I plug in a different device.
So it should work as chromebook which can access different devices automatically.

I think maybe some configuration I modified causes this problem, but I cannot find out what it is.

Would you please help to provide some suggestion what problem may cause this error?

Thanks.
A.B

Mike Frysinger

unread,
Dec 4, 2014, 2:46:26 AM12/4/14
to Arwen Bu, chromium-os-dev, Lei Zhang
[ +thestig ]
-mike

--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en


Lei Zhang

unread,
Dec 4, 2014, 3:27:53 AM12/4/14
to Arwen Bu, chromium-os-dev, Mike Frysinger
(Replying again for chromium-os-dev to see)

Hi Arwen,

Are you saying Chromebooks can access MTP devices without any
problems, but your custom ChromiumOS environment requires an
additional udev rule to make it work?

Arwen Bu

unread,
Dec 4, 2014, 3:37:29 AM12/4/14
to chromiu...@chromium.org, arw...@gmail.com, vap...@chromium.org
Hi Lei,

Yes. 

I guess some problem with udev, but I cannot confirm it.

Lei Zhang

unread,
Dec 4, 2014, 3:57:16 AM12/4/14
to Arwen Bu, Chromium OS dev, Mike Frysinger
The only extra rule I remember adding is in 55-mtpd.rules in [1]. I
don't recall touching udev beyond that. I can go look at one of the
Chromebooks in the office that's in dev mode and see what the udev
rules are there. You can too in dev mode. [2]

[1] https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/master/chromeos-base/chromeos-base/files/udev-rules/
[2] http://www.chromium.org/chromium-os/poking-around-your-chrome-os-device

Arwen Bu

unread,
Dec 4, 2014, 5:05:56 AM12/4/14
to chromiu...@chromium.org, arw...@gmail.com, vap...@chromium.org
Hi Lei,

I tried this, but it doesn't take effort.

Lei Zhang

unread,
Dec 4, 2014, 3:29:05 PM12/4/14
to Arwen Bu, Chromium OS dev, Mike Frysinger
I tested with a Chromebook: the /dev/bus/usb/MMM/NNN device node is
owned by root:usb with permission 664. The mtp user that runs mtpd is
also in the usb group according to /etc/group.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages