Page 1 of 2
Connecting an Android phone using MTP

Posted:
Jun 21st, '12, 15:49
by quartz
Hi folks
I'm trying to connect and mount the internal storage on my Android (Sony Xperia U) phone. The phone only supports MTP.
If I type lsusb, I get:
- Code: Select all
[root@d620]# lsusb
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 413c:a005 Dell Computer Corp. Internal 2.0 Hub
Bus 001 Device 003: ID 0b97:7761 O2 Micro, Inc. Oz776 1.1 Hub
Bus 001 Device 004: ID 0b97:7762 O2 Micro, Inc. Oz776 SmartCard Reader
Bus 005 Device 003: ID 0fce:0171 Sony Ericsson Mobile Communications AB
The last entry is obviously the phone. But, if I type mtp-detect, the following happens:
- Code: Select all
[root@d620]# mtp-detect
libmtp version: 1.1.2
Listing raw device(s)
No raw devices found.
And the same error "No raw devices found" if I try to mount it (I have made a /media/sony folder for mounting purposes).
- Code: Select all
[root@d620]# mtpfs -o allow_other /media/sony
Listing raw device(s)
No raw devices found.
I found the linked
blog entry, and created a udev rule in accordance with the instructions, replacing the galaxy tab vendor ids with my the sony's from lsusb, but that doesn't seem to have made a difference.
The phone itself shows a little USB icon, and the notification says "The internal storage has been connected to a PC". Conversely the PC can see the phone (it's there in lsusb), so where is the breakdown happening?
Thanks.
Re: Connecting an Android phone using MTP

Posted:
Jun 24th, '12, 08:20
by sgunhouse
Desktop?
I have an Android tablet (Acer Iconia Tab, the 7" model) which I was able to connect to in Mageia 1, haven't actually tried it since 2 came out. Sorry, forget the details but it was pretty trivial - I just plugged it in and KDE popped up that list it has of actions for the newly-detected device. (Not sure how other environments handle plugged-in devices, that's why I asked about the desktop you use.) I'll have to remember to try it out ...
Re: Connecting an Android phone using MTP

Posted:
Jun 24th, '12, 09:25
by quartz
Good point sgunhouse. I'm using the most recent KDE that rolled out with my Mageia 2 upgrade.
The KDE device notifier does nothing when the phone is plugged in. There's no obvious on-screen response. If I open Dolphin, the phone does not appear in the "Places" sidebar.
Two further bits of evidence:
1. After reading other threads I was prompted to look at dmesg, and found this, which suggests the phone is being recognised on some level:
- Code: Select all
[ 105.771149] usb 5-6: new high-speed USB device number 3 using ehci_hcd
[ 105.886127] usb 5-6: New USB device found, idVendor=0fce, idProduct=0171
[ 105.886136] usb 5-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 105.886142] usb 5-6: Product: SEMC HSUSB Device
[ 105.886147] usb 5-6: Manufacturer: SEMC
[ 105.886152] usb 5-6: SerialNumber: BX902XDYTQ
2. (and this is really odd): The device
does appear in the Places sidebar in the Gimp2.8 File Open dialogue box. So, I can browse, open and save images on the phone. But it doesn't appear in any other applications (I tested vlc, dragon player, libre office writer, gwenview, kwrite). What makes Gimp different?
Re: Connecting an Android phone using MTP

Posted:
Jun 24th, '12, 18:08
by sgunhouse
It appears in Amorak, also. Since Amorak is intended to control music players, no real surprise there ...
No, no new device menu here either, and drakeconf doesn't know what to do with it. Not shown in Dolphin either.
Re: Connecting an Android phone using MTP

Posted:
Jun 28th, '12, 15:24
by linuxero
Have you tried to check if there is an option in your phone as to how to act when connected to the PC? My HTC gives me a few options one of which is to connect as a storage device. Maybe you should check the USB Connection Behaviour in the phone settings and tweak it a little bit.
Re: Connecting an Android phone using MTP

Posted:
Jun 28th, '12, 15:57
by wintpe
I have one of these devices, and it does not have this option, much to my discust, as my gallaxy S phone does have the option.
as from android 3 MTP is the only option.
Im not sure why google have gone this way.
theres a thread here that elaborates more on it, but I chose to use sshdroid instead and connect to it over wifi with filezilla.
http://www.transformerforums.com/forum/ ... orage.htmlregards peter
Re: Connecting an Android phone using MTP

Posted:
Jul 1st, '12, 08:52
by quartz
Thanks for the suggestion Linuxero. Unfortuntately wintpe is right, though there is a "USB Connection Mode" menu, the only selection available is MTP. (I'm still on Android 2.3)
The thread wintpe linked to suggested you needed mtpfs and mtp-tools installed. The latter doesn't exist in the Mageia repository, but I do have lots of programs that begin "mtp-" in /usr/bin.
What remains inexplicable is how Gimp2.8 can see this connected device, but no other application can. That makes no sense to me.
Re: Connecting an Android phone using MTP

Posted:
Jul 1st, '12, 15:23
by linuxero
Hi;
I wa reading a bit about this mtp stuff. Strangely enough, and as far as I understand, MTP is originaly a protocol designed for MS as part of WMP. Well this is no longer a problem in Linux from what I have been checking on Internet.
Back to our problem here it is just a matter of USB Storage recognition. In this case I could not assume that Android is using MTP for its Mass Storage Connections.
Please check this video:
http://www.youtube.com/watch?v=fXtZIQ-R ... re=relatedThis link could be interesting too:
http://www.omgubuntu.co.uk/2011/12/how- ... ile-accessThere are few other ones too. I might be mistaken, most probably, but if someone could confirm that Android 2.* uses MTP only for the USb connection I would appreciate it.
Good luck.
Re: Connecting an Android phone using MTP

Posted:
Jul 1st, '12, 15:52
by doktor5000
With the device accessible in gimp, please show the output of
- Code: Select all
mount
Re: Connecting an Android phone using MTP

Posted:
Jul 1st, '12, 21:01
by quartz
Hi doktor5000
Whilst the phone is being accessed by Gimp, "mount" shows the following:
- Code: Select all
rootfs on / type rootfs (rw)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,relatime,size=508192k,nr_inodes=127048,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
/dev/sda5 on / type ext4 (rw,relatime,user_xattr,acl,commit=600,barrier=1,data=ordered)
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=23,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
systemd-1 on /proc/bus/usb type autofs (rw,relatime,fd=36,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
/dev/sda6 on /mnt/shared type vfat (rw,nosuid,nodev,noexec,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
usbfs on /proc/bus/usb type usbfs (rw,relatime,devgid=43,devmode=664)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
gvfs-fuse-daemon on /run/user/andy/gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,relatime,user_id=500,group_id=500)
I checked, and this is exactly the same as when there is no device plugged in.
Also, thanks to linuxero for the links. My phone doesn't have the menu options shown in the youtube video sadly. The ubuntu link was interesting, one of the ideas was to add users to the "fuse" group. Here on Mageia 2 that group doesn't seem to exist. I created it, and added root to it (I figured I should get it working in root first before trying as a user), but that didn't help.

Re: Connecting an Android phone using MTP

Posted:
Jul 6th, '12, 22:46
by RobinHood
Stumbled upon this kind of problem myself and here's my point of view.
Installed latest libmtp 1.1.3 from source and this version supports my phone (sony xperia s), but the version that is in Mageia 2 repositories (1.1.2) doesn't find my phone.
There's no problem in installing libmtp from source, but in order to take full functionatlity over the phone we need mtpfs. There's two ways to install it - 1) install from source, but it can't find the libmtp that was installed from source (tried to point it to libmtp but no luck); 2) install using Software Management, but then it forces to use the old libmtp.
And now i'm stuck until Mageia devs push the update for libmtp.
Re: Connecting an Android phone using MTP

Posted:
Jul 7th, '12, 15:58
by doktor5000
Well, have you openend bug reports for those problems? Developers won't update libmtp out of the blue, if they are not even aware of this particular problem ...
If not:
https://wiki.mageia.org/en/How_to_report_a_bug_properly
Re: Connecting an Android phone using MTP

Posted:
Jul 7th, '12, 16:45
by wintpe
you could always take the mageia src rpm and drop in the new tgz file, update the specfile and rebuild
regards peter
Re: Connecting an Android phone using MTP

Posted:
Jul 10th, '12, 08:32
by sgunhouse
Per my post earlier, Amorak will also see mtp devices - but of course only for purposes of transferring music files to/from the device.

Android support coming to Mageia?

Posted:
Jul 17th, '12, 18:11
by zxr250cc
I read the various posts from a year ago in advanced networking and wonder if the full connection of Android devices is coming to Mageia at some point. I am not saying anything new to say that the devices (smartphones, tablets) are very popular and their use is growing daily...
I have an Acer Iconia A100 using Android 4.0.3 and it sees the connection to my laptop as if it (the tablet) is connected as a media device. The laptop does not seem to see the tablet at all. I had a Motorila Defy before with Android 2.2 on it and it could be seen by Mandriva 2010.2 that I was running at the time, in 2011, and files on the SD card added and removed.
Are we as a group using many Android tablets? I am sure we are using Android phones since they are becoming or have become the number one version of software for smartphones.
Re: Android support coming to Mageia?

Posted:
Jul 17th, '12, 21:09
by doktor5000
zxr250cc wrote:I read the various posts from a year ago in advanced networking
Actually this is not about networking, as access happens as if it were a removable mass-storage/media player device. Merged your post in the existing thread where it belongs.
Re: Connecting an Android phone using MTP

Posted:
Jul 18th, '12, 00:10
by zxr250cc
The laptop does not see the tablet. The tablet says it is connected as a media device and shows a little USB icon. How is this functional? Is something about to change in rpm packages or features being developed to improve this?
cheers,
gcd
Re: Connecting an Android phone using MTP

Posted:
Jul 18th, '12, 05:49
by doktor5000
zxr250cc wrote:How is this functional? Is something about to change in rpm packages or features being developed to improve this?
I've never said anything if it is functional or not, seems you're a bit off there.
And as i've already told, if nobody does a proper bugreport about the problem that causes this and possible fixes, it won't get just fixed out of the blue.
Re: Connecting an Android phone using MTP

Posted:
Jul 18th, '12, 16:58
by zxr250cc
I didn't post in here originally because I wanted wider viewing of this issue. The core idea, as far as I am concerned is this: Does it work? At present the answer is, unfortunately, no.
The majority of the devices we would hope to use are ARM based (a few low priced ones have been MIPS already) and running Android 2.2, 2.3, 3.0, 3.1, 3.2 or 4.0 at this instant. With rapid turnover in smartphones built into the renewed contract/free new phone cycle the versions that should be of most interest would be 3.2 forward, I would guess. Tablets have gradually been gaining ground and have gotten more popular with Android 3.0 to 4.0 and now 4.1 with the Nexus 7.
There are going to be millions of these in use soon, I expect. I think many users will want the 7" screen instead of the 10" screen for the convenience of the smaller size and the lower price will also make them attractive. I don't think a bug report is the answer. It will need someone who can program and wants to use his tablet or phone with Linux. Is any other distribution making real progress with this? I am unaware of it but I will certainly begin to study the other popular ones like Ubuntu, SUSE and others to see if anyone there has made full use of a tablet connection yet.
We should do a survey of Mageia users to see if Android tablets/smartphones are desired to connect to our computers, why users would like to connect them and what features would they like to have for connectivity. This should not be in here but it a widely viewed section like general Mageia discussion...
Thoughts?
Cheers,
gcd
Re: Connecting an Android phone using MTP

Posted:
Jul 18th, '12, 19:55
by zxr250cc
I found an example of a user who was connecting an Acer tablet in Ubuntu. Perhaps this will help. I have not tried it yet but plan to see if I can get it to work.
http://www.acertabletforum.com/forum/ac ... buntu.htmlCheers,
gcd
Re: Connecting an Android phone using MTP

Posted:
Jul 18th, '12, 20:23
by doktor5000
zxr250cc wrote:I didn't post in here originally because I wanted wider viewing of this issue. The core idea, as far as I am concerned is this: Does it work? At present the answer is, unfortunately, no.
There is already a thread about this topic -> use that one. Just opening a new thread will just improve clutter of information, and not get you wider views, because less people will read multiple (relevant) threads and post in all of them. So effectively this would result in less coverage. If you want more coverage, use multiple communication channels, like posting this on relevant mailing lists. But not duplicating the existing information into one communication channel.
Otherwise, if you want to do a survey, just do it.
Also for Android version below 3 it works for some users, so your assumption is incorrect. And what exactly did you do until now to get it working, did you try to mount it via
- Code: Select all
mtpfs /path/to/where/you/want/it/to/be/mounted
for example if the device is detected and connection is existent? Furthermore you could try to fiddle around with instructions similar to
https://wiki.archlinux.org/index.php/Mtp
Re: Connecting an Android phone using MTP

Posted:
Jul 19th, '12, 10:32
by tom_
Hi all,
right now I have my android phone connected to my laptop
I setted the Android USB as mass memory,
and I can browse my phone memory via dolphin or command line
here my dmesg:
- Code: Select all
[ 6798.371079] usb 7-1: new high-speed USB device number 4 using ehci_hcd
[ 6798.485974] usb 7-1: New USB device found, idVendor=04e8, idProduct=681d
[ 6798.485983] usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 6798.485989] usb 7-1: Product: SAMSUNG_Android
[ 6798.485994] usb 7-1: Manufacturer: SAMSUNG
[ 6798.485999] usb 7-1: SerialNumber: 0123456789ABCDEF
[ 6798.487529] scsi31 : usb-storage 7-1:1.0
[ 6799.488901] scsi 31:0:0:0: Direct-Access SAMSUNG GT-I9001 Card 0327 PQ: 0 ANSI: 2
[ 6799.492379] scsi 31:0:0:1: Direct-Access SAMSUNG GT-I9001 Card 0327 PQ: 0 ANSI: 2
[ 6799.495586] sd 31:0:0:0: [sdc] Attached SCSI removable disk
[ 6799.497085] sd 31:0:0:1: [sdd] Attached SCSI removable disk
[ 6809.944678] usb 7-1: USB disconnect, device number 4
[ 6812.074085] usb 7-1: new high-speed USB device number 5 using ehci_hcd
[ 6812.189074] usb 7-1: New USB device found, idVendor=04e8, idProduct=681d
[ 6812.189080] usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 6812.189084] usb 7-1: Product: SAMSUNG_Android
[ 6812.189087] usb 7-1: Manufacturer: SAMSUNG
[ 6812.189090] usb 7-1: SerialNumber: 0123456789ABCDEF
[ 6812.192057] scsi32 : usb-storage 7-1:1.0
[ 6813.195049] scsi 32:0:0:0: Direct-Access SAMSUNG GT-I9001 Card 0327 PQ: 0 ANSI: 2
[ 6813.196037] scsi 32:0:0:1: Direct-Access SAMSUNG GT-I9001 Card 0327 PQ: 0 ANSI: 2
[ 6813.200979] sd 32:0:0:1: [sdd] Attached SCSI removable disk
[ 6813.201604] sd 32:0:0:0: [sdc] Attached SCSI removable disk
[ 6826.006104] sd 32:0:0:1: [sdd] 15742976 512-byte logical blocks: (8.06 GB/7.50 GiB)
[ 6826.006844] sd 32:0:0:1: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 6826.010513] sdd:
[ 6827.005593] sd 32:0:0:0: [sdc] 10457088 512-byte logical blocks: (5.35 GB/4.98 GiB)
[ 6827.006345] sd 32:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
this is the relevant part in mount (this line disappers when I unplug the phone):
- Code: Select all
/dev/sdc on /media/4066-07CE type vfat (rw,nosuid,nodev,relatime,uid=10001,gid=10001,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,errors=remount-ro)
and it seems that quartz has a similar line:
- Code: Select all
/dev/sda6 on /mnt/shared type vfat (rw,nosuid,nodev,noexec,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
with phone connected mtp-xxx says:
- Code: Select all
# mtp-detect
libmtp version: 1.1.2
Listing raw device(s)
No raw devices found.
# mtp-connect
libmtp version: 1.1.2
No devices.
installed packeges:
- Code: Select all
# rpm -qa | grep mtp
lib64mtp9-1.1.2-1.mga2
libmtp-utils-1.1.2-1.mga2
mtpfs-1.1-1.mga2
feel free to ask other details
Re: Connecting an Android phone using MTP

Posted:
Jul 20th, '12, 01:28
by zxr250cc
For curiosities sake I tried to set up the tablet with XP and it did not work very well even though it could see the tablet. I then connected it to a Windows 8 laptop which automatically went out into the internet and downloaded a file, set up the connection and let me do whatever I wished in the files inside the tablet. Score 1 for Windows 8, 0 for XP and 0 for Linux, so far...
sigh...
gcd
Re: Connecting an Android phone using MTP

Posted:
Jul 20th, '12, 11:10
by tom_
so you could help the libmtp project!!
http://libmtp.sourceforge.net/"New Devices
-----------
If you happen upon a device which libmtp claims it cannot
autodetect, please submit the vendor ID and device ID
(these can be obtained from the "lsusb" and "lsusb -n"
commands run as root) as a bug"
Re: Connecting an Android phone using MTP

Posted:
Jul 20th, '12, 14:24
by quartz
Hi Tom
For some reason I've stopped getting the notification emails, so it was a surprise to find so many posts here!
Unfortunately the line you quote from my mount list is a shared Windows drive, not the phone... The easy solution, as you say, is to set the phone's USB mode to Mass Storage. The problem is some Androids do not have this option...
I will submit my device details to the libmtp project, as you suggest.
Edit. It's already been posted on the libmtp
bugzilla- Code: Select all
This device is supported in the GIT version of
libmtp. Please make a GIT checkout and compile
from source if you want to try it out, or wait
for us to release the next version of libmtp, things
take time...
So there you go: either compile your own libmtp, or wait until the clever folks package it up...