KMix plasmified [Screencast]

Hello folks, it’s been a looong time since my last post. Three months ago, during the Christmas holydays, and inspired by Aurelien’s posts about how improve UI’s in KDE-Land, I got inspired and started submitting some small patches to plasma and ksysguard, and then I focused on an application I (and I think all of you) use a lot: the audio applet.

KMix has a fancy monochrome tray icon, which makes it appear homogeneous with the other plasmoids contained in the Notification area. From a non-developer point of view, this is great: the user doesn’t need to know the difference between a regular application and a plasmoid placed in the notification area; he/she simply has to use it. The problem raises exactly when we want to use it: instead of showing to the user a beatiful interface which takes advantage of the Plasma API, the audio applet shows the old and plain slider with a regular pushbutton, destroying the feeling of an homogeneous and polished panel. Moreover, if the notification area is embedded in a vertical panel, when you click the KMix tray icon, the widget partially covers the panel.

For these reasons, I started porting KMix as plasmoid. I encountered some troubles so I contacted the mantainer whom kindly told me that port was already started by an other developer. So I leaved that project, and focused on something else. Why this post then, you may ask?

About one month ago my exams session started and, as usual, I got inspired on some projects (daaaamn :P ) and specifically on KMix. I was curious to see how a possible port of KMix to Plasma would look like, so I’ve started this small experiment/proof of concept.

In the video below, you can see what I did, plus a cool feature made possible thanks to Plasma:  a minimalistic media panel :)

(Sorry for the bad quality of the video, but recordmydesktop is not working on natty, plus I’m having problems with fglrx so I’m using the opensource driver1)

[HQ Version]

Some screenshots for those that don’t want to download 53 MB of video:

KMix Applet - Collapsed in an icon

KMix Applet - Popup shown

KMix Applet - Controls shown inside panel

Pretty cool, isn’t it? ;)

However, there are a lot of issues with the current implementation, mostly because I’m using DBus calls to an interface exposed by KMix. Don’t get me wrong: it is awesome, because saved me  a lot of headaches like dealing with alsa/oss and whatever but, on the other hand, the interface exposed to DBus is outdated and far from complete. For example, you can retrieve only the ID of the master device and set/get/mute/unmute only that device, there is no signal exposed for notifying changes of the volume level, so you cannot be notified of the volume level if an other app is modifying it unless you repeatedly poll the result of the masterVolume() call2. Sometimes, when adding/removing multiple instances of the applet3, plasma crashes (this is my fault). Since I rely on DBus calls to get/set the volume, this means that you can’t quit the old KMix application; however, you can open KMix main window, click on “Configure KMix”, uncheck the “Dock in system tray” option, and then close the KMix window.  In this way KMix will run in the background, wihtout showing himself in the notification area, and you can enjoy the plasmoid version :)

If I didn’t scared you enough and you still want to give it a try (until the official version will be released) you can grab the code from my personal repo, and then compile and install it as usual.

Cheers!

_______________________________________________________________

1: By the way KWin’s “Magic Lamp” effect works way better with the opensource driver rather than the closed one, so much win :D
2: The mantainer told me that the developer in charge of porting KMix to plasma is also writing a better and efficient DBus interface, to allow a fine-grained control of the Mixer object, so the official release will really kick ass!
3: I know that it does not makes sense with the current implementation, since I can only modify the master channel, but I like to test all the possiblities :P

KDE project template(s) for QtCreator

Laziness is such a great virtue, sometimes :D

Yesterday I was sitting in front of my computer, ready to start an application from scratch, and I felt very bored when I thought about all the files I need to create every time in order to have a minimal and functional application to start with. You have to write a CMakeLists file (and every time I forget to set some vars, or make some stupid typo), a .desktop file, a main.cpp source file and a class.h/cpp files. Oh God, why QtCreator doesn’t ship with some simple and handy template for KDE projects?

So I sat down, learned how to build a custom template wizard, and here you go: I made three project wizard: one for KDE console app, one for GUI ones, and the last is a plasmoid wizard template :)

And, of course, now I’m gonna showing you some screenshots!

 

Overview of the Projects page

Overview of the options inside the KDE gui project page

Overview of the options inside the Plasma Applet project page

Final result

Of course these wizards are far from being complete, so any comment/suggestion/critics is highly appreciated :)

You can grab the templates by cloning my repository:

$git clone git://anongit.kde.org/scratch/casella/qtcreator_kde_wizards

and then simply copy the folders under $HOME/.config/Nokia/qtcreator/templates/wizards or /share/qtcreator/templates/wizards/ .

Cheers!

Say hello to KDE on Ubuntu Natty Alpha1

Pheeew, after some struggling, I finally managed to compile KDE from trunk (4.6.40) on Ubuntu Natty Alpha 1 :)

KDE SC4.7 from trunk (4.6.40) running on Ubuntu Natty Alpha1

KDE SC4.7 from trunk (4.6.40) running on Ubuntu Natty Alpha1

For those whom are waiting for a step by step guide about how to build KDE SC from trunk, I will not release it until the git migration will be done. The situation now is both delicate and a little messy, with modules partially splitted over git and svn. Almost weekly, a couple of submodules are moved from svn to git, and keep track of that changes in a blog post before a reader tries to build the whole thing is not feasible.

Anyway, Merry Christmas :)

My New Laptop Review

Ok, it’s been over three weeks since when I got my windows-free laptop. During this time, I’ve ran KUbuntu 10.10 with KDE 4.5.?  for about a week, then I moved to KDE trunk as usual and now it’s time to share my two cents (and personal random thoughts and rants) about this laptop :)

Technical Specs

The full reference is listed over here; below, I’m listing only the changes I’ve made from the configuration showed in the website.

  • Cpu: Intel Core i3 330M (2 cores@2.16GHz with 4 threads running concurrently);
  • Hard Disk: removed the default 320GB hd and replaced with a 128GB Kingston SSD;
  • Ram: upgraded to 4GB ddr3.

One really cool thing about this laptop is the possibility to mount up to two (sata) hard drives and, since my old laptop has a sata drive too, data recovery was amazingly easy: I simply had to remove my old hd and install it in my new laptop, and then move the content of my home directory to the new location, that’s all!

Design

Design is the first thing you notice when you unpack you laptop, be it its finishes or its input/output ports placement. Design (and design choiches) affects the way you are going to use your notebook, and it is responsible of the sensations you feel when you see it for the first time1.  Since I really care about design, let’s start with showing some pics I took to both my new and old laptop, and sharing my nit-picking opinions (I’m sorry for the quality of these pictures, I made it with my cellphone):

New laptop
My new laptop
Old laptop
My old laptop

The overall look of the new one is quite good: the 17.3″ screen is absolutely amazing, and the satin-finished chassis gives a professional appearance to the whole.  I said “quite good” because, on the other hand, this laptop gives me a sensation of brittleness due to its tiny screen pivots (in the old one, they are firmer and bigger).

One thing I really  miss in this laptop is the presence of the multimedia keys (play/pause/stop/next/previous); every time I need to change track within amarok, I need to switch the application I’m currently working on, or set a weird shortcut to do the dirty work for me :(

Other minor annoyance  are the ports placement. Let’s start, for example, with the audio jack port. In the following picture I’ll show where they are situated, and the nuisances arose with a wrong2 positioning.

Audio jack placement, new laptop

Audio jack placement, new laptop

Audio jack placement, old laptop

Audio jack placement, old laptop

Audio jack, new laptop

Audio jack, new laptop

Audio jack, old laptop

Audio jack, old laptop

As you can see, the audio jacks has been moved from the bottom-right border (old laptop), to the top-right border (new laptop); since I’m used to wear headphones for about 90% of my time (so does my brother too, in order to listen our favourite songs, watch our favourite movies etc.. without bothering each other), this means a headphone cable always annoying my right hand3. The annoyance is even greater when you play a game (did I mentionend quakelive? :P ), and you notice that your movements are not as fluid as before. An other detail I miss a lot is the wheel volume controller. You can clearly see it in the Audio jack placement, old laptop picture: it’s the first element from the left. This could sound silly, but how many times happened that someone has turned on his/her laptop in the College library, and the infamous login sound spreaded loudly all over the rooms? With a simple wheel scroll-down, the quiet of the library would be preserved :)

The power supply jack is an other example of not so wise™ placement.

Power jack, new laptop

Power jack, new laptop

Power jack, old laptop

Power jack, old laptop

In fact, it is now placed between other I/O devices (ethernet, usb, e-sata and ieee1394), rather than being situated near an edge of the chassis, far from other ports. So, in the worst case (which also happens to be mine), the power supply cable lies along the whole length of the back panel, occluding the other ports and forcing me to manually move it away every time I need to plug-in my external hard drive, or ethernet cable.

Ok, now stop being fussy, and let’s talk more interesting stuff ;)

Hardware compatibility

This is a major point for every Linux user, so I’m going to describe the issues I’ve encountered while running a KDE SC 4.5 from a live-cd distrubution, from an apt-gegt updated version of it, and finally from trunk (KDE SC 4.5.86).

  • KUbuntu 10.10 (with KDE 4.5.?) live-cd: wireless adapter, webcam, bluetooth, memory card reader, screen brightness fully working, suspend/hibernate too. Unfortunately, the audio was completely absent: I’ve tried to tweak alsa and phonon, with no results. Desktop running at the maximum resolution, but with desktop effects disabled.
  • KUbuntu 10.10 installed on hard drive: upgraded to 10.10.1, with KDE 4.5.3: again, wireless adapter, webcam, bluetooth, memory card reader, screen brightness, suspend/hibernate fully working. After tweaking alsa-base conf, I got the sound working from the audio jack, but still no sound from the speakers. I experienced a lot of X crashes with the Ati proprietary video drivers, but switching to the experimental ubuntu repo (ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu/) did the trick :)
  • KUbuntu4 10.10.1 with KDE 4.5.86:  wireless adapter, webcam, memory card reader, suspend/hibernate fully working. Bluetooth keep crashing kded, so it’s disabled for now (I barely use it, however). Screen brightness is not working anymore, so here it is an other interesting thing to investigate during this holidays :P . Audio still refuses to work from the speakers, this is kinda disappointing but I’m also confident that in the next few upgrades it will be fixed. Plasma desktop works like a charm, with all effects enabled and very little footprint, compared with two months ago. Good job, guys ;)

Performance

Ooh, I really enjoyed writing this chapter!

After installing KUbuntu for the first time, I wasn’t that curious to see how much time the SSD took to boot the operating system up. The reason is simple: as every one of you most likely did, I read a lot of reviews about SSD performaces and the opinions were (almost) always the same: the more performant are the Intel ones, next the Corsair, and then the Ocz and Kingston drives. I was absolutely amazed when i discovered that my fresh Kubuntu install took only ~9 seconds to boot, against my usual 30 seconds and more!

Now, with after a month of use, upgrades, and a full switch to KDE from trunk, the boot time is still impressive, around 11 seconds5. Check the video below, if you don’t trust me :P

As you should have guessed from a small detail on that video, I was so curious to test the boot speed on other operating system that I grabbed a copy of Windows7 license kindly offered6 by my University, created a partition,  installed Win7, and performed some tests. And guess what? It took 23 seconds to show the login screen, really slow compared with Linux boot. But the interesting part of the test isn’t come yet. I’ve measured the boot time of my brother’s laptop (a cheap model, 6 months old), powered by an usual sata drive@5400 rpm,  surprisingly scoring only 31 seconds! Just 7 seconds of improvement between a fresh Win7 install on a SSD, and a 6 months old installation on a 5400rpm sata drive… sounds like Windows’ Failboat delivered a huge present to its customers, again.

However, boot performance aside, let’s come back to our Linux/KDE world. Benefits of an solid state disk are more than just boot speed. The whole desktop experience is more fluid, fast and resposive (of course credits must be given to the Cpu and Ram too, see below). One example for all, OpenOffice: every time I opened an office file with it, it took ages to load and open it. Now, the app is amazingly quick.

The same for Dolphin: I have the bad habit to put everything in my home folder to save time and, when launching dolphin in the past, it took over 6-7 seconds to show up: now that time is significantly decreased.

Last, but not least, is the quietness of the whole computer: when it’s not performing heavy tasks, the loudest noise you can hear is the cpu fan.

Ok, I’ve talked a lot about solid state disk performance. Now, it’s time to spend some words about the cpu. As I’ve already said, it is responsible of the snappiness and fluidity of the whole desktop. But, from a developer perspective, what really matters is “How much time does it take to compile the package X.Y?” :P

With my old laptop (running a Core Duo T7200@2.0GHz), I measured the compile time of the QT framework (Qt 4.7.0 RC1, on early September), with the following configure switches

$./configure -qt-gif -debug -fast -system-libpng -system-libjpeg -system-zlib -dbus -webkit -no-phonon -plugin-sql-mysql -developer-build -declarative -opensource -script -scripttools -nomake examples -nomake demos -prefix /opt/qt4

and a MAKEFLAGS environment var set to -j3. With this setup, it took 94 minutes to compile everything.

With the same setup, and MAKEFLAGS  set to -j6, the new laptop scored an incredible result of only 40 minutes! But the detail that impressed me even more, is the overall responsiveness of the desktop: I could chat, watch videos on youtube, and desktop effects were running seamlessly, with small lags between the action that triggers the effect, and its actual accomplishment! With my old laptop, all of this was a mere dream (if someone owns my same old cpu, and ever tried to do what I did, knows exactly what I’m saying).

Kudos to the Intel Engineers for this awesome product, and of course to the Linux kernel developers too, who were able to exploit cpu resources at their best!

And now, the graphics card and the ram. The best way to push  graphic card and ram to their limits is to  –play the latest game?– , of course no! It’s performing real-time computation on graphical data, which means 3D modeling a high-poly object. Unfortunately, I don’t have Maya for Linux here, so I downloaded and installed ZBrush (take a look at it, it’s a very impressive piece of software) and started modeling a sort of alien face using HD geometry. For a graphic card designed to be installed on a laptop, I must admit I was surprised of the level of details I’ve been able to reach.

Wait, the review it’s not finished yet! There is still the audio performance to talk about. Even if the audio is half working on linux, and I hope to get it fixed soon, having an other OS gave me the opportunity to test how all the components works. And, hell, the speakers plus the subwoofer are really kick ass! They play sounds clear and loud, very very loud!

Conclusion

In consideration of all the points I’ve discussed in this post, I give to this laptop 8 out of 10 as final score. The performances are good, but the hardware compatibility with Linux is not as good as I would expect from a high-end laptop. If I was a person with no experience on tweaking linux, I’d probably switched to Windows after the second try on the audio configuration process. Design is fine, but could be better for, again, for a high-end laptop.

I hope I don’t have annoyed you with my loooong and enthusiastic review about my laptop, Merry Christmas and Happy New 2011 =)
A special thanks to my friend Alberto, who spent his time to help me with the ATI driver setup (and his trolling mood too :P ), and to my beloved girlfriend Mariaelena, who bears the weight of my nerd vein!

_______________________________________________________________

1: Sounds kinda romantic, isn’t it? :P
2: In my opinion, of course.
3: This might sound silly but, hey, try working on a computer with your right hand 10 centimeters farther than you were used to, and then we will talk about it.
4: Well, let’s say the basics packages of K/Ubuntu 10.10.1 because, if you read some of my older blog posts, I completely build KDE and QT from sources, so I don’t need the ones supplied by Ubuntu (I apt-get remove all of them after every new system install).
5: Now, I’m REALLY curious to see how long does the boot sequence take on an Intel Extreme SSD …
6: Whooops, i forgot the <sarcams></sarcams> tag here.

Ordered my new laptop, Windows free =D

[Edit:] Got the laptop, time to build KDE :D

This is not a kde-related post, so you can skip it if you like. However, since I managed to achieve this awesome result, I thought it’s worth sharing it with the community :)

As you should’ve noticed,  I’m not on irc anymore because my old laptop broke1 (after more than 4 years of honourable service), and it was my only computer at home. So, during this period, I looked for vendors that sell  linux-based laptops.  The criteria were the following:

  • Linux powered, or no operating system at all (of course ;) );
  • 17″ screen size: since this laptop will be my only computer, I’m going to use it for coding, university stuff, multimedia and I don’t want to stress too much my eyes with smaller screen size  (I’m already myopic asd);
  • Intel i3 or i5 processor;
  • a good video card;
  • a reasonable amount of ram and hard drive space :P

Turned out that most of the vendors that respect my first criteria are located in US, and they can ship their products only in US and Canada (some of them to Europe, but with restrictions) . The only exeption was zareason which ships worldwide but first,  — what if the laptop will broke? I can’t wait months for being fixed — and second, they don’t provide a 17″ model at the moment (unlike System76 does, for example). Of course I found a couple of vendors in italy, but they are quite unknown compared with the aforementioned ones, with little possibility of customization too.

So, before my surrender, I decided to give a last try with my previous laptop vendor (www.enface.it). I was really happy with it: a very good machine2, with an amazing audio and, a bright display and a good processor. Four years ago I was more naive than now, and when the retailer told me — “No, we aren’t allowed to sell you our laptops without XP” — I didn’t insisted; instead, I agreed.

But not this time.

After configuring the laptop according to my budget and wishes, here it is the most important part of our conversation:

Advisor:  “Now, by default this laptop comes out with windows7 Home Premium, but I think an upgrade to Professional would be a wise choice.”

Me: “Actually, I don’t want any Windows operating system at all.”

A: “What?”

M: “You heard me: I don’t want Windows in my laptop.”

A: “Well, this is not feasible because the vendor and Microsoft made an agreement, and we can’t overcome that.”

M: “I’m not pretty sure about that. I downloaded, printed and readed the full Windows7 EULA and, at page 1, it says — “By using the software, you accept these terms. If you do not accept them, do not use the software. Instead, return it to the retailer for a refund or credit” –. I’m saying I don’t want to use that software, ergo you don’t even have to waste your time with installing it; simply skip that step, subtract its cost and that’s all.

A: “I’m sorry, but we can’t. Furthermore, for a smoother and immersive desktop experience, we strongly recommend you Windows7.”

M: “I’m sorry for wasting your time then, because I have no intention on buying a laptop with Windows. I’ll try somewhere else. Sorry.”

A: “Hmm wait, let me make a call to the tech-support, ok?”

M: “Ok.”

[~30 seconds phone call]

A: “Ok, seems like it’s possbile to ship our laptops without OS. However, because of the agreement we and Microsoft made, the cost of the license is far different from the one you can find in a store. We can refund you 78€3 though.”

M: “That sounds great! Where should I sign?”

So yeah, an other little battle won against Micro$oft dictature :D

If some you guys are in the same situation I was, just remember these two things:

  1. never give up, be perseverant!
  2. you are not asking anything illegal, neither you are stealing a percentage of the retailer’s income: it’s your right to refuse Microsoft EULA and, if the retalier doesn’t allow you doing so, he is acting illegally, not you!

I will receive my laptop in about a week, so expect an other blog post with more details soon :P

Cheers !!
____________________________________________________
1: Because of an unfortunate event beyond my control, daaaamn =’(
2: if you are curious, check the tech details here (italian only)
3: About 104$, not so bad at all!

Thoughts about this Summer of Code :)

Yesterday I was thinking about my whole GSoC and what I learned and did during this period and, regardless the evaluation that Aaron will fill about my work, I must admit that this year I’m very excited about what I’ve done :D

In fact, during these months, I :

  • learned the QCA framework, and wrote the authentication library on the top of it;
  • got in touch with their developers, and asked them for improvements;
  • recognized QCA limitations, took the decision to move to the GpgME++ library, learned it, and ported the authentication library to this new library;
  • debated with the open-collaboration-service guys both at #ghns and on their mailing list about adding gpg support;
  • took part in the drafting of the new Open Collaboration Service API;
  • learned how the Attica library works, and modified it in order to make it work with the testerver they put online;
  • improved the KNewStuff3 library to retrieve, process and show the authentication informations.

Compared with the last year, when  I worked on PlasMate, this year I really enjoyed my gsoc, had a lot of fun and met great people.

That’s why I want to thank Aaron for begin my mentor, Frederik Gladhorn and Frank Karlitschek  for our talks about the open collaboration draft and their help with the testserver, Marc Mutz for his help on the GpgME++ library, Justin Karneges for his support with QCA, and Pinotree for his advices ;)

Authentication framework: closing the circle (+ screencast)

As I promised more than a week ago, today I’ll show you the progress done with the authentication framework, starting with signing a plasmoid with PlasMate, uploading that plasmoid and its signature to opendesktop.org within PlasMate, and retrieve it with the Widget Explorer  “Download widget dialog”.

Originally, I planned to show a more detailed screencast but, for an unfortunate serie of events, I started playing on a full functional opendesktop testserver just yesterday afternoon. However here it is the screencast, splitted in two pieces. Alas, I noticed too late that the screencast took so much time (the first part lasts about 14 minutes O.o, but you can skip the last 7 minutes because I’m repeatedly signing and sending some plasmoids on the server to show later the authentication process).  By the way, I hope you’ll enjoy these videos:

Part 1 (.ogv version):

Part 2 (.ogv version):

Cool, isn’t it? :)

However, this is only the beginning: as I mentioned in my previous post, the KNewStuff maintainer (fregl) wants to extend that authenticatiom mechanism for every package exchanged with KNS, so I need to move the library from plasma libs to a more suitable place (perhaps kdelibs?). There is some work to do also in the Attica library, because the opendesktop specification describes multiple signatures and fingerprints (because of the collaboration stuff), and I did only a basic implementation in order to see if everything worked as expected. The KNewStuff3 download dialog needs some love too, because the detailed up to now shows only a string with the signer name and the trust level for each plasmoid; I didn’t implemented a widget with start ratings for the following reasons:

  • there is already a starred rating widget, used for the users rating:  showing two widgets with different star ratings will confuse the user in my opinion, so I opted for visualizing a simple text ;
  • lack of time :P

The grid view is even more complex, because the same informations are condensed in less space, so I need to figure out how to show in a proper way also the authentication information.

PlasMate needs a lot of love too, and I realized it when playing on its code again; perhaps, after this summer of code, I’ll start on rewriting its internals and clean up the code.

That’s all, for now. Stay tuned ;)