Showing Movies on a Playstation Protable

Playtime Showtime


You can use Linux to load movies on your a Playstation Portable (PSP) gaming console.

By Kristian Ki▀ling

www.photocase.com

Although Sony doesn't like to admit it, one of the reasons for the success of Portable Playstations (PSPs) is that creative users can teach the gaming console new tricks. One of these tricks gives you the ability to copy movies to the PSP and take them with you on trips. This trick is possible because another Sony product, the "Memory Stick PRO," which Sony designed for storing music and images, will also store movies.

Of course, Sony would prefer to sell you DVDs of the movies, but a few inventive hackers have discovered how to convert movies to PSP format. The sticks with two or even four GB storage capacity give you enough space to store a whole movie. To do this, you need the "right" firmware (that is the older version), and an application for converting movies to PSP format.

Firmware Hack

In an attempt to prevent some of the more creative applications, Sony has now introduced new firmware. As a reaction, users have now started downgrading their PSPs to the older 1.0 and 1.5 firmware versions to keep the ability to copy movies to their consoles. The firmware is available from the usual suspects [1], with downloading and installation tips at [2]. But beware of a nasty piece of malware by the name of "Trojan.PSPBrick," which exploits downgrade attempts by unsuspecting users and destroys the existing firmware, rather than installing the older version, thus making the console unusable.

Sony has put a temporary end to the downgrade party with the introduction of firmware version 2.01: antivirus software treats all attempts to install older firmware as attacks and prevents them. At this time of writing, you can only downgrade from version 2.0 to 1.5 and 1.0, but make sure you check the firmware with an up-to-date virus scanner before you start to install.

Pictures and Music

Sony actually approves of users transferring certain types of content to the PSP. The manual explains how to copy photos and music to the PSP using a memory stick. The stick attaches to the integrated USB port, which gives Linux users an entry vector.

Use a USB cable to connect your computer to the PSP, and then pop up a console window and become root. Type tail -f /var/log/messages to discover the device file that Linux uses to mount the PSP on your system. The first time you try this, you might draw a blank, as you need to enable USB transfer mode on the PSP first. To do so, press the HOME button on your PSP to enter the main menu. Press the left arrow key to move the cursor to the suitcase icon with the Settings label on the left of the main menu.

Use the up and down arrow keys to navigate the Settings menu until you see the USB Connection icon. Press the right hand side of (x) to enable USB mode for your PSP.

Now check the tail dialog on your PC :

Nov 14 15:24:07 linux kernel: sda: sda1

This line tells you that Linux uses the device file /dev/sda1 to address the PSP. Suse automatically pops up a Konqueror window displaying the Playstation files (Figure 1), and you can work with the files, just like on any USB stick. Debian users can mount the PSP manually by typing the following as root:

mkdir /mnt/psp
mount -t auto /dev/sda1 /mnt/psp

For test purposes, let's start by copying a few photos to the memory stick. The PSP only recognizes images as such if they are in the appropriate directory. You can use Konqueror or a shell to create the directory.

mkdir /mnt/psp/PSP
mkdir /mnt/psp/PSP/PHOTO

Now move your photos to the PHOTO directory you just created.

cp testfoto.jpg /mnt/psp/PSP/PHOTO

It is very important to use uppercase letters for folder names and filenames; if you do not, the PSP will not see your images or movies. Unfortunately, the PSP can only display JPG formated images, so you will need to convert any PNG or GIF images first.

Figure 1: After setting up the USB connection between the PSP and Suse, Suse automatically pops up a window showing you the directories on the memory stick.

The procedure for copying MP3 formated music files to the PSP is similar - again you need an appropriately named directory:

mkdir /mnt/psp/PSP
mkdir /mnt/psp/PSP/MUSIC

You can create subdirectories for albums or genres if you need to: MADONNA or SALSA or JAZZ, for example.

And... Action!

Before you can copy a movie to the PSP, there are a few preparatory steps to complete. Again, the directories need to honor special conventions: create a directory named MP_ROOT in the root directory of the PSP, and then create a 100MVN01 subdirectory. This is the target directory for movies. To allow movies to run on the PSP, your movies must have the right resolution, format, and frame rate. Luckily, the Ffmpeg tool has an option for simpler conversion of movies to PSP format.

You need an Ffmpeg version from theáCVS, which in turn requires a Faac installation. Start by downloading faac-18102004.tar.gz from the website atá[3] and then installing the package.

Type tar xvfz faac-18102004.tar.gz to unpack the archive, change to the subdirectory created by this step, and then type chmod u+x bootstrap to modify the permissions for the bootstrap script. When you type sh ./bootstrap to run the script, it will tell you which files you need for the build, and - after you provide the missing files - create a configure file. You can then follow standard procedure to complete the build and install: ./configure, make, make install.

This finishes the Faac install, and you can now download Ffmpeg from the CVS:

cvs -z9 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co ffmpeg

You may need to install the cvs tool using your distribution's package manager. Change to the ffmpeg subdirectory, and configure the program by entering ./configure --enable-shared --enable-faac. Then run make and make install to complete the install.

Now it's time to tackle an AVI file to convert it into a PSP movie. We'll call the file test.avi, which gives us the following Ffmpeg command:

ffmpeg -i test.avi -f psp -r 14.985 -s 320x240 -b 768 -ar 24000 -ab 32 M4V00001.MP4

This command converts your AVI file to a file titled M4V00001.MP4. The cryptic parameters specify that the PSP can handle resolutions (-s) of max. 320 by 240 pixels and the video bit-rate (-b) must not exceed 768 kbps. If you select a frame rate (-r) different from 14 985, you may experience problems. The audio sampling frequency (-ar) has to be 24 000 Hz, and the audio bit rate (-ab) 32 Kbps. If Ffmpeg complains about missing libraries, become root, then add the /usr/lib and /usr/local/lib paths to the /etc/ld.so.conf file, save the results, and run ldconfig again.

The next step is to copy the movie to the PSP. You can now type cp M4V00001.MP4 /mnt/psp/MP_ROOT/100MVN01 to copy the movie to the PSP. Make sure you use uppercase letters!

On the PSP, move to the Video entry in the main menu, and press (x) twice (Figure 2) to launch the movie.

Figure 2: The Simpsons up to their tricks on the PSP. Make sure you use uppercase letters for the file name.
INFO
[1] Wiki on PSP: http://en.wikipedia.org/wiki/PlayStation_Portable_homebrew
[2] Downgrading your PSP: http://www.hackaday.com/entry/1234000687060851/
[3] FAAC website: http://www.audiocoding.com/modules/mydownloads/
[4] KDE integration: http://www.kde-apps.org/content/show.php?content=31679