Me, Raspberry Pi and old TV

In September I visited Akademy in Brno. It was close and sounded interesting (and it was). I met there Bruno and Francoise and tried to help them a little bit with openSUSE booth they organized. It was cool, wasn’t sure how many people I will know there, but I met Cornelius on my way to the venue and when we arrived there, there was already openSUSE booth – really great surprise 🙂 But getting to the point of this post (which is not the Akademy), there was a lottery where people could won Raspberry Pi. I already have better ARM board at home, but as I depend on that one as a home server so I can’t play with it that much anymore, I joined anyway. And to my surprise I won! As I had to leave before the draw, I have to thank Bruno and Francoise for fetching it up and sending it to me, so big thanks to them for everything!

I played with it, found out that getting video output running is super easy, openSUSE 13.2 runs there nicely, so I decided to put it into one specific use right now 🙂

Getting smart TV

TV & RPiI live in rented flat, which was already equipped with TV when I rented it. It is the old CRT one. One of the advantages of Raspberry Pi contrary to the most of the boards out there is that it supports video output even for those legacy technologies. So let’s make some use of it and convert dumb CTR into something that can play movies and streams available online.

First obvious thing I tried was mpv. Didn’t managed to get framebuffer output working, didn’t managed to get wayland working, resolved to the X11 and found out that it can’t play movies smoothly. I was playing with some options, frame dropping and such but didn’t helped. So I started googling how to use hardware acceleration. And I found one disturbing piece of information.

There is hardware acceleration in Pi, but some of the codecs are locked out and you have to pay license fee to unlock functionality your device was shipped with. That sounds crazy. You get a device where parts of it are intentionally locked out so they can ask you for more money to allow you to use hardware you already bought. I understand that problem isn’t the foundation selling Raspberries, but legal protection against stupid patent laws mainly in US, nevertheless, it is silly. Luckily, h264 codec is enabled by default and codecs that you have to unlock this way are only mpeg, which almost noone uses nowadays, and some VC-1 I never heard about before and doubt that anyone ever used. So to get my Raspberry to be Smart TV, I didn’t have to give in to the patent trolls extortion.

So after a little ranting, how do I use that hardware acceleration? I was searching for some vaapi/vdpau abstraction, but haven’t found any. Luckily it didn’t matter much because I found something maybe even better – OMXPlayer. It is standalone video player, that has support for hardware accelerated video playback and works directly with framebuffer so no need for X anymore. Tricky part is that there is an upstream which looks dead and fork that looks pretty much alive. I found that after week of using the original upstream when I started searching for solutions to some of my problems. So don’t bother with upstream, use fork directly. Using this I’m able to play h264 movies and streams (like TV) on my old CRT TV.

Controlling it

Controlling TV via ssh is fun, but not that user friendly. So I decided to cook up some proof of concept of remote web UI. I know I could use XBMC and probably would be better of, but I want my Pi be idle when it is idle and how hard could be to cook something up, right? So I cooked up something really terrible but working 🙂 It is just a bunch of cgi scripts that needs to be run from webserver under user with enough privileges. And it has plenty of disadvantages (like UX, speed and security), but works for me although I will probably have to spend some time on usability soon cause it is starting to hurt even me 🙂

Few last remarks

Yes, it is possible to make Raspberry Pi into TV player running openSUSE without having to resort to XBMC. But I still believe, that no matter what you want, there is better hardware available for similar price. If you are interested in multimedia, take a look at Matchstick. If in home server, there is plenty of Allwinners around, like Banana Pi, Cubie Board (my home server) or Cubie Truck (home server I would choose now).