HOME

TheInfoList



OR:

The Media Transfer Protocol (MTP) is an extension to the Picture Transfer Protocol (PTP)
communications protocol A communication protocol is a system of rules that allows two or more entities of a communications system to transmit information via any kind of variation of a physical quantity. The protocol defines the rules, syntax, semantics and synchron ...
that allows media files to be transferred automatically to and from portable devices. Whereas PTP was designed for downloading photographs from
digital camera A digital camera is a camera that captures photographs in digital memory. Most cameras produced today are digital, largely replacing those that capture images on photographic film. Digital cameras are now widely incorporated into mobile devices ...
s, Media Transfer Protocol allows the transfer of music files on digital audio players and media files on
portable media player A portable media player (PMP) (also including the related digital audio player (DAP)) is a portable consumer electronics device capable of storing and playing digital media such as audio, images, and video files. The data is typically stored o ...
s, as well as personal information on
personal digital assistant A personal digital assistant (PDA), also known as a handheld PC, is a variety mobile device which functions as a personal information manager. PDAs have been mostly displaced by the widespread adoption of highly capable smartphones, in partic ...
s. MTP is a key part of
WMDRM Windows Media DRM or WMDRM, is a Digital Rights Management service for the Windows Media platform. It is designed to provide delivery of audio or video content over an IP network to a PC or other playback device in such a way that the distributor c ...
10-PD, a
digital rights management Digital rights management (DRM) is the management of legal access to digital content. Various tools or technological protection measures (TPM) such as access control technologies can restrict the use of proprietary hardware and copyrighted works ...
(DRM) service for the Windows Media platform. In 2011, it became the standard method to transfer files to and from Android. MTP is part of the "Windows Media" framework and thus closely related to Windows Media Player. Versions of the Microsoft Windows operating system from
Windows XP Windows XP is a major release of Microsoft's Windows NT operating system. It was released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct upgrade to its predecessors, Windows 2000 for high-end and ...
SP2 support MTP. Windows XP requires Windows Media Player 10 or higher; later Windows versions have built-in support. Microsoft has made an MTP Porting Kit available for older versions of Windows back to
Windows 98 Windows 98 is a consumer-oriented operating system developed by Microsoft as part of its Windows 9x family of Microsoft Windows operating systems. The second operating system in the 9x line, it is the successor to Windows 95, and was released t ...
. 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

The main purpose of this protocol is to allow only the transfer of media files and associated metadata to and from portable devices, one transfer function, in or out, at a time. It does not support operations such as open, edit and modify. A
workaround A workaround is a bypass of a recognized problem or limitation in a system or policy. A workaround is typically a temporary fix that implies that a genuine solution to the problem is needed. But workarounds are frequently as creative as true solut ...
is to copy to the hosting system for these operations and then copy back. 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 The Internet protocol suite, commonly known as TCP/IP, is a framework for organizing the set of communication protocols used in the Internet and similar computer networks according to functional criteria. The foundational protocols in the suit ...
and
Bluetooth Bluetooth is a short-range wireless technology standard that is used for exchanging data between fixed and mobile devices over short distances and building personal area networks (PANs). In the most widely used mode, transmission power is limit ...
. Windows Vista supports MTP over TCP/IP.
Windows 7 Windows 7 is a major release of the Windows NT operating system developed by Microsoft. It was Software release life cycle#Release to manufacturing (RTM), released to manufacturing on July 22, 2009, and became generally available on October 22, ...
and Windows Vista with the Platform Update for Windows Vista also support MTP over Bluetooth. The host connecting to an MTP device is called an ''MTP Initiator'' whereas the device itself is an ''MTP Responder''. A main reason for using MTP rather than, for example, the USB mass-storage device class (MSC) is that the latter operates at the level of mass storage device blocks, rather than at the level of files, or blocks within files, in a file system. In other words, the USB mass storage class is designed to give a host computer undifferentiated access to bulk mass storage, such as
compact flash CompactFlash (CF) is a flash memory mass storage device used mainly in portable electronic devices. The format was specified and the devices were first manufactured by SanDisk in 1994. CompactFlash became one of the most successful of the ...
, rather than to a file system, which might be safely shared with the target device (except for specific files which the host might be modifying/accessing). In practice, therefore, when a USB host computer has ''mounted'' an MSC partition, it assumes absolute control of the storage, which then may not be safely modified by the device without risk of data corruption until the host computer has severed the connection. Furthermore, because the host computer has full control over the connected storage device, there is a risk that the host computer may corrupt the file system, reformat it to a file system not supported by the USB device, or otherwise modify it in such a way that the USB device cannot completely understand it. MTP and PTP specifically overcome this issue by making the unit of managed storage a local file rather than an entire (possibly very large) unit of mass storage at the block level. In this way, MTP works like a transactional file system - either the entire file is written/read or nothing. The storage media is not affected by failed transfers. Where the device maintains a database/index of the content of the disk, MTP saves the cost of re-scanning the entire disk every time the content is modified. Additionally, the 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 Digital rights management (DRM) is the management of legal access to digital content. Various tools or technological protection measures (TPM) such as access control technologies can restrict the use of proprietary hardware and copyrighted works ...
. 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

MTP's advantages are marked with "(+)" while disadvantages are marked with "(-)".


File oriented instead of block oriented protocol

By not exposing the
filesystem In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one larg ...
and metadata index, the integrity of these is in full control of the device. *(+) No risk of file system corruption if unplugging the device while writing. File transfers are atomic, meaning completed in a single operation, and no explicit file system unmounting ("safe removal") is required by the user, since the file system remains managed by the mobile device's operating system, and a mobile device is battery-powered, meaning power to the flash memory is not cut out unexpectedly. *The device can access its own file system while connected: **(+) Re-indexing after unplugging can be avoided. Also helped by the inclusion of metadata with the transfer. **(+) A separate file system for host exposure is unnecessary. This avoids the inflexibility of setting aside a fixed-size partition for this file system. *(+) File system support: The host does not need to support the file system of the device. Conversely, the device manufacturer is free to choose a file system (usually a Linux filesystem unsupported by Windows) other than the widely supported
FAT In nutrition, biology, and chemistry, fat usually means any ester of fatty acids, or a mixture of such compounds, most commonly those that occur in living beings or in food. The term often refers specifically to triglycerides (triple est ...
family of filesystems. *(-) Undeletion: Filesystem recovery and
undeletion Undeletion is a feature for restoring computer files which have been removed from a file system by file deletion. Deleted data can be recovered on many file systems, but not all file systems provide an undeletion feature. Recovering data witho ...
tools on the computer cannot be used, since MTP is an
abstraction layer In computing, an abstraction layer or abstraction level is a way of hiding the working details of a subsystem. Examples of software models that use layers of abstraction include the OSI model for network protocols, OpenGL, and other graphics librar ...
that offers no block-level access. *(-) Missing time stamps: Many MTP-attached devices, particularly older ones, do not report file timestamps via the protocol, causing them to be lost when files are copied/moved to or from a computer. Some file formats still store timestamps internally, such as JPEG photos with embedded Exif meta data, but the date and time information of files without such internal metadata would be lost. *(-) 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. *(-) Truncation: If a file has newly been created on the smartphone while it was connected to the computer through MTP, the computer's file manager could potentially misreport the file size as too small due to having loaded the directory listing in a moment where the file was not complete. Moving the file away from the phone could cause it to be truncated (incomplete) on the target path while being deleted from the source, since the file manager might wrongfully assume that the file has been fully transferred while it hasn't.


Performance

*(-) MTP operations are not multiplexable – any ongoing operation must either complete or be aborted before another operation can begin. Unlike USB mass storage, where the host operating system is free to multiplex block transfers, and logical operations are an emergent phenomenon, the operations supported by MTP are more coarse-grained, such as transferring entire files. Neither protocol is parallel or asynchronous by itself (aside from the UAS extension of USB mass storage, which adds multiple command queues). *(-) Limited support for transferring parts of files, such as blocks or byte ranges (see ). *(-) Limited support for direct modification of files (see ). To modify a file or its metadata, the whole file may need to be copied out of the device and reuploaded, 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. *(-) Loading long file listings of directories with thousands of items is slow. This could cause "preparing" for transferring files from highly populated directories to take longer than the file transfer itself, since the file manager needs to generate a list of paths to files it is about to transfer, which requires accessing the slow directory listings.


Transparency to MTP-unaware software

(-) Windows does not assign drive letters or
UNC UNC is a three-letter abbreviation that may refer to: Education * University of Northern California (disambiguation), which may refer to: ** University of Northern California (Santa Rosa), in Petaluma, California, United States ** University of No ...
paths to MTP devices because it does not natively expose them as
virtual file system A virtual file system (VFS) or virtual filesystem switch is an abstract layer on top of a more concrete file system. The purpose of a VFS is to allow client applications to access different types of concrete file systems in a uniform way. A VFS ...
s. Without drive letters or UNC paths, MTP-unaware software cannot access directories or files on these devices. The user has to switch to an MTP-aware application, or else work around by using an MTP-aware application such as Windows Explorer to copy or move the file to a file system that the application can access. One specific concern is that
antivirus software Antivirus software (abbreviated to AV software), also known as anti-malware, is a computer program used to prevent, detect, and remove malware. Antivirus software was originally developed to detect and remove computer viruses, hence the nam ...
on the host computer may not be aware of MTP devices, making them potentially less secure than mass storage devices (although if files on MTP devices are copied or moved to the host before use, MTP-unaware antivirus software will have a chance to scan them). Antivirus scanning might also be impractical due to blocking regular use of the device.


Drivers know a fixed set of supported devices

(-) Despite identifiability by the PTP/MTP
USB device class Universal Serial Bus (USB) is an technical standard, industry standard that establishes specifications for cables, connectors and communication protocol, protocols for connection, communication and power supply (Interface (computing), interfa ...
, libmtp documentation indicates that the vendor and product ID combination plays a functional role in identifying an MTP device, also by Windows drivers. Libmtp includes vast listings of vendor and product ID numbers of devices that it supports, along with workarounds for bugs. This non-generic methodology hinders MTP drivers' forward compatibility with new devices.


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 Sailfish OS is a Linux-based operating system based on free software, and open source projects such as Mer as well as including a closed source UI. The project is being developed by the Finnish company Jolla. The OS first shipped with the ...
. 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


Adaption in Windows

MTP is supported in
Windows XP Windows XP is a major release of Microsoft's Windows NT operating system. It was released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct upgrade to its predecessors, Windows 2000 for high-end and ...
if Windows Media Player 10 or later versions are installed. Windows Vista and later have MTP support built in. For older versions of Windows, specifically, Windows 2000, Windows 98 and Windows Me, Microsoft has released the MTP Porting Kit. which contains a MTP device driver. Some manufacturers, such as
Creative Technology Creative Technology Ltd. is a Singaporean multinational technology company headquartered with overseas offices in Shanghai, Tokyo, Dublin, and Silicon Valley (where in the US it is known as Creative Labs). The principal activities of the comp ...
, also provide legacy MTP drivers for some of their players; these usually consist of MTP Porting Kit files with a customized INF file describing their specific players.


Support by software

Windows does not assign drive letters or
UNC UNC is a three-letter abbreviation that may refer to: Education * University of Northern California (disambiguation), which may refer to: ** University of Northern California (Santa Rosa), in Petaluma, California, United States ** University of No ...
pathnames to devices connected via MTP; instead, they only appear as named devices in MTP-aware applications such as
Windows Explorer File Explorer, previously known as Windows Explorer, is a file manager application that is included with releases of the Microsoft Windows operating system from Windows 95 onwards. It provides a graphical user interface for accessing the file ...
. Compared to devices that implement USB mass storage, such devices cannot be accessed programmatically by scripts or normal Windows programs that depend on drive letters or UNC paths. Instead, files must be manipulated using Windows Explorer or applications with specially written MTP support. Under Windows, MTP-compatible devices support a feature called Auto Sync, which lets users configure Windows Media Player to automatically transfer all copied or newly acquired content to devices whenever they are connected - provided that content is compatible with Windows Media player. Auto Sync is customizable so that the player will transfer only content that meets certain criteria (songs rated four stars or higher, for instance). Changes made to file properties (such as a user rating and file playback counts) on a device can be propagated back to the computer when the device is reconnected. Copies of files accessed over MTP may remain on the host computer even after reboot, where they will be accessible to the user account which accessed them, as well as any other user accounts able to read that user account's files, including any administrative users. Windows 7's sensor platform supports sensors built into MTP-compatible devices.


File move behaviour

In the implementation of MTP used by Windows Explorer, files from a selection moved out of a mobile device's storage, perhaps with the goal of freeing up space, are not deleted individually from the source after each file, but instead the entire selection becomes deleted at once from the source only after the transfer has finished. As a result, file moves aborted untimely, whether manually or unexpectedly, will not have freed up any space on the source device.


Unix-like systems

A free and open-source implementation of the Media Transfer Protocol is available as libmtp. This library incorporates product and device IDs from many sources, and is commonly used in other software for MTP support.


Graphical

GNOME applications like GNOME Files (formerly called Nautilus) and Archive Manager (formerly called File-Roller) use
GIO Gio or GIO may refer to: People * Gio (nickname) * Gio (footballer, born 1984), Spanish * Gio (singer) (born 1990) * Gio people, an ethnic group in northeastern Liberia and Côte d'Ivoire Science and technology * Gi/o, protein subunits * GI ...
-based GVfs to access files on MTP devices. Proper MTP support was added to GVfs in version 1.15.2 (2013-01-15) by Philip Langdale. Early patches for GVfs to enable Google's direct I/O extensions are available. The KDE Project develops the MTP
KIO KIO (KDE Input/Output) is a system library incorporated into KDE Frameworks 5 and KDE Software Compilation 4. It provides access to files, web sites and other resources through a single consistent API. Applications, such as Konqueror and Do ...
Slave with a similar level of integration as GVfs. Not related to GNOME or KDE is the *NIX graphical MTP-capable media player
gMTP


Virtual file system

Several tools provide a
FUSE Fuse or FUSE may refer to: Devices * Fuse (electrical), a device used in electrical systems to protect against excessive current ** Fuse (automotive), a class of fuses for vehicles * Fuse (hydraulic), a device used in hydraulic systems to protect ...
based file system for mounting MTP devices within the Unix filesystem hierarchy, making it accessible to any program that operates on files and directories. Examples includ
mtpfsjMTPFSgo-mtpfs
an
simple-mtpfs


macOS

macOS has built-in support for MTP (through the application "Digital Images") but no (third-party) drivers to mount MTP devices as drives. Also several third-party file transfer applications are available for Mac OS X v10.5 and later: *Android File Transfer is a simple MTP client. *Android File Transfer For Linux (and Mac OS X!), Open Source, License GPL Version 3, Graphical UI, Command line tool, FUSE wrapper - mounting your device, *XNJB also offers syncing of iTunes playlists. *SyncMate Expert claims to also support MTP besides other synchronization tasks. The support can't be tested in the free version. *Commander One PRO Pack - file manager that allows mounting MTP devices to Mac and managing their content.


Other operating systems

Later versions of several operating systems, including
AmigaOS AmigaOS is a family of proprietary native operating systems of the Amiga and AmigaOne personal computers. It was developed first by Commodore International and introduced with the launch of the first Amiga, the Amiga 1000, in 1985. Early version ...
, Android, AROS, MorphOS, and Symbian OS support MTP, sometimes with additional drivers or software. A disadvantage of MTP devices on Android as compared to USB mass storage is that although file timestamps are preserved when copying files from the Android device to one's computer, when copying in the other direction, the file modification timestamps are replaced with the time the copy was done.


Other manufacturers

Companies, including Creative Technology, Intel, iriver, and
Samsung Electronics Samsung Electronics Co., Ltd. (, sometimes shortened to SEC and stylized as SΛMSUNG) is a South Korean multinational electronics corporation headquartered in Yeongtong-gu, Suwon, South Korea. It is the pinnacle of the Samsung chaebol, a ...
, that manufacture devices based on Microsoft's " Portable Media Center specification", have widely adopted MTP. Supporting devices were introduced at the 2004
Consumer Electronics Show CES (; formerly an initialism for Consumer Electronics Show) is an annual trade show organized by the Consumer Technology Association (CTA). Held in January at the Las Vegas Convention Center in Winchester, Nevada, United States, the event typi ...
. 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. Many devices and audio software applications support MTP.


Alternatives

* USB Mass Storage * Network-attached storage (NAS)


See also

* Windows Media *
IEEE 1394 IEEE 1394 is an interface standard for a serial bus for high-speed communications and isochronous real-time data transfer. It was developed in the late 1980s and early 1990s by Apple in cooperation with a number of companies, primarily Sony an ...
(firewire)


References


External links


MTP 1.1 specification
*{{webarchive , url=https://web.archive.org/web/20081120064214/http://www.windowsfordevices.com/news/NS2933236821.html , date=November 20, 2008 , title=Article on Canon's adoption
MTP What, Why, How. (Android feature)ArchLinux Wiki: Media Transfer Protocol
Microsoft application programming interfaces Microsoft Windows multimedia technology USB