Friday, August 9, 2013

Android 'mount as mtp media' libmtp

So you have an Android tablet and want to connect it to your Linux desktop:

apt-get install gmtp libmtp-runtime

Now you should be able to start Gmtp and see a screen like the following:

Now in order to get the file listing you have to 'Connect', so use the icon / menus to do that.

But my mtp device cannot connect?

 Here are a list of possible issues and a suggestion for each
  1. Your device is not connected - check the cable
  2. Your Android usb setting is set to PTP rather than MTP
    ( Settings -> Storage -> Connect as -> MTP )
  3. Your Android device is not recognised (unlikely but possible)
    See (4) below. Usually this is for low volume devices / devices that are newly launched.
    Request it be added at this link
  4. Your version of libmtp is not recent enough.
    If running Debian 6 then upgrade to Debian 7 (wheezy)
    If you are running Ubuntu 12.04 then find a backport / ppa
    OR for the adventurous compile libmtp yourself.
And lastly (5) "You have libmtp installed but not libmtp-runtime"

libmtp-runtime is essential, but is only listed as a 'Recommends' when installing Gmtp

Solution: apt-get install libmtp-runtime

How would I know that libmtp-runtime is missing?

Your package manager can tell you certainly, but one symptom is an entry in the system log that says:
failed to execute '/lib/udev/mtp-probe'

For those interested in dependency details, a screenshot next (see last line in screenshot)

Screenshot shows that libmtp-runtime is only a 'Recommends' of libmtp

Notes and Further Reading:

If you use Ubuntu then you should prefix the apt-get commands shown above with 'sudo'

Which are the best tablets/phones for vanilla mtp support?

The bigger the company, the more tempted the internal engineers are to tinker and extend the mtp protocol.

You probably already bought your device, so this may be a moot point, but given the choice and with Linux connectivity a priority ...

Avoid Samsung and Sony and go for an alternative midrange  / generic option.

If Linux connectivity is not a priority or you intend to install and use the connectivity software supplied with the device, then this is a non-issue.

No comments: