MTP
From Gentoo Wiki
| 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:
| 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 mtpfsConfiguration
Your user needs to be in the "plugdev" group:
root # gpasswd -a YOUR_USER plugdevModify your /etc/fuse.conf:
File/etc/fuse.conf
user_allow_other
Usage
-
user $mkdir ~/AndroidDevice
user $mtpfs -o allow_other ~/AndroidDevice - NoteThis 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:
| 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 goThen install Go-mtpfs:
user $ mkdir ~/go
user $ export GOPATH=/home/$USER/go
user $ go get github.com/hanwen/go-mtpfsConfiguration
Your user needs to be in the "plugdev" group:
root # gpasswd -a YOUR_USER plugdevUsage
-
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_keywordsroot # emerge --ask kio-mtpFinally 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".