Regression: MTP not working/very slow

Bug #1792085 reported by Lancillotto on 2018-09-12
202
This bug affects 41 people
Affects Status Importance Assigned to Milestone
libmtp
New
Undecided
Unassigned
gvfs (Ubuntu)
High
Unassigned

Bug Description

Hi, unfortunately (for me) MTP android devices no more work on Ubuntu 18.04.

I have used MTP on 16.04 without problems, but on 18.04 it does not work. When I connect my Android devices (Samsung A5 and Samsung J3) and I try to list directories with many files (e.g. /DCIM/Camera) the window hangs until I disconnect the device. Same issue if I try to post the command "ls /var/run/1000/gvfs/<MTP-FOLDER>".

I have installed Ubuntu 18.04 on two different machines - an older HP laptop and a recent DELL laptop - and the issue is present on the all of them.

I suspect a defect on the "libmtp". I tried many alternative solutions suggested by the net (e.g. jmtpfs and so on) but anyone worked.

That's all!

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: gvfs-fuse 1.36.1-0ubuntu1.1
ProcVersionSignature: Ubuntu 4.15.0-29.31-generic 4.15.18
Uname: Linux 4.15.0-29-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.2
Architecture: amd64
CasperVersion: 1.394
CurrentDesktop: ubuntu:GNOME
Date: Wed Sep 12 06:20:07 2018
LiveMediaBuild: Ubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 (20180725)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gvfs
UpgradeStatus: No upgrade log present (probably fresh install)

Lancillotto (antonio-petricca) wrote :
description: updated
Lancillotto (antonio-petricca) wrote :

The hang occurs when file names contain '('. The workaround is to rename that files by the Android file manager.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gvfs (Ubuntu):
status: New → Confirmed
tomaskCZ (tomaskcz4) wrote :

I just switched to Ubuntu 18.04 and I have the same problem. Unable to list files on my android phone, specifically pictures from camera. It just hangs after clicking the DCIM dir - there are no '(' file names. It works without problem on Ubuntu 16.04.

It is broken, lots of similar reports over internet, no clear solution.

Eddy White (myubu17) wrote :

I literally waited an HOUR to get to my Camera directory on my Samsung S7 (Android 9) and FINALLY got to the files. I did not have any parenthesis error as mentioned above.

HOWEVER, this was EXTREMELY slow... wow. Just to do file copies. still took a while to pull 2Gb of pics and vids. But the HOUR WAIT? Ridiculous. This this the 21st Century. This basic need should not even been a bug.

ferranb (ferranb) wrote :

Exactly the same happens to me. It's a huge issue to me because I need constantly copy files from android to ubuntu.

ferranb (ferranb) wrote :

I've tried a live ubuntu 16.04.5 LTS desktop 64 and works perfectly. The results of dpkg -s gvfs on the working ubuntu is:

Package: gvfs
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 622
Maintainer: Ubuntu Developers <email address hidden>
Architecture: amd64
Multi-Arch: same
Version: 1.28.2-1ubuntu1~16.04.2
Depends: libc6 (>= 2.14), libglib2.0-0 (>= 2.45.7), gvfs-daemons (>= 1.28.2-1ubuntu1~16.04.2), gvfs-daemons (<< 1.28.2-1ubuntu1~16.04.2.1~), gvfs-libs (= 1.28.2-1ubuntu1~16.04.2), gvfs-common (= 1.28.2-1ubuntu1~16.04.2)
Suggests: gvfs-backends
Description: userspace virtual filesystem - GIO module
 gvfs is a userspace virtual filesystem where mounts run as separate
 processes which you talk to via D-Bus. It also contains a gio module
 that seamlessly adds gvfs support to all applications using the gio
 API. It also supports exposing the gvfs mounts to non-gio applications
 using fuse.
 .
 This package contains the GIO module that lets applications use gvfs
 mounts.
Homepage: https://wiki.gnome.org/Projects/gvfs
Original-Maintainer: Debian GNOME Maintainers <email address hidden>

The dpkg -s gvfs in the not working 18.04.1 LTS:

Package: gvfs
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 368
Maintainer: Ubuntu Developers <email address hidden>
Architecture: amd64
Multi-Arch: same
Version: 1.36.1-0ubuntu1.2
Depends: libc6 (>= 2.14), libglib2.0-0 (>= 2.49.3), gvfs-daemons (>= 1.36.1-0ubuntu1.2), gvfs-daemons (<< 1.36.1-0ubuntu1.2.1~), gvfs-libs (= 1.36.1-0ubuntu1.2), gvfs-common (= 1.36.1-0ubuntu1.2)
Suggests: gvfs-backends
Description: userspace virtual filesystem - GIO module
 gvfs is a userspace virtual filesystem where mounts run as separate
 processes which you talk to via D-Bus. It also contains a gio module
 that seamlessly adds gvfs support to all applications using the gio
 API. It also supports exposing the gvfs mounts to non-gio applications
 using fuse.
 .
 This package contains the GIO module that lets applications use gvfs
 mounts.
Homepage: https://wiki.gnome.org/Projects/gvfs
Original-Maintainer: Debian GNOME Maintainers <email address hidden>

Sebastien Bacher (seb128) wrote :

Thank you for your bug report. Seems like there are different issues described there
- slowness
- filenames with a '('
- hang

Could those having the issue give some details on whether waiting works for them and it if happens only in directory with lot of files? Could you also add your journalctl log from the session/time of the issue?

Changed in gvfs (Ubuntu):
importance: Undecided → High
status: Confirmed → Incomplete
summary: - MTP no more working on Bionic
+ MTP not working/very slow on Bionic

Hi everyone.

The slow access is also observed by me on Xubuntu 18.04. It affects all tools using MTP (Thunar, Shotwell) when opening folders with many files.

In all cases the application stops responding and some (like Thunar) eventually crash entirely.
Neither disabling nor enabling previews in Thunar has any effect.

As reported by the others, it works just fine with Xubuntu 16.04.

Also, the output of "dmesg -w" shows no issue. It shows that the device connects fine -- once after hooking it up to USB and the second time after allowing the MTP access on Android.

I will try to get the "journalctl" log output on Sunday, when I get access to the affected machine again.

Yuriy Vidineev (adeptg) wrote :

Same/similar issue here.
Ubuntu 16.04 + Samsung Galaxy Note 8 - works
Ubuntu 18.04 + Samsung Galaxy Note 8 - doesn't: very slow, lost devices. Completely impossible to move photos via MTP
KDE Neon 18.04 - doesn't works as well

I think that it's something with mtp-tools/libmtp

For me only one reliable way to transfer photos via MTP - Android File Transfer for Linux https://www.omgubuntu.co.uk/2017/11/android-file-transfer-app-linux

Sebastien Bacher (seb128) wrote :

Could those having that issue maybe try for a 18.10 liveCD to see if the issue is resolved there?

Michael Kuster (user240) wrote :

I can confirm, the bug exists in Ubuntu 18.10

I tested the behaviour many times by enabling and disabling the USB-Tethering from Android phone.

I found out, than if there are more than 7 pictures on the phone, the MTP connection is VERY slow => bug
If I delete some photos, less than 7 pictures, MTP then works, but if I make some new photos MTP it is very slow again => bug

tomaszko (kossut) wrote :

any hacker can estimate when patch will be released ?
>Cheers,
tk

Valentin Crone (va-crone) wrote :

Same problem, was not reliable on 14.04 but work with a bad integration.
Integration is better on 18.04 but very very slow, and crash when opening folder with many files (like music or dcim folder).
Unusable actually...

alex (alexlab05) wrote :

I have the same problem, as I moved from Ubuntu 16.04 to 18.04 I experienced a tremendous slowness when opening folders containing lots of files.
While I did not find any actual solution, I put together a workaround that I wanted to share here as I think someone might find it useful. I'll appreciate any comment or suggestion.

https://github.com/alexlab2017/adb_photo_pull

I see this problem when I am running Calibre and connect a Kindle Fire. The Fire shows up as a mounted device in Nautilus, but has nothing on it (which is wrong). Errors from both dmesg and Calibre imply that the problem may be related to libusb_claim_interface()

dmesg shows:

[149203.958526] usb 1-1: new high-speed USB device number 6 using xhci_hcd
[149204.107572] usb 1-1: New USB device found, idVendor=1949, idProduct=00f1
[149204.107582] usb 1-1: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[149204.107589] usb 1-1: Product: Fire
[149204.107595] usb 1-1: Manufacturer: Amazon
[149204.107601] usb 1-1: SerialNumber: 00DA080750350787
[149205.439654] usb 1-1: usbfs: process 19822 (DeviceManager) did not claim interface 0 before use
[149205.567133] usb 1-1: reset high-speed USB device number 6 using xhci_hcd
[149205.715936] usb 1-1: usbfs: process 19822 (DeviceManager) did not claim interface 0 before use
[149205.716428] usb 1-1: usbfs: process 19851 (events) did not claim interface 0 before use
[149205.716462] usb 1-1: usbfs: process 19851 (events) did not claim interface 0 before use
[149205.716643] usb 1-1: usbfs: process 19851 (events) did not claim interface 0 before use
[149205.717093] usb 1-1: usbfs: process 19822 (DeviceManager) did not claim interface 0 before use

Calibre output:

Device 0 (VID=1949 and PID=00f1) is UNKNOWN in libmtp v1.1.13.
Please report this VID/PID and the device model to the libmtp development team
ignoring libusb_claim_interface() = -6PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
ignoring libusb_claim_interface() = -6LIBMTP PANIC: failed to open session on second attempt
Error while trying to open MTPDevice(busnum=1, devnum=5, vendor_id=6473, product_id=241, bcd=65535, serial=u'00DA080750350787', manufacturer=u'Amazon', product=u'Fire') (Driver: <calibre.devices.mtp.driver.MTP_DEVICE object at 0x7fa71054b090>)
Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/gui2/device.py", line 295, in detect_device
    dev.open(cd, self.current_library_uuid)
  File "/usr/lib/calibre/calibre/devices/mtp/driver.py", line 126, in open
    BASE.open(self, device, library_uuid)
  File "/usr/lib/calibre/calibre/devices/mtp/base.py", line 26, in synchronizer
    return func(self, *args, **kwargs)
  File "/usr/lib/calibre/calibre/devices/mtp/unix/driver.py", line 220, in open
    connected_device, as_unicode(e)))
OpenFailed: Failed to open MTPDevice(busnum=1, devnum=5, vendor_id=6473, product_id=241, bcd=65535, serial=u'00DA080750350787', manufacturer=u'Amazon', product=u'Fire'): Error: Unable to open MTP device with busnum=1 and devnum=5, tried 1 such devices

Arutyun (arutyun-akopov) wrote :

I have the same problem on Ubuntu 18.04 and Samsung Galaxy S9 (Android 9).

Behrouz (javanmardy) wrote :

I have this exact problem with Calibre and Kindle PaperWhite (10th Gen).
I checked every part over here )https://www.mobileread.com/forums/showthread.php?t=118560) but I think it's an OS problem.

Behrouz (javanmardy) wrote :

Also couldn't solve with "go-mtpfs"

Behrouz (javanmardy) wrote :

I checked again but this time with Cantata. It can't access my Samsung Galaxy J6 device. Must be a privilege problem or maybe I'm wrong.

Behrouz (javanmardy) wrote :

I did something else today.
Calibre on Flathub detected both my phone and my Kindle perfectly but Calibre on Bionic official repo couldn't do that. Well, official repo is version 3.21 and Flathub version is 3.46. I don't know if that's the problem.
Anyone knows what is that mean?

willdeans (william-deans) wrote :

How is this not fixed a year later? Whatever people are working on for the next release that they feel is sexy I hate it. Instead please fix bugs which make the existing system unusable. Then you will be my hero.

Valentin Crone (va-crone) wrote :

It's not the first bug who is not fixed in one or more years, the problem is, when you invite new users to discover ubuntu, at a time, they will need to connect their phone on their computer, and they will say: This doesn't work, and the fix (via mtpfs-go) is complicated for basic users.

Today from the boot to the basic usage, you have a lot of problems never fixed or ignored when reported that make ubuntu or linux in general not user friendly, and even if people with some knowledge in IT always find after some hours a way to use their favorite OS on their computer, the lambda user, who will be really happy to use ubuntu, is in fact not able to install it, or use it on some specific points like this, even if they follow a tutorial. (Boot, uefi, wifi, graphics, mtp, bugs in gui, missing basic feature or removed, sound, video, etc....)

For information, with go-mtpfs, you can set an higher timeout value, then the mtp is usable, the bug is just a timeout issue....not fixed in 1 year....

Jarno Suni (jarnos) wrote :

I had this problem, too, but it suddenly started to work in the middle of session. I don't know, if installing package android-tools-adb and pcmanfm had anything to do with it.

Like others reported here, I observe the same problem (slowness) with my Samsung Galaxy A5 and ubuntu-18.04.

I tried Android File Transfer as suggested in comment #10, and it's indeed way faster. That being said, I had to switch my phone to using the "Image transfer protocol" (MTP (or PTP?), not sure what's the actual name in english), and it seems this also sped up access via Thunar.
Switching back to "File transfer protocol", the access is again very slow under Thunar.

As other complained, this was reported 1 year ago, and apparently no progress? (No even a "OK I could reproduce the problem...)

Dark Dragon (darkdragon-001) wrote :

Same problem with Samsung Galaxy S6 on Ubuntu 19.04 and 19.10.

When I try to connect/open in Nautilus, I get the error "Unhandled error message: The name 1.153 was not provided by any .service files".

Chris Barnes (4-chris-2) wrote :

Same problem on Ubuntu 18.04 LTS with all updates and Samsung Galaxy S8. Why did Google have to implement MTP instead of good old fashioned media access over USB like we used to have ? The good old days where the storage would show up just like a USB stick ? What is the benefit of MTP ?:-(

Same problem on Ubuntu 18.04.3 LTS. ls hangs in /run/user/1000/gvfs/mtp:host=... .

Prahlad Yeri (prahladyeri) wrote :

For those experiencing the slowness problem:

I've observed that if you turn on USB Debugging (by enabling Developer Mode) on your android phone, the mtp file transfer then becomes considerably faster.

David (davidervideira) wrote :

I just had this problem yesterday with Ubuntu 18.04 with all the updates and with a brand new Xiaomi Mi A3.
Copying from the phone (Xiaomi Mi A2) wasn't that bad, I was with speeds around 20mb/s but copying the data back to the other phone was unreasonably slow. It would start at around 5mb/s and then quickly drop to around 60kb/s.

To me, enabling the USB Debugging didn't make any difference.

To me, Android File Transfer ( https://www.omgubuntu.co.uk/2017/11/android-file-transfer-app-linux ) worked as worked around, I managed to copy the files back at about 10mb/s. Not great, but workable.

As a temporary workaround ADB push/pull can be used. Mine worked with speed around 20 Mb/s.

Raul Manoel (raulmanoelr) wrote :

Same problem on Ubuntu 19.10 and galaxy S9 plus. I tried to play some videos via usb cable and during the transfer Ubuntu froze the screen. I was forced to remove the usb cable without ejecting the smartphone. = /

Sad to see that this bug has been reported for over a year and has not been resolved.

Oscar (os77) wrote :

Hello, on Ubuntu 18.04 and USB 3 try diferent android devices and MTP it's extremely slow!

jeff (jeff124578) wrote :

I was able to fix this on Ubuntu 18.04 (bionic), which comes with libmtp-common=1.1.13 by installing a newer version of libmtp 1.1.16. Now Ubuntu transfers huge numbers of songs between my phone and laptop by simply drag-and-drop in Nautilus.

    sudo apt install build-essential pkg-config wget libusb-1.0-0-dev libusb-dev

    wget http://downloads.sourceforge.net/project/libmtp/libmtp/1.1.16/libmtp-1.1.16.tar.gz
    tar xzf libmtp-1.1.16.tar.gz
    cd libmtp-1.1.16

    ./configure
    make
    sudo make install

I didn't even have to uninstall the old version, and also no need for android-file-transfer or jmtpfs.

isparnid (isparnid) wrote :

I use ubuntu 19.10 and a lg d855. The version of libmtp is 1.1.16-2.
Transfers do not work on USB3 but work on USB2 (My motherboard has both types of USB ports).

florin (florin-arjocu) wrote :

@jeff - for me it does not work your solution, maybe it is related to isparnid's comment? I only have USB3 on my Toshiba Satellite P50.

Jarno Suni (jarnos) wrote :

It is odd that this slowness happens with some directories, but not with others. For example it happens on a directory with 7 files; file names consist of letters, '-', digits and '.'. ls command on that directory takes about 5 minutes. But there are other directories (where there are more or less files) with which there is no such delay. Do you have any clue why is this?

tags: added: eoan
tags: added: regression
Jarno Suni (jarnos) wrote :

Sebastien Bacher, I attach the output of 'LC_ALL=C journalctl -b'. I issued ls command
on 11.39.34 and it took about 5 minutes to complete.

summary: - MTP not working/very slow on Bionic
+ Regression: MTP not working/very slow
Jarno Suni (jarnos) wrote :

The previous was on Xubuntu 19.10

Lancillotto (antonio-petricca) wrote :

Latest release upgrade of "libmtp" solved for the issue:

https://github.com/libmtp/libmtp/releases/tag/libmtp-1-1-17

florin (florin-arjocu) wrote :

@lancillotto Sorry for the noob question, I am trying to install it, but don't make it.

I did like the above .16 version, which worked, but this one does not.

tar xzf libmtp-libmtp-1-1-17.tar.gz
cd libmtp-libmtp-1-1-17/
./configure
bash: ./configure: No such file or directory

Should I have done something else? Thanks!

Lancillotto (antonio-petricca) wrote :

Hi I suggest you to give to configure the execution rights by "chmod +x configure".

Davide (davide-cester) wrote :

I am also affected by this bug, on Ubuntu 18.04. I can't get the list of files from a folder on the phone ("could not get object handles"). No brackets in file names, just a folder named "Camera" and default Android names for pictures.

Manually installing and linking version 1-1-17 does not help. And, by the way, release documentation is wrong, since in the archive there is no "configure" file but one has to run "autogen.sh" first, then "configure" is created.

Davide (davide-cester) wrote :

If that can be of interest, the "unlistable" folder has 124 files.

I erased all the content from the phone, then I tried to copy 127 items; 124 of them were copied, then Nautilus hang, the last three were never copied and the folder became unaccessible.

Mariusz Domański (mario.7) wrote :

I have just tried installing libmtp-1.1.17-2 on 18.04 from here:
https://launchpad.net/ubuntu/+source/libmtp/1.1.17-2/+build/18694144
files:
libmtp-common_1.1.17-2_all.deb
libmtp-runtime_1.1.17-2_amd64.deb
libmtp9_1.1.17-2_amd64.deb
(disconnect phone and after installation log out and log in back to the system or reboot for new libraries to be loaded)
Now listing files is quick and I can actually transfer files.

Allen Brian (allenbt42) wrote :

Also have this problem - on Linux Mint 19.3, XFCE with a Samsung S7. This worked fine under Mint 17.1 - listing 3500 jpeg files took 20 seconds; usually less. Now when trying to read the same directory which is now only 2500 jpeg files, both Thunar and PCMANFM take > 20 MINUTES to generate a file listing - a slowdown by a factor of 60 for a thousand fewer files. But once the listing shows up, I can scroll and do file transfers just fine. Directories of only a few hundred jpegs on the phone come up almost instantly. I can't get a more recent version of the libmtp than 1.1.13 from the repository, and I get errors that state "Dependency is not satisfiable: libmpt9(=1.1.17-2)" when I try the other solutions mentioned previously.

This is a deal breaker. Downloading pictures from my phone is one of the most common operations I perform. At this point, I may have to reconsider going back to Windows 10, which at least gets the job done - it takes roughly 40 seconds to do the directory on those 2500 files.

Yuriy Vidineev (adeptg) wrote :

@allenbt42 probably beta version of Ubuntu 20.04 could help if it has never version of libmpt

azanaz (azanaz) wrote :

Had the same issue - fixed it today by installing the libmtp 1.1.17 packages from the ubuntu-focal repositories. Seems to work OK now.

Karl Kastner (kastner-karl) wrote :

I have a similar problem in 18.04, extremely slow mpt access to a Huawei P20. Installation of libmtp9_1.1.17-2, libmtp-common_1.1.17-2 and libmtp-runtime_1.1.17-2 did not result in any improvement.

Florian Herfurth (darvan42) wrote :

I have the same Problem on Ubuntu 19.10 with a Samsung Galaxy S10 (SM-G973F)

Kernel: 5.3.0-46-generic x86_64
Architecture: arm64
Desktop: Gnome 3.34.2
gvfs: amd64 1.42.1-1ubuntu1

Davide (davide-cester) wrote :

Hi, I came back after a while and I found a nice link to deb packages at post #47 (thanks!).
I installed them and speed is improved, but file copies are still crashing randomly. The most common error message is "libmtp error: Could not send object." (it's an mp3).

I will upgrade to Ubuntu 20 as soon as possible, but I don't know what to expect. Since two years I cannot realiably move files between my smartphone and my computer, it's quite sad. At least in previous phones it was easier to extract the SD card... :-(

Davide (davide-cester) wrote :

And again folders with more than 124 items become unreadable and transfer of files crash at the 124th. So I can confirm that 1.1.17 brought not fix at all and mtp under Ubuntu 18 is still below usable levels.

Alexander Kassai (kassai) wrote :

I have the same issue, and recommend those who haven't tried it out yet, to look at post #10 ( https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/1792085/comments/10 ) and use this application in the meantime. It works reliably for me.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers