MiniDLNA on a Synology DS213j
The hardware is very nice and the web interface (called Disk Station Manager aka. DSM) is really slick. It comes with its own package manager which allows you to install additional software on the machine.
What's wrong with the official Media Server?
For DLNA media serving, Synology wants you to install 4 packages:
- Media Server
- Photo Station
- Video Station
- Audio Station
The first one just does the DNLA stuff while the other three do the indexing of your files. Sounds good enough, unfortunately it's not all they do. Each of these *Station thingies does a whole bunch of things more.
Photo Station creates thumbnails for each image which takes ages and litters your photo hierarchy with a bunch of additional folders. It also comes with some sort of blog software.
Video Station tries to download meta data for your video files from the internet. Automatically. Which works beautifully for some files but fails horrible for others, making your movies unrecognizable. Stupid!
Audio Station creates a bunch of additional folders in your hierarchy as well for no apparent reason. It also has some overblown web interface for you library.
I did not want this. All I wanted was some simple way to access my media files via DLNA from my TV and Playstation. So I looked for alternatives.
MiniDLNA to the Rescue?
The simplest DNLA server still seems to be MiniDLNA, which I already used on my B3 before. So I started a journey to get minidlna running on my DiskStation:
- Unfortunately there is no official package
- But you can add 3rd party sources to the Package Manager
- There is a MiniDLNA package at spk.unzureichende.info
- MiniDLNA does not show up when the repository was added
- This seems to be caused by a architecture mismatch
Intermission: The various Synology product use a huge variety of processors. The DS213j seems to have a “Marvell Armada 370” ARM7 processor. The available package was compiled for ARM5. Shouldn't ARM7 run ARM5 as well? I had no idea but decided to dig around.
First I figured out what SPK packages actually are. Turns out they are tar files. Unpacking the SPK and trying to run the binary in it on the DS actually did work!
So getting the package to install was easy:
- download the SPK
- unpack it
- change the architecture in the INFO file to
- pack it up again
- install it manually
The package should come with its own config editor - that didn't work because a recent DSM update changed how authentication is handled in the admin CGI scripts. But editing the config by hand via SSH was simple enough and got me a working DNLA server.
Creating my own Package
But not all was well. While it successfully indexed my music and pictures it failed with my videos. After a lot of debugging I found out that it seemed not to like the MKV format. But that was working on my B3! So I knew it should work with MiniDLNA. So probably some thing was missing in this special compile.
I was in no mood to figure out how to crosscompile for ARM. Instead I desperately tried if my minidlna binary from the B3 would work on the DS213j. Lo and behold - it did! It was missing some libs but it was clearly executing.
So this was when I decided to build my own package based on the original but with the Debian based binary and libs from my B3. And while I was at it I also replaced the config editor with a vary simple status CGI script so that the icon in the DSM GUI would at least do something.
The whole thing is available on Github and I'd be happy if someone wants to improve it or get the config editor to work again.
TL;DR just give me the package
Okay, okay. Use it at your own risk. No support given.