So after recently rebuilding one of the servers in my dogghouse, I realized that I hadn’t installed a uPNP/DLNA AV media server. Previously I had been using Fuppes, but the lack of active development and some other quirks made me re-think what I wanted to use. So, after comparing available packages, I decided to give the PS3 media server a try. I specifically wanted something that could run without a GUI on a headless machine as a service/daemon if necessary, that would support an XBox 360 and various Android devices.

Installation was fairly easy, however the documentation to make it work how I wanted on an RPM based distro was conflicting, spread across multiple sites, and somewhat lacking…

First, we need to add the rpmforge repo, in order to install the prerequesites with yum. Instructions for installing RPMForge can be found at the CentOS RPMForge Howto, but it basically consists of the following:

rpm --import
rpm -i

Next, we need to install some prerequisite packages:

yum install gcc mplayer ffmpeg mencoder java-1.7.0-openjdk ImageMagick

If you wish to stream web content, you will also want to install vlc:

yum install vlc

If you are having problems installing vlc, because of version conflicts with libupnp, add the line exclude=libupnp to your /etc/yum.repos.d/epel.repo, in the main [epel] section

We will also want to install libzen and libmediainfo for some additional features. You can skip this step if you like, but not all the features will work!

You can get RPM packages for libzen and libmediainfo from the MediaInfo Download Page, just select the appropriate distro and architecture, download the package, then install like this:

rpm -Uvh libzen0-0.4.29-1.x86_64.CentOS_6.rpm
rpm -Uvh libmediainfo0-0.7.64-1.x86_64.CentOS_6.rpm

Finally, we are ready to install ps3mediaserver! Go grab the latest ps3mediaserver package from the ps3mediaserver download page, and extract it somewhere. I like to put it in my /usr/local/share directory so that I can run it as a service in the background or as a non-privileged user.

Next, we will follow Geoff Hodder’s advice and create a symlink from /usr/local/share/pms to the current version of pms, which we can change in the future when upgrading, making the upgrade process easier!

ln -s /usr/local/share/pms-1.90.0 /usr/local/share/pms

Double check the ownership here on the pms-1.90.0 folder. I have mine owned as root:root. The default permissions should be correct. Below are what my folder permissions look like.

lrwxrwxrwx   1 root root   27 Nov 19 21:07 pms -> /usr/local/share/pms-1.90.0
drwx------   5 root root 4.0K Jan 29 07:48 pms-1.90.0

Now go to the directory you just created with the ln command above, (/usr/local/share/pms/ in my case), and edit the file PMS.conf, changing the following settings:

minimized = true
network_interface = br0
folders = /data/movies,/data/music,/data/pics

Optionally, edit the following settings to enable chapters on .mkv files, and disable forced subtitles:

chapter_support = true
mencoder_disablesubs = true

If you are upgrading from a previous version of ps3mediaserver, don’t just copy your old config file. Variable names are often changed, new variables are added, and old ones may be removed. Double check your settings and apply them to the new file!

Obviously you will want to change the folders and network_interface settings to match your setup. The defaults for the rest of the settings should be fine, but take a look through the other settings if you wish.

One additional change was made to the /usr/local/share/pms/renderers/XBOX360.conf file to allow avi streaming to the XBox 360. Find the StreamExtensions= line and avi to the end, so it will look like this:


Phew… We’re almost there!

One of the things I specifically wanted was to be able to run this as a service on boot. I also wanted to specify my config file, instead of having it use one from my home folder. In order to do this we are going to edit the /usr/local/share/pms/ file. Comment out the DIRNAME=`dirname $CMD` line and add a line like DIRNAME="/usr/local/share/pms/" right below it. Here is what the first few lines of my file look like:


CMD=`readlink -f $0`
#DIRNAME=`dirname $CMD`

One more thing that I wanted was the ability to simply run a command from anywhere, as any user, and start the service. I just created a symbolic link in the /usr/local/bin to the script like so:

ln -s /usr/local/share/pms/ /usr/local/bin/pms

We must now allow TCP traffic on port 5001 and UDP traffic on port 1900 through our firewall, along with multicast IGMP traffic, to actually let this thing work! Open the appropriate ports with some lines like this in your /etc/sysconfig/iptables file:

-A INPUT -s -i br0 -p tcp -m tcp --dport 5001 -j ACCEPT
-A INPUT -s -i br0 -p udp -m udp --dport 1900 -j ACCEPT
-A INPUT -d -i br0 -p igmp -j ACCEPT

You will also need to set the default multicast address route. This can be set in the /etc/sysconfig/network-scripts/route-br0 file, looking like this:

# /etc/sysconfig/network-scripts/route-br0 dev br0

Make sure to change the source address mask to match your local network addresses, and the interface to match your local network interface. If you have IPv6 running, you should also open those same ports in your /etc/sysconfig/ip6tables firewall:

-A INPUT -p tcp -m tcp -s 2001:1234:5678:abcd::/64 -i br0 -j ACCEPT --dport 5001
-A INPUT -p udp -m udp -s 2001:1234:5678:abcd::/64 -i br0 -j ACCEPT --dport 1900

PLEASE NOTE!!! If you have IPv6 running, you will want to remove the parameter from the last line of the file. More details below…

Again, make sure that your source address mask and interface match your network configuration, and don’t forget to restart your firewalls to apply the new rules!

Now, before we go any further, we can attempt to run the server and make sure that everything is actually working correctly. Just type pms from a command prompt and watch it go!

If everything is working correctly, you will either have the GUI window pop up, or get a message like this:

GUI environment not available
Switching to console mode

or you may get a bunch of debug messages fly by. If there are any errors, double check everything before moving on.

If you are in the console mode, press crtl-c to stop the ps3mediaserver.

Finally, the last thing I want to do is set this thing to run as a service/daemon in the background and start on boot. In order to do this we need a startup script!

Create the /etc/init.d/ps3mediaserver file and put the following in it:

# chkconfig: - 91 50
# description: Starts and stops the ps3mediaserver
# version: 0.8
# pidfile: /usr/local/share/pms/
# config:  /usr/local/share/pms/PMS.conf

# Source function library.
if [ -f /etc/init.d/functions ] ; then
  . /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
  . /etc/rc.d/init.d/functions
  exit 1

# Avoid using root's TMPDIR
unset TMPDIR

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 1



start() {
        echo -n $"Starting $KIND services: "
        cd $PROG_ROOT
        daemon $PROG_ROOT/$PROG_EXEC
        [ $RETVAL -eq 0 ] && echo `ps axo pid,args | grep $PROG_JAR | grep -v grep | awk {'print $1'}` > $PROG_ROOT/$ || \
           ps axo pid,args | grep $PROG_JAR | grep -v grep | awk {'print $1'} > $PROG_ROOT/$
        return $RETVAL

stop() {
        echo -n $"Shutting down $KIND services: "
        killproc -p $PROG_ROOT/$
        [ $RETVAL -eq 0 ] && rm -f $PROG_ROOT/$
        return $RETVAL

restart() {

rhstatus() {
        status -p $PROG_ROOT/$ $PROG_NAME
        return $?

case "$1" in
        echo $"Usage: $0 {start|stop|restart|status}"
        exit 2
exit $?

One of the last things we need to do is make a small change to the last line of our script, to allow it to run in the background, and log to a file. The last line should look like this (note the difference between IPv4 and IPv6 networks!):

exec "$JAVA" $JAVA_OPTS -Xmx768M -Xss1024k -Dfile.encoding=UTF-8 -Djna.nosys=true -classpath "$PMS_JARS" net.pms.PMS "$@" >> /var/log/ps3mediaserver.log 2>> /var/log/ps3mediaserver.log &


exec "$JAVA" $JAVA_OPTS -Xmx768M -Xss1024k -Dfile.encoding=UTF-8 -Djna.nosys=true -classpath "$PMS_JARS" net.pms.PMS "$@" >> /var/log/ps3mediaserver.log 2>> /var/log/ps3mediaserver.log &

I have not been able to get the IPv6 configuration for PS3 Media Server to work reliably on all my devices… If you have any suggestions please let me know!

Finally, install the startup script and set it to run on boot!

cd /etc/init.d
chmod +x ps3mediaserver
chkconfig --add ps3mediaserver
chkconfig --level 345 ps3mediaserver on

Now, we can start the ps3mediaserver and be done!

service ps3mediaserver start
Starting ps3mediaserver services:                          [  OK  ]

Now that we are done, go ahead and get yourself a dogg treat!

Thanks to Geoff Hodder for some good tips left in the comments below. Go check out his page at PHReeK.oRG

Also, thanks to the following webpages for giving me some of the information necessary to get this thing working:

Print Friendly, PDF & Email