Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Media Transfer Protocol
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==<span id=Drawbacks></span>Comparison with USB Mass Storage== {{See also|USB mass storage device class}} {{Original research section|date=November 2019}} MTP's advantages are marked with "<span style=color:green>(+)</span>" while disadvantages are marked with "<span style=color:red>(-)</span>". ===File oriented instead of block oriented protocol=== By [[abstraction layer|not exposing]] the [[filesystem]] and metadata index, the integrity of these is in full control of the device. *<span style=color:green>(+)</span> '''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: **<span style=color:green>(+)</span> Re-indexing after unplugging can be avoided. Also helped by the inclusion of metadata with the transfer. **<span style=color:green>(+)</span> A separate file system for host exposure is unnecessary. This avoids the inflexibility of setting aside a fixed-size [[disk partitioning|partition]] for this file system. *<span style=color:green>(+)</span> '''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 [[File Allocation Table|FAT]] family of filesystems. *<span style=color:red>(-)</span> '''Undeletion:''' Filesystem recovery and [[undeletion]] tools on the computer cannot be used, since MTP is an [[abstraction layer]] that offers no [[Block (data storage)|block-level]] access. *<span style=color:red>(-)</span> '''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. *<span style="color:red">(-)</span> '''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.<ref>{{Cite web |title=Google Issue Tracker |url=https://issuetracker.google.com/issues/36956498 |access-date=April 2, 2022 |website=issuetracker.google.com}}</ref><ref>{{Cite web |title=usb - Why does MTP show wrong directory location? |url=https://android.stackexchange.com/questions/209110/why-does-mtp-show-wrong-directory-location |access-date=April 2, 2022 |website=Android Enthusiasts Stack Exchange}}</ref> *<span style="color:red">(-)</span> '''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.{{citation needed|date=April 2023}} ===Performance=== *<span style=color:red>(-)</span> MTP operations are not multiplexable β any ongoing operation must either complete or be aborted before another operation can begin. Unlike [[USB mass storage device class|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 [[USB_Attached_SCSI|UAS]] extension of USB mass storage, which adds multiple command queues). *<span style=color:red>(-)</span> Limited support for transferring parts of files, such as blocks or byte ranges (see {{section link||Direct modification and partial transfer features}}). *<span style=color:red>(-)</span> Limited support for direct modification of files (see {{section link||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 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 (operating system)|Android]] includes extensions to deal with this limitation; however, these extensions must be supported by the host operating system.<ref>{{cite web|url=https://blog.intr.overt.org/?p=174|title=Normal file read/write support with the GVFS MTP backend!|date=February 18, 2013|access-date=June 1, 2016|archive-date=April 14, 2016|archive-url=https://web.archive.org/web/20160414110840/http://blog.intr.overt.org/?p=174|url-status=live}}</ref><ref name="hanwen_android.go">{{cite web|url=https://github.com/hanwen/go-mtpfs/blob/master/mtp/android.go|title=hanwen/go-mtpfs|website=[[GitHub]]|access-date=June 1, 2016|archive-date=October 7, 2018|archive-url=https://web.archive.org/web/20181007172816/https://github.com/hanwen/go-mtpfs/blob/master/mtp/android.go|url-status=live}}</ref> *<span style=color:red>(-)</span> 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. ===<span id="Transparency to MTP unaware software"></span>Transparency to MTP-unaware software=== <span style=color:red>(-)</span> Windows does not assign [[drive letter assignment|drive letters]] or [[Universal Naming Convention|UNC]] paths to MTP devices because it does not natively expose them as [[virtual file system]]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 [[workaround|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]] 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=== <span style=color:red>(-)</span> Despite identifiability by the PTP/MTP [[USB#Device classes|USB device class]], libmtp documentation indicates that the vendor and product ID combination plays a functional role in identifying an MTP device, also by Windows drivers.<ref name="libmtp_readme">{{cite web|title=libmtp README|url=https://sourceforge.net/p/libmtp/code/ci/HEAD/tree/README|access-date=July 9, 2017|date=July 8, 2017|quote=Devices need different PIDs for every alternative interface due to the Windows USB stack.|archive-date=August 10, 2016|archive-url=https://web.archive.org/web/20160810194856/https://sourceforge.net/p/libmtp/code/ci/HEAD/tree/README|url-status=live}}</ref> Libmtp includes vast listings of vendor and product ID numbers of devices that it supports, along with workarounds for bugs.<ref name=libmtp_list_of_devices>{{cite web|title=libmtp source code: music_players.h|url=http://sourceforge.net/p/libmtp/code/ci/HEAD/tree/src/music-players.h|access-date=November 26, 2015|archive-date=November 18, 2015|archive-url=https://web.archive.org/web/20151118071110/http://sourceforge.net/p/libmtp/code/ci/HEAD/tree/src/music-players.h|url-status=live}}</ref><ref name=libmtp_ptp>{{cite web|title=libmtp source code: ptp.h|url=http://sourceforge.net/p/libmtp/code/ci/HEAD/tree/src/ptp.h|access-date=July 9, 2017|archive-date=March 8, 2021|archive-url=https://web.archive.org/web/20210308041744/http://sourceforge.net/p/libmtp/code/ci/HEAD/tree/src/ptp.h|url-status=live}}</ref> 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''.<ref name="spec1.1"/> 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.<ref>{{cite web|url=https://together.jolla.com/question/43221/webm-vp8-vp9-opus-support-for-sailfish/|title=Webm (VP8, VP9, Opus) support for Sailfish - together.jolla.com|access-date=June 1, 2016|archive-date=March 4, 2016|archive-url=https://web.archive.org/web/20160304052200/https://together.jolla.com/question/43221/webm-vp8-vp9-opus-support-for-sailfish/|url-status=live}}</ref>{{Unreliable source?|reason=User-generated content|date=June 2017}}<ref>{{cite web|url=https://forum.sailfishos.org/t/unable-to-use-mtp-using-usb-cable/5874|title=Unable to use MTP using USB cable |website=Sailfishos.org|date=April 13, 2021 |access-date=April 13, 2021}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)