This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

MTP

From Gentoo Wiki (test)
Jump to:navigation Jump to:search
This page contains changes which are not marked for translation.
Resources


MTP (Media Transfer Protocol) is a protocol to allow the transfer of files to external devices. It is provided by several programs, most of them depending on FUSE.

Installation

Kernel

Prepare for MTP implementations by activating CONFIG_FUSE_FS in the Linux kernel.

KERNEL Enable FUSE for MTP implementations:
File systems  ---> 
   <*> FUSE (Filesystem in Userspace) support

Available software

Here are some MTP packages available in Gentoo:

Name Package Homepage Description
MTPfs sys-fs/mtpfs https://www.adebenham.com/mtpfs/ A FUSE-based filesystem providing access to MTP devices. More mature than some of the alternatives.
Go-mtpfs sys-fs/go-mtpfs https://github.com/hanwen/go-mtpfs A simple FUSE-based filesystem written in Go language.
jmtpfs sys-fs/jmtpfs https://github.com/JasonFerrara/jmtpfs A FUSE and media-libs/libmtp based filesystem for accessing MTP devices.
gphotofs media-gfx/gphotofs http://www.something.com gphotofs is a FUSE-based file system for interfacing with digital cameras using the gphoto2 application.
simple-mtpfs sys-fs/simple-mtpfs https://github.com/phatina/simple-mtpfs Like the others: a simple MTP FUSE filesystem driver written in C++.
Gnome gnome-base/gvfs https://wiki.gnome.org/Projects/gvfs Install gnome-base/gvfs with the mtp USE flag enabled. This can be either globally in make.conf's USE flag or for gnome-base/gvfs in package.use.
Thunar xfce-extra/thunar-volman https://goodies.xfce.org/projects/thunar-plugins/thunar-volman To have Thunar automount MTP devices (and other volumes), install the xfce-extra/thunar-volman package and make sure gnome-base/gvfs is also installed with the mtp USE flag enabled as above.
Android File Transfer for Linux sys-fs/android-file-transfer-linux/ https://whoozle.github.io/android-file-transfer-linux/ Robust MTP implementation with unlimited file size support, partial 64-bit edits, album cover, USB zero copy, with Qt, CLI and Fuse interfaces available.

KDE Plasma 5

kio-extras contains MTP support, but it requires the mtp USE flag.

Enable the global mtp use flag:

FILE /etc/portage/make.conf
USE="$USE mtp"

Alternatively, enable it in kio-extras:

FILE /etc/portage/package.use
kde-apps/kio-extras mtp

Then emerge:

root #emerge --ask kde-apps/kio-extras

After this, quitting plasmashell and restarting is probably sufficient to get it working.

If that does not work, please try restarting the system.

gMTP

gMTP is a simple MTP client for Solaris and Linux.

It is sufficient to just install and run media-sound/gmtp:

root #emerge --ask media-sound/gmtp
user $gmtp

Click on connect. A few second later, the file hierarchy on the device should appear. It is now possible to manipulate the files on the device. It support features like Album Artwork and playlists.

Troubleshooting

  • Make sure the Android device is not going to sleep and the screen is not getting locked. Set screen timeout to very long values, or enable the "Do not turn off the screen" flag in the device's Settings - Development section.
  • Some ROMs (e.g. PAC ROM) require the unlocking of the screen of the device before files will appear. If the screen is not unlocked the device will appear empty.
  • Sometimes (specifically on HTC One X) USB debugging automatically activates when device is connected to a PC. USB debugging must be disabled. Otherwise media-libs/libmtp can't recognize the device.
  • If the device is not recognized by media-libs/libmtp, try upgrading to latest (or even live) version.
  • Lumia devices might require media-libs/libmtp version 1.1.9 and sys-fs/simple-mtpfs to be mounted properly.
    • Lumia devices must be unlocked to be able to connect (enter the user's PIN).

See also

  • MTPfs — a FUSE-based filesystem providing access to MTP devices.