MTP

From ParabolaWiki
Jump to: navigation, search

MTP is the "Media Transfer Protocol" and is used by many MP3 players such as the Creative Zen and some Walkmans. In addition, Android phones and tablets use it since version 3.0. It is part of the "Windows Media" Framework and has close relationship with Windows Media Player.

1 Installation

MTP support is provided by the libmtp package, to install:

# pacman -Su --noconfirm libmtp

2 Usage

After installation, you have several mtp tools available. Upon connecting your MTP device, you use:

$ mtp-detect

to see if your MTP device is detected.

To connect to your MTP device, you use:

# mtp-connect

If connection is successful, you will be given several switch options in conjunction with mtp-connect to access data on the device.


There are also several stand alone commands you can use to access your MTP device such as,

Note: Some commands maybe harmful to your MTP device!!!
 mtp-albumart        mtp-emptyfolders    mtp-getplaylist     mtp-reset           mtp-trexist
 mtp-albums          mtp-files           mtp-hotplug         mtp-sendfile
 mtp-connect         mtp-folders         mtp-newfolder       mtp-sendtr
 mtp-delfile         mtp-format          mtp-newplaylist     mtp-thumb
 mtp-detect          mtp-getfile         mtp-playlists       mtp-tracks

3 Using media players

You can also use your mtp device in music players such as VLC. To do this you may have to edit /etc/udev/rules.d/51-android.rules (The MTP device used in the following example is a Galaxy Nexus): To do this run and look for your device, it will be something like,

$ lsusb
Bus 003 Device 011: ID 04e8:6860 Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II], GT-P7500 [Galaxy Tab 10.1]

in which case the entry would be,

SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0755"

Then, reload udev rules,

# udevadm control -R
Note: After installing MTP you may have to reboot for your device to be recognised

4 mtpfs

Mtpfs is FUSE filesystem that supports reading and writing from any MTP device. Basically it allows you to mount your device as an external drive.
It's available in the community repository.

  • To mount your device
   # mtpfs -o allow_other /media/YOURMOUNTPOINT
  • To unmount your device
   # umount /media/YOURMOUNTPOINT

Also, you can put them into your ~/.bashrc:

   alias android-connect="mtpfs -o allow_other /media/YOURMOUNTPOINT"
   alias android-disconnect="umount /media/YOURMOUNTPOINT"