0

I have a Google Pixel 5 that recently updated to Android 12.

Since then, it has not been able to connect to my Debian 11 Linux desktop to transfer files in the usual way.

The "usual way" is, I have USB debugging enabled, connect the device to the computer by USB, select "Use USB for" -> "File Transfer" in the USB Preferences dialog that's available from the notifications. Then on the linux desktop, I do jmtpfs and transfer files. (This is a command-line operation.)

This is no longer working. The jmtpfs invocation reports:

$ jmptfs /mnt/android
Device 0 (VID=18d1 and PID=4ee2) is a Google Inc Nexus/Pixel (MTP+ADB).
error returned by libusb_claim_interface() = -6LIBMTP PANIC: Unable to initialize device
terminate called after throwing an instance of 'MtpErrorCantOpenDevice'
  what():  Can't open device
Aborted

If I change the selection away from "File Transfer / Android Auto" in the USB prefs, I just get No mtp devices found.

I also have an mtp-detect tool, which reports the same error:

$ mtp-detect
libmtp version: 1.1.17

Listing raw device(s)
Device 0 (VID=18d1 and PID=4ee2) is a Google Inc Nexus/Pixel (MTP+ADB).
   Found 1 device(s):
   Google Inc: Nexus/Pixel (MTP+ADB) (18d1:4ee2) @ bus 2, dev 92
Attempting to connect device(s)
error returned by libusb_claim_interface() = -6LIBMTP PANIC: Unable to initialize device
Unable to open raw device 0

I can use the adb tool. adb devices reports the device ID and "device", and adb pull /path/to/file destination works, so it is still possible to do the file operations I want to do, but I'm mystified by the change in behavior.

This activity is kind of irregular, so I can't prove it was the Android 12 update that caused it, there have also been routine package updates on the desktop, but the Android update seems like the logical suspect, given that Debian package updates rarely cause breakage.

The fact that adb works suggests the fundamentals (hardware, cables, device detection, Linux drivers) are probably OK.

Maybe some kind of extra layer of MTP permissions in Android 12? A change in the MTP protocol that's gotten ahead of the Linux command-line tools?

Any help greatly appreciated.

Android build is #SP2A.220505.002.

jmtpfs is the Debian-11 packaged version, and reports:

$ jmtpfs --version
jmtpfs version: 0.5
FUSE library version: 2.9.9
fusermount3 version: 3.10.3
using FUSE kernel interface version 7.19

mtp-detect is from the Debian-11 mtp-tools package, version 1.1.17-3.

5
  • "A change in the MTP protocol that's gotten ahead of the Linux command-line tools?" - Possible may be a minor bug that prevents connection. You are using Debian this is a realistic cause as Debian usually ships with pretty old software. But according to the jmtpfs repo on Github the last commit was nearly 10 years ago...
    – Robert
    May 13, 2022 at 7:12
  • 1
    I have much better experiences using adbfs. Way better performance compared to MTP. And as you report adb pull and adb push is working for you I'm confident so will adbfs. (if that is a suitable solution for you just let me know and I expand it to an answer – or wait, I already did that here and here).
    – Izzy
    May 13, 2022 at 7:18
  • Thanks @Izzy, that does indeed work. I'm not sure how to read your evident snark, but if you expand it to an answer I'll accept it. In my diagnostic efforts, I did see a few references to adbfs, maybe even yours, but at the time I was not interested in "what is a way to mount my phone", my question was closer to "why doesn't jmtpfs work anymore". Still don't have an answer to that one, but workarounds also count. May 13, 2022 at 20:37
  • MTP is a very protocol that does not allow concurrent requests. Is it possible that you have updated some UI related components or services that automatically try to access the phone via MTP concurrently and thus interfere with jmtpfs?
    – Robert
    May 15, 2022 at 17:04
  • @Robert Good thought, this looks like it! I previously searched for mounts with "mpt" or "Pixel" in the name, and there aren't any, but following your hint, I searched the process table for "mtp", and found a /usr/libexec/gvfs-mtp-volume-monitor process, and sure enough, when you turn on file-transfer on the phone, a directory appears under /run/user/<my-uid>/gvfs/mtp:host=Google_Pixel_5_<phone_id>. This is also new-to-me behavior, but good to find! May 15, 2022 at 22:19

1 Answer 1

1

While this doesn't explain why jmtpfs is having trouble or how to fix them, let's for a moment assume that's an XY problem and tackle the real one: How can you properly mount your phone so it is accessible in the Linux file system?

As you state that adb pull and adb push are working fine, the first option coming to mind is using adbfs – which is what I do successfully for about 10 years now and am quite happy with. adbfs sits on top of ADB and utilizes ADB pull/push for file transfers plus other ADB commands (e.g. adb shell ls) for other background information. It works reliably and stable, is transparent to the entire system (so you can access the device from the command line as well as from GUI applications), plus transfers are much faster than via MTP.

For setup etc. please refer to my answers here, here and here. An advanced setup for multiple devices connected at the same time plus integration with Midnight Commander you can find in my answer here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .