Bug 314681 - Trying to browse Galaxy SIII leads to error
Summary: Trying to browse Galaxy SIII leads to error
Status: RESOLVED LATER
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: mtp (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: HI normal
Target Milestone: ---
Assignee: Philipp Schmidt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-08 15:01 UTC by Ron Peck
Modified: 2013-10-20 18:11 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Dolphin displaying the infamous mtp error on KDE 4.10.00 "release 1" (84.60 KB, image/png)
2013-03-20 15:10 UTC, Stefan Hinz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Peck 2013-02-08 15:01:35 UTC
When I connect my Galaxy SIII the Device Notifier shows it. When I click on "open with file manager" it throws an error "The Process for mtp protocol died unexpectedly."

I get the same error if I open Dolphin and then click on the Portable Media Player entry.

The phone is a Galaxy SIII - SGH-T999 running Android 4.1.1

My Nexus 7 works perfectly. (Sorry if that isn't relevant)

Here is the output of mtp-detect:
libmtp version: 1.1.5

Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
   Found 1 device(s):
   Samsung: Galaxy models (MTP) (04e8:6860) @ bus 2, dev 11
Attempting to connect device(s)
libusb_detach_kernel_driver() failed, continuing anyway...: Permission denied
ignoring libusb_claim_interface() = -6PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
LIBMTP PANIC: failed to open session on second attempt
Unable to open raw device 0
OK.
Comment 1 Philipp Schmidt 2013-02-08 15:20:26 UTC
Yes, the S3 has some problems, and I encountered this myself since my work phone is a S3. So hopefully I'll know something after the weekend.
Comment 2 Philipp Schmidt 2013-03-11 18:38:33 UTC
Please retest with current git, I just pushed a lot of changes regarding device handling. Some issues still persist, but mostly can be solved by removing and plugging the device back in.
Comment 3 Stefan Hinz 2013-03-20 15:10:00 UTC
Created attachment 78243 [details]
Dolphin displaying the infamous mtp error on KDE 4.10.00 "release 1"

I just upgraded from openSuse 12.2 to 12.3, so now I'm on KDE 4.10. Unfortunately, the mtp error is still there. Here's how I can reproduce it:

1) Plug in the Galaxy S2 with a USB cable.
2) In Device Monitor, the S2 shows up as Portable Media Player.
3) Select that device in Device Manager, then select Open with File Administration (not sure if that's the proper English term) from the available options.
4) Browsing the S2's file system works flawlessly. Copy over a file from the computer to an arbitrary location on the S2 to provoke the error (see attached screenshot).
5) Once the error has occurred, even browsing the S2's filesystem stops working. The workaround is to unplug and then replug the S2.
Comment 4 Philipp Schmidt 2013-03-21 08:37:26 UTC
The error is not related to the KDE Version. I would need to know if you either used packages (and which version, preferably with a link to the package to check the version) or if you compiled from source and when.

If you did not compile from source in the last couple of days: Please uninstall any kio-mtp packages and then build the current git from source. Cause I didn't get any errors either with my N7, GNex or S3.
Comment 5 Stefan Hinz 2013-03-21 10:46:12 UTC
Hi Philipp,

I'm getting the error for an openSuse system that has just been upgraded from 12.2 to 12.3. I'm wary of fiddling with the system, so I'd rather not uninstall any kio-mtp packages and build stuff from source. (This is my main desktop machine, sorry.)

Let's see if the openSuse folks will fix this with the next couple of updates to 12.3. (I was just a bit disappointed to find it still not working in openSuse 12.3, but I copy photos and stuff with a script, anyway, so it's nothing that really impacts me. Would be nice to see it working at some point, though. :-))
Comment 6 Philipp Schmidt 2013-03-21 11:17:44 UTC
Hi Stefan, I just found the official package. It is named kio_mtp, not kio-mtp as I expected and for which I only found outdated packages. I will try and set up a virtual machine with OpenSUSE on the weekend, before that I will test with my Kubuntu machines at home, because as I said, my Arch install works...
Comment 7 Philipp Schmidt 2013-03-21 18:01:22 UTC
Ok, the Problem seems to be that the slave is started once and checks the device, finds it and opens it. Then another slave is started while the device was not closed. As the S3 doesn't like this and also doesn't allows its interface to be reset the slave times out. FYI the Nexus devices handle these events much more gracefully, which is why you won't run into problems there.

The problem doesn't exist if you open the device from the Dolphin sidebar, only from the device notifier.
Comment 8 Stefan Hinz 2013-03-21 19:06:41 UTC
Hi Philip,

Oh boy, dash versus underscore making a difference. Holy crap! ;-)

I tried opening the device (an S2, BTW) from the Dolphin sidebar, but that gives the exact same issue. Trying to copy a file from the computer to the device brings up the mtp error message. (Otherwise, I'd consider that a viable workaround.)
Comment 9 Philipp Schmidt 2013-03-23 07:35:05 UTC
Well, I might be able to get a friend with an S2 over here to test that myself, but in the meantime:

Please run >kdeinit4< in a terminal (without the ><). If that results in 3x "kdemain: Waiting for already running klauncher to exit." use >killall klauncher && kdeinit4<. (Please save all data before you do this or use an empty session). That should give you debug output in the terminal.

Not unplug the device (if connected) and plug it back in. Then try to open the device via the Dolphin sidebar and you should get something like this in the terminal (The first error is from libmtp and is nothing to worry about):

Error: Unable to open ~/.mtpz-data for reading.                                                                               [8:27]
kio_mtp(2724)/kio MTPSlave::MTPSlave: Slave started
kio_mtp(2724)/kio DeviceCache::checkDevice: new device, getting raw devices
Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
kio_mtp(2724)/kio DeviceCache::checkDevice: No Error, continuing
kio_mtp(2724)/kio DeviceCache::checkDevice: Found device matching the Solid description
kio_mtp(2724)/kio CachedDevice::CachedDevice: Created device  "GT-I9305"   with udi= "/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1"  and timeout  60000
Object::connect: No such signal CachedDevice::expired() in /home/philipp/Entwicklung/Projekte/KDE/kio-mtp/devicecache.cpp:141
kio_mtp(2724)/kio MTPSlave::MTPSlave: Caches created
kio_mtp(2724)/kio MTPSlave::listDir: "udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1"
kio_mtp(2724)/kio MTPSlave::checkUrl: KUrl("mtp:udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1")
kio_mtp(2724)/kio MTPSlave::checkUrl: udi =  "/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1"
kio_mtp(2724)/kio MTPSlave::stat: "udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1"
kio_mtp(2724)/kio MTPSlave::checkUrl: KUrl("mtp:udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1")
kio_mtp(2724)/kio MTPSlave::checkUrl: udi =  "/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1"
kio_mtp(2724)/kio MTPSlave::stat: "/"
kio_mtp(2724)/kio MTPSlave::checkUrl: KUrl("mtp:/")
kio_mtp(2724)/kio MTPSlave::getPath: "/" 0
kio_mtp(2724)/kio MTPSlave::stat: "/GT-I9305"
kio_mtp(2724)/kio MTPSlave::checkUrl: KUrl("mtp:/GT-I9305")
kio_mtp(2724)/kio MTPSlave::getPath: "/GT-I9305" 1
kio_mtp(2724)/kio MTPSlave::getPath: returning LIBMTP_mtpdevice_t
kio_mtp(2724)/kio getDevicestorages: [ENTER] false
kio_mtp(2724)/kio getDevicestorages: found storage "Phone"
kio_mtp(2724)/kio getDevicestorages: [EXIT] 1
kio_mtp(2724)/kio MTPSlave::listDir: "/GT-I9305"
kio_mtp(2724)/kio MTPSlave::checkUrl: KUrl("mtp:/GT-I9305")
kio_mtp(2724)/kio MTPSlave::getPath: "/GT-I9305" 1
kio_mtp(2724)/kio MTPSlave::getPath: returning LIBMTP_mtpdevice_t
kio_mtp(2724)/kio getDevicestorages: [ENTER] false
kio_mtp(2724)/kio getDevicestorages: found storage "Phone"
kio_mtp(2724)/kio getDevicestorages: [EXIT] 1
kio_mtp(2724)/kio getDevicestorages: [ENTER] false
kio_mtp(2724)/kio getDevicestorages: found storage "Phone"
kio_mtp(2724)/kio getDevicestorages: [EXIT] 1
kio_mtp(2724)/kio MTPSlave::listDir: Listing storages for device  "GT-I9305"
kio_mtp(2724)/kio MTPSlave::listDir: [SUCCESS] :: Storages

For the Device Notifier (for comparison) you should get:

Error: Unable to open ~/.mtpz-data for reading.                                                                               [8:30]
kio_mtp(2935)/kio MTPSlave::MTPSlave: Slave started
kio_mtp(2935)/kio DeviceCache::checkDevice: new device, getting raw devices
Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
kio_mtp(2935)/kio DeviceCache::checkDevice: No Error, continuing
kio_mtp(2935)/kio DeviceCache::checkDevice: Found device matching the Solid description
kio_mtp(2935)/kio CachedDevice::CachedDevice: Created device  "GT-I9305"   with udi= "/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1"  and timeout  60000
Object::connect: No such signal CachedDevice::expired() in /home/philipp/Entwicklung/Projekte/KDE/kio-mtp/devicecache.cpp:141
kio_mtp(2935)/kio MTPSlave::MTPSlave: Caches created
kio_mtp(2935)/kio MTPSlave::stat: "udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/"
kio_mtp(2935)/kio MTPSlave::checkUrl: KUrl("mtp:udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/")
kio_mtp(2935)/kio MTPSlave::checkUrl: udi =  "/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1"
kio_mtp(2935)/kio MTPSlave::stat: "/GT-I9305"
kio_mtp(2935)/kio MTPSlave::checkUrl: KUrl("mtp:/GT-I9305")
kio_mtp(2935)/kio MTPSlave::getPath: "/GT-I9305" 1
kio_mtp(2935)/kio MTPSlave::getPath: returning LIBMTP_mtpdevice_t
kio_mtp(2935)/kio getDevicestorages: [ENTER] false
kio_mtp(2935)/kio getDevicestorages: found storage "Phone"
kio_mtp(2935)/kio getDevicestorages: [EXIT] 1
"/org/freedesktop/UDisks2/drives/OCZ_VERTEX2_OCZ_REGN1FX6PZ5N7O92" : property "Drive" does not exist 
"/org/freedesktop/UDisks2/drives/WDC_WD15EARS_00Z5B1_WD_WMAVU3197484" : property "Drive" does not exist 
"/org/freedesktop/UDisks2/drives/SAMSUNG_HM160JC_S0CMJ10L910924" : property "Drive" does not exist 
"/org/freedesktop/UDisks2/drives/MATSHITADVD_RAM_UJ892_HG97_883469" : property "Drive" does not exist 
"/org/freedesktop/UDisks2/drives/TrekStor_DS_pocket_g_2eu_00e2dc88" : property "Drive" does not exist 
Error: Unable to open ~/.mtpz-data for reading.
QPixmap::scaled: Pixmap is a null pixmap
kio_mtp(2943)/kio MTPSlave::MTPSlave: Slave started
QPixmap::scaled: Pixmap is a null pixmap
QPixmap::scaled: Pixmap is a null pixmap
kio_mtp(2943)/kio DeviceCache::checkDevice: new device, getting raw devices
Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
kio_mtp(2943)/kio DeviceCache::checkDevice: No Error, continuing
kio_mtp(2943)/kio DeviceCache::checkDevice: Found device matching the Solid description
libusb_detach_kernel_driver() failed, continuing anyway...: Keine Berechtigung
ignoring libusb_claim_interface() = -6PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
LIBMTP PANIC: failed to open session on second attempt
kioslave: ####### CRASH ###### protocol = mtp pid = 2943 signal = 11

You can see nicely where he starts the second slave and can't access the device as there is still a session open. The last 3 lines are then when he can't reset the device and crashes. If that happens you need to unplug the device and plug it in again.

And why the H*** can't I mark a bug as "Confirmed"?
Comment 10 Stefan Hinz 2013-03-23 17:07:00 UTC
Hi Philipp,

Not sure if you're asking for the output I'm getting with the S2, but here it is:

Atlas~> kdeinit4
kdeinit4: Shutting down running client.
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
KDE Daemon (kded) already running.
kbuildsycoca4 running...
kbuildsycoca4(25251) VFolderMenu::loadDoc: Parse error in  "/home/stefan/.config/menus/applications-merged/xdg-desktop-menu-dummy.menu" , line  1 , col  1 :  "unexpected end of file" 
kbuildsycoca4(25251) KConfigGroup::readXdgListEntry: List entry Categories in "trendyent_com-dungeondefenders_1.desktop" is not compliant with XDG standard (missing trailing semicolon). 
kbuildsycoca4(25251) KConfigGroup::readXdgListEntry: List entry Categories in "/home/stefan/.local/share/applications/trendyent_com-dungeondefenders_1.desktop" is not compliant with XDG standard (missing trailing semicolon).+

Now, when plugging in the S2 and then opening Dolphin, here's what I see in the terminal:

Atlas~> Error: Unable to open ~/.mtpz-data for reading.
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Fontconfig warning: "/etc/fonts/conf.d/56-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.
"/org/freedesktop/UDisks2/drives/WDC_WD5000AAKS_75V0A0_WD_WCAWFC217826" : property "Drive" does not exist 
"/org/freedesktop/UDisks2/drives/TSSTcorp_DVD_2b_2f_RW_TS_H653G_R4606GEZC17680" : property "Drive" does not exist 
"/org/freedesktop/UDisks2/drives/WDC_WD5000AAKS_75V0A0_WD_WCAWFC217826" : property "DeviceNumber" does not exist 
"/org/freedesktop/UDisks2/drives/WDC_WD5000AAKS_75V0A0_WD_WCAWFC217826" : property "Device" does not exist 
"/org/freedesktop/UDisks2/block_devices/dm_2d4" : property "Name" does not exist 
"/" : property "DeviceNumber" does not exist 
"/" : property "Device" does not exist 
"/" : property "MediaCompatibility" does not exist 
"/" : property "MediaRemovable" does not exist 
"/" : property "Removable" does not exist 
"/" : property "ConnectionBus" does not exist 
"/org/freedesktop/UDisks2/block_devices/dm_2d3" : property "Name" does not exist 
"/org/freedesktop/UDisks2/block_devices/dm_2d2" : property "Name" does not exist 
"/org/freedesktop/UDisks2/block_devices/dm_2d1" : property "Name" does not exist 
"/org/freedesktop/UDisks2/block_devices/dm_2d0" : property "Name" does not exist 
Error: Unable to open ~/.mtpz-data for reading.
QPixmap::scaled: Pixmap is a null pixmap
QPixmap::scaled: Pixmap is a null pixmap
QPixmap::scaled: Pixmap is a null pixmap
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
QPixmap::scaled: Pixmap is a null pixmap
QPixmap::scaled: Pixmap is a null pixmap
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team
Device 0 (VID=04e8 and PID=6865) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team

Looks like I have lots of stale connections, but this is just a wild guess.

BTW, KDE has stopped auto-mounting the device when trying to connect the S2 using Samsung's "USB connection". Not sure if that's related to the MTP errors, so I'm just mentioning it in case it is. (In previous openSuse/KDE versions, the device would show up as a storage device in Device Manager. It doesn't show up there any more in openSuse 12.3/KDE 4.10, but it is still auto-mounted under /var/run/media/<user>/. At least when auto-mounting works, which it currently doesn't; see above. :-) Rebooting the box now to see if that changes anything.
Comment 11 Philipp Schmidt 2013-03-25 09:31:21 UTC
Ok,  now that my account has the correct rights: Confirmed ;)
Comment 12 Maxim Egorushkin 2013-04-29 13:01:23 UTC
I am also having difficulty browsing Galaxy S3 with KDE. From .xsession-errors:

Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
usb_clear_halt() on INTERRUPT endpoint: Protocol error
LIBMTP PANIC: failed to open session on second attempt
kioslave: ####### CRASH ###### protocol = mtp pid = 13238 signal = 11
Object::disconnect: No such slot QObject::dataUpdated(QString,Plasma::DataEngine::Data)
Object::disconnect:  (sender name:   '/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7')
file:///usr/share/kde4/apps/plasma/plasmoids/notifier/contents/ui/devicenotifier.qml:333: Unable to assign [undefined] to bool mounted
file:///usr/share/kde4/apps/plasma/plasmoids/notifier/contents/ui/devicenotifier.qml:317: Unable to assign [undefined] to QString emblemIcon
KUrl("mtp:udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7") KUrl("") 
KUrl("") KUrl("mtp:udi=/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7")
Comment 13 Philipp Schmidt 2013-04-29 13:10:57 UTC
Sorry to have to dissapoint you: This bug will be fixed in a future version of kio-mtp. However quite some groundwork needs to be done beforehand.

Short explanation why this is happening and a small workaround: Samsungs MTP stack is quite buggy. That includes the error that it can't recover when a second connection is opened to the device while it still has an open one. But that is what happens when you for example open the device from the device notifier due to the inherent design of the KIO stack. Nexus devices are unaffected, as they are programmed to be much more resilient. What you can do is simply NOT open it from the device notifier but instead directly from dolphin. That is how I get my S3 to work.

What will be done to circumvent this in the future? Well, I will push efforts to create a daemon that acts similarly to what Windows does, e.g. opens one connection to which all applications then share. But that might take a while as it is a project where we will need to get a lot more people on board.
Comment 14 Maxim Egorushkin 2013-04-29 13:17:18 UTC
Thanks for the update Philipp. The workaround you sometimes works.
Comment 15 Dima Ryazanov 2013-10-14 09:40:21 UTC
I'm getting similar errors with my Samsung Galaxy Nexus. It works for a little bit, then mtp crashes. I was hoping it would work since it's a "Nexus", and doesn't come with any of Samsung's software...
Comment 16 Philipp Schmidt 2013-10-20 18:11:36 UTC
I had those too from time to time. Still haven't had time to check if its the same error. But if it is: Same things apply. Can't fix now :(