PSA: Workaround for a working MTP
KDE Connect is awesome, we all know that. But sometimes you still want (or need) to acces the files on your Android phone via a good old USB cable. And to do so, you need a working implementation of the MTP protocol.
Many people on bugzilla complain that the MTP support in Plasma is just broken. And indeed the MTP implementation we have has always been ignoring a fundamental limitation of MTP: the protocol doesn’t allow parallel operations, unlike the old Android USB mass storage did. In practice, if more than one process spawns an mtp ioslave, everything breaks.
The workaround
When you need to move files from your phone to your computer (or viceversa), either use only one dolphin window (tabs are your friends!), or use only Plasma’s Folder View.
What works
If you follow the workaround above, you will be able to copy/move files to/from your phone, or delete them.
What doesn’t work
Everything else will still be broken, unfortunately:
- you cannot copy MTP files from dolphin to the desktop.
- you cannot open e.g. a PDF file from the MTP folder; copy it somewhere else first.
- you cannot open Amarok and dolphin at the same time.
- … you get the picture.
The long term solution
Every time you open an MTP URL (e.g. mtp:/Your Phone/Documents/
), an mtp ioslave gets spawned. As soon as you open another MTP URL from another process (e.g. Amarok or Okular), a second mtp ioslave spawns. This model is just wrong for MTP, as there should be at most one place where the MTP implementation lives. A possible solution could be to use a KDED module for that, moving the MTP-specific code from the ioslave to the kded plugin. Then the ioslave would just act as proxy between the applications and the kded plugin.
We discussed this idea with David Faure at Akademy and we came up with a design to go forward. If anyone is interested in the technical details, there is a task on phabricator you can look at.
Cheers from Vienna!