MTP changes with Android 12 update on Pixel 5?
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
jmtpfsand transfer files. (This is a command-line operation.)
This is no longer working. The
$ 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-detecttool, 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 devicesreports the device ID and "device", and
adb pull /path/to/file destinationworks, 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.
jmtpfsis 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-detectis from the Debian-11
mtp-toolspackage, version 1.1.17-3.
While this doesn't explain why jmtpfs is having trouble or how to fix them, let's for a moment assume that's an https://meta.stackoverflow.com/q/66377/192154 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 pushare working fine, the first option coming to mind is using https://github.com/spion/adbfs-rootless – 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 /a/89525/16575 , /a/58783/16575 and /a/53278/16575 . An advanced setup for multiple devices connected at the same time plus integration with Midnight Commander you can find in /a/216230/16575 .