Can't browse MTP device starting with Android 4 (e.g. Galaxy Nexus) with gmtp

Bug #986722 reported by Laurent Dinclaux
402
This bug affects 83 people
Affects Status Importance Assigned to Milestone
libmtp
Confirmed
Undecided
Unassigned
gmtp (Ubuntu)
Confirmed
Medium
Unassigned
Precise
Won't Fix
Medium
Unassigned
Quantal
Won't Fix
Medium
Unassigned

Bug Description

I just plug my Galaxy Nexus and launch those commands:

$ gmtp
Device 0 (VID=04e8 and PID=6860) is a Samsung GT-P7310/P7510/N7000/I9100/Galaxy Tab 7.7/10.1/S2/Nexus/Note.
Android device detected, assigning default bug flags
Error 1: Get Storage information failed.
Error 2: PTP Layer error 02fe: get_handles_recursively(): could not get object handles.
Error 2: (Look this up in ptp.h for an explanation.)
Erreur de segmentation (core dumped)

$ gmtp
Device 0 (VID=04e8 and PID=6860) is a Samsung GT-P7310/P7510/N7000/I9100/Galaxy Tab 7.7/10.1/S2/Nexus/Note.
PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
LIBMTP PANIC: failed to open session on second attempt
Détecté: Impossible d'ouvrir le périphérique brut?
LIBMTP PANIC: Trying to dump the error stack of a NULL device!
LIBMTP PANIC: Trying to clear the error stack of a NULL device!

$ mtp-detect
libmtp version: 1.1.3

Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung GT-P7310/P7510/N7000/I9100/Galaxy Tab 7.7/10.1/S2/Nexus/Note.
   Found 1 device(s):
   Samsung: GT-P7310/P7510/N7000/I9100/Galaxy Tab 7.7/10.1/S2/Nexus/Note (04e8:6860) @ bus 1, dev 8
Attempting to connect device(s)
PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
LIBMTP PANIC: failed to open session on second attempt
Unable to open raw device 0
OK.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: gmtp 1.3.1-2
ProcVersionSignature: Ubuntu 3.2.0-23.36-generic 3.2.14
Uname: Linux 3.2.0-23-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.0.1-0ubuntu5
Architecture: amd64
Date: Sun Apr 22 10:50:30 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha amd64 (20120316)
ProcEnviron:
 TERM=xterm
 PATH=(custom, user)
 LANG=fr_FR.UTF-8
 SHELL=/bin/bash
SourcePackage: gmtp
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Laurent Dinclaux (dreadlox) wrote :
Changed in gmtp (Ubuntu):
status: New → Confirmed
Revision history for this message
Fabounet (fabounet03) wrote :

Same here with a galaxy Tab 8.9, and libmtp compiled from GIT :

# mtp-detect
libmtp version: 1.1.3

Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung GT-P7310/P7510/N7000/I9100/Galaxy Tab 7.7/10.1/S2/Nexus/Note.
   Found 1 device(s):
   Samsung: GT-P7310/P7510/N7000/I9100/Galaxy Tab 7.7/10.1/S2/Nexus/Note (04e8:6860) @ bus 8, dev 5
Attempting to connect device(s)

PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
LIBMTP PANIC: failed to open session on second attempt
Unable to open raw device 0
OK.

Note that it has probably nothing to do with gmtp, which is merely a graphic front-end to libmpt.

Changed in libmtp:
status: New → Confirmed
Revision history for this message
Alessio Treglia (quadrispro) wrote :

Could you try to reproduce this with the latest upstream snapshot available in Quantal?

Revision history for this message
Zayed Amer Al-Saidi (zayed-alsaidi) wrote :

same issue with Galaxy Nexus (GSM version):
$ mtp-detect
libmtp version: 1.1.3

Listing raw device(s)
Device 0 (VID=04e8 and PID=685c) is a Samsung Galaxy Nexus/Galaxy S i9000/i9250, Android 4.0 updates.
   Found 1 device(s):
   Samsung: Galaxy Nexus/Galaxy S i9000/i9250, Android 4.0 updates (04e8:685c) @ bus 2, dev 11
Attempting to connect device(s)
Android device detected, assigning default bug flags
Error 1: Get Storage information failed.
Error 2: PTP Layer error 02fe: get_handles_recursively(): could not get object handles.
Error 2: (Look this up in ptp.h for an explanation.)
USB low-level info:
   Interface has a kernel driver attached.
   bcdUSB: 512
   bDeviceClass: 0
   bDeviceSubClass: 0
   bDeviceProtocol: 0
   idVendor: 04e8
   idProduct: 685c
   IN endpoint maxpacket: 512 bytes
   OUT endpoint maxpacket: 512 bytes
   Raw device info:
      Bus location: 2
      Device number: 11
      Device entry info:
         Vendor: Samsung
         Vendor id: 0x04e8
         Product: Galaxy Nexus/Galaxy S i9000/i9250, Android 4.0 updates
         Vendor id: 0x685c
         Device flags: 0x0800a106
Configuration 0, interface 0, altsetting 0:
   Interface description contains the string "MTP"
   Device recognized as MTP, no further probing.
Device info:
   Manufacturer: samsung
   Model: Galaxy Nexus
   Device version: 1.0
   Serial number: 0149BD310100F014
   Vendor extension ID: 0x00000006
   Vendor extension description: microsoft.com: 1.0; android.com: 1.0;
   Detected object size: 64 bits
   Extensions:
        microsoft.com: 1.0
        android.com: 1.0

Revision history for this message
jeremy-list (quick-dudley) wrote :

The output from the build in Quantal is as follows:

jeremy@hector:/tmp$ mtp-detect
libmtp version: 1.1.3

Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung GT P7310/P7510/N7000/I9070/I9100/I9300 Galaxy Tab 7.7/10.1/S2/S3/Nexus/Note/Y.
   Found 1 device(s):
   Samsung: GT P7310/P7510/N7000/I9070/I9100/I9300 Galaxy Tab 7.7/10.1/S2/S3/Nexus/Note/Y (04e8:6860) @ bus 2, dev 45
Attempting to connect device(s)
PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
LIBMTP PANIC: failed to open session on second attempt
Unable to open raw device 0
OK.

Revision history for this message
Simplehuman (simplehuman) wrote :

Problem is realy actual, I am forced to use Windows to copy files on my Galaxy Nexus, because in Ubuntu it just don't show any files.

Revision history for this message
Jan Gutter (ubuntu-jangutter) wrote :

Hi, I recently posted this in bug 903422:

Have you tried using jmtpfs?

http://research.jacquette.com/jmtpfs-exchanging-files-between-android-devices-and-linux/

It's working for me on my Galaxy Nexus (JB and ICS), and I've also had luck with it with a Galaxy S3 (ICS). (I'm using 12.04 with the latest libmtp)

Unfortunately mtp is still really slow: keep in mind it was never really designed to scale, and mapping it on to a filesystem will always be imperfect.

The long and the short of it, it seems the bug is NOT in libmtp (since jmtpfs also uses libmtp). gmtp and gvfsd uses a much older method to access mtp devices which involves downloading the entire directory structure beforehand. Turns out that this can take a looooong time (mtp is *SLOW*) which causes timeouts and very unhelpful error messages in the rest of the system.

Google put everyone slightly between a rock and a hard place here. The options are:
1) Support old-style (Microsoft) devices and fail horribly on new-style (Android). (Do nothing)
2) Break backward compatibility (HEAVEN FORBID!)
3) Emulate what Windows does. Since they seemed to design it for Windows in the first place...

I have a private bet with myself what the eventual solution is going to be. I hope I'm wrong.

Jan

Revision history for this message
Onlyodin (ubuntu-xsnet) wrote :

I can confirm this issue still exists, even in Quantal Daily Build downloaded a couple of hours ago.

'Sorry, could not display all the contents of "Galaxy Nexus": Timeout was reached'

And I'm not about to bother trying jmtpfs until it's packaged appropriately.

Revision history for this message
Laurent Dinclaux (dreadlox) wrote :

@Jan Nah MTP isn't slow by itself.

I often use my Nexus devices to exchange data with my customers using windows and I find it quite fast in fact!

Revision history for this message
Laurent Dinclaux (dreadlox) wrote :

There are 1 million of android devices activated daily, that is about 1 million people that can't transfer data between their mobile device and Ubuntu. Do not expect that these people will ever switch to Ubuntu anytime soon!

Canonical should take that bug into high consideration, why not asking Google to help solving it too, they are responsible about that switch to MTP and they use Linux a lot.

Revision history for this message
Dan Burzynski (contax) wrote :

I suspect that those 1 million people were never potential Ubuntu customers. ;-)

But I agree, I think that this bug needs a priority boost. Not only because it affects me directly, but also because mobile phones are pretty ubiquitous, Android's an important OS on them and Samsung's the main producer of this platform.

I've never been able to sync my phone to Ubuntu, which is sad as it's one of those things that I feel should "just work" if Ubuntu wants to position itself as an OS for the people.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

And not all 1 million of those devices are galaxy nexus or jelly bean ones. Still, very annoyed that I can transfer files to and from my super proprietary iPod with Ubuntu but not my galaxy nexus :(

BTW, I posted in another bug that with Fedora and SuSE it worked with no timeouts:
https://bugs.launchpad.net/ubuntu/+source/udev/+bug/903422/comments/59
https://bugs.launchpad.net/ubuntu/+source/udev/+bug/903422/comments/60

So maybe Ubuntu just needs to grab a patch or something.

Revision history for this message
Laurent Dinclaux (dreadlox) wrote :

"I suspect that those 1 million people were never potential Ubuntu customers. ;-)"

Every person not using Ubuntu is a potential Ubuntu user.

"And not all 1 million of those devices are galaxy nexus or jelly bean ones"

This concerns all ICS equipped phones too. The number of devices having at least ICS is groing fast as device are being upgraded (eg. Galaxy S2, Transformer TF300) or bought (eg. Galaxy Nexus, HTC OneX, S3 and so on). And it is going to go faster.

Revision history for this message
Ludovico (aasonykk) wrote :

I need to switch to windows every times I need to copy files. This is really annoying :(

Revision history for this message
Brownie in Motion (brownianmotion) wrote :

For those people getting the error:

"PTP_ERROR_IO: failed to open session, trying again after resetting USB interface"

Something else has accessed the PTP session. One common one is gvfs-gphoto2-volume-monitor. Try killing that, and then try again.

(For me, it gets rid of that error, but then the S3 hits another error later...)

Revision history for this message
Mike Morris (mikro2nd) wrote :

Confirming this with the combination of Asus Transformer TF101/Android 4.0.3 and Kubuntu 12.04 fully up to date.

This is beyond annoying! Can anyone comment on whether this is fixed in other apt-based distros?

Revision history for this message
psypher (psypher246) wrote :

Can this bug please be assigned and attended to, it is clearly a big issue for many with 279 people being affected @ bug 903422 and 44 people so far on this bug.

My nexus was mounting in Nautilus fine up to the last update a couple of days ago.

This shouldn't be an issue at all and canonical should make big efforts to get all android devices full supported in Ubuntu!

Changed in gmtp (Ubuntu):
importance: Undecided → High
Changed in gmtp (Ubuntu Precise):
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Simplehuman (simplehuman) wrote :

Ubuntu 12.10 x64 with the latest updates - the problem is still there.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

This is not a release blocker (and precise already shipped with it). Keeping someone working on it, however, downgrading to medium

Changed in gmtp (Ubuntu Quantal):
importance: High → Medium
Changed in gmtp (Ubuntu Precise):
importance: High → Medium
Revision history for this message
Thomas Hotz (thotz-deactivatedaccount) wrote :

Does this happen with Android 4?

Changed in gmtp (Ubuntu Precise):
status: Confirmed → Incomplete
Changed in gmtp (Ubuntu Quantal):
status: Confirmed → Incomplete
Revision history for this message
Thomas Hotz (thotz-deactivatedaccount) wrote :

Yes I see you use Android 4.

Changed in gmtp (Ubuntu Precise):
status: Incomplete → Confirmed
Changed in gmtp (Ubuntu Quantal):
status: Incomplete → Confirmed
summary: - Can't browse MTP device (Galaxy Nexus)
+ Can't browse MTP device starting with Android 4
summary: - Can't browse MTP device starting with Android 4
+ Can't browse MTP device starting with Android 4 (e
summary: - Can't browse MTP device starting with Android 4 (e
+ Can't browse MTP device starting with Android 4 (e.g. Galaxy Nexus) with
+ gmtp
Revision history for this message
Thomas Hotz (thotz-deactivatedaccount) wrote :

I tried with my LG Optimus P700 and it also failed.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I said in another bug that was closed as duplicate that it worked with fedora and suse, so they must have some patch. The package maintainer could take a look there.

Revision history for this message
mue.de (emuede) wrote :

Confirming this using Samsung Galaxy S2 with Kubuntu Precise Pangolin (12.04 LTS); I've also tried the tool 'kio-mtp' to implement the mtp-protocol in Dolphin (w/o success)

Revision history for this message
Bogdan Radu (bog-radu) wrote :

Confirmed with 12.10, newest update.
mtp-files, mtp-folders, mtp-detect take abnormally long to work, and you can't browse anywhere in the GUI itself, as the device just times out.

gmtp also takes forever, and times out/errors out or produces garbage before disconnecting.

Can we get some traction on this, seeing as many people are running into this snag (this was brought to my attention by a co-worker who's just trying Ubuntu for the first time).

This is affecting real people, and it is a dealbreaker for him.

Revision history for this message
Vincent Gerris (vgerris) wrote :

same issue confirmed here on ubuntu 12.10 with latest updates when in camera mode
I am using a Galaxy Note 2.
In MTP mode i get time outs, mtp-detect says :

ubuntu@ubuntu-Latitude-D630:~$ mtp-detect
libmtp version: 1.1.4

Listing raw device(s)
   No raw devices found.
ubuntu@ubuntu-Latitude-D630:~$

on MTP mode i get:
ubuntu@ubuntu-Latitude-D630:~$ mtp-detect
libmtp version: 1.1.4

Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung GT P7310/P7510/N7000/I9070/I9100/I9300 Galaxy Tab 7.7/10.1/S2/S3/Nexus/Note/Y.
   Found 1 device(s):
   Samsung: GT P7310/P7510/N7000/I9070/I9100/I9300 Galaxy Tab 7.7/10.1/S2/S3/Nexus/Note/Y (04e8:6860) @ bus 2, dev 7
Attempting to connect device(s)
PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device

On MTP mode there are timeouts. In Camera mode, only the internal file sytem of the phone is mounted, not the SD.
After some Time, gMTP seems to work, the bug seems to be that it takes such a long time.
It seems to be fixed in Fedora 17 and this solution is also quick for me (but less likable):
http://www.webupd8.org/2012/12/how-to-mount-android-40-ubuntu-go-mtpfs.html

Revision history for this message
Martin Stjernholm (msub) wrote :

I've unmarked this bug as a duplicate of #903422 since that bug is marked as fixed but this issue is still around in Saucy, using libmtp 1.1.6.

The behaviour is erratic - sometimes mtp-detect, gmtp, etc work but with excessive delays (i.e. many minutes), and sometimes they fail with messages like this:

Error 2: PTP Layer error 02fe: get_track_metadata(): call to ptp_mtp_getobjectpropssupported() failed.
Error 2: Error 02fe: PTP: Protocol error, data expected

They invariably fail this way when it comes to actually transferring data to the device, in my experience.

https://sourceforge.net/p/libmtp/bugs/902/ might be considered an upstream bug for this issue.

I'm pinging to make it known that this is still ongoing and fairly annoying since music apps can't sync. Interestingly, go-mtpfs works even though it's still compiled against libmtp 1.1.5 in the webupd8team ppa.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

quantal has seen the end of its life and is no longer receiving any updates. Marking the quantal task for this ticket as "Won't Fix".

Changed in gmtp (Ubuntu Quantal):
status: Confirmed → Won't Fix
Revision history for this message
Alessio Treglia (quadrispro) wrote :

This should be fixed now in recent releases.

Revision history for this message
Steve Langasek (vorlon) wrote :

The Precise Pangolin has reached end of life, so this bug will not be fixed for that release

Changed in gmtp (Ubuntu Precise):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.