Score:2

MTP file transfer not working with Ubuntu/Kubuntu 20.04

uz flag

I just have a fresh install of Kubuntu 20.04 on an Acer Swift 3 laptop. I ran into problem with transferring files from my Android phone. Here was the steps I went through:

  1. Plug the phone into USB port. The device shows up on Kubuntu (Dolphin and popup notification)
  2. Unlock the phone and accept permission.
  3. Click on the device and got the following error:

No storage media found. Make sure your device is unlocked and has MTP enabled in its USB connection settings.

When I run mtp-detect, I got the following error:

$ mtp-detect
libmtp version: 1.1.17

Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
Found 1 device(s):
Samsung: Galaxy models (MTP) (04e8:6860) @ bus 3, dev 11
Attempting to connect device(s)
error returned by libusb_claim_interface() = -6LIBMTP PANIC: Unable to initialize device
Unable to open raw device 0
OK.

dmesg:

[ 1799.438225] usb 3-1: new high-speed USB device number 16 using xhci_hcd
[ 1799.593572] usb 3-1: New USB device found, idVendor=04e8, idProduct=6860, bcdDevice= c.00
[ 1799.593575] usb 3-1: New USB device strings: Mfr=7, Product=8, SerialNumber=9
[ 1799.593576] usb 3-1: Product: SAMSUNG_Android
[ 1799.593577] usb 3-1: Manufacturer: SAMSUNG
[ 1799.593578] usb 3-1: SerialNumber: 27a0c9216c1c7ece
[ 1799.603905] cdc_acm 3-1:1.1: ttyACM0: USB ACM device

lsusb:

$ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 1c7a:0575 LighTuning Technology Inc. EgisTec EH575
Bus 003 Device 002: ID 0408:a094 Quanta Computer, Inc. HD User Facing
Bus 003 Device 004: ID 8087:0026 Intel Corp. 
Bus 003 Device 016: ID 04e8:6860 Samsung Electronics Co., Ltd Galaxy series, misc. (MTP mode)
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

But something is really strange. It works if I do the following:

  1. Plug the phone into laptop.
  2. Boot the laptop.
  3. Once Kubuntu loaded, run $ mtp-detect. This time mtp-detect no longer reports any error.
  4. Access the phone device via Dolphin works now.

Then MTP file transfer will work, until the phone is unplugged. Replugging the phone in will not work anymore.

I really have no idea what is going on. Any help is much appreciated.

cc flag
Check your Android USB settings, or maybe when the USB notice of a new device shows up on the phone, click on it. Select MTP from the list of how to connect to the device.
meter avatar
uz flag
It is already in MTP mode, so I don't think it is the phone's settings issue.
hoatzin avatar
bv flag
The method described of re-booting computer while attached to Android device worked for me and is suitable workaround for me. Thank you for sharing!
Score:2
in flag

I'm also confronted by this bug and have discovered this issue reported elsewhere:

https://bugs.mageia.org/show_bug.cgi?id=28216

And here:

https://bugs.kde.org/show_bug.cgi?id=442170

If I understand correctly, a fix is available here:

https://github.com/libusb/libusb/commit/f6d2cb561402c3b6d3627c0eb89e009b503d9067

Unfortunately, my Linux Voodoo only goes so far. I don't know how to implement this fix, but maybe you do. It might also be possible to install later versions of Libusb (the package that seems to be at issue):

https://packages.ubuntu.com/search?keywords=libusb

But I leave that to others better suited to advise. I only post this with the hope that others with more experience can explain to us how to implement the fix.

meter avatar
uz flag
I just found this page relating to libmtp: https://sourceforge.net/p/libmtp/bugs/1868/ However, I tried closing everything down but still not able to connect via MTP. I don't know what else is owning the MTP connection if it is really the case as described in the above link.
nkoniishvt avatar
tr flag
Thank you for finding the commit on libusb. For anyone on Debian, you can add Debian sid in apt sources.list file, then apt-get update and then upgrade libusb-1.0, reconnect your phone or whatever and everything works.
Score:0
gb flag

I turned off USB debugging on my android and this problem was solved.

Score:0
in flag

I haven't solved the bug but did find a workaround that works for me.

  1. Connect the phone. Choose "This Device", then choose Data Transfer.
  2. Three options (under Plasma) will be provided. Choose Data Transfer and Dolphin will open with the error above.
  3. Choose "Connected Device" on the phone as the controlling device. Give it a minute to reset.
  4. Once it has reset, re-choose "This Device" when the option becomes available.
  5. Choose "Data Transfer" on the phone, then choose the same option from the Plasma popup.

This seems to be a reproducible workaround on my system.

meter avatar
uz flag
Yes, I found that even Dolphin shows the error. If I plug in the phone and ***wait for a minute or so***, I can access the phone via MTP!
Hugolpz avatar
jp flag
Where do you have "This device" ?
hoatzin avatar
bv flag
When I try this I get "Couldn't switch". Ugh.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.