MTP

From Gentoo Wiki
Jump to: navigation, search
External resources

MTP (Media Transfer Protocol) is a protocol to allow the transfer of files to external devices.

Contents

MTPfs

Installation

Install sys-fs/mtpfs:

→ Information about USE flags
USE flag Default Recommended Description
debug No Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see http://www.gentoo.org/proj/en/qa/backtraces.xml
mad No Enable handling of MP3's metadata
root # emerge --ask mtpfs

Configuration

Your user needs to be in the "plugdev" group:

root # gpasswd -a YOUR_USER plugdev

Modify your /etc/fuse.conf:

File/etc/fuse.conf

user_allow_other

Usage

user $ mkdir ~/AndroidDevice
user $
mtpfs -o allow_other ~/AndroidDevice
Note
This can take really long time, up to several minutes. As an indication of successful mount the mtpfs will go to background.
  • Unmount:
user $ fusermount -u ~/AndroidDevice

Go-mtpfs

Note
Newer Galaxy Devices (S3, Note2 and similar) use an own MTP-stack and don't work reliable, although this should be fixed in newer versions. See Bug#29

Installation

Install dev-lang/go:

→ Information about USE flags
USE flag Default Recommended Description
bash-completion No Enable bash-completion support
emacs No Adds support for GNU Emacs
vim-syntax No Pulls in related vim syntax scripts
zsh-completion No Enable zsh completion support
root # emerge --ask go

Then install Go-mtpfs:

user $ mkdir ~/go
user $
export GOPATH=/home/$USER/go
user $
go get github.com/hanwen/go-mtpfs

Configuration

Your user needs to be in the "plugdev" group:

root # gpasswd -a YOUR_USER plugdev

Usage

user $ mkdir ~/AndroidDevice
user $
~/go/bin/go-mtpfs ~/AndroidDevice
  • unmount:
user $ fusermount -u ~/AndroidDevice

KDE

kio-mtp is a slave for KDE's KIO framework.

As kio-mtp is still unstable, it is only part of kde overlay, which you need to setup first. Then:

root # echo kde-misc/kio-mtp >> /etc/portage/package.accept_keywords
root # emerge --ask kio-mtp

Finally quit KDE, and relaunch it. Now your MTP devices appear e.g. in Dolphin.

Troubleshooting

  • If your device is not recognized by libmtp, try upgrading to latest (or even live) version.
  • Sometimes (e.g. on HTC One X) USB debugging automatically turns on when device is connected to PC. You need to turn debugging off, otherwise libmtp can't recognize device.
  • Make sure your Android device is not going to sleep and the screen is not getting locked. Set screen timeout to very long values, or enable in Development section flag "Do not turn off the screen".
Personal tools
Namespaces

Variants
Actions
Gentoo Websites logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Navigation
Toolbox
Categories