0

I am trying to connect a brand new Samsung Galaxy S7 phone with Android 8.0 to my Kubuntu 14.04 computer via USB.

When I connect the device, it appears normally on the device notifier of my computer. I check SAMSUNG_Android -> Open with File Manager, like I did with my old Android 5.0 device (which was always unstable, but worked). At the same time, a notification on the device says Android system: Transferring media files via USB.

A dialog says No Storages found. Maybe you need to unlock your device? on the computer, while the device is not locked. At the same time, a dialog appears on the device, saying Allow access to phone data? The connected device will be able to access data on this phone. DENY/ALLOW. I check ALLOW but the file manager just shows an empty folder and refreshing does not help. No matter how many times I repeat, the behavior is always the same, and I never get to access any data.

Following advice on Android forums, I enable Developer options and USB debugging on the phone, while USB Configuration is MTP (Media Transfer Protocol) by default.

On the computer, I try installing and using mtpfs and jmtpfs, with no success. My understanding is that they both use libmtp underneath. I have libmtp 1.1.6 and mtp-detect says

Unable to open ~/.mtpz-data for reading, MTPZ disabled.libmtp version: 1.1.6

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 5, dev 8
Attempting to connect device(s)
ignoring libusb_claim_interface() = -6PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
LIBMTP ERROR: couldnt parse extension samsung.com/devicestatus:1
Error 1: Get Storage information failed.
Error 2: PTP Layer error 02fe: get_handles_recursively(): could not get object handles.
Error 2: Error 02fe: PTP: Protocol error, data expected
USB low-level info:
   bcdUSB: 512
   bDeviceClass: 0
   bDeviceSubClass: 0
   bDeviceProtocol: 0
   idVendor: 04e8
   idProduct: 6860
   IN endpoint maxpacket: 512 bytes
   OUT endpoint maxpacket: 512 bytes
   Raw device info:
      Bus location: 5
      Device number: 8
      Device entry info:
         Vendor: Samsung
         Vendor id: 0x04e8
         Product: Galaxy models (MTP)
         Vendor id: 0x6860
         Device flags: 0x48000207

followed by a bunch of additional information.

I try connecting the phone to a Windows 7 computer, and it works perfectly.

I then try the same to a Windows 7 virtual machine inside my Kubuntu 14.04 host, but unfortunately no USB device is seen.

Then, I try a Kubuntu 18.04 virtual machine inside the same Kubuntu 14.04 host. This can see the USB device, but upon accessing with File Manager as above, a dialog on the computer says The process for the mtp protocol died unexpectedly while nothing appears on the device. Such message still appears randomly with my old Android 5.0 phone on my Kubuntu 14.04 computer, but eventually it works; while here the failure is consistent. mtp-detect now says

libmtp version: 1.1.13

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 1, dev 4
Attempting to connect device(s)
LIBMTP PANIC: Could not open session! (Return code 8194)
  Try to reset the device.
Unable to open raw device 0
OK.

Googling that message, I cannot find anything helpful.

Finally, I install the latest libmtp 1.1.15 from source on my Kubuntu 14.04. Nothing changes in the File Manager access, while mtp-detect similarly says

Unable to open ~/.mtpz-data for reading, MTPZ disabled.libmtp version: 1.1.15

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 5, dev 16
Attempting to connect device(s)
LIBMTP PANIC: Could not open session! (Return code 8194)
  Try to reset the device.
Unable to open raw device 0
OK.

and the device shows the familiar ALLOW/DENY dialog.

I remember trying another Samsung Android phone (6.0 or 7.0 I think) to another Kubuntu 14.04 computer with the same No Storages found and ALLOW/DENY behavior, but I didn't care much at the time because that was not my phone.

I have lost countless hours trying other workarounds with no success. I cannot change my operating system, at least not now. It's still supported for another six months, while the new system does not appear to work any better. I cannot change the phone either, but not being able to transfer files via USB makes it useless.

Such things should really work out of the box, right?

2
  • Have you ried Kubuntu 18.04 from USB? In case it can see Android files, it might be a strong incentive to move on. Oct 6, 2018 at 21:57
  • @mikewhatever Thanks. I had tried in the past and it wouldn't boot. I will try again, but the fact that it fails from virtualbox is not a good sign.
    – iavr
    Oct 6, 2018 at 22:07

1 Answer 1

1

Check /etc/udev/rules.d for a file named xx-android.rules. I believe I manually created mine but it was years ago. Possibly on 14.04 as you're running. My android rules file is named 51-android.rules.

If this file exists, open it to determine if your specific device is included. I'm willing to bet it isn't.

If not,

`sudo <your_favorite_editor> /etc/udev/rules.d/xx-android.rules`

and add the following rule

`ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"`

If you don't have an xx-android.rules file, let me know and I'll tell you how to create one.

Just for GP, here's a template for an android rules files

SUBSYSTEM!="usb", GOTO="android_usb_rules_end"
LABEL="android_usb_rules_begin"

ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", SYMINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

LABEL="android_usb_rules_end"

The following requires root permissions... Place the template in /etc/udev/rules.d/. Save as xx-android.rules where 'xx' is a number between 10 and 99. IE; 51-android.rules

Log out of your session and log back in. I recommend rebooting instead.

7
  • Thanks. One of the workarounds I tried was like that and failed, but I don't recall details now. There is no such file. How do I create it and what should xx be? By the way, I do have the rule ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1" in /lib/udev/rules.d/69-libmtp.rules, which defines Samsung Galaxy models (MTP) as listed in my question.
    – iavr
    Oct 6, 2018 at 22:37
  • The XX can be any number between 10 and 99, if memory serves. The higher the number the higher the priority. My file is "51-android.rules" but mine also contains entries for over 100 devices. You're good if you have another file with the same rule(s) however. I think your problem is the MODE="660". And I don't think the GROUP item is needed either. Try changing MODE="660" to MODE="666". Or remove it all together. You'll need to sudo that file to edit it. None of the Samsung entries in my file contain MODE or GROUP.
    – BillWeckel
    Oct 6, 2018 at 22:44
  • I did that (MODE="666", also removing the GROUP), followed by sudo service udev restart. Without reboot, the error messages are slightly different now, but it still fails. It's weird because there are hundreds of rules in this file, all with "660".
    – iavr
    Oct 6, 2018 at 23:01
  • Try a custom rules files, like I posted in my answer. I've never had any issues unless I've plugged in a device that wasn't in the rules files. Give it a LOWER number than your 69-libmtp.rules file. I was backwards in my explanation about the numbers.
    – BillWeckel
    Oct 6, 2018 at 23:08
  • After logging out and back in, I observe the behavior has now changed from No Storages found and ALLOW/DENY to The process for the mtp protocol died unexpectedly, as in 18.04. This must be the new libmtp in effect.
    – iavr
    Oct 6, 2018 at 23:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .