[WIP] Installing SubSonic on the MBL

Awesome nfo, thanks! Sure, I’ll copy your guide and add the stuff for Premium validation to it.

One question, I think in your previous guide you were using the ipkg installer, without the need to remove the wd-nas WD files to use apt-get… is that so or am I confused? In that case, do you still have that old guide around? Because so far, at least for me, I’ve no need to remove those files and mess with that to use apt-get, since my other two mods from you  (pyLoad and Transmission), plus my own Apache h5ai file server work great without doing that.

Oh, and by the way, the things stopping me to fully deploy (yet) Subsonic in the MBLD is 1) that after it’s running the disks don’t sleep anymore 2) the CPU/RAM usage and the fact that according to child it wasn’t very capable of streaming any quality video because of CPU limitations. It would be interesting to compare to Serviio to see how it performs!

I was using apt-get on old guide but I didn’t have the wdnas remove command in there. I can try it without that command but I think I will run into issues.

  1. No answer for disk sleep yet, but it is Java causing it for sure

  2. I will try video later and see how it pans out

ffmpeg 1.06 is solid, flac transcoding doesn’t break a sweat

Trying to play a 720p mkv from the browser, I get the following error

Video not found or access denied: /stream?id=18&maxBitRate=1000&timeOffset=0&player=1

So still some work to do

Changed -threads 0 -

to

-threads 1 -

Video now plays but plays for a couple of seconds and pauses… rinse and repeat

It’s set to transcode to flv by default… I’ll have to play with that some

Sorry, been away for a bit.

Unfortunately, I do not think I will turn this into a guide. The performance of the system is poor, installation is shaky, and Java is a liability. It doesn’t seem suitable for a general guide.

Video streaming will not work on this device. It simply does not have the power. The issue is threading - ffmpeg and Java have to share resources, and neither is very good at it. That’s why it plays and then pauses - it can transcode or stream, not both. So it transcodes a bit, then streams the buffer, transcodes a bit more, streams it, etc…

@timmy: Unfortunately, by design, it seems that the disk sleep issue will not have a resolution. The MBL determines whether or not it should sleep by monitoring disk I/O (it seems to be a rather crude implementation). The way Java is designed, it runs tasks (like garbage collector) at periodic intervals. In addition to this, Subsonic occasionally runs periodic tasks. Most of the memory that Java uses is virtual memory and is stored on the swap partition of the disk. Every time Java accesses the memory, it resets the WD I/O counter, delaying sleep. Every time garbage collector runs, for example, it will register as a disk I/O and reset the sleep timer. Simply put: while Java is running, the MBL will likely never sleep.

I love it for FLAC transcoding on the go. That’s all I really use it for, and I’m not too concerned at the moment about disk sleeping. But it isn’t optimal, and I’m not sure I would even call it stable. I intend to keep digging and see what optimizations and/or alternate solutions I can find. Serviio seems to be a good alternative for video transcoding, based on nfo’s reports. It has the benefit of not having to fight with Java for resources.

Timmy1024 wrote:> @ child : please let me know if you plan to continue experimenting/advancing with Subsonic or not, so I could stop from refreshing the thread every day in hope of seeing some news :stuck_out_tongue:

 

Thanks

 

Sorry! I get distracted easily. They have me teaching an FPGA design course over the summer, and decided to completely restructure it. So now I get to make it up as I go, and it has proven to be rather time consuming. I don’t get any time to tinker anymore :cry: It’s definitely not because I lost interest! My sincerest apologies for leaving you hanging.

@addchild serviio was good at transcoding using the sony smp profiles. A lot of the other profiles were not transcoding fast enough for a steady stream. As a general DLNA server though, it is very nice. Again there is the issue of the hard drive not sleeping though due to its java requirements.

Thank you both guys!

As child says, sadly (I think) this Subsonic server is way to bloated to have it running 24/7 on our MBL(D). I guess I’ll go to install it in my Windows computer and combine that with your wake-on-lan guide nfo, to have it available from the outside network.

It was really great to think about having it available on the NAS and forget about turning on a computer, Windows crashing or frozen because updates running/connection crashing/whatever :frowning:

Hopefully we’ll get some advances on this some day!

I just installed Subsonic on my Windows 7 computer to test it out and I’ve tried playing a mkv from Android and it wouldn’t do anything when clicked from the client. Then I added a .mp4 and .flv to the server and they wouldn’t show on the list of available files (of course, rescanned the media library). THEN I tried playing the mkv from the web browser, the jwplayer show up and all the computer went crazy: the mouse would move but none of the UAC actions would work anymore (couldn’t stop the service, couldn’t kill the process, wouldn’t open services.msc, wouldn’t shut down or restart the computer, etc.). I had to forcefully turn it off by holding the power button for a couple of seconds :frowning:

What a mess… By the way, I’ve tried applying the patch to the hosts files there and it wouldn’t work neither. Apparently, a web server should be running with a validation file to serve to Subsonic as a validation scheme. And in the MBL, the validation would last until I reboot… I don’t know if it’s because I forcefully killed the service or something, that the settings weren’t saved.

Anyway… all is a mess, I don’t know where to go actually! Having it in Linux, if it works, would be great. One work around that came to mind is having an script monitoring java and subsonic process usages. Let’s say that 60 minutes  passed and their CPU usage was < 50%, then kill them both. This would let the disk go to sleep again and when you want to stream files just run the start up command of the server and use it… then forget about it and a script would auto kill it after 60 minutes :slight_smile:

By the way, which is the correct command to close/exit Subsonic gracefully, so I could try to see if the validation bypass worked?

I gave up trying, set up a IIS server with the validation file in it and it still wouldn’t work, so I’ve found out a setup for the previous version of Subsonic (4.7) where it didn’t have the Premium subscription built in. From there I could Donate a fixed amount (10 EUR) and got my lifetime license key. :smiley:

I’m glad it worked, I was afraid it wouldn’t honor the license. I suggest you guys if you want to buy it do it while it lasts, I won’t post the PayPal link here (in case it gets indexed by Google and it gets found/removed), but PM me if you wan it.

So, the remaining things now are:

1) Validation bypass in linux. It seemed to work until a restart, then not anymore. Maybe because it didn’t save the settings, as it was behaving well as if it was validated the whole time. It was different in Windows, where it kept showing as trial even after all my tries

2) Let me know what do you think of that script workaround to close java/subsonic after a timeout without using it have passed? That would ease the resources usages in MBL and allow it to go back to sleep.

3) Still can’t play the mkv from the Android client. nfo , how did you achieve this?

I had to change the threads from 0 to 1 in the video decode line in the Subsonic dashboard. I was using the dashboard to play the file though, not an android client.

Hi guys! Have you moved forward with this?

As I think I wrote before, and removed it from the MBLD and went on to install it in a Windows PC. THEN I found out another awful problem of Subsonic… As soon as the computer is restarted, goes to sleep, power cut, whatever, the library empties itself and the clients would see an empty library until I manually go to the server page through a browser and press “Refresh”! :crying_cat_face:

After some researching, I found it was the “expected behavior” from the app. I also started a thread in the official forum about this, and all they say is that the computer should never disconnect from the NAS, for whatever reason, because if it does then the app would empty the library. I think that’s quite unacceptable, to expect 100% connection and if not, empty the library! Why is there then a scanning schedule, it SS would empty the library whenever it wants!

ANYWAY… that issue is slowly getting me back to think of installing it directly on the NAS and parting away with video streaming and acceptable browser speed. :frowning:

The only brick between me and doing that is the thing that the drive wouldn’t sleep after installing SS + Java.

I haven’t found a way yet, but what I’d do is to run a cron job (or something) every day at 00:00 (or another fixed schedule/interval) and kill java + all the other proccesses stopping the NAS from sleeping. My workflow would be:

1) I connect from from work with DSub (Android client) to my NAS. On launch, I created a Tasker task (a programming app) to log in into SSH and start Subsonic by launching the appropiate script

2) I use my phone to stream music for a while

3) After some time (an interval of Subsonic proccess inactivity? is this even possible in Linux?) or at a fixed time (i.e. every day at 00:00), I would kill the process and after a while, the NAS would be able to go to sleep again

What do you think of these? Is this too crazy or would be possible? Do you have a clue of what processes I should kill to let the drive go to sleep? I recall trying to killall Java processes and the drive still wouldn’t go to sleep…

Please let me know what you think, thanks!