Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Media Transfer Protocol

From Wikipedia, the free encyclopedia
Data transfer protocol designed for mobile devices

TheMedia Transfer Protocol (MTP) is an extension to thePicture Transfer Protocol (PTP)communications protocol that allows media files to be transferred automatically to and fromportable devices.[1] Whereas PTP was designed for downloading photographs fromdigital cameras, Media Transfer Protocol allows the transfer of music files ondigital audio players and media files onportable media players, as well as personal information onpersonal digital assistants. In 2011, MTP became the standard method to transfer files to and from Android.[2]

TheUSB Implementers Forum device working group standardized MTP as a full-fledgedUniversal Serial Bus (USB) device class in May 2008.[3] Since then, MTP is an official extension to PTP and shares the same class code.[4]

Overview

[edit]

MTP is a high levelfile transfer protocol, as opposed to a general storage protocol likeUSB mass storage. That means that the MTP client (computer) does not see an array ofbyte blocks that makes up adata structure that makes up afile 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.[5] The non-generality of MTP has consequences for how a computeroperating 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,[4] a secondary purpose being to enable command and control of the connected device.[4] A battery-powered mobile device can report its battery charge level through MTP.[5]

The protocol was originally implemented for use across USB but extended for use acrossTCP/IP andBluetooth.Windows Vista supports MTP over TCP/IP.Windows 7 and Windows Vista with the Platform Update for Windows Vista also support MTP over Bluetooth.[6] The host connecting to an MTP device is called anMTP Initiator, whereas the device itself is anMTP Responder.[7]

MTP allowsMTP 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 enabledigital 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

[edit]
See also:USB mass storage device class

File oriented instead of block oriented protocol

[edit]

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.[8][9]

Performance

[edit]

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 inAndroid includes extensions to deal with this limitation; however, these extensions must be supported by the host operating system.[10][11]

Transparency to MTP-unaware software

[edit]
[icon]
This section is empty. You can help byadding to it.(August 2025)

Drivers know a fixed set of supported devices

[edit]

Despite identifiability by the PTP/MTPUSB 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.[12][13]

The spec knows a fixed set of defined file formats

[edit]

The MTP specification includes anenumeration of file formats, calledobject format.[4] 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 ofWebM support in MTP as one reason not to support the video format in their mobile operating systemSailfish 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.[14][unreliable source?][15]

Direct modification and partial transfer features

[edit]

These features can be used as more efficient alternatives to whole-file transfers and re-uploads:

From the MTP 1.1 spec:[4]

OpcodeOperation NameExplanation
0x9805GetObjectPropListMetadata transfer
0x9806SetObjectPropList
0x1019MoveObjectRename a file or directory
0x101BGetPartialObjectRequest a byte range of a file

Android extensions

[edit]

According to go-mtpfs:[11]

OpcodeOperation NameExplanation
0x95C1GetPartialObject64Same asGetPartialObject, but with 64 bit offset
0x95C2SendPartialObjectSame asGetPartialObject64, but copying host to device
0x95C3TruncateObjectTruncates file to 64 bit length
0x95C4BeginEditObjectMust be called before usingSendPartialObject andTruncateObject
0x95C5EndEditObjectCalled to commit changes made bySendPartialObject andTruncateObject

MTP support

[edit]

Windows

[edit]

Adoption in Windows

[edit]

Windows Vista and later have MTP support built in.Windows XP supports MTP ifWindows Media Player 10 or a later version is installed. For the older Windows 2000, Windows 98, and Windows Me, Microsoft released a "Media Transfer Protocol Porting Kit".[16] which contains a MTP device driver. Some manufacturers, such asCreative Technology, 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.[citation needed] Windows 7's sensor platform supports sensors built into MTP-compatible devices.[17]

Support by software

[edit]

Windows does not assigndrive letters orUNC pathnames to devices connected via MTP; instead, they only appear as named devices in MTP-aware applications such asWindows Explorer. 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.

File move behavior

[edit]

In the implementation of MTP used by Windows Explorer, files from a selectionmoved 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. (Also, attempting to copy or move files from one Android folder to another on the same device, using Windows File Explorer, does not work. Copying does not create copies, and moving only deletes the source files without creating the destination files.)[18][19]

Unix-like systems

[edit]

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

Graphical

[edit]

GNOME applications likeGNOME Files (formerly called Nautilus) andArchive Manager (formerly called File-Roller) useGIO-basedGVfs to access files on MTP devices.

The KDE Project develops the MTPKIO 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

[edit]

Several tools provide aFUSE based file system for mounting MTP devices within the Unix filesystem hierarchy, making it accessible to any program that operates on files and directories.

macOS

[edit]

macOS has built-in support for PTP (through "Image Capture"[21]) but no support for MTP. Several third-party applications that support MTP are available:

  • Android File Transfer is a simple MTP client created by Google.[22] It is no longer actively maintained or supported.[23][24]
  • Android File Transfer For Linux (and macOS)[25]
  • OpenMTP[26]
  • MacDroid[27]
  • SyncMate Expert[28]
  • Commander One[29]

Other operating systems

[edit]

Newer versions of several operating systems, includingAmigaOS,Android,AROS,MorphOS,Symbian OS, andHarmonyOS/OpenHarmony/Oniro support MTP, sometimes with additional drivers or software.

A disadvantage of MTP devices on Android as compared to USB mass storage is that although MTP preserves file timestamps when copying files from the Android device to one's computer, when copying in the other direction, it replaces the file modification timestamps with the time that the copy was done.[30][31]

Other manufacturers

[edit]

Companies, including Creative Technology,Intel,iRiver, andSamsung Electronics, that manufacture devices based on Microsoft's "Portable Media Center specification", have widely adopted MTP. Supporting devices were introduced at the 2004Consumer 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.

Alternatives

[edit]

See also

[edit]

References

[edit]
  1. ^"Media Transfer Protocol Implementation Details". MTP defined in slide 3. Archived from the original on December 14, 2005.
  2. ^"Ice Cream Sandwich supports USB mass storage after all, Galaxy Nexus does not". Engadget. November 25, 2011.Archived from the original on February 5, 2020. RetrievedJanuary 5, 2020.
  3. ^"MTP, Portable Player Standard? Microsoft's McLauchlan Sets Us Straight". July 31, 2006.Archived from the original on August 4, 2016. RetrievedJune 1, 2016.
  4. ^abcde"Media Transfer Protocol v.1.1 Spec and MTP v.1.1 Adopters Agreement". April 6, 2011.Archived from the original on September 29, 2018. RetrievedSeptember 29, 2018.
  5. ^ab"Fear and Loathing in the Media Transfer Protocol"(PDF).eLinux. PTP/MTP basics.Archived(PDF) from the original on February 7, 2021. RetrievedFebruary 7, 2021.
  6. ^"MTP Over Various Transports". August 29, 2009.Archived from the original on May 1, 2019. RetrievedDecember 4, 2025.
  7. ^"MTP Specification".Archived from the original on June 4, 2011.
  8. ^"Google Issue Tracker".issuetracker.google.com. RetrievedApril 2, 2022.
  9. ^"usb - Why does MTP show wrong directory location?".Android Enthusiasts Stack Exchange. RetrievedApril 2, 2022.
  10. ^"Normal file read/write support with the GVFS MTP backend!". February 18, 2013.Archived from the original on April 14, 2016. RetrievedJune 1, 2016.
  11. ^ab"hanwen/go-mtpfs".GitHub.Archived from the original on October 7, 2018. RetrievedJune 1, 2016.
  12. ^ab"libmtp source code: music_players.h".Archived from the original on November 18, 2015. RetrievedNovember 26, 2015.
  13. ^"libmtp source code: ptp.h".Archived from the original on March 8, 2021. RetrievedJuly 9, 2017.
  14. ^"Webm (VP8, VP9, Opus) support for Sailfish - together.jolla.com".Archived from the original on March 4, 2016. RetrievedJune 1, 2016.
  15. ^"Unable to use MTP using USB cable".Sailfishos.org. April 13, 2021. RetrievedApril 13, 2021.
  16. ^"Media Transfer Protocol Porting Kit". Microsoft. Archived fromthe original on June 8, 2016. RetrievedJune 1, 2016.
  17. ^"Sensors and Windows".Windows Portable Devices Team Blog. December 17, 2009.Archived from the original on October 18, 2019. RetrievedDecember 4, 2025.
  18. ^guenni (August 30, 2017)."Windows 10 has an MTP problem with Android devices".Born's Tech and Windows World.Archived from the original on October 27, 2020. RetrievedOctober 27, 2020.
  19. ^Leonhard, Woody (August 31, 2017)."Don't use Windows 10 to move data on your Android phone".Computerworld.Archived from the original on October 27, 2020. RetrievedDecember 4, 2025.
  20. ^"libmtp". Libmtp.sourceforge.net.Archived from the original on March 2, 2014. RetrievedMarch 15, 2014.
  21. ^"Transfer Photos from Android to Mac OS X". Osxdaily.com. February 8, 2013. RetrievedFebruary 8, 2013.
  22. ^"Android File Transfer". Android.com.Archived from the original on March 29, 2021. RetrievedMarch 15, 2014.
  23. ^[1]
  24. ^[2]
  25. ^"Android File Transfer Linux Mac OS X". whoozle.Archived from the original on February 22, 2017. RetrievedDecember 2, 2016.
  26. ^"OpenMTP".GitHub.
  27. ^"How to Set MTP Mode on Android | MacDroid". April 12, 2024.
  28. ^"SyncMate". ELTIMA software.Archived from the original on June 19, 2014. RetrievedJune 15, 2014.
  29. ^"Commander One PRO Pack". IvanK_Eltima.Archived from the original on April 9, 2017. RetrievedApril 20, 2017.
  30. ^"Issue 57065 - android - Writing files via MTP set date and time for pictures and files to current, does not preserve timestamp. - Android Open Source Project - Issue Tracker - Google Project Hosting".code.google.com. August 30, 2016.Archived from the original on October 11, 2016. RetrievedSeptember 2, 2016.
  31. ^"Issue 18624 - android - setLastModified() always fails on Xoom unless running as root - Android Open Source Project - Issue Tracker - Google Project Hosting".code.google.com. August 30, 2016.Archived from the original on August 18, 2016. RetrievedSeptember 2, 2016.

External links

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=Media_Transfer_Protocol&oldid=1336321348"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp