Running Playstation 3 Media Server on an ARM-based QNAP NAS

PS3 Media Server on an ARM-based QNAP NAS is a very handy tool to play various kinds of media types on your playstation 3. Especially the live transcoding features are awesome. They essentially allow to transcode a video file on-the-fly while playing it back on the playstation. While video decoding and recoding requires a powerful machine, simply transforming the file format (from mkv to mp4) can be done on the fly on “normal” machines such as my iMac from 2007. Having a subset of those features on my QNAP NAS was the motivation to try to install PS3 Media Server on the NAS.

PS3 Media Server is written in Java. Also you will need some additional tools such as ffmpeg. Please make sure, that you have OptWare installed before starting.

1. Downloading Java

This is actually the trickiest part: getting the proper Java file from Oracle. It took me forever because you need an account for downloading it (why?) and activating it produced multiple errors. I hope you have more luck. You can download “Java headless for ARMv5” here: http://www.oracle.com/technetwork/java/embedded/downloads/javase/index.html. After downloading, please copy the file to the “Public” share and make sure that the name matches the following:

/share/Public/ejre-*.tar.gz

2. Installing Java

There are excellent entries (1, 2) in the QNAP Wiki that explains how this can be done. Essentially: Download the QPKG and install it via the QNAP web frontend. Then activate the JRE in the QNAP web frontend.

3. Autostart Java on Startup

You will need to execute some commands when starting up your QNAP. Your QNAP will automatically execute the script autorun.sh in the config mtdblock. However, changing this script requires to mount the mtdblock device which is not very handy. Therefore we will create our own file on the harddisk that can be changed on the fly.

Create a file called /share/MD0_DATA/.qpkg/autorun/autorun.sh with the following content:

#/bin/bash

# Start Optware
/etc/init.d/Optware.sh start

# Start Java
/etc/init.d/jre.sh start

# Export JAVA PATH
export JAVA_HOME=/usr/local/jre

# Fix PATH
export PATH=/opt/bin:/opt/sbin:$PATH

and make it executable:

$ chmod +x /share/MD0_DATA/.qpkg/autorun/autorun.sh

Now mount the config mtdblock (only for newer ARM-based QNAPs, others look here):

$ mount -t ext2 /dev/mtdblock5 /tmp/config

Now create the file /tmp/config/autorun.sh with the following content:

#!/bin/sh
/share/MD0_DATA/.qpkg/autorun/autorun.sh &

and make it executable:

$ chmod +x /tmp/config/autorun.sh

Now unmount the config mtdblock:

$ umount /tmp/config

The file /share/MD0_DATA/.qpkg/autorun/autorun.sh will now be executed every time your QNAP boots.

4. Download PS3 Media Server

Go to http://sourceforge.net/projects/ps3mediaserver/files/ and download the “generic-linux-unix” package onto your NAS.

$ cd /opt
$ wget "http://downloads.sourceforge.net/project/ps3mediaserver/pms-1.90.1-generic-linux-unix.tar.gz" # make sure to download the latest version!

5. Install PS3 Media Server

Unfortunately, there is no qpkg package for this. However, the installation is very simple. Just create a directory /opt/pms and unpack the archive into there:

$ tar -xvzf pms-1.90.1-generic-linux-unix.tar.gz
$ mv mv pms-1.90.1 pms

6. Autostart PS3 Media Server on Startup

To start PMS automatically on startup of your QNAP, simply add the following to your /share/MD0_DATA/.qpkg/autorun/autorun.sh file:

# Start PS3 Media Server
cd /opt/pms
./pms.sh &

7. Installing dependencies

$ ipkg install ffmpeg coreutils

8. done

1 Comment

  1. Pingback: Running a Tor relay on your QNAP NAS « Wolfs Tech Blog

Leave a Comment

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