14

Ubuntu 13.04 comes with MTP support to access files on newer Android devices. My Nexus 10 works OK: after plugging in, I can access the N10 files with Nautilus, and I can copy from and to the device. Evince will open PDF files right from the device, but some applications fail to open files directly from the device like gedit or libreoffice. Gedit says something like:

Cannot open file mtp://[usb:001,009]/65537/5823/5824

I guess MTP is integrated at the gvfs level, so should not all gvfs-enabled applications be able to access the MTP device? Why evince but not gedit?

I know that MTP could be mounted with fuse, but it would be nice if it worked with regular applications from Nautilus just like sftp:// or smb://.

karel
  • 114,770
jjchico
  • 179
  • I had this problem when using a vmware virtual machine. Could be related to latency on the usb passthrough or presenting as more than one device/subdevice and not getting completely passed through pure speculation – RobotHumans Apr 24 '13 at 00:11

2 Answers2

29

The MTP specification doesn't support the basic open/read/write/close operations that are required to implement normal file access on Linux - it only provides upload/download for files, and that's what the MTP backend implements.

Nautilus will copy files just fine, but as soon as you try to use an application that doesn't explicitly account for the restricted set of operations, you'll get an error. evince is an example of an app that does support it (it copies the file to /tmp then opens it).

So, that's what's going on in 13.04.

Now, it happens to be the case that Google implemented a set of MTP extensions in Android that offer open/read/write/close, and it's possible to provide normal file access with these. I've done this work in the gvfs development branch but it missed the 1.16 release window, so it's not going to show up in Ubuntu until 13.10 at the earliest. 14.04 and still not there

In the meantime, you can use my ppa to install builds where I have backported this work.

https://launchpad.net/~langdalepl/+archive/gvfs-mtp

Finally, it's important to note that these extensions only exist in Google's MTP stack. You have a Nexus 10, so it will work as it's running stock Android - but someone using a Samsung device, or devices from other manufacturers, will not have these extensions and might not have support for normal file I/O.

ElefantPhace
  • 3,190
  • 3
  • 18
  • 29
langdalepl
  • 324
  • 2
  • 3
  • However it seems that Windows 7 have those extra capabilities or a workaround, and it's pretty useful. It would be nice if those "extras" were implemented in Ubuntu too – Álvaro Oct 02 '13 at 16:36
  • 1
    As a workaround a read operation could just be a download to /tmp and read from it, which Nautilus could perform automatically to let the user have the impression of a read operation. And with similar things you can issue write (download to /tmp , modify and upload to the device) – Álvaro Oct 02 '13 at 16:42
  • 2
    I've never been comfortable with the implicit download/upload behaviour - it can be a very unpleasant surprise for the user, and I didn't want to introduce it. Consider what happens if you have a multi-gigabyte movie on there that you want to watch, so you double click on it and then it suddenly starts downloading to your /tmp which is really a tmpfs... Or you want to edit some document and you open, do some work and then save, but your computer crashes before the fs can upload it back, and the intermediate file was stored in /tmp, which is a tmpfs so it's lost when you restart. Unfriendly! – langdalepl Oct 11 '13 at 21:20
  • @Álvaro Just FYI, MTP specification were developed by Microsoft. So many of the capabilities of MTP seem to work great an Window Devices but not so much elsewhere. – RomaH Feb 04 '14 at 17:34
0

I had trouble getting photos off my Fujifilm FinePix S1500. Error message:

Operation not supported by backend

I solved it by umounting the camera and copying the files from the command line using gphoto2.

andrew.46
  • 38,003
  • 27
  • 156
  • 232
Cliff
  • 9
  • 1