INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Handheld issue - files not transferring over mtp  (Read 1467 times)

laba

  • Recent member
  • *
  • Posts: 9
Handheld issue - files not transferring over mtp
« on: August 15, 2018, 07:01:17 am »

Hi all,

Just moved from Windows to Ubuntu 18.04. I had MC23 installed on Windows - both 64bit and 32bit, as handheld support didn't work in the 64bit version.

I've installed MC24 ("latest" repository) to test it with a view to possibly buying a new license, and everything seems to be working so far except for the handheld file transfers. This is an important issue for me as I need a good way of filling my Android phone (currently a Samsung Galaxy S9 running LineageOS) with music files, so given the new higher prices it is likely to be the issue that leads me to buy or not buy.

My normal process is to add the device to MC, specifying the Music folder on the phone's internal storage. Then, create a smart playlist that builds lists of tracks, which I can transfer to the device via the Drives & Devices panel.

I have been able to add the phone as a new device. However, when I start the transfer, one by one they fail with an error (not sure how to find the details of the errors).

I have tried to do the same thing with a regular USB stick - added the device, specified a folder, started the transfer, and it worked fine. Seems only to fail with the phone.

This is the file path that MC24 appears to see after browsing to the Music folder on the phone when adding it as a new device:

/run/user/1000/gvfs/mtp:host=%5Busb%3A004%2C003%5D/Internal shared storage/Music

Compare that to the file path when adding a USB stick instead (fyi "md" is the user name on the Linux system, 9229-D605 is the name of the USB stick):

/media/md/9229-D605/Music

For the record, I am not transcoding any audio, just want to transfer the original files as is. In my testing, the only setting I have manipulated is changing the audio mode to "original" under "Conversion".

Also in case it's useful to know, I selected the minimal installation when installing Ubuntu 18.04. That means that some stuff that would be there by default in a full installation may need to be added (although I'd have assumed that would be picked up in the dependencies when installing MC24).

Any suggestions on how to get this working? Any data I can provide to give a clue to the reasons for the errors?

thanks for any advice!
Logged

laba

  • Recent member
  • *
  • Posts: 9
Re: Handheld issue - files not transferring over mtp
« Reply #1 on: August 15, 2018, 07:24:10 am »

Also possibly relevant.

If I use the terminal to browse to /run/user/1000/gvfs/ I can see a folder called mtp:host=%5Busb%3A004%2C003%5D (see the file path posted in the original post above).

Running ls -l on the folder mtp:host=%5Busb%3A004%2C003%5D I get this result:

dr-x------ 1 md md 0 Jan  1  1970 'mtp:host=%5Busb%3A004%2C009%5D'

Moving into that folder, the next level down is:

drwx------ 1 md md 0 Jan  1  1970 'Internal shared storage'
drwx------ 1 md md 0 Jan  1  1970  sdcard


Then again:

drwx------ 1 md md 4096 Aug 14 18:22 Music


I'm wondering if the issue is affected by the permissions on that mtp:host=%5Busb%3A004%2C003%5D folder which only has read and execute allowed?

Is it safe to use chmod to change it?
Logged

laba

  • Recent member
  • *
  • Posts: 9
Re: Handheld issue - files not transferring over mtp
« Reply #2 on: August 15, 2018, 07:28:27 am »

Is it safe to use chmod to change it?

Safe or not, it's apparently not possible:

md@pc:/run/user/1000/gvfs$ sudo chmod 0700 mtp\:host\=%5Busb%3A004%2C009%5D/
chmod: cannot access 'mtp:host=%5Busb%3A004%2C009%5D/': Permission denied



I can use the file browser to copy/paste files into the Music folder on the Android device.

I cannot use the command line to copy/paste files in exactly the same way. That's kind of weird.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Handheld issue - files not transferring over mtp
« Reply #3 on: August 15, 2018, 03:02:28 pm »

MTP seems really hit or miss with MC.

Are you able to use other Linux utilities to do file transfer to and from your Android?  If so, I would recommend having MC do handheld sync to a local folder on the Linux box and *then* use the other utility to transfer that folder's contents to your Android. 

I've done this successfully with "Android File Transfer" under Mac.  I have not touched this under Linux, but it's the same principle.

Brian.
Logged

laba

  • Recent member
  • *
  • Posts: 9
Re: Handheld issue - files not transferring over mtp
« Reply #4 on: August 16, 2018, 04:21:10 am »

MTP seems really hit or miss with MC.

Are you able to use other Linux utilities to do file transfer to and from your Android?  If so, I would recommend having MC do handheld sync to a local folder on the Linux box and *then* use the other utility to transfer that folder's contents to your Android. 

I've done this successfully with "Android File Transfer" under Mac.  I have not touched this under Linux, but it's the same principle.

Brian.
It seems that MTP is dodgy with Linux generallly. I tried AFT after reading this, but it wouldn't even detect an MTP device.  :-\

However your post really helped! I did a bunch more checking and what I found confused me. I'm new to using Linux as my primary OS, but this just didn't make sense to me:

I found that if I was above the mtp:host=%5Busb%3A004%2C009%5D directory, I was unable to transfer files onto the device. As shown above, the permissions wouldn't allow writing into the directory, and I assume that's why. However, if I navigated further down into the hierarchy, as soon as I was below that directory, I was able to transfer files into that level or below from my PC.

I have figured out a workaround process that pretty much anyone should be able to use in similar circumstances. I'll detail it here shortly. Thanks!
Logged

laba

  • Recent member
  • *
  • Posts: 9
Re: Handheld issue - files not transferring over mtp
« Reply #5 on: August 16, 2018, 04:45:08 am »

So here are the steps I put together to get a working process for using MC to build playlists for transfer to my Android phone, which mounts as an MTP device:


- Create a smart playlist with parameters that suits your needs in terms of size, content etc.

- Create a folder anywhere on your computer to fill with the files you will transfer to your device.
- in Media Center, via Tools, Options, Handheld, add a new "device", give it a name and then browse to the folder you just created to specify that the folder is your "device".
- ensure the "Auto-sync on connect" box is unchecked.
- set any other parameters to suit your needs, e.g. transcoding, file path etc.
- in the right hand panel, check the box next to your new smart playlist


- in Media Center, under Drives & Devices in the left hand navigation, select the "device" you added (which is actually a folder on your computer) and click Recheck Sync until you get a playlist that suits your needs.

- When you have a playlist that you are happy with, click Sync Now. MC then copies all those files to your "device" folder.


###############################


- connect MTP device/phone to computer and ensure it is set to transfer files via the MTP option

- If appropriate for your needs, browse to the appropriate folder on your device, either using the computer's file manager or one on the device and delete contents of your Music folder.

- then fill your device via the method of your choice. I found I was able to simply copy/paste using the file manager app, but I prefer using the terminal as below as it gives a running commentary:

- If using the terminal, cd into the phone's Internal shared storage where the Music folder sits. You'll probably need to start from the /run/user folder. On my machine I went to:

/run/user/1000/gvfs/

and then checked for what's there:

ls

mtp:host=%5Busb%3A004%2C003%5D
  <= what you will see here will be different

cd mtp:[whatever]

cd Internal shared storage

- run a command to copy from your local "device" folder into the Music folder on the phone:

cp -rv /home/user/path/to/your/local/folder/* Music/

- The above command has the option -r to ensure that all folders in your "device" folder and below are selected, and -v to provide a file-by-file update on what's being transferred, and the * wildcard at the end ensures that everything MC copied into your "device" folder is transferred.

- wait until transfer is complete.

Done! You may then want to delete the files from your "device" folder as they are duplicates of what's in your main library.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72446
  • Where did I put my teeth?
Re: Handheld issue - files not transferring over mtp
« Reply #6 on: August 16, 2018, 05:47:34 am »

Thanks for taking time to document that.
Logged
Pages: [1]   Go Up