I have to tell you, I am thoroughly enjoying this phone! I'm loving it! I really like the big screen, the great on-screen keyboard, the snazzy new Ice Cream interface, and most of all the 4G Internet speed.
There was only one little surprise for me with this new phone: Having to use the Media Transfer Protocol "MTP" ( ms ft technology), and/or the Photo Transfer Protocol "PTP" to transfer files to/from the device instead of USB Block mode. Both of my previous phones, the Moto Droid and then the Droid Incredible, used USB block mode instead.
The way USB block mode works is that when you plug the device into the USB port with the cable it is simply detected as an external USB drive. This is nice because no additional applications or proprietary frameworks are needed to access the drive.
With the Samsung Galaxy Nexus however, you have to install some additional software so you can mount the device using "MTP" Media Transfer Protocol. I think it would be nice if you had the choice of using whichever one you want.
MTP works with GNU/Linux, but it requires the installation of some extra applications to get connected to the device. One such application is called gMTP by Darran Kartaschew (aka Chewy509).
The gMTP program is a graphical utility that lets you add/delete/copy/make folders/etc. to your device via MTP. gMTP is available in the Ubuntu Software Center.
The only problem I had with gMTP, which depends upon libmtp from sourceforge.com, is that the latest libmtp hadn't been updated on my Ubuntu (11.10) yet. So, since I had the older libmtp, I was experiencing a bug where trying to copy files onto my Samsung Galaxy Nexus wasn't working properly. At least one other person was having this problem, according to this post on sourceforge.com. To make a long story short, I posted my complaint on G+ and then magically.. +Paul Eubanks suggested that I should check into installing the newer libmtp to fix the problem. This hit the nail on the head! Thanks Paul!
Eventually, probably within a few weeks or months, libmtp will be updated for Ubuntu, and then you won't experience the bug I did.. But until then, here are the instructions for installing the newer libmtp, after compiling it from source.
Step 1. Install the libusb-dev dependency package so you can build libmtp
sudo apt-get install libusb-devStep 2. Download the latest libmtp tar.gz from here:
http://sourceforge.net/projects/libmtp/files/libmtp/
Step 3. cd into the same directory where you downloaded the new libmtp*.tar.gz and extract the tar package:
tar xvf libmtp-1.1.1.tar.gzStep 4. cd into the libmtp directory you just extracted , then compile and install using configure/make/make install:
cd libmtp-1.1.1/Step 5 (maybe optional). Not sure if I needed this step or not, but if everything in the last step went well, you'll now have the 69-libmtp.rules file in the current directory, and you can copy it to /etc/udev/rules.d to ensure you can access the phone through the USB.
./configure --prefix=/usr
make
sudo make install
sudo cp 69-libmtp.rules /etc/udev/rules.dStep 6. Install the handy gMTP Graphical MTP file access utility:
sudo apt-get install gmtpStep 7. Try to run gMTP and see if it connects to your device. If not, then refresh things by unplugging your phone, rebooting the computer, then plugging in your phone again. Then, try to launch gMTP from the Unity/Gnome menu again, see below.
Step 8. You should see something like below when you click connect. Also you should be able to copy files to and from the device with ease.
If you want to check to ensure your computer has the newer libmtp, run this command:
ls -lah /usr/lib/libmtp*You should see something like below.. notice the libmtp.so.9.0.1 and file date there
Here's an extra tip: The gMTP program version 1.2.0 has the root of the filesystem "/" set for the "Download" control (by default). So if you launch the program normally, when you select a file and click "Download", you'll get an error because the program will have tried to save the file to "/", which unless you run your computer as root - is not writable by regular users. To fix this problem, you should open Edit > Preferences for gMTP, then place a checkmark by "Always show Download Path", as shown in the picture below. With this setting enabled, you'll be prompted for a location to store the file when clicking "Download", and you can pick something like Desktop or your Documents folder so you can get your files.svanwagner@ubuntu-scythe:/usr/lib$ ls -lah libmtp.* -rw-r--r-- 1 root root 725K 2011-12-18 01:12 libmtp.a -rwxr-xr-x 1 root root 921 2011-12-18 01:12 libmtp.la lrwxrwxrwx 1 root root 15 2011-12-18 01:12 libmtp.so -> libmtp.so.9.0.1 lrwxrwxrwx 1 root root 15 2011-12-18 01:12 libmtp.so.9 -> libmtp.so.9.0.1 -rw-r--r-- 1 root root 256K 2011-08-09 06:10 libmtp.so.9.0.0 -rwxr-xr-x 1 root root 611K 2011-12-18 01:12 libmtp.so.9.0.1
That's it! Now you can move files on and off your Samsung Galaxy Nexus device with ease!
Update: @seankenefick pointed out how the libmtp update does not help the problem with connecting the Nexus to Banshee or even Rhythmbox.
To have Banshee see your Samsung Galaxy Nexus (Android):
- Close out of banshee completely
- Plug in your phone and open the root folder (select open folder on plug-in prompt)
- Create an empty file, rename it to ".is_audio_player" (no quotes)
- Open the Banshee Music player and it will see your device
- Simply enable Debugging Mode on the Phone, then attach it to the computer
http://www.omgubuntu.co.uk/2011/01/banshee-doesnt-show-android-fix/
https://bugs.launchpad.net/ubuntu/+source/banshee/+bug/896376
Want to try a different way? See here: http://www.omgubuntu.co.uk/2011/12/how-to-easily-mount-the-galaxy-nexus-on-ubuntu-11-10-via-unity/
If you'd like to leave a comment, please do so below.
Cheers!
Shannon VanWagner
12-18-11




thanks, this helped :)
ReplyDeleteGreat write up. Thanks Shannon!
ReplyDeleteShannon,
ReplyDeleteI use Gentoo and had libmtp-1.1.1 installed and could access the device fine but could not write to my Galaxy Nexus, I had to re-emerge libmtp and my problems went away but if I never read your post I would still be bashing my head of why this isn't working. Thanks for the howto!
Thank You!!
ReplyDeleteExcellent directions for the CC's of the world (Command challenged)
Loven my Gnex
this is great for individual file copies, but fails for directory hierarchies containing .mp3 files, which are inexplicably placed in the root of the copy target rather than in their directories. other file types are properly placed in their target hierarchies. :/
ReplyDelete>this is great for individual file copies, but fails for directory hierarchies containing .mp3 files, which are inexplicably placed in the root of the copy target rather than in their directories. other file types are properly placed in their target hierarchies.
ReplyDeleteMe: hmm, I didn't seem to have this same problem. Although, I still would prefer to use the block mode over MTP, because then I could just use the OS to access the data rather than having to use an additional program. Anways, thanks to libmtp/gmtp/etc. at least I can get access.
Will this work with the samsung galaxy prevail?
ReplyDelete>I think it would be nice if you had the choice of using whichever one you want.
ReplyDeleteIt's up to the phone makers if they want to use the old way of partitioning the internal flash storage or the new.
Old: Where you need a "Move to SD" option to use all internal storage. When you plug-in the USB it unmount the SD-partition, there by allowing the PC to mount it. This also requires FAT32 to be included where Microsoft holds a long-filenames patent (most likely one of the 5 patents phone vendors pay to use).
New: All apps and media are stored on a single partition, no more "Move to SD" that isn't really a SD in most phones. Use of the more modern file system EXT4 (compared to FAT32) on all partitions, this will most like improve speed (App load) as well as lower the chance for data to be lost during power failure. The downside of this is that you can't unmount to when the USB is pluged-in, since all apps are stored on it.
Google solution was to use MTP to transfer files to/from the mounted partition. This will force a lot of Linux distributions to improve their MTP support.
Another solution could be to implement a virtual USB storage device that mirrors everything on the internal storage. But this would have taken more time to implement and test.
+Bruno Thomsen - Good stuff. Thanks for the background on that.
ReplyDeleteActually, if I connect the cable; set it to Camera (PTP) mode; unmount it from linux; and then enable Debugging mode (under Developer options), the drive pops up as a window (same as before), but this time I can write/drag files/drag folders/etc. It still doesn't show up under #df, but it seems to look like a normal folder at least...
ReplyDeleteBuilding libmptp 1.1.1 from source got me slightly further than before (gmtp and qlix now see that there is a device, although they don't see it as a Nexus, but then both segfault trying to connect). This is with Ubuntu Natty.
ReplyDeleteThankfully I can do file transfer with PTP/Camera Mode, and libmtp will only get better!
This looks very cool but one problem... there is only a 32-bit version of gMTP [does anyone really still use 32-bit computers? :-)]
ReplyDeleteAny chance of an x86_64 version?
Thanks!
>I think it would be nice if you had the choice of using whichever one you want.
ReplyDeleteOn my Galaxy Nexus I go to Settings>Storage>Menu>USB Computer Connection and choose Camera (PTP) and the device shows in Fedora without changing anything just as it shows in Windows.
Thanks for the great article.
ReplyDeleteI have a Samsung Galaxy Tab 10.1 and had tried gmtp to no avail. I found your article and tried updating libmtp but still no luck.
Running gmtp from the commandline gives the following:
Device 0 (VID=04e8 and PID=6860) is a Samsung GT-P7510/Galaxy Tab 10.1.
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
Detect: Unable to open raw device?
LIBMTP PANIC: Trying to dump the error stack of a NULL device!
LIBMTP PANIC: Trying to clear the error stack of a NULL device!
Any help you can give would be greatly appreciated.
cheers
@lochutus - Apparently there's another way to try:
ReplyDeleteUse ddms from sdk tools (follow instructions at http://developer.android.com/sdk/index.html to install sdk tools):
Then go to Device > File Explorer > navigate to mnt,sdcard, then select the folder or files you want to transfer to your device > then click the "pull from device" icon, select a local destination to copy files (e.g., Desktop) and click OK.
Thanks heaps, shall give that a go.
ReplyDeleteI used PTP instead of MTP and didn't have to install or upgrade any software on my Linux-Mint 10.
ReplyDeletehttp://gurjeet-tech.blogspot.com/2012/02/how-to-use-mtp-on-googles-galaxy-nexus.html