Bug 343570

Summary: mtp kio slave crashes constantly while coping from android device
Product: [Frameworks and Libraries] kio Reporter: Alexander Nolting <a.nolting>
Component: mtpAssignee: Philipp Schmidt <philschmidt>
Status: RESOLVED INTENTIONAL    
Severity: major CC: afachat, frank78ac, k.salver
Priority: NOR    
Version: 4.14.1   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Alexander Nolting 2015-01-30 14:32:07 UTC
Hello,
the mtp kio slave is crashing constantly my browsing, copying or moving files between external/internal harddisk and an Android device.

Message: mtp protcol unexpectedly ended

Reproducible: Always

Steps to Reproduce:
1. Connect any MTP capable device
2. Browse
3. Copy
4. Move
5. Paste

any file(s)/folder(s)


Actual Results:  
mtp protocol ends by unexpected exception

Expected Results:  
working MTP protocol handling
Comment 1 Alexander Nolting 2015-02-02 13:47:36 UTC
If someone show how to retrieve logs for the communication btween Dolphin <=> kio and the device I'll collect and upload them.
Comment 2 A. Fachat 2015-07-19 19:49:15 UTC
Same for me. Real bugger. 

And it is NOT anything in the kernel - Gnome Nautilus works mighty fine copying files over from my mobile.

Just connect an Android (e.g. Galaxy S3, or Galaxy S5 mini which are the two I tested it with) as MTP device. Completely broken.

KDE backports 5.3 on kubuntu 15.04
Comment 3 Philipp Schmidt 2015-07-20 15:38:35 UTC
Well, with Samsung Devices it won't work, and there is nothing I can do about it. Explanation in my Blog at https://philipp.schmidt-rheinhausen.de/blog/2013/07/whats-up-with-kio-mtp/ (cacert certificate).

What it comes down to is this: Samsung allows one mtp session for each time you connect the device, libmtp (and the mtp protocol in general) allow closing and reopening those sessions, a fact that samsung successfully ignores. kio-mtp (by design of kio itself) however requires opening and closing sessions, and when the device notifier comes in it gets even messier as that one also opens and closes a session. So Samsung thinks the valid one is the one opened by the device manager and crashes with every subsequent session.

So: You're out of luck. With CM on a SGS3 or Stock Android it all works. But not Samsungs own Software.
Comment 4 Alexander Nolting 2015-07-20 17:53:34 UTC
Hello Philipp,

I'm using on my SGS2, SGS4, SG Note2 and Note 3 CM on my devices and as I can say: kio doesn't work stable with CM10, CM11, CM12 and CM12.1.

If it would help you I'll try to bisect this together with your help. Espescially giving me some hints what logs files excatly needs to be gathered.

Best Regards
Alex
Comment 5 KarlheinzS 2017-09-06 10:09:20 UTC
really kio-mtp crashes in dolphin when trying to connect to a device, even UBUNTU-Phone (p.ex. BQ-Aquaris 4.5).
!! my Interim-solution:
install nautilus + gnome-icin-theme-symbolic 
starting with nautilus i can connect to the device and get data.
not tested (i will test these days): 
to rename or to move a file.
to connect a android 6.x.
-->so, i think the problem is in dolphin.

user1@testkub:~$ locate mtp | grep lib | grep .so
/lib/modules/3.19.0-25-generic/kernel/sound/drivers/snd-mtpav.ko
/lib/modules/3.19.0-80-generic/kernel/sound/drivers/snd-mtpav.ko
/usr/lib/i386-linux-gnu/libmtp.so.9
/usr/lib/i386-linux-gnu/libmtp.so.9.1.0
/usr/lib/kde4/amarok_collection-mtpcollection.so
/usr/lib/kde4/kio_mtp.so
/usr/lib/kde4/kio_smtp.so
/usr/lib/libreoffice/share/config/soffice.cfg/cui/ui/applyautofmtpage.ui
/usr/lib/vlc/plugins/access/libaccess_mtp_plugin.so
/usr/lib/vlc/plugins/services_discovery/libmtp_plugin.so
/usr/share/apport/package-hooks/source_libmtp.py
user1@testkub:~$