View previous topic :: View next topic |
Author |
Message |
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Fri Jun 15, 2012 10:05 am Post subject: [Solved] Galaxy S3 and MTP |
|
|
Hi all,
I have just bought a samsung galaxy S3 and I want to connect it to my gentoo box, so I googled a bit and I emerged mtpfs but it doesn't automount with nautilus any ideas?
Thanks
Last edited by yellowhat on Tue Jun 26, 2012 8:56 pm; edited 1 time in total |
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Sat Jun 16, 2012 10:49 am Post subject: |
|
|
Any ideas? |
|
Back to top |
|
|
yngwin Retired Dev
Joined: 19 Dec 2002 Posts: 4572 Location: Suzhou, China
|
Posted: Sun Jun 17, 2012 7:10 am Post subject: |
|
|
Don't buy a device that doesn't allow normal USB Mass Storage...
I know, not very helpful... Try google, I believe there are some scripts out there. _________________ "Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF |
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Sun Jun 17, 2012 7:44 am Post subject: |
|
|
I founded this http://shkspr.mobi/blog/index.php/2012/01/connecting-samsung-ics-to-ubuntu-using-mtp/ but I get this error:
Code: | Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung GT-P7310/P7510/N7000/I9100/Galaxy Tab 7.7/10.1/S2/Nexus/Note.
Found 1 device(s):
Samsung: GT-P7310/P7510/N7000/I9100/Galaxy Tab 7.7/10.1/S2/Nexus/Note (04e8:6860) @ bus 1, dev 5
Attempting to connect device
PTP_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
|
Using a CM9 or AOSP rom could help? |
|
Back to top |
|
|
chrisyu Apprentice
Joined: 10 Apr 2003 Posts: 207 Location: China
|
Posted: Sun Jun 17, 2012 11:37 am Post subject: |
|
|
mtpfs is buggy.
I tried jmptfs and worked well, but I don't know how to auto mount either.
http://forum.xda-developers.com/showthread.php?t=1643757
You could use this ebuild.
Code: |
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=4
DESCRIPTION="a FUSE based MTP filesystem designed to make exchanging files between Android devices and Linux"
HOMEPAGE="http://research.jacquette.com/jmtpfs-exchanging-files-between-android-devices-and-linux/"
SRC_URI="http://research.jacquette.com/wp-content/uploads/2012/05/${P}.tar.gz"
LICENSE="GPL"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""
DEPEND="media-libs/libmtp
sys-fs/fuse"
RDEPEND="${DEPEND}"
|
|
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Sun Jun 17, 2012 3:10 pm Post subject: |
|
|
Thanks for reply but I get this error in emerging:
Code: | make -j3
Making all in src
make[1]: Entering directory `/tmp/portage/sys-fs/jmtpfs-0.4/work/jmtpfs-0.4/src'
i686-pc-linux-gnu-g++ -DPACKAGE_NAME=\"jmtpfs\" -DPACKAGE_TARNAME=\"jmtpfs\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"jmtpfs\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"jmtpfs\" -DVERSION=\"1.0\" -DHAVE_LIBMAGIC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_MAGIC_H=1 -I. -I/usr/include/libusb-1.0 -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -march=native -O2 -pipe -fomit-frame-pointer -std=c++0x -c -o jmtpfs-jmtpfs.o `test -f 'jmtpfs.cpp' || echo './'`jmtpfs.cpp
i686-pc-linux-gnu-g++ -DPACKAGE_NAME=\"jmtpfs\" -DPACKAGE_TARNAME=\"jmtpfs\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"jmtpfs\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"jmtpfs\" -DVERSION=\"1.0\" -DHAVE_LIBMAGIC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_MAGIC_H=1 -I. -I/usr/include/libusb-1.0 -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -march=native -O2 -pipe -fomit-frame-pointer -std=c++0x -c -o jmtpfs-MtpDevice.o `test -f 'MtpDevice.cpp' || echo './'`MtpDevice.cpp
i686-pc-linux-gnu-g++ -DPACKAGE_NAME=\"jmtpfs\" -DPACKAGE_TARNAME=\"jmtpfs\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"jmtpfs\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"jmtpfs\" -DVERSION=\"1.0\" -DHAVE_LIBMAGIC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_MAGIC_H=1 -I. -I/usr/include/libusb-1.0 -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -march=native -O2 -pipe -fomit-frame-pointer -std=c++0x -c -o jmtpfs-ConnectedMtpDevices.o `test -f 'ConnectedMtpDevices.cpp' || echo './'`ConnectedMtpDevices.cpp
i686-pc-linux-gnu-g++ -DPACKAGE_NAME=\"jmtpfs\" -DPACKAGE_TARNAME=\"jmtpfs\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"jmtpfs\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"jmtpfs\" -DVERSION=\"1.0\" -DHAVE_LIBMAGIC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_MAGIC_H=1 -I. -I/usr/include/libusb-1.0 -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -march=native -O2 -pipe -fomit-frame-pointer -std=c++0x -c -o jmtpfs-Mutex.o `test -f 'Mutex.cpp' || echo './'`Mutex.cpp
jmtpfs.cpp: In function ‘int main(int, char**)’:
jmtpfs.cpp:454:90: error: ‘getuid’ was not declared in this scope
jmtpfs.cpp:454:100: error: ‘getgid’ was not declared in this scope
make[1]: *** [jmtpfs-jmtpfs.o] Errore 1
make[1]: *** Attesa dei processi non terminati....
make[1]: Leaving directory `/tmp/portage/sys-fs/jmtpfs-0.4/work/jmtpfs-0.4/src'
make: *** [all-recursive] Errore 1
|
|
|
Back to top |
|
|
jcTux Apprentice
Joined: 29 Dec 2009 Posts: 276 Location: Tours, France
|
Posted: Sun Jun 17, 2012 6:37 pm Post subject: |
|
|
It's a shame that MTP protocole is not fully supported on Linux.
I have a Galaxy S3 also, I use the old FTP solution for now. |
|
Back to top |
|
|
kernelOfTruth Watchman
Joined: 20 Dec 2005 Posts: 6111 Location: Vienna, Austria; Germany; hello world :)
|
Posted: Sun Jun 17, 2012 9:21 pm Post subject: |
|
|
jcTux wrote: | It's a shame that MTP protocole is not fully supported on Linux.
I have a Galaxy S3 also, I use the old FTP solution for now. |
++
good to know that !
it already sucked to find that out with my Xoom
probably won't buy a Galaxy S3 then
alternatively:
use other ROMs provided over by XDA devs
for the file-sharing:
try File Expert that one works flawless for me (there might be others but FE was the first one that really worked - the others had issues for me)
concerning the issue with automount:
sorry - can't help
I only mounted it manually while I used mtpfs _________________ https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa
Hardcore Gentoo Linux user since 2004 |
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Sun Jun 17, 2012 10:21 pm Post subject: |
|
|
I have just switched to CyanogenMod 9: on a ubuntu box it gets automounted without any changes, on my gentoo box it is detected by "mtp-detect" but it's not automounted by nautilus. |
|
Back to top |
|
|
jcTux Apprentice
Joined: 29 Dec 2009 Posts: 276 Location: Tours, France
|
Posted: Mon Jun 18, 2012 12:01 pm Post subject: |
|
|
kernelOfTruth wrote: |
probably won't buy a Galaxy S3 then
|
I don't think that Galaxy S3 is the problem. This is the new recommendation by Google for new devices under ICS.
It makes sense, because virtually with MTP you don't have to use FAT32, the use of modern filesystem like ext4 is possible => no more limitation on filesize. Plus, when connecting the device on a computer, the filesystem is still avalalble on the phone unlike USB mass storage.
Unfortunately MTP is not well supported on Linux. |
|
Back to top |
|
|
jcTux Apprentice
Joined: 29 Dec 2009 Posts: 276 Location: Tours, France
|
Posted: Mon Jun 18, 2012 12:08 pm Post subject: |
|
|
Here are some explanations by a Google engineer on the reasons why they made this choice. |
|
Back to top |
|
|
chrisyu Apprentice
Joined: 10 Apr 2003 Posts: 207 Location: China
|
Posted: Tue Jun 19, 2012 1:16 am Post subject: |
|
|
yellowhat wrote: | Thanks for reply but I get this error in emerging:
Code: | make -j3
Making all in src
make[1]: Entering directory `/tmp/portage/sys-fs/jmtpfs-0.4/work/jmtpfs-0.4/src'
i686-pc-linux-gnu-g++ -DPACKAGE_NAME=\"jmtpfs\" -DPACKAGE_TARNAME=\"jmtpfs\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"jmtpfs\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"jmtpfs\" -DVERSION=\"1.0\" -DHAVE_LIBMAGIC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_MAGIC_H=1 -I. -I/usr/include/libusb-1.0 -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -march=native -O2 -pipe -fomit-frame-pointer -std=c++0x -c -o jmtpfs-jmtpfs.o `test -f 'jmtpfs.cpp' || echo './'`jmtpfs.cpp
i686-pc-linux-gnu-g++ -DPACKAGE_NAME=\"jmtpfs\" -DPACKAGE_TARNAME=\"jmtpfs\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"jmtpfs\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"jmtpfs\" -DVERSION=\"1.0\" -DHAVE_LIBMAGIC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_MAGIC_H=1 -I. -I/usr/include/libusb-1.0 -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -march=native -O2 -pipe -fomit-frame-pointer -std=c++0x -c -o jmtpfs-MtpDevice.o `test -f 'MtpDevice.cpp' || echo './'`MtpDevice.cpp
i686-pc-linux-gnu-g++ -DPACKAGE_NAME=\"jmtpfs\" -DPACKAGE_TARNAME=\"jmtpfs\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"jmtpfs\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"jmtpfs\" -DVERSION=\"1.0\" -DHAVE_LIBMAGIC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_MAGIC_H=1 -I. -I/usr/include/libusb-1.0 -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -march=native -O2 -pipe -fomit-frame-pointer -std=c++0x -c -o jmtpfs-ConnectedMtpDevices.o `test -f 'ConnectedMtpDevices.cpp' || echo './'`ConnectedMtpDevices.cpp
i686-pc-linux-gnu-g++ -DPACKAGE_NAME=\"jmtpfs\" -DPACKAGE_TARNAME=\"jmtpfs\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"jmtpfs\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"jmtpfs\" -DVERSION=\"1.0\" -DHAVE_LIBMAGIC=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_MAGIC_H=1 -I. -I/usr/include/libusb-1.0 -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -march=native -O2 -pipe -fomit-frame-pointer -std=c++0x -c -o jmtpfs-Mutex.o `test -f 'Mutex.cpp' || echo './'`Mutex.cpp
jmtpfs.cpp: In function ‘int main(int, char**)’:
jmtpfs.cpp:454:90: error: ‘getuid’ was not declared in this scope
jmtpfs.cpp:454:100: error: ‘getgid’ was not declared in this scope
make[1]: *** [jmtpfs-jmtpfs.o] Errore 1
make[1]: *** Attesa dei processi non terminati....
make[1]: Leaving directory `/tmp/portage/sys-fs/jmtpfs-0.4/work/jmtpfs-0.4/src'
make: *** [all-recursive] Errore 1
|
|
Seems that's a gcc-4.7 related problem, try gcc-4.6 instead. |
|
Back to top |
|
|
chrisyu Apprentice
Joined: 10 Apr 2003 Posts: 207 Location: China
|
Posted: Tue Jun 19, 2012 2:00 am Post subject: |
|
|
The intention was good, but implementation (mtp) is bad.
Slow when copy many small files; no real move/rename function, it's copy and delete; buggy, even in windows 7. |
|
Back to top |
|
|
yngwin Retired Dev
Joined: 19 Dec 2002 Posts: 4572 Location: Suzhou, China
|
Posted: Tue Jun 19, 2012 8:52 am Post subject: |
|
|
If you find a decent solution to make MTP (more or less) work on Gentoo, please document it in our wiki! _________________ "Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF |
|
Back to top |
|
|
chrisyu Apprentice
Joined: 10 Apr 2003 Posts: 207 Location: China
|
Posted: Tue Jun 19, 2012 3:45 pm Post subject: |
|
|
OK, made a new version of jmtpfs, tested with gcc 4.7.1 ~amd64.
/usr/local/portage/sys-fs/jmtpfs/jmtpfs-0.4.ebuild
Code: |
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=4
inherit eutils
DESCRIPTION="a FUSE based MTP filesystem designed to make exchanging files between Android devices and Linux"
HOMEPAGE="http://research.jacquette.com/jmtpfs-exchanging-files-between-android-devices-and-linux/"
SRC_URI="http://research.jacquette.com/wp-content/uploads/2012/05/${P}.tar.gz"
LICENSE="GPL"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE=""
DEPEND="media-libs/libmtp
sys-fs/fuse"
RDEPEND="${DEPEND}"
src_unpack() {
unpack ${A}
cd "${S}"
epatch "${FILESDIR}"/${PN}-gcc-4.7.patch
}
|
/usr/local/portage/sys-fs/jmtpfs/files/jmtpfs-gcc-4.7.patch
Code: |
--- src/jmtpfs.cpp.orig 2012-06-19 23:17:11.954301180 +0800
+++ src/jmtpfs.cpp 2012-06-19 23:17:41.745302509 +0800
@@ -32,6 +32,7 @@
#include <sstream>
#include <iomanip>
#include <assert.h>
+#include <unistd.h>
#define JMTPFS_VERSION "0.4"
|
Plug my galaxy nexus, then run "jmtpfs ~/nexus" as normal user, it will mount the phone, there is a drive in nautilus too.
mount says
Quote: |
jmtpfs on /home/test/nexus type fuse.jmtpfs (rw,nosuid,nodev,user=test)
|
Don't know how to auto mount yet. |
|
Back to top |
|
|
kernelOfTruth Watchman
Joined: 20 Dec 2005 Posts: 6111 Location: Vienna, Austria; Germany; hello world :)
|
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Tue Jun 19, 2012 8:35 pm Post subject: |
|
|
Ok the patch worked, and running "jmtpfs /folder" worked too.
Thanks you very much |
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Tue Jun 19, 2012 10:30 pm Post subject: |
|
|
A question for you how to unmount? |
|
Back to top |
|
|
chrisyu Apprentice
Joined: 10 Apr 2003 Posts: 207 Location: China
|
Posted: Wed Jun 20, 2012 6:04 am Post subject: |
|
|
Thanks, will check that later.
yellowhat wrote: |
A question for you how to unmount?
|
umount /path/to/folder should do the job.
yngwin wrote: | If you find a decent solution to make MTP (more or less) work on Gentoo, please document it in our wiki! |
Will file a bug report or add a wiki when I dig something more. |
|
Back to top |
|
|
tonyp n00b
Joined: 27 Apr 2005 Posts: 9
|
Posted: Sat Jun 23, 2012 5:17 pm Post subject: |
|
|
I was able to get MTP to work by emerging mtpfs and then creating a /media/android_mtp folder which you could put anywhere and then mounting like this (as normal user):
mtpfs /media/android_mtp
I could then access it with Dolphin as a normal folder. As mentioned in other posts, speed is not the best.
Unmount like this:
fusermount -u /media/android_mtp |
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Sat Jun 23, 2012 11:05 pm Post subject: |
|
|
Ok, this workaround can go but a question is: why ubuntu automounts internal and external sd without typing any command?
This would be great with nautilus. |
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Tue Jun 26, 2012 4:33 pm Post subject: |
|
|
Seems that ubuntu uses gphoto2 to mount it. Any ideas for gentoo?
The ideas using ssh over usb is too slow (1-2 MB/s) |
|
Back to top |
|
|
*zensiert* n00b
Joined: 10 Oct 2004 Posts: 55 Location: Germany
|
Posted: Tue Jun 26, 2012 4:50 pm Post subject: |
|
|
yellowhat wrote: | Seems that ubuntu uses gphoto2 to mount it. Any ideas for gentoo?
The ideas using ssh over usb is too slow (1-2 MB/s) |
There's , which woks with my Samsung Galaxy Nexus. |
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Tue Jun 26, 2012 6:38 pm Post subject: |
|
|
Enabling "gphoto2" use flag for gnome-base/gvfs I get automounting.
I will test the transfer speed. |
|
Back to top |
|
|
yellowhat Guru
Joined: 10 Sep 2008 Posts: 528
|
Posted: Tue Jun 26, 2012 8:56 pm Post subject: |
|
|
Transfer speed is much better ~5 MB/s |
|
Back to top |
|
|
|