KMix on KDE Frameworks 5

KMix on KDE Frameworks 5KMix is now ported to KDE Frameworks 5. After a one day long porting effort, the basic functionality of KMix is available: Main Window, Systray, Volume Key Shortcuts, Sound Menu, volume save and restore. More sophisticated parts require more efforts and are currently missing, like the On-Screen-Display (OSD), which requires a port to Plasma 2.

Soundcard hotplug and unplug is also not yet available, as support for this has been dropped from KDE’s Solid libraries. Alex Fiestas explained during the KDE Sprint that it was necessary to reduce complexity in Solid, and that Soundcard hotpluging is not a very widespread usage1. The required code will thus move to KMix in  a later porting step.

The part that looks most changed optically is the configuration dialog. In the picture you see some style changes from KDE Frameworks 5.

All other changes can be seen in .

1 To avoid confusion: “Not widespread” refers to the number of applications using this feature. Users tend to hotplug their devices obviously frequently.

KDE Sprint 2014

Randa - the place of the KDE Multimedia  Sprint 2014

Randa – the place of the KDE Multimedia Sprint 2014

Currently a KDE Sprint is taking place – which means 43 people meet in Randa (Switzerland) and dedicate 7 days in a row solely to KDE.  Some topics are KDE Frameworks 5, gluon and many multimedia related topics like Amarok, kdenlive and KMix. I am attending to work on three main matters.

Polishing KMix

This mainly concentrates on generating a better user experience. It is not about adding new features, but about perfecting what we have.

High-DPI support was contributed by Kai Uwe Broulik. Icons now follow your icon size settings  in the KDE Control Center. If you own a High-DPI display and have not yet adjusted the icon sizes, you should do that. Setting most icon sizes to 32 pixels (and desktop: 48 pixels)  did the trick for me (Systemsettings -> Symbols ->Extended).

Jonathan Marten contributed an enhancement to the “Select Master Channel” dialog. It exchanges the radio buttons to list view, which is also the recommended way in the  KDE HIG).

There are various polishing actions that you can follow on KMix’s QuickGit. Most noteworthy is a fix for the configuration dialog that some time ago became ridiculously wide. The cause was very interesting: A very wide warning text about a missing “kmix_autostart.desktop” file. Even though the text is usually hidden, it had an effect on the width of the dialog.

Open topics cleanup

Reviewboard, the bug system and personal mails are the most important sources for open topics. My real life always wants me to do other things, so I am working on the accumulated backlog. Obviously it will not be possible to clean the complete bug system from KMix issues and wishes, but I will tackle a couple. Interesting too many people, there might be a new approach on the login delay problem. While there is still no real solution in KDE 4 in sight, I will try a workaround. By artificially delaying the application initialization,  KMixD will hopefully appear later on DBus which may solve some deadlock situations.

Determining the future of KMix

The release of KDE Frameworks 5 is a major change. Porting KMix has not yet been started, and before doing so it deserves discussion what role KMix should play within. Multimedia people will gather in BoF style to discuss future needs. The discussion can lead in various directions, like strengthening the background service (KMixD), moving to a default interface that is more plasma-like or separating the components more (tray icon, tray pop-up, main window, KMixD). I am sure other participants will have further ideas. I will keep you updated about this topic in this blog.

Scripting KMix via DBUS : kmixremote

KMix has a long history of having a remote interface. But whether it was based on DCOP or DBUS, it has always been an expert tool. For some common tasks like muting the master or setting a volume, the hurdles have been too high for many users and script developers.
Starting with the next release KMix ships a small script kmixremote, that makes things very easy: You can mute, get and set volume levels, and list soundcards and controls. This bash script can also serve as a starting point for developers interested in creating scripts or 3rd party apps.
This was a two hour excursion back into bash scripting for me. I found it entertaining as I am not doing a lot of those anymore. I hope you find the result useful.

Local usage example:

Shown are (in this order) listing soundcards, listing controls of a specific soundcard. After that reading, modifying, and reading the (modified) volume level again:

chris@whitefall # kmixremote list
chris@whitefall # kmixremote list  ALSA__Creative_X_Fi_1
chris@whitefall # kmixremote get  ALSA__Creative_X_Fi_1 PCM_0 
chris@whitefall # kmixremote set  ALSA__Creative_X_Fi_1 PCM_0 70
chris@whitefall # kmixremote get  ALSA__Creative_X_Fi_1 PCM_0 

Remote usage example:

Remote usage does not differ from local usage. You only have to make sure you have a remote login, and permissions to access the X11 server where KMix is running. In the example, I am using “DISPLAY=:0”:

chris@remote-pc: ssh user@pc-with-kmix DISPLAY=:0 /usr/bin/kmixremote

SoundMenu additons. New KMix Configuration Dialog.

Responsive KMix

The new Configuration dialog (right). The Sound Menu (left) reflects the selected controls, and also shows the new “Pause” icon, as Clementine is currently playing and can be paused.

I took a small vacation from work to research relocation possibilities. While I was home I also spent time on completing the announced configuration dialog update and for updating the Sound Menu. KMix is more responsive,  playback changes being reflected by KMix. Thanks to the communication infrastructure established done during the Multimedia Sprint 2012 in Randa it was easy to keep KMix consistent. Additionally I refactored  the code for future additions like showing album picture.

  • Media Player playback status is reflected by Sound Menu. Shows media-playback-start or media-playback-pause.
  • Configuration dialog overhaul; Options are grouped in tabs and the apply button is responsive.
  • Configuration of the Sound Menu has been integrated in the configuration dialog as separate tab
  • Volume Overdrive up to 150% now officially supported for PulseAudio due to popular request.
  • Less CPU usage and latency for MPRIS2.
  • Sound Menu position optimized for all 4 panel positions (Bottom, Left, Top, Right)

The end of year 2013 is nearing. We will all see an exciting Year 2014 with Plasma 2 waiting in the wings.

See you all there,

Technical stuff

If you are interested in the source code changes, is the biggest commit, and it also contains references to features and bugs. For the technical interested: It is based on KConfigDialog and KConfigSkeleton [1], which is a very cool technology I discovered recently. If you do not know KConfigDialog and KConfigSkeleton, here is a short overview:

KConfigSkeleton + KConfigDialog

  • KConfigSkeleton links configuration entries from a property file with variables (e.g. a QString)
  • There are methods to copy from property file to configuration variables and vice versa
  • KConfigDialog can use a KConfigSkeleton, to prefill e.g. a related QCheckBox
  • KDE Techbase recommends KConfigXT. But KMix is a fine example without.

The OpenSource Eclipse Kepler C++ KMix productivity boost

Today I’d like to share a revelation with you:

Developing C++ can actually be fun.


How you work can define your productivity

In the next sections I will tell you a bit about how I develop KMix today, and why the newest toolchain gave me a productivity boost. As a peek ahead, this post is mainly about developing KDE applications with Eclipse.

If you just came across this post via searching for Eclipse,  C++ and cmake, then you might want to directly head to the practical example at the end of this post.

The core message is that the environment you work with can have a very high impact on productivity. As an example, see the picture to the right from my office: Isn’t this a more comfortable environment than – a cubicle? OK, I was talking about productivity, wasn’t I? So lets forget the image quickly. 😉

The C++ nuisance and rant

Honestly, most of the time  C++ development is a nuisance for me. For a better understanding, you should know that I am a 95% Java developer nowadays. And if you do a lot of Java, C++ is full of strangeness:

CMake and Eclipse as a rescue boat

If you get good tool support, C++ can still be a very good language. CMake helps a lot. For the source code editor it is more complicated: In the past I used every viable tool for KMix development, including misc versions of emacs, vi, aXe, kate, KDevelop and Eclipse CDT. All have their own strengths, but I could use none of them well for KMix development. Then recently I did a new shot at Eclipse CDT (Kepler based), and I am actually delighted.

  • The CMake integration now works flawless for me
  • The C++ indexer is super-fast and reliable (a massive weakness in former versions)
  • Navigation for header to source and back finally works and is very fast. Signals and Slots are parsed correctly and can be navigated.
  • Call hierarchies work great most of the time. In some C++ specific constructs they do not work, but using “references” is a good alternative.
  • Even the strangest #define and #include constructs work as expected.
  • Warnings, Errors, TODO’s and so forth are shown by default very appropriately in the editor and the other Eclipse Views. Very comfortable if one is accustomed to Eclipse.

KMix is a pretty small project, so mileage may vary for your project. Still I recommend to try “Eclipse Kepler CDT” if you have not done so recently. It brought back the fun in development for me.

Practical guideline for developing KDE applications with Eclipse

The basic step to build an Eclipse project is:

cd kmix-git-trunk.obj; cmake -G”Eclipse CDT4 – Unix Makefiles” ../kmix-git-trunk

As a reference, kmix-git-trunk.obj is where I build kmix, kmix-git-trunk is the GIT checkout. After that you can import the project into Eclipse. Run the above command again whenever required and refresh the whole source tree in Eclipse (F5) after that. Personally I am using Eclipse only to edit the source code, to navigate and browse quickly through sources, headers and includes. Everything else I am doing from a console window, like building, running, debugging and version control (GIT).
(Update 2013-12-16: Debugging works fantastic from within Eclipse, so I will use that from now on)

Thanks if you read until the end. If you have any input, experience or feedback, please leave a comment.


Secret view in the new configuration dialog

2013-11.KmixConfigDialogI decided to devote some time to polishing KMix. I cannot reveal too much at this point, but here is a sneak preview of the new configuration dialog. This dialog got more and more crowded, so I decided on a tabbed design like many KDE applications use.Also it will be a central place for all the configuration, including Sound Menu and OSD.

Feedback is welcome, but keep in mind that this is a very early preview snapshot. I will commit the work in one or two weeks, when the development line gets “unfrozen”.

KMix Mission Statement 2013 and KDE 4.11

Dear KMix Users, and reader of this blog [1]. This is a mission statement.KMix KDE 4.11

“I am now happy. Happy with the KMix version shipping with KDE4.11. Happy that I can now declare Media Play control as stable.”

You might neither be surprised or impressed or as happy as I am now. Here is the explanation: For years I mainly maintained KMix for following up with changes dictated by the outside world. The last year was very different and awesome – last year’s KDE Randa Meeting brought enough motivation to do critically needed  KMix refactoring, and add support for media player contol (MPRIS2). KDE4.11 stabilizes the media player support. It is now really smoooooth. 🙂

Enough talking about me, and back to you, the user. Integrating media player control (MPRIS2) was dramatical harder harder than I anticipated. Issues arose where I did not expect them. I sincerely apologize if you endured issues, hangs during start or running the KDE Desktop due to KMix. Please go for KDE 4.11. All will be well now. If not, let me know. 🙂

I thank everybody involved, especially apachelogger for practical advice and Albert Astals Cid for coping with me technically being too late for KDE 4.11.

[1] Well, I guess that everybody reading this is a KMix user.  But not the other way round. 😉

Back on track for Sound Menu

_TSF0831I had busy months after KDE 4.10, alas it was all about  KMix unrelated actions, like my Java Job and theatre performance in Jekyll & Hyde. So work has piled up, but I am happily announcing that I am back on track. I did an initial cleanup session some weeks ago and will continue this weekend. So what will happen (I’ll keep it short):

  • Fix hangs for MPRIS2 backend
  • Prepare for  KDE 4.11
  • Cleanup Reviewboard
  • Fix MPRIS2 polling: Trunk has a working version, but it consumes too much CPU.
  • API documentation: Especially about how to write a proper Backend, including polling versus event-based mode (the latter is strongly preferred).

So everybody who still waits for an answer from me should have it next week – don’t hesitate to contact me – I will promise not to bite. 🙂

Desktop Linux – Steam as a new Chance

I enjoy running my Desktop  under Linux. And while I am a long-term KDE supporter, my desktop diverges from the standard KDE setup quite drastically: There are no “Activities”, no noticeable Plasmoids  and nothing on the desktop except one folder view. This flexibility is exactly Linux greatest strength, but the average users neither needs nor want this. Wikipedia claims 1.19% desktop market share – a stagnation at best. I do not want it to go down. So who will give Linux Desktop a new push?

Canonical has recently started diverging drastically from other distributions – no KDE, no Gnome, just Unity including intentional AdWare and privacy issues and a built-in Software Shop. This un-unifying does not help Linux.

Now Valve has entered the Scene – providing Steam, developing the Linux based Steam Box, and doing native ports of their game engines and games. While at beta, Valve is already doing things the Linux way: You have desktop files, it integrates into the package system, installs requirements like 32-bit libs  and so forth. Valves investment is a good thing. They are tackling many issues that bring Linux forward, for example pushing hardware vendors like NVidia or providing a better fullscreen mode [1].
So I will be positive and count Valve’s work as a second chance for Linux Desktop and Multimedia. Users are more likely considering Linux if there are well-known games around.

KMix in Half Life 1

Half Life under Linux requires PulseAudio. In the middle: KMix OSD.

[1] Fullscreen mode has sometimes quirks:

  • Unexpectedly leaving fullscreen. For example some Flashplayer  applications or “Trine 2” may leave fullscreen when you press KMix volume buttons (even w/o OSD)
  • Problems with global keyboard shortcuts. Apps can sometimes take away keys from fullscreen applications
  • Popups showing up. The image above shows the KMix OSD in Half Life.

KDE 4.10 available in January 2013 – run your Test Drive now

Christmas time is always busy – this time another topic kept me even more busy. And that was the release of KDE 4.10 RC1. If you have some spare time you are invited to run a test  drive. KDE is running an extra detailed beta-testing program throughout the 4.10 beta and RC releases. For many distributions, updating is quite simple.

Participate in the KDE 4.10 Test Drive

If you do, I am happy to read your comments. While you test, I am doing media player compatibility tests, this time with Tomahawk.

Have a nice test drive,