Media Transfer ProtocolThe
Media Transfer Protocol is described by Microsoft, who introduced it, as a protocol for intelligent storage devices based on and compatible with Picture Transfer Protocol(PTP).[1] Whereas PTP was designed for downloading photographs from digital cameras, Media Transfer Protocol supports 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. MTP is a key part of WMDRM10-PD,[1] a digital rights management (DRM) service for the Windows Media platform.
The USB Implementers Forum device working group standardized MTP as a fully fledged Universal Serial Bus (USB) device class in May 2008.[5] Since then MTP is an official extension to PTP and shares the same class code.[6]
The protocol was originally implemented for use across USB but extended for use across TCP/IP and Bluetooth. Windows Vista supports MTP over TCP/IP. Windows 7 and Windows Vista with the Platform Update for Windows Vista also support MTP over Bluetooth.[7] The host connecting to an MTP device is called an MTP Initiator whereas the device itself is an MTP Responder.[8]
A main reason for using MTP rather than, for example, the USB mass-storage device class(MSC) is that the latter operates at the granularity of a mass storage device block (usually in practice, a FAT block), rather than at the logical file level.
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.
In case 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.MTP保存一个硬盘内容的目录或是数据库,MTP发现当内容改变时进行扫描数据文件。
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 enablerestricted capabilities. Nothing specific of this nature is in the core standard but the possibility is allowed via Vendor extensions (whereas USB mass-storage does not cater for such 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.
Why abandon USB Mass Storage?
As explained by Google Engineer Dan Morrill, the USB mass storage protocol was a block-level protocol. What this meant was that a partition could not be mounted on two different systems at the same time. Each partition that needs to be mounted on a computer must be unmounted from the phone first. This would be impossible on a phone with only a single partition, since if the system partition was unmounted, the phone would crash.
To work around this issue, Android phones up until now either had two partitions in the internal memory (like the Nexus S) or had a microSD slot (like the Samsung Galaxy S II). Phones with micro-SD slots would just export the microSD card partitions to the connected computer.
But the Galaxy Nexus only has a single internal partition. Other Ice Cream Sandwich phones in the future are likely to follow suit.
According to Google Engineer Dan Morrill, the advantages of the single partition approach are that “ no more staring sadly at your 5GB free on Nexus S when your internal app data partition has filled up — it’s all one big happy volume. ”
So Google has made the move on to MTP, to enable phones with single large partitions to connect to a computer with nearly the same results as USB mass storage. I’d personally prefer a phone with MTP rather than a phone with two tiny partitions.
推动Android MTP的原因是因为Google认为MTP能更好的使用一块大容量的存储,而不用分两个区。
MTP/PTP簡單來說就是支援多媒體傳輸的協定,同時支援一般的 UMS 功能。這兩項功能分別由兩間廠商所提出,MTP 是微軟為了搭配 Windows Media Player 所提出的、而PTP由 Kodak 為了數位照片所提出。市場上,其實 Samsung 早就在 Galaxy S 就使用 MTP 取代傳統的 UMS,而 Nokia 在 Symbian 也有 support MTP。
Google 在 Android 3.0 會採用 MTP 作為標準,其實有一大部分是為了DRM (Digital Rights Management) 而作的,因為MTP原本就是為了 DRM 所設計出來的協定。如同MS當初提出MTP的原因,Google目前面臨的也是如何處理數位內容的問題,才能替Android 取得更多的數位內容,其實更是為了解決 Android App 太容易被散佈問題鋪路。
更详细的MTP实作原理可以参考此 文件 ,概要来说
- MTP 实作分为物理层(Physical Layer)、传输层(Transport Layer)以及指令层(Command Layer)
- MTP 是基于PTP 设计出来的,两者在物理层的运作方式是相同的
- MTP增加了对播放清单、PDA、日历、联络人、群组影像等功能的支援。
- 加入数位版权管理(DRM)属性,包括DRM状态、URL(在授权权限过期时,让DRM可以要求付费)、使用次数和其他相关属性。
- 支援超过4G的档案传输
- 基本MTP规格的使用是免费的,但只要使用MTP就必须完整支援其规格
- Enhanced Initiator (主机端?)则是要付费的
Google 在Android 3.0 实作的MTP 可在2.6.36 的tegra kernel 找到
下面是MTP 的一些基本资讯的参考来源:
Introduction to MTP: Media Transfer Protocol译文:
http://shiwawa.blog.hexun.com.tw/8323038_d.html
MTP Function driver:
http://www.usb-software.org/mtp_function_driver.php