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)

[ ?posts_id=4858227&dest=-1]

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



1: By the way KWin’s “Magic Lamp” effect works way better with the opensource driver rather than the closed one, so much win πŸ˜€ ↑
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 πŸ˜›β†‘

24 responses to “KMix plasmified [Screencast]

  1. Yes, yes, YES! Man, this is just awesome πŸ™‚
    I was always hoping for a KMix port to plasma, hope this will be in 4.7 πŸ™‚
    And then we just need a port of Klipper and then everythingβ€˜s perfect. Thanks for the update(s) πŸ™‚


    • Thanks but, as I said, this is only an experiment (and I used it to start learning how to use DBus πŸ˜› ); we have to wait for the official release and, in the mean time, play with this toy if you want =]

      P.S: klipper is on my todo-list as well πŸ˜‰


      • Okay πŸ™‚ I have seen that you cannot resize the widget yet? Sure, this is going to be implemented? πŸ™‚
        And, donβ€˜t the rotation buttons at the widget have an effect on the widget content? Or have you just been too busy implementing this and used this Flip horizontally/vertically menu entry for this?


      • That was my design choice: if the widget is vertical, set its height to the screen height/4 ; if horizontal, set the width to screen width/4. You may ask why, and i’ll answer you: because the 1/4 ratio fits good all over the screens. Therefore, the uselessness to set the widget resizable πŸ˜‰
        About the rotate menu action, I wanted to provide an option to show the widget horizontal/vertical when it _pops out_ from a panel. Take a look to these screenshots:

        1. KMix Applet vertical on vertical panel
        2. KMix Applet horizontal on vertical panel
        3. KMix Applet horizontal on horizontal panel
        4. KMix Applet vertical on horizontal panel

        and now, which are the less “intrusive” applets shows in these screenshots?
        In my opinion, the first and the third, because they have the same orientation of its containment.
        Anyways, you are a smart guy: even if the applet would be placed in the desktop, you should have noticed that flipping the widget with my action, and rotate the widget with the applet handle provided by Plasma, produces very different effects: with the latter, you rotate the entire widget, which means the labels hard to read, icons flipped, and a slider with a different behaviour (guess what happens if you rotate it by 180Β°).


    • Yep, I saw it a long time ago but I’m running KDE compiled with the latest sources. This means having the bleeding edge apps, but has also some side-effects. One of them is that I hardly can get kdebindings module compiled (I really admire their mantainers and devs) because small changes in the api made the bindings fail to be built. In my case, I can’t run steadily veromix because it relies upon Python bindings for Plasma, and I don’t have it. That’s an other reason why I wanted to make this small experiment.


  2. Beatiful, can’t wait to have it on my desktop :p

    It would be nice if someone gave Klipper same kind of makeover.


  3. The idea is brilliant, i waited for this for two years now. Just a small note, i think vertical orientation should be used by default, its just not natural to use mousewheel up/down when the slider moves left and right.


  4. Since kmix has removable tabs (kde 4.6), it is completely unusable with pulseaudio, see bug

    I think it is very difficult to write another gui for kmix, because kmix is more complicated as it seems (different backends, route pulseaudio-streams to other outputs, define default soundcard,…). Thats why I would more like to see more fixing for remaining issues (bug above, and for example it is still not possible to select “monitor-of-soundcard-xx” as input source for pulseaudio-streams).


    • Ok, but:

      1. this is just an experiment, as I said;
      2. I’m not a KMix developer.

      That’s why I decided to use that DBus interface, to avoid digging inside KMix internals πŸ˜‰
      Posting bug reports here won’t solve anything, you should contact the mantainer instead πŸ™‚


    • You are welcome =)
      The applet options are not yet implemented (sorry, I forgot to disable them :(). However, if you meant if it’s possible to select different channels, the answer is: with the current DBus interface, no. Only the Master channel is available, PCM, headphones, speakers, mic aren’t.
      But don’t worry, I’ve talked with the developer whom is rewriting that interface, and his work looks promising, so in a near future we will offer also mixer options πŸ™‚


  5. Pingback: Experimentos con KMix : KDE Blog

  6. Make it so you can show a panel with all the current apps playing / recording audio, VU meters and volume controls, and I’m sold. pavumeter has got you guys beat there.


    • KMix supports this since KDE 4.6 when running in PulseAudio mode. Some distros already backported it to their 4.5, too, e.g. Fedora.


  7. Pingback: [Screencast] KMix QML Applet, the real one « [Po]lentino's blog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s