Raspberry Pi, Plex and RasPlex

I’ve got a rather large collection of photos and home video;  more than 20000 photos and >50 videos. A few years ago I digitized all the slides, negatives and analog video I could find and of course nowadays all new media is being made the digital way, with a HD Camcorder and a DSLR. So the collection keeps on growing…

I also have a media player in the living room from which all this media is accessible. However, the amount of devices that should be able to access all this content, have increased rapidly the last few years – currently it’s 4 smartphones, 3 tablets, 4 TVs, 2 PCs and a laptop. But there’s no universal way of accessing all that content – each device is different and so is the UI -I need some sort of universal ‘thing’ for this!

I’ve seen XBMC a few times and liked it; I heard about Plex but knew too little about it to judge if it would suit my needs. So the media issue stayed on the to-do list – until now! I got an email last Friday with only this link in the message: http://rasplex.com. Hey, that’s interesting.. a Plex client for the Raspberry Pi!

Time for some action.. I have my own RPi for a few days now, so why not give Plex, RasPlex and all that comes with it a try, right now! Nothing else to do anyway 😉

First I had to find a spare display with a HDMI input (which is not really needed, I guess the RCA can be used as well). We had one – a TV/PC monitor being used as a PC monitor. I also had an unused LCD monitor somewhere, so I swapped the 2 and put the TV/PC monitor on the desk next to me. I installed the Plex Media Server (PMS) on a Windows Vista VM that’s only being used for testing and added a number of home videos to the PMS Library.

IMAG0064r

I downloaded the latest RasPlex image, put that image on a new SD card and inserted it into my RPi. A HDMI cable, network cable and a USB keyboard connected to the RPi was all that had to done to give it a try. I plugged the power supply (an old smart phone charger) into the mains socket and – yeah, it’s booting! Cool..

IMAG0065r

The development of RasPlex has started just very recently and it’s still in alpha phase as you can see on the screenshot to the right. The User Interface was working OK; I didn’t find anything that didn’t work (with my 2-day Plex user experience, that is). The User Interface can be a bit laggy sometimes, but after the first time (after it has been cached) it’s OK. Lets move on the watching some video ans see how Alpha that is..

IMAG0067r

Playing Home Videos is still a bit buggy I guess, cause I experienced some strange behavior a couple of times: audio but no video, audio that suddenly stopped, stuff like that. To the left you see a screenshot of RasPlex playing a Home Video of our trip to Madurodam last year – great!

I also ripped some of my DVD’s to see if those had the same problems, but they didn’t – all went well.

2013-03-16_15-52-15r

I also downloaded the Plex Media Center so I could watch all our photos and videos on my PC and also installed the Plex for Android App on my smartphone. Hey, I can control my TV with my smart phone… ooh man, this is nice!

And you’re not restricted to your own media – Vimeo, YouTube and other sources can be embedded in that same media portal…

With a single Plex server somewhere in your home and multiple Plex clients (RasPlex, smart phones, tablets) for all of us this is the best media solution I’ve seen so far and I love it!

Keeping AV power consumption acceptable

After the first night with Network control enabled on my new Onkyo, it was clear that something had happened to the power usage; it was much too high compared to the usual power usage during the night. I didn’t want to postpone the power measurements any longer, cause the power usage increase was too much; I had to know where this was coming from. So I did some tests today regarding power usage of my new Onky TX-NR709… well, it was worth it! Here are some numbers:

  • Receiver on, watching TV: 42-43 W
  • Receiver on, listening to the Tuner: 43-44 W

Ok, I can live with that. Now let’s see what the power consumption is when I switch the receiver to standby: 38W. WHAT? WATT?? Yep, thirty-eight. This is ridiculous, this can’t be true. Standby usage as stated in the manual is 0.3W; but as I already mentioned earlier, the term “slightly” with regard to power consumption of a device capable of consuming 730W doesn’t say a thing. Apparently, the guys at Onkyo think that an increase of 5% of 730W can be called slightly; yeah right, think again. It’s a lot!

So, what can be done to fix this? Cause this is not acceptable of course. I’m not going to accept a new device which will add 38W to my power consumption 24/7, no way! There are a few things to explore; I changed the factory settings at some points of which I knew they would “slightly” increase standby power consumption (the word “slightly” is getting a whole new meaning for me now, thanks Onkyo …), so I decided to rollback those changes and see what the effects would be.

The changes I made of which I knew they would influence standby power consumption were HDMI Through mode and Network Control.

HDMI Through mode enables (regardless of  the AV receiver being on or in standby mode) to pass both audio and video stream from a HDMI input through to the TV. In other words: you can pass your cable STB output through to the TV, even when the Receiver is in standby mode.

Network Control mode enables or disables control over the network (duh).

Being an optimist by nature, my first thoughts were that this HDMI Through function was the biggest contributor to this huge standby power consumption, so I switched it off again. No change.. Standby power usage  was still 38W. So I switched off Network Control as well. Bingo! 0.0W, that’s the way I want it. Turning back on the HDMI Through function made the power consumption increase to the unacceptable level of 38W again.

So, what’s the real benefit of Network Control over RS-232? Nothing, zero, nada; or better, it makes the receiver perform worse in my opinion, the effect on standby power consumption is ridiculously high. Let’s assume the  receiver will be used 8 hours per day, this standby power consumption of 38W would mean 38x16x365= 222 kWh per year … that’s about the same amount our washing machine uses during a year ! Need I say more?

I think Onkyo should do a Search&Replace on the text of their manuals and replace the word “slightly” with “considerably” or “unacceptable” or something similar…

In the mean time, I’m preparing a switch to RS-232 control!

Controlling the AV Receiver

Being able to control my new media player is nice, but of no use at all if the AV Receiver the player is connected to (along with a Cable STB and a Playstation) cannot be controlled. I wanted to have the same wired control for my AV Receiver as I have for my media player and searched the net for a suitable model with all the right specs. Both Denon and Onkyo (and probably more, but those are my favorite brands) have the ability for controlling some of their Receiver models with  a RS-232 port and both have  reasonably well documented proprietary protocols.

The new Onkyo TX-NR709 I bought recently is also equipped with a RS-232 port (what a surprise :-)), so this makes controlling the whole set of A/V equipment complete: TV, Dune media player, AV Receiver, Cable STB are all under control of my Domotica system; either wired or by IR (IrTrans). After I bought the receiver, I found out that the Onkyo is not only controllable by means of the Serial RS232 port, but that the Ethernet connection can be used for this purpose as well. The Serial protocol (called ISCP) and the Ethernet version (eISCP) look very much alike, in a way that it should be possible to support both protocols in one go without much extra work. The Ethernet version has some extra header bytes, a data length and a version byte added to the ISCP Message, that’s all; the ISCP message stays the same.

But why should I want to support both? Well, it seems not all receivers are that good at keeping power consumption at an acceptable level when network control is enabled. The Onkyo NR709 user manual says: “enabling network control will slightly increase power consumption in Standby mode“; right, we’ll see what “slightly” means, considering this receiver can consume 570W. If the difference between with or without network control is too big for my taste, I’ll go for RS-232 (only if this can compensate for the extra Serial Ethernet Server running 24/7  ;-)) I have all of my power usage monitors in use while I’m writing this, so I’ll have to test this power consumption issue later; for now, it won’t hinder development and testing of the interface; I can make the choice between RS-232 and Ethernet later.

The nice thing about the (e)ISCP Protocol is that there are different ways to control the Receiver; for instance, the Muting Command has 3 values with which you can control it: on, off and toggle. Why’s that so convenient? Because with this, there’s no need to track the receivers Muting state in my own Domotica system.  Without the toggle option built into the protocol, I would have to track Muting state if I would like to have a single “Mute” button for a GUI, cause I (read: my system) don’t know what the user wants to do; mute on or off? I’ll have to know the current mute state to send the right mute command…

With the on, off and toggle options I can switch muting on in case of an incoming phone call, off again at the end of that phone call, but also create that single mute button on the GUI as well, all without the need for tracking everything I want to control. Of course, this is not the complete story behind something ‘simple’ as controlling mute; it’s very easy to come up with scenarios where things can still go wrong… there’s always that user, constantly interfering and overriding things 😉

After a few hours of defining all the commands that are supported by the (e)ISCP protocol, I could do my first tests today. I started with testing the Master Volume Command (“MVL”). Nothing really spectacular actually; I pushed a button and the Master Volume went up; pushing another button made it go down again, just as I expected. No, the really cool stuff happened when I went to the living room and manually turned the Master Volume knob; I saw incoming eISCP packets containing the new, manually set Master Volume! Wow, this is real 2-way communication! Nice surprise, I missed that one 🙂

This means I’ll be informed of everything that’s happening without the need for polling; this is what I really wanted but didn’t expect to get! Now, when someone selects the tuner on the Receiver (no matter how), I can switch off those devices which are not needed for listening to the radio – the TV, the Dune and the Cable STB. Or switch off the Dune media player when watching cable TV. Ow yeah 🙂

Darn, I don’t have discrete IR codes for my TV; no wait, haha, I don’t need those discrete codes anymore! Since the TV is Ethernet connected, I can ping it (another small project I’m working on) so I do know whether the TV is on or off…

Long live integration!

 

Controlling A/V hardware

Last year we replaced our ‘old’ Loewe CRT TV by a new LCD HD model from Samsung. Bigger LCD screen, lots of pixels, (HDMI) inputs, Ethernet connection, etc.

I’ve also been using a Pinnacle Showcenter 1000 (yeah, it’s really old 🙂 as media player for years, but the new Samsung TV didn’t support the video output very well, so the Showcenter couldn’t be used anymore and I had to live with the DLNA capabilites of the Samsung. After living a year without a real media player in the living room, it was time to do something about that. And while at it, why not take a closer look at the rest of the A/V equipment? Cause I’ve never been really 100% satisfied with the current Home Theatre system – the DVD player only accepted DVDs after switching the thing completely off and sometimes 1 or 2 speakers just stopped working. You know what…it’s time to replace all the A/V hardware! (except for the TV)

Since I’m always looking for a way to control stuff from my Domotica system, I had an important extra requirement: being able to control (and monitor) my A/V equipment by means of Ethernet, RS232 or anything else I can handle.

The first thing I selected was the HDI Dune HD Max media player. The good reviews and form factor were the decisive issues on which this choice is based. And guess what… the (beta 1 GBps) Ethernet connection can not only be used to stream media to the player or download new firmware, but also to control the player – cool!

On the HDI website I found a document describing how the Dune can be controlled with HTTP calls. With these HTTP calls all of the remote buttons can be ‘simulated’ and there are some more HTTP calls specifically to stop/start and pause media. This is fun!

I started up my Delphi IDE, created a new Device class to see if I could make my Dune respond to my commands. I decided to test the Eject button, like this:

http://HDMAX/cgi-bin/do?cmd=ir_code&ir_code=EF10BF00

I let the HTTP call fire, walked to the living room and – yes, the drive tray was open! Well, when all the remote buttons can be emulated, it’s just a matter of time before I can control the Dune with my Pronto, Touchscreen … well, anything I guess.

But there’s more…

The HTTP response contains some interesting information regarding the player state; things like command status, player state, playback speed, duration & position (depending on the state the Dune is in) are returned:


I wish all things were as easy as with this HDI Dune! 🙂
Next item on the list: a new A/V Receiver.