Summary: | kiod5 doesn't release usb device when it is not in use | ||
---|---|---|---|
Product: | [Frameworks and Libraries] kio-extras | Reporter: | hamelg |
Component: | MTP | Assignee: | Elvis Angelaccio <elvis.angelaccio> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | bugseforuns, creideiki+kdebugs, dan, dimchkin, goeran, gustavo.lapido, heri+kde, houssem.elfekih, ilikefoss, jacob, joseph, kde.org, kdebugs.cmrck, kevin.legouguec, knoblauchlands, lorenzofsutton, mark, mehanoid.ru, norbert, ossi, post, postix, px79, rasasi78, sitter, stillflyinginc, s_chriscollins, thomas, ticket.kde.djr4kjpch5320z5k, tomas, travneff, v.ortex, vidra.jonas, volchok, yuilytg7 |
Priority: | NOR | Keywords: | efficiency |
Version: | 19.08.1 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=440794 | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
hamelg
2019-09-23 20:01:21 UTC
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. Device info: Manufacturer: Samsung Electronics Co., Ltd. Model: SM-T580 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: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging 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". VLC player was failing to play files from my Android phone connected in MTP mode. journal log said: mtp services discovery: The device seems to be mounted, unmount it first Then I killed kiod5 process and VLC was able to play the files. Operating System: Arch Linux KDE Plasma Version: 5.26.2 KDE Frameworks Version: 5.99.0 Qt Version: 5.15.7 Graphics Platform: Wayland Hi I am experiencing a similar issue with KDE Plasma 5.26.4 on Manjaro with an Android MTP phone while wanting to use Android File Transfer [1][2] to mount the device and e.g. do rsync or similar (AFT will mount to a 'normal' directory thus allowing terminal operations etc.). Whenever I plug the phone in and select file transfer (i.e. MTP) on the phone, KDE / Dolphin grab it and it results 'busy' to any other application trying to use it. Also there's no 'unmount' / release option. The only work-around I've found is, as reported by other users, to kill kiod5 and then after that run aft-mtp-mount I think it would be great to have either an interface to 'release' a device or maybe have an option in the Removable devices systems setting for this. [1] https://whoozle.github.io/android-file-transfer-linux/ [2] https://wiki.archlinux.org/title/Media_Transfer_Protocol#Android_File_Transfer Manjaro KDE user here too and also experiencing annoyance that seems to be connected with KIO issue: inability to properly use MTP device (Android smartphone) with Double Commander. (Whereas other managers like Krusader and Dolphin can access device fine) I suspect, from our exchange with one of the doublecmd developers, that my MTP problem might be connected to OP's issue: https://doublecmd.h1n.ru/viewtopic.php?p=38126#p38126 Quote "Looks like it is a conflict between GIO and KIO. On my system MTP works fine in DC under Xfce/LXQt but does not work under KDE. I guess only one system service can work with MTP at the same time." (In reply to Norbert Preining from comment #2) > Killing the kiod process that holds the lock (to be found with fuser > /dev/libmtp...) resolves this problem, but is not optimal. I do not have a `kiod` process on my system: ``` ❯ ^ps aux | rg -i kio 2156 USER 0:00 {.kioslave5-wrap} /nix/store/56k6avzd8fwihzdgaq8dhzmpzyca18qn-kio-5.106.0/libexec/kf5/kioslave5 /nix/store/r0nmigm87b3psl5n83jid51fpp3910pj-plasma-workspace-5.27.6/lib/qt-5.15.9/plugins/kf5/kio/desktop.so desktop local:/run/user/1000/plasmashellQDMkBR.1.kioworker.socket 2634 USER 0:00 {.kioslave5-wrap} /nix/store/56k6avzd8fwihzdgaq8dhzmpzyca18qn-kio-5.106.0/libexec/kf5/kioslave5 /nix/store/p3283shmkk8j6zk9rm6xcbqa8xvzmdwx-baloo-5.106.0/lib/qt-5.15.9/plugins/kf5/kio/tags.so tags local:/run/user/1000/plasmashellZMjtuQ.2.kioworker.socket ``` And neither `lsof` nor `fuser` find a process that has the USB device opened: ``` ❯ sudo lsof /dev/libmtp-9-1 ❯ sudo lsof /dev/bus/usb/009/002 ❯ sudo fuser /dev/libmtp-9-1 ❯ sudo fuser /dev/bus/usb/009/002 ``` I am on NixOS 23.05.20230721.6da4bc6: ``` Operating System: NixOS 23.05 KDE Plasma Version: 5.27.6 KDE Frameworks Version: 5.106.0 Qt Version: 5.15.9 Kernel Version: 6.4.4 (64-bit) Graphics Platform: Wayland Processors: 16 × AMD Ryzen 9 6900HS with Radeon Graphics Memory: 30,6 GiB of RAM Graphics Processor: AMD Radeon Graphics ``` Do you have another idea how I could unblock the USB device? (In reply to Dennis Schridde from comment #24) > Do you have another idea how I could unblock the USB device? This was after a reboot. It appears the device was not blocked by KDE yet. I was able to connect to it using Calibre and manage the ebooks stored on the device without much trouble. *** Bug 476986 has been marked as a duplicate of this bug. *** Issue is still present. I connect my Android phone, set it to FIle Transfer mode then I try to browse and download photos using Rapid Photo Downloader, which tells the device is locked by another program. As others said, killing kiod allows me to use it. (In reply to gustavo.lapido from comment #27) > Issue is still present. > I connect my Android phone, set it to FIle Transfer mode then I try to > browse and download photos using Rapid Photo Downloader, which tells the > device is locked by another program. > As others said, killing kiod allows me to use it. Forgot to show OS info: Operating System: EndeavourOS KDE Plasma Version: 6.0.5 KDE Frameworks Version: 6.2.0 Qt Version: 6.7.1 Kernel Version: 6.6.32-1-lts (64-bit) Graphics Platform: Wayland Processors: 16 × AMD Ryzen 7 5800H with Radeon Graphics Memory: 15,0 GiB of RAM Graphics Processor: AMD Radeon Graphics Manufacturer: Dell Inc. Product Name: Dell G15 5515 System Version: 1.16.0 I am also encountering this issue when attempting to connect my book reader to Calibre 7.18 killing kio process works but is not an adequate workaround |