maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   MTP support on Mac OSX (https://talk.maemo.org/showthread.php?t=92095)

aegis 2013-12-20 01:11

MTP support on Mac OSX
 
This got a bit heated in the Jolla User Experience Thread and frankly I don't care about the politics of who broke what and why. I want to concentrate on finding a solution to file transfers over USB on a Mac to a Jolla using MTP.

Google's Android File Transfer program is built on an old version of libmtp so I dug about to see if I could find a later version.

I couldn't get the libmtp sources to compile from http://libmtp.sourceforge.net but using homebrew I got a later version installed.

1) Install Homebrew from http://brew.sh

2) brew install libmtp

Code:

==> Installing libmtp dependency: libusb
==> Downloading http://downloads.sourceforge.net/project/libusb/libusb-1.0/libusb-1.0.9/libusb-1.0.9.tar.bz2
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/libusb/1.0.9
==> make install
/usr/local/Cellar/libusb/1.0.9: 11 files, 412K, built in 11 seconds
==> Installing libmtp dependency: libusb-compat
==> Downloading http://downloads.sourceforge.net/project/libusb/libusb-compat-0.1/libusb-compat-0.1.4/libusb-compat-0.1.4.tar.bz2
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/libusb-compat/0.1.4
==> make install
/usr/local/Cellar/libusb-compat/0.1.4: 12 files, 132K, built in 8 seconds
==> Installing libmtp dependency: libgpg-error
==> Downloading ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.10.tar.bz2
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/libgpg-error/1.10
==> make install
/usr/local/Cellar/libgpg-error/1.10: 15 files, 248K, built in 10 seconds
==> Installing libmtp dependency: libgcrypt
==> Downloading ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.5.0.tar.bz2
######################################################################## 100.0%
==> Downloading patches
######################################################################## 100.0%
==> Patching
patching file cipher/rijndael.c
==> ./configure --prefix=/usr/local/Cellar/libgcrypt/1.5.0 --disable-asm --with-gpg-error-prefix=/usr/local
==> make CFLAGS= -std=gnu89 -fheinous-gnu-extensions
==> make check
==> make install
/usr/local/Cellar/libgcrypt/1.5.0: 14 files, 1.2M, built in 73 seconds
==> Installing libmtp
==> Downloading http://sourceforge.net/projects/libmtp/files/libmtp/1.1.4/libmtp-1.1.4.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/libmtp/1.1.4
==> make install
/usr/local/Cellar/libmtp/1.1.4: 26 files, 1.1M, built in 17 seconds

Next I tried simple-mtpfs which runs MTP over a FUSE filesystem.

https://github.com/phatina/simple-mtpfs

Again, couldn't get it to compile on a Mac but looking through the comments there's been recent activity on getting it to work for the Mac.

Does anyone who knows there way around Mac development better than me have time to try and get these running?


Lastly, I also tried a commercial application called SyncMate which worked with my Nexus 7 but absolutely nothing from my Jolla.

http://www.sync-mac.com

I plugged my Nexus 7 in and it popped up in syncmate as an mtp device. The Jolla doesn't show anything in SyncMate's log.

Miharin 2013-12-20 17:54

Re: MTP support on Mac OSX
 
It was maybe a week ago when I was trying to compile that simple-mtpfs as well, and nobody from the forum could help me or they missed my posts, but I had one Linux friend who helped me a bit but I got stuck because apparently there isn't a version of FUSE that is high enough for Mac.

rasjani 2013-12-21 17:10

Re: MTP support on Mac OSX
 
There are couple of packages in the repositories that, atleast in theory, sound promising:

Available usb-moded-acm-mode-android-0.76.3-1.3.1.armv7hl USB mode controller - android acm mode config
Available usb-moded-defaults-0.76.3-1.3.1.armv7hl USB mode controller - default configuration
Available usb-moded-defaults-android-0.76.3-1.3.1.armv7hl USB mode controller - default configuration
Available usb-moded-mass-storage-mode-0.76.3-1.3.1.armv7hl USB mode controller - mass-storage mode config
Available usb-moded-mtp-mode-0.76.3-1.3.1.armv7hl USB mode controller - mtp mode config
Available usb-moded-mtp-mode-android-0.76.3-1.3.1.armv7hl USB mode controller - android mtp mode config
Available usb-moded-settings-sailfish-0.3.14-10.26.1.jolla.noarch USB mode configuration for Sailfish

I dont have have time right now to take a look what these do or even if they work but i'll get back to the thread if i find something ..

attah 2013-12-21 20:12

Re: MTP support on Mac OSX
 
I tried the usb-moded-mass-storage-mode-0.76.3-1.3.1.armv7hl.
It added that option to the settings menu, and the corresponding usb-moded config file. However it didn't contain any mount point or the like.. So i messed around a bit and added the lines from my N9. Changed the homedir obviously for alt-mount.. and checked that the other parth that was referenced exists. But it didn't work anyway. So i am starting think it takes something more than configuration.. at least by a layman like myself.

pycage 2013-12-21 21:08

Re: MTP support on Mac OSX
 
For USB mass storage, the filesystem must be unmounted from the phone to make it accessible to the computer. You cannot unmount something that is not a partition of its own, or is in use, like the home directory.
Therefore, USB mass storage cannot work. It's a stupid solution of the past.
With luck, you could get your SD card exported, but that's it.

MartinK 2013-12-21 21:24

Re: MTP support on Mac OSX
 
Quote:

Originally Posted by pycage (Post 1399521)
For USB mass storage, the filesystem must be unmounted from the phone to make it accessible to the computer. You cannot unmount something that is not a partition of its own, or is in use, like the home directory.
Therefore, USB mass storage cannot work. It's a stupid solution of the past.
With luck, you could get your SD card exported, but that's it.

And not only that, as it works on the block layer, it enforces what filesystem can be used on the volume exported by mass storage.

So for example if you format the volume with EXT4 (so that you can have 4GB+ files, symlinks & file permissions) and the computer you connect your device to does not understand EXT4, it will not work even if the mass storage procedure works fine.

In the end, this basically forces you to use FAT32 (<4GB files, no symlinks, no file permissions, issues with many small files) for the mass-storage exported volume, as that's basically the only filesystem supported on Linux, Windows and MacOS.

rasjani 2013-12-21 21:55

Re: MTP support on Mac OSX
 
Quote:

Originally Posted by pycage (Post 1399521)
With luck, you could get your SD card exported, but that's it.

That would all i need. As currently none of of the libmtp based apps on osx do not seem to even recognize Sailfish at all (except dropbox but thats not really helpful)

attah 2013-12-21 22:32

Re: MTP support on Mac OSX
 
Thanks for connecting the dots pycage!
@MartinK: So the N9 has FAT32? That's crazy! :eek:

Oh well, yet another reason to make the switch to Linux.

MartinK 2013-12-21 23:11

Re: MTP support on Mac OSX
 
Quote:

Originally Posted by attah (Post 1399537)
Thanks for connecting the dots pycage!
@MartinK: So the N9 has FAT32? That's crazy! :eek:

Oh well, yet another reason to make the switch to Linux.

Yep, it has a few GB (2-4?) EXT formatted program partition and the rest is FAT32 formatted, so it can be exported by mass-storage.

So like this, if you install a lot of stuff or store a lot of data on the "program" partition, you will not be able to install more applications, even if the FAT32 partition is still half empty.

Works also the other way around - if you run out of space on the FAT32 partition, I think you would not be able to take more photos for example.

This is another advantage of unified filesystem - you can install apps, take photos, etc. until you run out of ALL available space.

MaemoUser 2014-01-04 15:29

Re: MTP support on Mac OSX
 
Got MTP to work @OSX.

Quote:

bash-3.2$ mtp-detect
libmtp version: 1.1.6

Listing raw device(s)
Device 0 (VID=2931 and PID=0a01) is a Jolla Sailfish.
Found 1 device(s):
Jolla: Sailfish (2931:0a01) @ bus 29, dev 7
Attempting to connect device(s)

PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
inep: usb_get_endpoint_status(): Operation timed out
outep: usb_get_endpoint_status(): Operation timed out
Error 2: PTP Layer error 02fe: get_all_metadata_fast(): could not get proplist of all objects.
Error 2: Error 02fe: PTP: Protocol error, data expected
Error 7: Found a bad handle, trying to ignore it.
Error 7: Found a bad handle, trying to ignore it.
USB low-level info:
bcdUSB: 512
bDeviceClass: 0
bDeviceSubClass: 0
bDeviceProtocol: 0
idVendor: 2931
idProduct: 0a01
IN endpoint maxpacket: 512 bytes
OUT endpoint maxpacket: 512 bytes
Raw device info:
Bus location: 29
Device number: 7
Device entry info:
Vendor: Jolla
Vendor id: 0x2931
Product: Sailfish
Vendor id: 0x0a01
Device flags: 0x00000000
Device info:
Manufacturer: Jolla
Model: armv7hl
Device version: xxxxxxxxxx
Serial number: xxxxxxxxxxxxxxxxx
Vendor extension ID: 0x00000006
Vendor extension description: microsoft.com:1.0; microsoft.com/WMPPD:11.0;
Detected object size: 64 bits
Extensions:
microsoft.com: 1.0
microsoft.com/WMPPD: 11.0
Supported operations:
1001: get device info
1002: Open session
1003: Close session
1004: Get storage IDs
1005: Get storage info


All times are GMT. The time now is 00:54.

vBulletin® Version 3.8.8