Nov
24

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).

Apr
03

Help MariaDB gather some statistics!

MariaDB logoI was browsing around the Internet (don’t remember what for) and I accidentally found one cool aspect of MariaDB. There is a feedback plugin and this short post is meant to encourage you to use it!

Ok, so what it does and why should you opt-in to be spied on :-) It takes some information about your MariaDB server including it’s usage and it will send it to the MariaDB folks. It doesn’t send private data from your database. It sends stuff like what OS are you running, what version of various plugins, how did you tweaked the default settings and also how big and how busy is your server. Now a short list of why I turned this on:

  • Why not? Doesn’t cost me anything, nothing from the data I send is secret.
  • When I develop an application, I’m always happy when somebody uses it. This is an easy way how to tell developers, that they have here one happy user :-)
  • Easy way to contribute. It’s really simple to turn it on, it will help MariaDB folks make better database and doesn’t require much effort from my side.
  • Selfish reason – if they see that plenty of people use MariaDB the same way I do, they will focus more on my use case :-)

But all these data are not only available to them, they are also making some nice graphs out of it. That way, I can find out that there is at least another 27 guys running latest 10.0.10. Also I found out that there is not many reports from openSUSE folks. And that is one of the reasons to write this blog. If you are running MariaDB on openSUSE, please turn feedback plugin on to show that we have plenty of people using MariaDB :-)

How can you turn it on? Simple, login to your database and activate the plugin using following command:

INSTALL PLUGIN feedback SONAME 'feedback';

Now just wait till your reports will show up in statistics. If I got you interested, you can read more about the plugin on MariDB website (it can report to any url, not only MariaDB one, you can use it for monitoring). While waiting, browsing already collected statistics is also interesting ;-)

Mar
20

My Jolla applications

One of the things, that I really like about Jolla is the technology to write applications. C++ is my favorite programing language and I always admired Qt. At least big parts of it. So when I got my Jolla, I started playing with SDK and writing some simple applications. It was kinda harder than I expected, but I’ll write about there in separate blog post. This one is dedicated to the applications I wrote and to show what do they do. And if you have a Jolla, maybe get you interested in those ;-) Both of them are available via OpenRepos and Harbour.

Hunger Meter

This was the first application I wrote. I was wondering how power hungry are various applications. On Android I used to have CPU usage monitor and I know that surprisingly many applications take advantage of CPU to the full extend which affects a battery life. Since I was writing the application I decided not to go for CPU usage but directly for what I was interested in – battery usage. First version was really simple, it just showed two numbers – current consumption and average (over ten seconds) one. But that already helped me to find out, that if you want to drain your battery fast, use Angry Birds :-)

I haven’t stopped developing after first version and continued extending functionality. Currently time intervals are configurable, it displays semi-nice graph for the longer interval, displays some basic information about battery and collects long time (day and more) statistics. These are not plotted yet, that is part of my TODO.

If you are interested, you can get this application from OpenRepos where is the last development version or from Harbour where is the last stable version (one that was successfully tested in OpenRepos). Sources are available on GitHub and here are few screenshots :-)

HungerMeter - CoverHungerMeter - Settings

HungerMeter - GraphHungerMeter - Battery

Crest

My second application is also simple. It’s top-like application. Shows processes, how much memory (RSS) and CPU they use, allows you to sort them, filter for GUI applications only and most importantly – allows you to kill processes you don’t like. Not much more to write about in regards to this. Just a set of links to OpenRepos and GitHub and few screenshots.

CrestCrest - kill

End note

I wrote some applications when I was using Palm OS. When I switched to Android, I never forced myself to cope with Java thingy. Although there are some nuisances in developing for Sailfish OS (more about them next time), I’m happily developing applications for my PDA/CellPhone again :-) So if you have Jolla and like my ideas for applications, try them. You can report bugs/feature requests via issues page on GitHub, maybe I’ll respond. If you submit the patch, chances that I’ll respond are much higher :-)

Mar
18

Cool Live flash GSoC idea

openSUSE Flash drive

openSUSE Flash drive

I have this idea nagging me for a while about how to make our ambassadors live (and mine) easier. From time to time you need a flash drive with Live version of our favorite openSUSE to show it to people. Currently it is really simple to create one using dd. But once you do it, you cannot use flash drive for “normal” purposes. People somehow doesn’t appreciate flash drive that doesn’t contain vfat. So this project is about redoing openSUSE flash drive to make it way cooler and more usable.

There are two projects out there that inspired me (or that I want to copy). It’s Slax live distribution and SystemRescueCD. Both are great and I would like to pinpoint some of the goals that project should reach.

First of all, whole flash drive should contain vfat or ntfs or some commonly supported dumb filesystem. Nothing fancy. And everything should be just a file on that flash drive. If you need to transfer quite some data, you simple delete few directories, use flash drive as a storage and then copy those directories back.

Other feature that should be implemented is to make it easily possible for flash drive to contain multiple flavors of distribution at the same time. So during the boot, you will be able to select whether you want to show Gnome or KDE. Adding new flavor should be easy – copying files with new flavor to the flash drive. Same to get rid of it – just delete Gnome flavor files and Gnome version is gone from flash drive. This is what Slax manages to do really well, although they try to combine everything into one distribution. I wouldn’t go that deep in regards to modularity for this project, but selecting which live version do you want to boot sounds like a good idea. It should be also possible to decide whether changes you make while running this Live distribution are stored permanently or lost after reboot.

Now how to make it cool for Ambassadors? I think we are not rich enough to give everybody his flash drive during conference. There are two options that I would like to see integrated in this flash drive project. First, it should be possible to boot from flash drive and load everything into memory. So people can come to the booth, use flash drive to boot openSUSE, leave and play with it till reboot and we can reuse the flash drive to boot another computer. Other cool option to have would be to make it possible to to distribute this Live version over PXE, so we can have just a few ethernet cables on our booth where people can connect to boot openSUSE.

Personally I would love to have something like this. And few students already shown some interest in this idea, so it might even happen. If you just decided to apply as well, feel free to submit your proposal to the melange and I have a simple homework for you (can be sent during reviewing process). My friend tried to run Live KDE over PXE few weeks ago and run into trouble that NetworkManager was messing up with network and thus his NFS root was having some serious troubles. Your homework is to solve this issue :-) Take an initrd from openSUSE 13.1 Live KDE and modify it so when you are booting vith NFS root, it will disable NetworkManager. Send me the result (either description or initrd or both) and the best solution (from maintainability and robustness point of view) wins.

Jan
18

Importing SMS from Android to Jolla

This is just a little note related to my last blog about Jolla. I wrote that I’m pretty fine with messaging application although I don’t have many SMS yet in my phone. Well, I fixed that :-) I imported all my SMS messages from the backup of my Andriod phone.

I searched around and I found really interesting thread on talk.maemo.org that describes how to import SMS from n900. As they are doing it via csv, it was easy to put together a simple one-liner that would produce the csv from my SMS database. Now how to do it…

My database used to be at /data/data/com.android.providers.telephony/databases/mmssms.db. You can get it from your phone to your PC for example with

adb pull \
  /data/data/com.android.providers.telephony/databases/mmssms.db

Now download the script and get your csv

curl http://susepaste.org/view/raw/49179811 > sms_export
sh ./sms_export mmssms.db > sms.csv

What is left is to fix all the extra newlines in SMS. But without fixing them, the import program just imports messages without newlines which was good enough for me as most people don’t use new lines in SMS.

Now time to play with Jolla and that part is simple thanks to Merlin1991 who wrote importer application. I will assume that your are sshed on your Jolla and and you copied your csv file over to the current directory. Now what is left on device is following:

curl http://cdnm.at/~christian/Harmattan-SMS-Boat/jollaImport \
   > jollaImport
chmod a+rx jollaImport
./jollaImport -s sms.csv

And SMSes are transfered from Android to Jolla :-) Many thanks to Merlin1991.

Older posts «