11 Mar 2012

Installing Playstation Media Server (PMS) on a Synology NAS (411j)

11 Mar 2012

So I’ve recently acquired a Synology DS411j, which I hoped would have flawless built-in DLNA compatibility with my PS3. I should’ve known it was too much to ask for proper transcoding.

There’ve been plenty of discussion regarding how to get the PS3 media server, something I’ve been using on my Windows PC, installed on a Synology NAS. The most complete guide I’ve found is here on Mark in the Dark. I followed it, but I had to do a few things differently and additionally to get it to work proper.

In the end, transcoding was horrifyingly slow on the 411j’s processor. I could barely get the first frames off a 720p movie. But for those who have more powerful units and would like to try anyway, here are the modifications to the original guide. Props to Mark and synops for the original guide. My DSM version is 4.0-2197.

  1. Install nano via ipkg. It’s much easier than vi for the purpose of editing files.
    ipkg install nano
  2. Follow the guide all the way till after updating ‘/etc/profile’. At this point in time, the java version is 1.6.0_30, so adapt accordingly.
  3. Install git via ipkg.
    ipkg install git
  4. Now we install mplayer.
    mkdir /opt/local/mplayer
    cd /opt/local/mplayer
    svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
    ./configure
    make
    make install
    

    During one of the steps above, it’ll ask you to include ffmpeg from git. I just did it just to continue.

  5. Continue following the guide till after the libpthread section.
  6. Now we install libzen, libmediainfo, and the mediainfo CLI, in that order. Instead of copying the lib files, I created symbolic links. I didn’t have to do copy/link the libmediainfo files.
    cd /volume1/@tmp/
    tar zxvf MediaInfo_CLI_0.7.51_GNU_FromSource.tar.bz2
    cd /volume1/@tmp/MediaInfo_CLI_GNU_FromSource/ZenLib/Project/GNU/Library
    ./configure –enable-shared=yes
    make
    make install
    ln -s /usr/local/lib/libzen.so.0.0.0 /usr/lib/libzen.so
    cd /volume1/@tmp/MediaInfo_CLI_GNU_FromSource/MediaInfoLib/Project/GNU/Library
    ./configure –enable-shared=yes
    make
    make install
    cd /volume1/@tmp/MediaInfo_CLI_GNU_FromSource/MediaInfo/Project/GNU/CLI
    ./configure -enable-shared=yes
    make
    make install
  7. We install libffi, again using symbolic links instead of copying. make install worked for me.
    cd /volume1/@tmp/
    wget ftp://sourceware.org/pub/libffi/libffi-3.0.9.tar.gz
    tar zxvf libffi-3.0.9.tar.gz
    cd libffi-3.0.9/
    ./configure
    make
    make install
    ln -s /usr/local/lib/libffi.so.5.0.10 /usr/lib/libffi.so
    ln -s /usr/local/lib/libffi.so.5.0.10 /usr/lib/libffi.so.5
    ln -s /usr/local/lib/libffi.so.5.0.10 /usr/lib/libffi.so.5.0.10
  8. Download and install PMS as per the guide. At this point of time it’s version 1.50.1.
  9. Add libjnidispatch to the jar file. gjar needs to be run in the PMS folder to preserve the relative placement of the .so file within the jar file.
    cd /volume1/@tmp/
    wget http://ftp.nl.debian.org/debian/pool/main/libj/libjna-java/libjna-java_3.2.7-4_armel.deb
    ar vx libjna-java_3.2.7-4_armel.deb
    tar -xzf data.tar.gz
    mkdir /opt/local/pms-linux-1.50.1/com
    mkdir /opt/local/pms-linux-1.50.1/com/sun
    mkdir /opt/local/pms-linux-1.50.1/com/sun/jna
    mkdir /opt/local/pms-linux-1.50.1/com/sun/jna/linux-arm
    cd /opt/local/pms-linux-1.50.1
    cp /volume1/@tmp/usr/lib/jni/libjnidispatch.so com/sun/jna/linux-arm/
    gjar uf /opt/local/pms-linux-1.50.1/pms.jar com/sun/jna/linux-arm/libjnidispatch.so
    chown -R admin:users /opt/local/pms-linux-1.50.1/
  10. Link a few more library files for mencoder to work.
    ln -s /opt/lib/liba52.so.0.0.0 /usr/lib/liba52.so.0
    ln -s /opt/lib/libbz2.so.1.0.6 /usr/lib/libbz2.so
    ln -s /opt/lib/libbz2.so.1.0.6 /usr/lib/libbz2.so.1
    ln -s /opt/lib/libbz2.so.1.0.6 /usr/lib/libbz2.so.1.0
    ln -s /opt/lib/libfontconfig.so.1.4.4 /usr/lib/libfontconfig.so
    ln -s /opt/lib/libfontconfig.so.1.4.4 /usr/lib/libfontconfig.so.1
    mencoder

    Last line is just to check if mencoder is still looking for anything. Link accordingly.

  11. Follow the remaining part of the guide.

That’s it. I hope you’ll have better luck than me. Let me know if you’ve any improvements to the steps that may allow us 1080p transcoding on the NAS. 🙂

Finally, I didn’t bother doing this, but you should be able to have PMS autorun by adding the following lines to the end of ‘/etc/rc.local’:

cd /opt/local/pms-linux-1.50.1
nohup ./PMS.sh &

If you try it let me know if it works. 😛

Leave a comment
More Posts
Comments
  1. Serge Glibert August 4th, 2013 7:54PM

    Hello,

    I’m trying to install pms on a synology. I found your (thaks a lot) but I have a little problem. The link to to the tuto of markinthedark is dead. Perhaps do you have a copy of his tuto ?

    Sorry for my bad English

    Regards

    Serge

  2. myuu August 22nd, 2013 3:03PM

    Ah shucks, I didn’t save a copy of his tutorial. Perhaps you can try following the discussion thread that led to the creation of Mark’s guide:-

    http://www.ps3mediaserver.org/forum/viewtopic.php?f=3&t=12387

Trackbacks

  1. PS3 Media Server on Synology 411j revisited | purrfect bliss
Comment

Leave a Reply