Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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://.

share|improve this question
    
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 –  hbdgaf Apr 24 '13 at 0:11

2 Answers 2

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. So 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 the 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 going not going to show up in Ubuntu until 13.10 at the earliest.

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 certain other manufacturers, will not have these extensions and will never have support for normal file I/O. Unfortunately, the majority of android devices out there are Samsung's so a lot of people will be stuck with the limited functionality. They'd have to install CyanogenMod or another AOSP based replacement to get the Google stack.

share|improve this answer
3  
+1 very good explanation of limitations –  Brandon Bertelsen Apr 24 '13 at 22:22
    
Stellar answer! –  jonallard Jun 11 '13 at 22:40
    
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 2 '13 at 16:36
    
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 2 '13 at 16:42
1  
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

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 using gphoto2 from the command line.

share|improve this answer
1  
It would be nice if you could explain exactly how you should use the command like gphoto2 –  Amith KK Feb 16 at 4:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.