Workspaces gain MTP support

For those who don’t know MTP stands for “Media Transfer Protocol”, having support for it has become really important because since Android 4.0 it is a requirement in order to manage files in any Android device, even though MTP has been here for years and other products offer support for it lilke the Nokia N9.

In order to have MTP support we needed a “kio-slave”, which has been developed by Philipp Schmidt, and then modify some parts of our workspaces (dolphin, kdelibs and notifier) to integrate the MTP devices as if they were just regular massive storage (pen drives).

As usual, small screencast showing how well it works:

Vimeo link

Direct link

How to install?
To have basic support for MTP you have to install “kio-mtp”, executing the following:

git clone http://anongit.kde.org/kio-mtp
mkdir kio-mtp/build
cd kio-mtp/build
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debugfull #(THIS MAY BE DIFFERENT)
make install

Or simply ask your distribution to package it :)

As for the Workspaces integration, I expect to get the patches in for 4.9.2 and 4.10

Cheers !

  • Markus

    Great but won’t this be a regular part of 4.10? (As we should ask distributors for packaging)

    • Philipp

      We will try to get the slave into 4.10 as well, if it is stable. So please test!

      • Manu

        Tested with a Sony Xperia S (Android 4.0.4).
        Works almost well, but is very very slow: a simple text document of 2 KB takes like 8 seconds to open; reading a folder with 41 files, aproximately 10 seconds; opening a 2 MB mp3 from that same folder, 7 sec.

        Besides that there’s another issue I don’t know who Zto blame» I can’t open any image file with Gwanview. I can copy (and them open it correctly with Gwenview), see its preview on Dolphin’s info panel and open it with Okular, Krita or Gimp, but can’t open them in Gwenview, GW complains about not being able to read the file’s metadata; it literally says “Ha fallado la carga de metainformación” (my KDE is in spanish, I don’t know how can be that warning in english, sorry).

        Anyway, even if my problem with Gwenview is due to some problem on my instalation, this slave it’s very slow but works rather well (apart from the GW issue).

        Thanks a lot for your great work, and regards.

        • Manu

          Excuse my bad english and my even worse typing dexterity (lack of).
          I meant that I can open image files directly from the phone via this great KIO slave with every graphics program I have tried except Gwenview; if I want to open it with GW I need to copy the file to some drive on my computer and then, open it with GW.

  • promeneur

    kio slave kamera manages ptp and mtp.

    there will be some conflict, no ?

    • Philipp

      Conflict: No, but they will both tell you that you can open the device with them. In my experience however the camera:/ slave doesn’t work with MTP, at leas not for my Nexus, that’s why I started kio-mtp. Additionally, a seperate MTP implementation can make use of higher level API calls than a pure P2P one.

      • Bugsbane

        I have a creative Zen Mosaic. As in Phillip’s case, camera:/ picks it up as an MTP device, and then fails to open it.

  • promeneur

    an idea : mtp over bluetooth

    since i discover bluetooth i don’t want to use a cable anymore
    and mtp is more handy to get all multimedia files (in my case video and photos) in a window according to copy them to my pc.

    today with bluetooth i must run through directory tree of my nokia 5800 to get photos then run through directory tree again to get videos

  • http://www.biglinux.com.br Bruno Gonçalves Araujo

    Parabéns, esse é um recurso muito importante para a maioria dos usuários do KDE.

    Para tornar o ambiente perfeito para conectividade entre dispositivos resta apenas melhorias na parte de bluetooth.

  • http://www.biglinux.com.br Bruno Gonçalves Araujo

    Congratulations, this is a very important feature for most users of KDE.

    To make the perfect environment for connectivity between devices remains only part of improvements in bluetooth.

  • gulja

    Thanks a lot, that is great news! Thanks a lot, that is great news! Thanks a lot, that is great news!

  • http://xardas008.wordpress.com xardas008

    Great news. And I was just thinking why my Xperia S worked once and since some time it wasn’t recognized by KDE at all (I don’t really know if it started after the upgrade from Android 2.3.3 to 4.0.4).

  • Bugsbane

    Thank you so much for working on this! Poor MTP support has been a real pain for me as my wife has an MTP based MP3 player and Android tablet and gets very annoyed when they don’t “just work” for her in KDE.

    • Philipp

      Nice we could help you there ;). If you would be so kind and test with the MP3-Player very thoroughly as I only have an Android Device. Feel free to email me to the address noted in the source code if you find anything.

  • BajK

    In the mean time also kudos to Aurelien Gateau, the picture importer in Gwenview saved me quite some headaches when getting my pictures and videos off my Nexus to the computer :)

  • Alejandro Nova

    A bit off topic, but, is there something resembling a “N9 Suite” for KDE?

    • http://www.afiestas.org afiestas

      What exactly N9 suite does?

  • CTown

    Thanks a lot for this KIO slave, the amount of devices the the Plasma Desktop is comptabile just skyrocketed!

  • Jeffery

    Off-topic, but how did you get the file transfer progress bar in the Dolphin icon on the task manager? Is that yet-to-be-released official code? I haven’t been paying attention lately.

  • Lamarque V. Souza

    That’s awesome. I have just bought a Samsung Galaxy Tab P7300 with Honeycomb installed (Android 3.1) just to find out that the USB port does not export the partition using USB mass Storage (UMS). I read on the Internet that the reason is because there is only one partition on the internal flash drive and when the OS use UMS it exports the entire partition, which makes it unaccessible by the OS (in this case by Android). To make things a little worse I had to upgrade to the git version of libmtp to access my tablet’s data through USB. The libmtp-1.1.4 does not work with my tablet. Strange enough I could not use Amarok to list my tablet’s songs even though it work (most of the time) through command line tools.

    • Philipp

      You are quite right with your analysis of why the UMS Support was dropped. Additionally exporting a partition using UMS exposes the underlying filesystem to the client, which is problematic for windows if the host (Android) is a Linux based system and therefore uses ext4 or something similar. So the sdcard partition alway had to be formatted with fat32, with all its downsides (4GB maximum filesize etc.).

      It would probably be possible to add a layer that exposes the files using a generic filesystem, but MTP is probably less problematic if client support is there (which now, it is :D).

      And the Amarok implementation is, well, broken and in dire need of a rewrite.

  • Andrii

    Unfortunately, I have faced some issues with my MP3 player. I can send a bit extended review how the KIO slave works with my Walkman.

    • http://www.afiestas.org afiestas

      You should report a bugs at http://bugs.kde.org and we can help you to track down the issue.

  • istok

    good news indeed and not a moment too soon!

  • Andrew

    CMake Error at /usr/share/cmake-2.8/Modules/FindKDE4.cmake:98 (MESSAGE):
    ERROR: cmake/modules/FindKDE4Internal.cmake not found in
    /home/amason/.kde/share/apps;/usr/share/kubuntu-default-settings/kde4-profile/default/share/apps;/usr/share/kde4/apps
    Call Stack (most recent call first):
    CMakeLists.txt:7 (find_package)

    Any idea which package i need to install to be able to compile this ?

  • promeneur

    i confirm since kde4.8.4 (i asked this feature to kio camera dev for several years) camera kio can access to ptp and mtp

    but for mtp it is buggy

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

  • Pingback: Cannot connect Samsung Galaxy S3 (Android 4) via USB cable - Page 6()

  • Manu

    Functions well -altough rather slow- with my Sony Xperia S. I now can say ciao to Airdroid. Thanks! :)

  • Jose

    Thank you! Worked perfect on a fresh Suse 12.2 install with Samsung Galaxy Nexus.

  • Pingback: Las nuevas funcionalidades de Dolphin 2.2 en KDE 4.10 » KDE Blog()

  • http://blog.geeksinaction.org JR Peck

    This is such a huge improvement. Thank you so much for your work.

    I compiled from source – looking forward to hopefully seeing this in the Fedora repos very soon.

  • http://blog.geeksinaction.org JR Peck

    It looks like this will be part of what rolls out with KDE 4.10 From what I can tell that will be finished early next month maybe. Then there will be a little time before it makes it to Fedora.

    If I install this now, per the instructions above, (I had installed it before but did a new install on my machine to Fedora 18) what would I need to do to uninstall it when it becomes supported through my updates? Or do I even need to worry about that?

    thanks so much

    • http://blog.geeksinaction.org JR Peck

      Never mind – just went into apper to make sure I had everything I need and see that kio_mtp is there now.

  • Andy

    Thanks,
    it works great with my LG P970 with CM10.
    To have it by default in 4.10 is fantastic.

  • Anestis

    Thank you for the great screencast and sharing with the public. Looking forward to going stable! In the meantime I have a question for you. I’ve installed the kio-mtp from the latest version but now when I connect my phone, the pop-up dialog for the usb device shows the Open with dolphin twice. In your screencast I noticed that it didn’t do that… it only showed open with dolphin once and once you clicked there it took you straight to mtp:/ is there any way to remove the old entry ?

  • Anestis

    as in old entry I mean the second open with dolphin going to camera:/ instead of mtp:/

  • http://zigmund.kz ZigmunD

    Is there any way to diagnose and debug kio-mtp?
    openSUSE 12.2 (x86_64)
    KDE 4.9.98
    kio-mtp 0.0.1 from KDE:Distro:Factory repo.

    Connecting Nexus 7 and nothing happening. No errors, no messages, nothing at all.

  • http://zigmund.kz ZigmunD

    Problem solved. Reinstalled libmtp from oss repo and everything works fine now. There was permission problem with new libmtp from unofficial repo.

  • Juergen

    Works like a charm on Ubuntu 12.10 and KDE 4.10 in which it was not included (used the backports ppa).

    Transferring files to my Nexus7 right now! :-)

    • Thomas

      Juergen, how did you get it working ?
      I’m on Kubuntu 12.10 KDE 4.10, but nothing happens when I try to connect my nexus 10 through MTP. Works like a charm for transfering photo from camera through PTP, though.

      Is there a package called kio-mtp ? I can not find it on my system.

      • http://blog.bauermann.eng.br/ Thiago Jung Bauermann

        It’s a pity that kio-mtp didn’t make it to KDE 4.10. I would also *love* to get it working on Kubuntu 12.10 KDE 4.10. Juergen’s silence reminds me of

        https://xkcd.com/979/

        :-)

      • http://blog.bauermann.eng.br/ Thiago Jung Bauermann

        In the spirit of not leaving the question unanswered: I just found out that installing the kio-mtp package from raring:

        http://packages.ubuntu.com/raring/kio-mtp

        Works well in Kubuntu 12.10 with KDE 4.10.

  • nero

    My test report:
    Device: Samsung Galaxy S3 (Android 4.1.2), stock ROM
    System: Debian wheezy, KDE 4.8.4, libmtp9 1.1.5 (Debian sid)

    + Files can be opend directly from the device (internal SD & external SD), except images with Gwenview “Loading meta information failed.”
    + Copying of files onto the device works reliable and fast
    – Can’t copy files >4GB (external SD is exFat and i can copy files >4GB over wifi), when trying to copy files >4GB with mtp-sendfile (mtp-tools package) the file size limit is 2,6GB. wtf?
    – Can’t create directories on the device (internal SD & external SD)
    – Can’t copy directories onto the device (empty or otherwise)

    Thank you! Keep up the great work!