libVitaMTP & OpenCMA: Vita content management on Linux (and more)

More than a year ago, I’ve analyzed how the Vita communicates with the computer. I mentioned at the end that I started a project that will be an open source implementation of the protocol that the Vita uses. This protocol is just MTP (media transfer protocol) with some additional commands that I had to figure out. MTP is used by most Windows supported media players and cameras, so I was able to use a lot of existing code from libmtp and gphoto2. After lots of on and off work, I am happy to announce the first (beta) version of libVitaMTP and OpenCMA.

What is libVitaMTP and OpenCMA?

In anticipation of allowing developers to include Vita support in their media management applications, and for allowing developers to create custom applications that use the Vita (for example, it would be possible to write an application that uses the Vita as a general purpose storage device), I’ve placed all the backend code into libVitaMTP. This includes connecting of the Vita through libusb-1.0, processing various XML data sent from the device with libxml2, and supports an interface that allows the developer to send the various custom MTP commands to the device.

OpenCMA is the first user-level software that uses libVitaMTP. It serves two purposes. First, it’s a stripped down, open source implementation of CMA, that allows the user to send and receive games, backups, and media to and from the Vita. It is stripped down because Sony’s official CMA supports reading the metadata from media files, and I chose not to include this feature because it would complicate things.

More information can be found on the Github page.

Testing

If you are a developer and wish to include libVitaMTP in your projects, please give feedback on any bugs or difficulties/bad documentation/inconsistant documentation.

If you are a user and wish to test OpenCMA, I’ve provided some Debian packages (created and tested on Ubuntu 12.04) for you to try. After installing, just invoke “opencma -h” in the terminal to see how to use it.

A sample run of OpenCMA could be

$ opencma -u /path/to/dir/containing/updatelist -p /path/to/photos -v /path/to/videos -m /path/to/music -a /path/to/apps -l 4

the -l 4 means to show more logging information. This is very important for filing bug reports. If you encounter a crash or bug, please make sure to include the output of the OpenCMA session with -l 4. Note that more logging means slower transfers.

Please be careful not to pass in large directories because OpenCMA tries to create an index of all files (recursively) for each path.

Please submit all bug reports and feature requests to the Github issues page. It would make things easier if you include the -l 4 output.

Downloads

As always, the most up to date packages will be uploaded to the project page.

Comments

  1. M

    Thanks yifan.Is it possible to use remote desktop on vita with out any hack or is there any app to use vita as remote device.

  2. Soupaface

    Thank you Yifan yet again for at the very least releasing something related to the Vita, but mostly thank you for writing this for a Linux based OS.

    Now while I’m not in any way a developer interested in using these tools, I will say that I’m interested if libVitaMTP and OpenCMA could potentially lead to using Sony’s “Content Manager” offline, or perhaps a unique “Content Manager” Linux based program which has an offline mode to transfer media to [and from?] the Vita without being monitored.

  3. Yes, obviously I don’t send anything to Sony (for the paranoid, you can check the source). And yes, it also allows spoofing the psp2-updatelist.xml

  4. ./opencmaa.sh OpenCMA 1.1 Beta libVitaMTP Version: 2.0 Protocol Max Version: 01500010 Once connected, send SIGTSTP (usually Ctrl+Z) to refresh the database. main: Waiting for Vita to connect… connect_usb: Looking for USB device… connect_usb: No Vita found. Attempt 1 of 10. connect_usb: No Vita found. Attempt 2 of 10. connect_usb: No Vita found. Attempt 3 of 10. connect_usb: No Vita found. Attempt 4 of 10. connect_usb: No Vita found. Attempt 5 of 10. connect_usb: No Vita found. Attempt 6 of 10. PTP: Opening session VitaMTP ptp_usb_sendreq[534]: REQUEST: 0x1002, Open session VitaMTP ptp_write_func[327]: USB OUT==> 00: 10 00 00 00 01 00 02 10 00 00 00 00 01 00 00 00 | ……………. VitaMTP ptp_usb_getresp[873]: RESPONSE: VitaMTP ptp_read_func[159]: Remaining size to read: 0x0200 bytes VitaMTP ptp_read_func[178]: Reading in 0x0200 bytes VitaMTP ptp_read_func[187]: Result of read: 0xfffffffc (0 bytes) VitaMTP ptp_usb_getresp[904]: 02ff VitaMTP: PTP_ERROR_IO: failed to open session VitaMTP: Cannot configure USB device. connect_usb: No Vita found. Attempt 7 of 10. PTP: Opening session VitaMTP ptp_usb_sendreq[534]: REQUEST: 0x1002, Open session VitaMTP ptp_write_func[327]: USB OUT==> 00: 10 00 00 00 01 00 02 10 00 00 00 00 01 00 00 00 | ……………. VitaMTP ptp_usb_getresp[873]: RESPONSE: VitaMTP ptp_read_func[159]: Remaining size to read: 0x0200 bytes VitaMTP ptp_read_func[178]: Reading in 0x0200 bytes VitaMTP ptp_read_func[187]: Result of read: 0x0000 (12 bytes) VitaMTP ptp_read_func[192]: 0: 0C 00 00 00 01 00 11 95 01 00 00 00 | …………
    VitaMTP ptp_usb_getdata[700]: GET DATA PHASE VitaMTP ptp_read_func[159]: Remaining size to read: 0x0200 bytes VitaMTP ptp_read_func[178]: Reading in 0x0200 bytes VitaMTP: PTP: reading event an error 0x02ff occurred vitaEventListener: Error reading event from Vita. VitaMTP ptp_read_func[187]: Result of read: 0xfffffffc (0 bytes) main: Cannot retreve device information.

  5. i did -u somedir without an updatelist there … is that a problem ? or must i then try the -d switch ? does it work in any way without updating or update spoofing ?

  6. Hi, I obtain this error VitaMTP ptp_usb_getresp[904]: 2001 VitaMTP: PTP: reading event an error 0x02ff occurred vitaEventListener: Error reading event from Vita.

    The psvita see the openCMA 1.1 Beta, when I try to upload Album, after click the start button, the psvita try to connect and give the message “Update CMA on PC” and when I press OK button return the error.

    Thank in advance

Leave a Comment

Your email address will not be published. Required fields are marked *

Loading...