Akademy ==~*

My badge at akademy
Yes I am.

So, Akademy 2012 is over. A huge thanks to everyone involved, it has been amazing. Met a lot of friends, made many new ones, attended really interesting talks about varied subjects, attended even more varied BoFs, hacked and partied. Even attended the start of the QtQuick workshop (but had to leave for the Phonon BoF before they started handing out N9s :P). A huge thanks also to the KDE e. V. so that I could attend (even without a paying job).

The most interesting results of Akademy are probably the plans for Phonon 5 (and the rest of the discussion about Phonon), the plans for KDE multimedia in general, and I finally managed to revive carewolf’s avkode project. Which is so interesting that it’ll get its own paragraphs.

avkode

Some of you may remember the aKode project from KDE 3 times, which was an audio playback framework made by Allan Sandfeld Jensen. What not so many people know is that he started working on a sibling during the KDE 4.0 times, which also supported video playback, with a corresponding Phonon backend. Unfortunately he got busy with Real Life™, and avkode was left alone in SVN for many, many years. Then along came a bored Sandsmark and first got it to build, updated it to not use outdated ffmpeg API, and rewrote most of the Phonon backend (it was written before the final version of Phonon was release, apparently, so it didn’t really match with how things are done nowadays). Then at Akademy Allan and I sat down and hacked on it a bit, to the point where I am now using it as my main Phonon backend (it seems to work well in JuK, Dragon, Amarok, file dialog previews, etc.).

Why?

I started looking into creating a tiny, minimal Phonon backend, for many reasons; firstly we are now working towards Phonon 5, so I wanted to get a fresh look on how the backend/frontend integration works, and I also got a bit tired of working around bugs in the frameworks Phonon are using. Making a backend that uses ffmpeg/xv/alsa-lib/etc. directly has been something I’ve wanted to look into for a long while now. And when I finally sat down, and looked at aKode for inspiration, I found that Allan had already done most of the work needed. So now we have a pretty minimal Phonon backend (it only depends on Qt, ffmpeg, libxv and alsa-lib), though it doesn’t support most of the advanced features available in other backends (like painting on anything other than the normal VideoWidget).

For now the code is at http://quickgit.kde.org/index.php?p=scratch/sandsmark/avkode.git&a=summary

It is still kind of rough around the edges, and will probably stay like that for a while, as I plan on working more on VLC (I have plans for a KIO access module for example, so we can avoid the ugly platform plugin kio hackery with phonon-vlc). I give no guarantees for it (I’m not even sure it builds on many major distributions at all, since they apparently have started shipping the libav fork instead of proper ffmpeg). And it has no website, logo or documentation for now, though I did put up a PKGBUILD for Arch in the AUR.

Another thing that you’ll notice with avkode is that when using it playback progress bars should be smooth, since it has spatial tick emission (not properly, it assumes that all progress bars are 1024 pixels for now). Spatial tick emission is a fancy name I made up on the spot, where instead of always emitting a progress tick at fixed intervals it emits a fixed amount of ticks per media object, independent of how long it is, so that an application can get pixel-perfect progress bars.

KHTML ♥

Oz Fox of Stryper
A picture of Oz Fox from Stryper I took ages ago. We’re rock stars.

So, after working on the cool “Large image displaying library” in KHTML I decided to look into other parts of KHTML, and work on getting my lolcat page working in KJS/KHTML. It turned out quite easy, KHTML is very friendly, both the code base and the community around it.

So, after fixing a couple of other small issues, I decided to take on Twitter which has stopped rendering properly in KHTML/KJS. Thanks to the excellent debugging support in the khtml kpart, it only took a couple of minutes to track the error down. The issue turned out to be that the maximum stack size in the KJS interpreter was too small, Twitter is serious about its Javascript. The issue is then if we should bump up the maximum amount of stack frames, since if we eat up all the available stack space we can get nasty crashes without Dr. Konqi (the crash reporting tool) showing up. But for now KHTML in git should render Twitter just fine.

Lastly, a tip if you want to debug production sites with long lines in KJS; turn on the “Reindent Sources” option if it is slow, the katepart embedded in the javascript debugger isn’t a fan of the long lines most websites put together.

And as usual, thanks to the KHTML developers for help with everything.

long time no blog

cat
A random cat picture. I like cats.

So, I don’t blog too often, but I thought I’d blog and write down the most important stuff.

Since last time I blogged, I helped write a pure-Java, Android client for the Quassel IRC client, named QuasselDroid. Not strictly a KDE project, but Quassel has very good KDE integration, and many KDE users use it. It lacks some features compared to for example Konversation, but it’s distributed so the compromise is kind of worth it. I had to reimplement the whole QVariant/QDataStream based protocol with just Java, so that was kind of fun. And it’s still one of the most-used applications on my phone, so there’s that.

I also started using Spotify, and found the excellent KDE client Spokify, found it lacked some features, so I implemented those. I think you can see all of them in the screenshot (except for the last.fm scrobbling).

Then I got bored with Spotify not having the music I listen to, so I started using JuK again. I found it missed last.fm scrobbling, so I implemented that (unfortunately liblastfm seems to be a dead project, so I had to implement it more or less from scratch, but whatever). I also fixed cover fetching in it; Yahoo has discontinued their image search API, and Google has deprecated theirs, so I switched it to fetching covers from last.fm (then I could also reuse some code from the scrobbling I implemented. I also fixed a couple of paper cuts before I got bored.

Then I got bored with all the webpages working correctly, so I found my old love, Konqueror (with KHTML). Unfortunately I spend too much time looking at cat-pictures on reddit, and since imgur shows a downscaled image by default, and KHTML only did nearest neighbour scaling (which is fast, but looks kind of crappy), I implemented a semi-quick bilinear scaling (using a trick which I think Ariya blogged about forever ago). Looking at the before and after screenshots should explain. It still looks kind of crappy for ratios over 2-ish, but it’s more than adequate for my cat picture looking.

Then I got bored of my desktop being state of the art, and remembered that there is a very nice, KDE-based lightweight alternative to krunner and plasma-desktop called “Kor Testudo“. Basically a lightweight KDE desktop, with support for plasmoids and everything (much more feature rich and less buggy than Razor Qt in my experience, even if it’s just a one-guy project). Only problem I had was that with a transparent panel it got kind of hard to read, so I implemented optional blurring support. There is an even older and more lightweight desktop alternative called Blazer, but that’s kind of unmaintained and not as feature rich as Kor, and I haven’t really tried it in a while. Last time I had to hack a bit on it just to get it to build. Just thought I’d mention it if anyone was interested.

Lastly I’ve also been using an excellent launcher/krunner replacement called Mangonel for some time now. It’s inspired by Katapult, if anyone remembers that. The only thing I was missing was the ability to launch config modules directly from it, so I implemented that (and fixed a couple of bugs and paper cuts).

Lastly I’ve started writing on my master’s thesis. We’re using a software framework called LIDA which is a generic and customizable framework written in Java for implementing cognitive/conscious systems, and are using that as a basis for our StarCraft: Brood War bot written with the help of BWAPI (an excellent free software project, under LGPL 3).

Lastly, we (me and my buddy, we call ourselves Legendary) also participated in a couple of competitions at The Gathering. We thought we were participating as compofillers, but then we won 2×2500 NOK, so that was a nice surprise, considering it is our first time competing in anything like that. Covered our trip there at least.

I love blurring

Since I wasn’t able to sleep yet, I thought I’d blog. :-)

Inspired by this after installing the latest beta on my workstation (which has a cool enough graphics card for the KWin blurring), I added ~4 lines of code (3 calls to Qt to set a transparent background on the widgets, and 1 to turn on blurring) to Filelight to get this:
lolblur

I won’t commit this now, because it is more of a quick hack to see how simple it was and probably not very usable, but I’ll see if I can make something a bit more usable with transparency and blurring later on in Filelight.

Goodnight.

GSoC, CloudSync, moving from Firefox, Phonon release

So, I’m participating in GSoC this year as a student, working on ownCloud, or more precisely using ownCloud in desktop applications.
Firstly we need to expand the OCS (OpenCollaborationServices) API to handle private key/value-storage for individual users, and then implement support for using this API in libattica. OCS and libattica already has support for notifications from the server to the clients, to easily synchronise all clients when some setting or data is updated.
The only non-trivial problem to solve is of how to handle deletions, especially when some client was disconnected when the deletion was pushed to the server, but I timestamping all items should solve this (if an item doesn’t exist on the server, and hasn’t been updated locally since last synchronization, discard the local one).

Then, when this is working and tested, I intend to write an Akonadi bookmarks resource using libattica for storage, so that we can easily synchronize several sources of bookmarks (there is a del.icio.us resource in playground already, for example). I also want to integrate (optional) support for this in KWalletManager, or maybe in a separate application. Lastly I think synchronization support in the note-taking application Basket would be neat. If someone has good ideas for other applications that could enjoy some cloudifying, please comment, and I’ll look into it, and see if it is easy/feasible in the time I have.

Another thing I started on after a couple of glasses of wine, in a hotel room in Tokyo, was something tentatively called CloudSync, which I intended as a Dropbox/Ubuntu One “killer”, only that it didn’t rely on a proprietary webservice, it only needed something that had a kio-slave (like webdav/owncloud, smb, nfs, sftp, etc.). It’s not usable yet (and relies on some KIO behaviour from KDE 4.5), and the code is close to what I would call a proof-of-concept and generally a mess (I blame the wine). But some students got in contact because they wanted to work on something similar as a SoK-project, so maybe something will pop up there (or I will get bored one evening and finish my app and clean it up).

Also, I’ve been using Firefox for a while now (mostly because of Mozilla Weave, since I’ve been using a lot of different machines, and I suck at remembering stuff). And since I like eating my own dogfood (yum-yum), I thought I’d switch back to Konqueror for a while (or maybe try rekonq since everyone keep raving on about it). But I still suck at remembering stuff, so I wrote a small utility to automagically export all my credentials from Firefox’ password storage. The only problems is that there are ~4% of my passwords that it is unable to decrypt (and I can’t say I enjoy working with NSS, to be honest, and therefore I’m tired of debugging that part of the code), and that Firefox doesn’t store the name of the form the username/password fields belong to, which KHTML/kdewebkit uses as a key to store the credentials under. So I enganged Mr. KHTML (Maksim), and hopefully KHTML in the future will fall back to using the credentials imported from Firefox (and probably kdewebkit too, if someone fixes it).

And finally we just released a new version of Phonon (4.4.2), not much to be excited about, it’s a bug-fix release.
And it seems like the GSoC students working on Phonon are well under way, very exciting stuff. :-D

So, to apologize for the unreasonably long entry, here’s a funny and cute kitten:
I'm not addicted to caffeine, I just need it to function

API documentation

Since api.kde.org has been down a lot lately, I generated some Qt Assistant-compatible documentation from kdelibs, and put it up on my server, and also linked to it from the topic in the #kde-devel IRC channel.
But since not everyone visits IRC, I thought I’d mention it here too.
So, fetch kde45.qch and save it somewhere save, launch Qt Assistant, go to Edit→Preferences→Documentation→Add… and navigate to where you saved the file and add it. You should now have a fully indexed, searchable and browsable API documentation for kdelibs.

In other news, I’ll be working on desktop synchronization with ownCloud as a GSoC project this summer. The plan is to first extend libattica and ownCloud to be able to store and retrieve random values by keys (so a key/value-store), and then utilize that in for example kwalletmanager (for synchronizing passwords), rekonq (to synchronize bookmarks) and Basket (to synchronize notes).

There will also be two students working on Phonon this summer (on AV-capture and low-level audio APIs, much like QtMultimedia, only in Phonon). I’ll try to get them both on planet so they can introduce themselves properly. :-)

Also, I unfortunately couldn’t make it to Randa to the multimedia sprint due to some really lousy exam dates. I wish I was there. :-(

R. I. P. Jan Mette

Saturday afternoon I got a private message on IRC from a childhood friend of Jan Mette; primus motor of the old KDEmod package repository for Arch Linux, and initiator and primus motor of the Chakra Linux distrolet, that he had died friday morning.

Although I never met him in person, we spent a lot of time together on IRC and packaging kdemod before I started maintaining Phonon, and I’m having a hard time putting down what I’m feeling. He had quite a profound impact on my life, and I’m certain I wouldn’t be the same today if we hadn’t crossed paths.

I also grieve for the friends and family he left behind, I can’t really start to imagine what they must be going through now.

More information here.