As soon as I plug my usb mtp device, udev launches the KIO MTP module. It opens the usb device and doesn't release it when it is not in use.
Other programs which doesn't support KIO can not access it anymore.
See this bug report :
kde Frameworks 5.62
I still have this problem more than a year later the bug report
Can this be solved?
I cannot use the MTP interface unless I pop up the command line and kill kiod5.
Why does kiod5 hangs my tablet anyway?
Indeed, same here on Debian with Plasma 5.21.5, Frameworks 5.82, Gears 21.04 - kiod does not release a claimed USB MTP device and blocks all other devices (in particular Calibre in my case).
Killing the kiod process that holds the lock (to be found with fuser /dev/libmtp...) resolves this problem, but is not optimal.
I am having the same problem: after boot, when I connect my phone, I can access files just fine. When I unplug and replug, I can no longer connect. I am doing a lot of unplugging and replugging since I am migrating from an old to a new phone. I basically have to reboot my entire system each time since KDE refuses to ever let go of that MTP connection.
I hope killing kiod5 does not have too adverse side-effects. I can recommend "android-file-transfer" -- as long as KDE stays out of the way, it is a very reliably tool to access MTP devices.
Could this be fixed?
Have to manually kill kiod5, then run mtp-detect to mount the device properly.
Manufacturer: Samsung Electronics Co., Ltd.
Another workaround, I have found:
If you do not use KIO MTP at all (since you only use something like "jmtpfs"), you can "disable kmtpd":
# chmod 000 /usr/lib/x86_64-linux-gnu/qt5/plugins/kf5/kiod/kmtpd.so
After restarting, mounting my android mobile phone with jmtpfs (MTP protocol) worked again.
Thanks to user "arkonbob" at reddit for bringing up this solution: https://www.reddit.com/r/kde/comments/mvrtck/restarting_kiod/
I am using Debian 11 (Bullseye):
* KDE Frameworks 5.78.0
* Qt 5.15.2
Another workaround is to switch to a runlevel without graphical desktop. This stops KDE and KIOD. (In my case I want to run some scripts to backup the data on my mobile phone, so I don't need a graphical desktop while these scripts are running.)
I you use systemd, you can do the following:
* log out from KDE session
* go to console (e.g. CTRL + ALT + F2)
* log in at the console as root
* switch the runlevel: # systemctl isolate multi-user.target
* mount your mobile phone via "jmtpfs"
* run your backup-scripts (or whatever you wanted to do)
* unmount jmtpfs
* switch back to normal runlevel: # systemctl isolate graphical.target
* log out from console
* go back to graphical session with CTRL + ALT + F7
But this is very cumbersome and you have to close all your running graphical programs.
*** This bug has been marked as a duplicate of bug 432557 ***
*** Bug 432557 has been marked as a duplicate of this bug. ***
I'm not quite sure what you expect to happen here. MTP is a single-access kind of protocol. You can either access it through KIO or another app, you cannot access it through both at the same time. Any insight into what you expect to happen?
In my case, kio seems to even lock itself out -- after unplugging and re-plugging my phone, kio-based applications are unable to access it.
Also, kio will lock the MTP device even without me using any kio app -- if I want to use another app, I always have to kill the KIO daemon, even if I did not open the phone in Dolphin.
(In reply to Harald Sitter from comment #8)
> I'm not quite sure what you expect to happen here. MTP is a single-access
> kind of protocol. You can either access it through KIO or another app, you
> cannot access it through both at the same time. Any insight into what you
> expect to happen?
MTP is a single-access - this I did not know. Interesting.
You can either access it through KIO or another app - that's fine. I only need access to one app at a time.
expect to happen - As it is only accesses one protocol at a time then I would like it to recognise that another protocol has been launched, shut down the current process and then automatically switch to the new process.
(In reply to Ralf Jung from comment #9)
> In my case, kio seems to even lock itself out -- after unplugging and
> re-plugging my phone, kio-based applications are unable to access it.
The unplugging and plugging back in should be fixed in master. There were caching problems.
> Also, kio will lock the MTP device even without me using any kio app -- if I
> want to use another app, I always have to kill the KIO daemon, even if I did
> not open the phone in Dolphin.
Plasma itself will already trigger the device opening, this isn't particularly related to dolphin. Any file IO application (which is the majority of general purpose KDE apps really - anything with a file open dialog) can ultimately talk to MTP. It's a bit unfortunate that this happens without you even opening anything but from what I can tell changing that is way too complicated for what we gain. Specifically since we already have problems with caching another level of asynchronicity would only serve as an additional source for bugs I fear :(
Ultimately I think the best solution would be for third party apps to use the XDG desktop portal for file open dialogs. That way we, plasma, control the file IO and can route it through KIO as needed. But that is a bit of a pipe dream probably
it should be obvious that kde locking out other frameworks from accessing mtp devices by its mere presence is not acceptable, and deferring to a pipe dream solution just doesn't cut it.
so kde needs to a) claim the device lazily (e.g., the file dialog doesn't really need it to merely show the device's presence) and b) release it eagerly.
(i didn't check the current state of master, so i can't judge what actually still needs being done.)
It is not.
what is (not), and why?
I would expect a "Release" action in the applet and the context menu in dolphin, "like" the "Safely remove" for a USB key.
Additionally to the "release" action (see previous comment), I would be glad to have a "disable" option, too.
I do not use KIO MTP at all. But I use MTP with other applications a lot, so it would be cumbersome to always click the "release" action before I can use MTP in other applications. Maybe the option "disable kio mtp" can be put in KDE settings dialog.
Dear Bug Submitter,
This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.
For more information about our bug triaging procedures please read the
wiki located here:
If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.
Thank you for helping us make KDE software even better for everyone!
afaict, the question was about expectations, which imo has been adequately answered.
(In reply to Harald Sitter from comment #11)
> The unplugging and plugging back in should be fixed in master. There were
> caching problems.
Unfortunately it is not. I am running Arch Linux with the latest released KDE packages, and unplugging and replugging a mtp ebook reader does not help. The device contents is shown, but I cannot copy files to the device.
I need to kill the kiod as always to get rw access to the device again.
A typical example is Calibre (which I use a lot) which has a "Release" button for the device. Something similar should be included in Dolphin and "Removable Devices".