The Media Transfer Protocol (MTP) is an extension to the Picture Transfer Protocol (PTP) communications protocol that allows media files to be transferred automatically to and from portable devices. Whereas PTP was designed for downloading photographs from digital cameras, Media Transfer Protocol allows the transfer of music files on digital audio players and media files on portable media players, as well as personal information on personal digital assistants. In 2011, MTP became the standard method to transfer files to and from Android. The USB Implementers Forum device working group standardized MTP as a full-fledged Universal Serial Bus (USB) device class in May 2008. Since then, MTP is an official extension to PTP and shares the same class code.
Overview MTP is a high level file transfer protocol, as opposed to a general storage protocol like USB mass storage. That means that the MTP client (computer) does not see an array of byte blocks that makes up a data structure that makes up a file system, but instead speaks in terms of files and folders to the MTP device. This lets the MTP device take part in the high level operations (such as updating its metadata indexes) while keeping the integrity of its file system in its own hands. In particular, dropped transfers (such as by unplugging the USB cable too soon) do not corrupt the device file system. The non-generality of MTP has consequences for how a computer operating system can present the MTP device, both to other programs and to the user. According to its specification, the main purpose of MTP is to facilitate communication between media devices with transient connection, a secondary purpose being to enable command and control of the connected device. A battery-powered mobile device can report its battery charge level through MTP. The protocol was originally implemented for use across USB but extended for use across TCP/IP and Bluetooth. The host connecting to an MTP device is called an MTP Initiator, whereas the device itself is an MTP Responder. MTP allows MTP Initiators to identify the specific capabilities of device(s) with respect to file formats and functionality. In particular, MTP Initiators may have to provide passwords and other information to unlock files, or otherwise enable digital rights management. Nothing specific of this nature is in the core standard, but the features are available via vendor extensions. MTPZ, the Zune Extension to MTP, specifically denies access to files until authentication has been processed, which is only possible using Windows Media Player 10 or higher.
Comparison with USB Mass Storage
File oriented instead of block oriented protocol Mislocation: Users have reported files occasionally showing up in incorrect locations as a result of poor communication between the MTP host (e.g. smartphone) and client (e.g. computer file manager). Should a directory be moved away from the MTP host without the client detecting all files, undetected files could end up deleted without all files having been transferred successfully.
Performance Limited support for direct modification of files (see § Direct modification and partial transfer features). To modify a file or its metadata, the whole file may need to be copied out of the device and then re-uploaded, which takes a long time for a large file or directory, and blocks the device for other operations in the meantime. Google's MTP implementation in Android includes extensions to deal with this limitation; however, these extensions must be supported by the host operating system.
Transparency to MTP-unaware software
Drivers know a fixed set of supported devices Despite identifiability by the PTP/MTP USB device class, libmtp documentation indicates that the vendor and product ID combination plays a functional role in identifying an MTP device. Libmtp includes vast listings of vendor and product ID numbers of devices that it supports, along with workarounds for bugs.
The spec knows a fixed set of defined file formats The MTP specification includes an enumeration of file formats, called object format. The use of this enumeration is in communicating supported file formats, and formats of transferred files. Apart from some uncategorized formats in the beginning, the list of formats is grouped in categories of image, audio, video, and document formats, with each category having one "Undefined" format followed by specific formats. There is also a super-generic "Undefined object" format. Jolla cited lack of WebM support in MTP as one reason not to support the video format in their mobile operating system Sailfish OS. It is unclear if the limitation is in the tools or the spec, other than that WebM is not defined by the MTP 1.1 spec.
Direct modification and partial transfer features These features can be used as more efficient alternatives to whole-file transfers and re-uploads: From the MTP 1.1 spec:
Android extensions According to go-mtpfs:
MTP support
Windows
Adoption By 2004, companies that manufacture devices based on Microsoft's "Portable Media Center specification", including Creative Technology, Intel, iRiver, and Samsung Electronics, had widely adopted MTP, debuting their devices in the 2004 Consumer Electronics Show. After an initial period of uncertain reactions, several large media player producers such as Creative Technology and iRiver adopted the MTP protocol in place of their own protocols. Windows Vista and later have built-in MTP support over USB and Internet Protocol (IP). Support for MTP over USB (but not IP) could be added to Windows XP through installing Windows Media Player 10 or a later. For the older Windows 2000, Windows 98, and Windows Me, Microsoft released a "Media Transfer Protocol Porting Kit". which contains an MTP over USB device driver. The Platform Update for Windows Vista adds support for MTP over Bluetooth, which is present in Windows 7 and later. Microsoft plans to deprecate MTP over Bluetooth in 2027 update for Windows 11, in favor other Bluetooth file transfer methods, such as OBEX Object Push Profile. Windows 7's sensor platform supports sensors built into MTP-compatible devices.
… excerpt ends here. Continue reading the full article.