Categories
My Media System profiling Programming

MMS now environmentally friendly

Sometimes nice tools just come dumping down from the sky and PowerTOP is the latest of such programs. The Linux kernel 2.6.21 has become tickless which means that instead of waking up at specific intervals it will just sleep until it needs to do something next. This clearly has the potential to save quite a lot of power, but only if it really can sleep longer than it otherwise would have.

Intel has created a tool, PowerTOP, to test which programs causes the kernel to wake up. And thanks to the power of free software they have also been able to fix quite a lot of the programs people use a lot. So tonight I decided that I would run MMS and see how it performed. I installed the new kernel and the tool on my laptop and was ready to test. Initially the kernel was waking up between 60-80 times a second but after starting MMS it quickly rose to 1000! Something was definitely wrong. After a long debug session I finally found the cause of this massive spike in kernel wakeups: SDL. For some reason SDL was initialized using SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER). This small SDL_INIT_TIMER flag caused SDL to start a thread which just slept for 10ms, woke up, just to sleep for 10ms again over and over again…

Luckily the fix was easy and now MMS causes no mentionable extra wake ups 🙂

Categories
My Media System tablet

MMS running on nokia 770

I got MMS running on the nokia 770 today.

MMS on nokia 770

Ok so maybe I cheated a little and it was running on my server and I was just using VNC to connect to it. Anyway it’s working great for music playback 🙂

Edit: Added instruction on how to get this working

Edit2: Better input method

First one must start a VNC server: Xvnc :1 +render -dpms -s 0 -geometry 800×480 -depth 24 -rfbport 5900 -PasswordFile ~/.vnc/passwd

Then MMS can be started using: DISPLAY=”:1″ ./mms -i keyboard

After MMS starts up, one can use the navigation keys on the Nokia for navigating around and then use the house (bind it to F5 in input config) for action and the back button (bind it to ESC) for secondary action and everything will work perfect.

I had some trouble with the NIC on my new server. It apparently only wanted to run in 100mbit otherwise it would drop the connection at least once each second. And since the motherboard (Asus m2n-mx) only had 2 PCI slots, I had to choose between wireless, internet and TV 🙁 Anyway I fixed it by connecting my old 100mbit hub and now everything is running fine so I had some time to play some more with the nokia. The house button is no way near perfect since it minimizes the program and thus one has to press it twice each time. Very annoying! Futhermore the vnc client on the nokia is extremely bad and sends all kinds of nonsense commands. Sometimes it will send and F5 after each other command making the device unusable. So I hacked the keyboard input driver to discard these bogus input and added a mouse input so that one can just touch the screen for action. All works much better than before, but it’s still not perfect so I’m releasing the patch here. The patch is against 1.1.0 revno 1028. I might eventually integrate it cleanly but currently it’s a bad hack.

Uses this setup one can have 2 MMS setups running concurrently. One for the Nokia device and a second one for normal display. I havn’t gotten movie playback working yet, but I don’t find it particularly important since one will want to watch that on big screen anyway 🙂

Categories
My Media System

MMS featured in heise

My Media System has been featured in the German magazine heise this month. The article is categorized under Praxis and has a funny image on the first page of a penguin on a stage 🙂

Can’t wait to pick up my copy tomorrow.

Edit: Add the pengiun 🙂

MMS on stage

Categories
.net On the web Programming

Interesting video on the future of programming

I found this interesting video today. It’s basicly just Anders Hejlsberg, Herb Sutter, Erik Meijer and Brian Beckman sitting around a table discussing future and current trends of programming languages. It touches a lot of exciting subject such as concurrency and the .Net’s ability to mix several programming languages.

It was very relieving that a lot of what was taught in courses at the university where I studied is now reaching mainstream languages 🙂

Categories
On the web

This months cool hacks

Clever hacks of the month:

Categories
Free Software Hacking iola

Creating nice and clean patches

I was creating some patches for tracker today from a rather large amount of local changes which was nicely filtered together. Some source files had several independent changes that I wanted to extract and submit as a single patches instead of one big megapatch. So I looked around and found out that the OO guys have created a script to do exactly that. It takes as input a regular expression (the script is created in perl so one gets the nice regular expressions from perl) and a diff and spits out a clean diff + the rest of the changes.

Categories
Free Software Hacking My Media System VCS

Bzr kicks gits ass

So I’ve been known to rant about bzr before. I got a new machine recently and it came to my attention that it quite a pain to keep two local bazaar branches in sync. So I thought I would have a look at the new breed of revision control systems: git and bzr.

My first preference was git, mainly because of what I said in my rant post. So I installed it and got my arch repository imported. I then tried to see how it handled merging of two branches. To be fair the branches have diverted quite a lot but the change was extremely simple: two identical po files where one of them has been updated. It completely fall flat on its face and I had to manually merge the changes. It also failed to find a merge point between the two revisions so I had to cherry pick changes by hand. After some more testing I tried to merge my local repo to the mms mirror using ftp. Sadly ftp is not supported so that was kind of the last drop that made me think twice about trying out bzr.

So I installed bzr, made it import my two branches and went to sleep (it takes a long time since it takes all my 1000+ changes). After I woke up I played around with the different commands. It’s really a pleasure to work with the system. I guess the clean start was a very good thing. Every command just work like you think they do, you don’t have to use a lot of time learning the system. E.g. when you want to mirror an archive you just do bzr push sftp://somewhere. It will automatically remember that location and just use that path the next time you push. So far it has been working great and I even put all of my cxfe patches into a repo since it’s just so damn easy. It handled the arch import with grace and I have been able to pick of where I left in baz. It can merge the two branches without and problem. The only small bug I have hit so far has been that it won’t work if your ftp server doesn’t support renaming (sunsite doesn’t) but at least it has been confirmed and added to their bug db so there is hope that it will get fixed.

Categories
Free Software Personal

Back from FOSDEM

Last friday I was very afraid that I was not going to be able to attend FOSDEM due to a large amount of snow in most of Denmark. Luckily our flight was not canceled so it was just a matter of getting to the airport. Easier said than done, the busses was not driving because of the weather and the taxi companies phone system was overloaded. But we managed to reach the airport in time and after several hours of delay in both Aalborg and Copenhagen, we landed in Brussels late friday night.
snow

It was my first time there. I’ve been to linuxtag and linuxforum before and I must say that this event beats both hands down. There was a lot of interesting talks, some of which can be found here, and in general everyone seemed to be in a very good mood – especially sunday. My favorite talks was Jim Gettys OLPC talk, Miguel de Icaza’s mono talk and Federico Mena Quintero’s extremely funny Profiling talk. Be sure to watch that one, it’s both entertaining and learningful.

Categories
Movies

Time for a free alternative to iMDB?

After writing my last blog post, I wrote to iMDB to hear what they thought about my first suggestion. They have a whole department for this kind of stuff 🙂 Sadly they weren’t that happy about it: “The minimum cost to license data from IMDb is US$15,000 per year. If that is within your budget […]”. So I guess I’m back to the second solution: create a library for passing iMDB html pages. While thinking about the whole thing yesterday, it hit me (hard), that it’s quite strange there is no wiki-like site available for this. The idea is to use a wiki-like site, with a little stricter syntax so that it’s easier to pass, colored with a voting system. The same concept could also be used for music. While wikipedia does have some classic movies, it does miss the voting feature. So why hasn’t this been created before?

Categories
Movies My Media System

imdb page layout restructuring

Seems imdb has changed their page layout again. This is bad news for all parsers, such as MMS, which relies on the format of the html structure for fetching information. Luckily MMS has already been updated and now works with the latest page layout. Expect a release soonish. There are two things I would like to do to better this current playing catch up situation:

  1. Find out if imdb is willing to give FOSS projects access to their xml data
  2. Create a library, like imdbpy but in c++, to encapsulate the imdb parsing if 1 fails