Categories
My Media System Programming

It’s all the little things

Having been coding in c# for some time now, what is really nice about the language compared to c++ is the foreach statement. The syntax is really natural and easy to read:

     foreach (string s in strings)

Compare this to the standard c++ notation:

     for (vector::const_iterator i = strings.begin(),
             iend = strings.end(); i != iend; ++i)

So I decided there must be something easier and vague remembered that boost had something for this. And low and behold they had. So now instead of writing that horrible for line, one can just write:

     foreach (const string& s, strings)

It’s not quite as nice as i c# since one can’t have a pair on the leftside of the comma, so one needs to be using typedefs to fix that. And one must also remember the & as to not create unneeded copies of the string.

And the best part is that it’s written as a bunch of templates and macro’s so one can just include a header and of it goes. Doesn’t even have to change the Makefile 🙂

I’ve converted the whole MMS 1.1.0 code base to the new syntax and it’s really so much easier to read. Especially because I tend to use better names for the loop variable than i 🙂

Categories
Free Software My Media System

CXFE 0.9.2 released

A long time ago, Rett D. Walters created a console frontend for Xine so that we could use that in MMS. I’ve since the last release created quite a few patches for it, and because Rett wasn’t actively maintaining it anymore I decided to roll all my patches into a new release:

http://people.iola.dk/anders/cxfe/

Categories
HTPC My Media System

My Media System 1.0.8.4 released

A new stable release of MMS is out. This is a bugfix release and so 15 bugs have been fixed and no new features implemented. Upgrading is recommended.

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
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
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
Categories
Free Software My Media System

Going to Fosdem

I’ll be attending Fosdem this year, staying at the Atlas Hotel. Let me know if anyone wants to meet, especially if you’re using MMS. I had that wonderful opportunity at Wacken last year and it’s always nice to talk face to face with people that you have only talked to over email.

Categories
HTPC Movies My Media System Personal

Building a 100″ projector screen

I have so far projected the picture of my Sanyo PLV-Z4 projector onto the wall. Clearly this is not optimal, so I have been looking for a screen for a while. I decided to built it DIY-style this weekend. It’s a lot cheaper than buying one from new and can give excellent results. Plus there is nothing to beat the feeling of having created something yourself.

For the project the following materials was used:

  • 228x131cm 16mm MDF board (screen size calculator).
  • 40mm wide wood frame
  • 1 liter of very low gloss paint. The color code used was S-1502B (I think it’s a european standard).
  • 100 ml very low gloss black paint.

The wood was bought at Bauhaus and the paint at the local paint shop.

After we carried the board up the stairs it was quite clear that it was perhaps a little too big for the wall. But after some rearranging we got it to fit 🙂

Here’s a picture of the screen being painted.

painted projector screen

I have been super happy with how it turned out. First a picture of a TV source (4:3) projected on the screen.

projector screen 4:3

Finally a picture of the result with a 16:9 source.
projector screen 16:9

Sadly the camera on my phone doesn’t do the final result justice. More pictures with real camera here on flickr.