kde Syndicate content

» Logitech Mini Boombox on Linux

Tue, 08/21/2012 - 16:57

Two of my friends gave me the Logitech Mini Boombox for my birthday. While it can be used with a plain old jack cable, it also supports Bluetooth. I don’t have a smartphone, but my laptop has Bluetooth support, so lets try it out, shall we?

First, we have of course to install all the required software packages. On Archlinux that was all pulled in by installing the bluedevil package. We could now theoretically start Bluetooth already and connect to the device, but lets fix a problem first: Pulseaudio integration: See this Gentoo wiki page, essentially you have to add a Enable=Socket line to the [General] section of your /etc/bluetooth/audio.conf file.

Now, start Bluetooth via /etc/rc.d/bluetooth start 1 and head over to the Bluetooth section in systemsettings. There you should be able to connect to the Boombox using “Add device”. Once that’s done, go to the Multimedia section in systemsettings and prefer the new boombox audio device over your built-in hardware devices. Then, don’t forget to go to the “Audio Hardware Setup” tab, select the Boombox in the “Sound Card” combobox and finally choose the “High Fidelity Playback (A2DP)” profile. If you don’t do that, the audio quality will be abysmal!

Cheers, it should work now. If the Boombox is not connected, your built-in hardware will be used. If you connect the Boombox, the audio device will automatically be switched over and you can enjoy much louder music compared to cheesy laptop speakers.


  1. On Archlinux, if you want to have the daemon running automatically when you restart your machine, don’t forget to add it to the DAEMONS list in /etc/rc.conf

» KDevelop 4.4.0 Beta 1 Released

Tue, 08/14/2012 - 18:01

Hey all!

After quite some slacking on my side, I’ve finally managed to drop the good news: KDevelop 4.4.0 Beta 1 is released!

Our 4.4 branch already contains some more interesting changes for the next beta, stay tuned. Oh and yeah, we’ll try to release 4.4.0 final sometime in September, I hope.

Cheers

» KDevelop 4.3.1 Released with improved GCC 4.7 compliance

Thu, 04/19/2012 - 10:58

Hey all!

KDevelop 4.3.1 is out! Go read the announcement and update.

Many thanks to all contributors, you rock :)

» KDevelop 4.3.0 - Go Get It!

Tue, 03/20/2012 - 13:21

Finally I managed to get my job as the release dude done: http://kdevelop.org/kdevelop/kdevelop-430-final-released-basic-c11-support

Thanks to all the developers who sent in patches! The same goes to our loyal users for their continued support and bug reports :)

It’s really fun to work on KDevelop and - I’ve said it many times before - I’m really looking forward to our next releases! Even now our code in the master branches has some neat commits that make the eventual 4.4 release something to look forward to!

» Improving Massif-Visualizer For Large Data Files

Fri, 03/16/2012 - 15:42

As I just wrote in another article, Massif is an invaluable tool. The [Visualizer](https://projects.kde.org/massif-visualizer] I wrote is well appreciated and widely used as far as I can see.

A few days ago though, I did a very long (~16h) Massif run on an application, which resulted in a 204MB massif.out data file. This proved to be a very good stress test for my visualizer, which triggered me to spent some time on optimizing it. The results are pretty nice I thing, so look forward to Massif-Visualizer 0.4:

Reduced Memory Consumption

Yeah, meta eh? Just how I like it! I’ve used Massif to improve the memory consumption of Massif-Visualizer, and analyzed the data in the Visualizer of course… :)

Initial Version
initial memory consumption of the visualizer
fig. 1: initial memory consumption of the visualizer

The initial version of my visualizer took about ~470MB of memory to load the 204MB data file above. 80% of that was required for QString allocations in the callgraph of each detailed snapshot, i.e. the function signatures and location. See fig. 1 for the details.

QString to QByteArray
memory consumption of the visualizer using QByteArray instead of QString
fig. 2: `QByteArray` instead of `QString`: 50% less memory

Thomas McGuire gave me the tip of using QByteArray instead, since the Massif callgraph data is just ASCII data. We can convert the data to QString where required, essentially saving us 50% of the memory consumption. You can see that applied in fig. 2. It was simple to code and already reduced the memory consumption considerably.

Implicit Sharing
memory consumption of the visualizer leveraging implicit sharing
fig. 3: leveraging implicit sharing

I committed the above, thinking this was it. But thanks to the awesome people in the KDE community, this time André Wöbbeking, I was thankfully shown wrong: He commented on my commit, arguing that I should try out to leverage the implicit sharing of Qt containers, such as QByteArray. After all, the strings we have here are function signatures and file locations, which are repeated quite often. Especially when you have recursion in your call tree, or the same functions are encountered again and again in Massif snapshots, you can potentially safe a lot of memory by leveraging implicit sharing.

Personally, I’m suprised to see just how much this gains in this case! See fig 3., where the string allocations are nearly gone completely from the Massif log! Now only the tree node allocations, and the containers saving them, are visible in the memory log - something I do not plan to reduce further.

If you are interested in how this was implemented, take a look at commit 4be5dad13fb.

Final Notes

I think this shows quite nicely how to improve the memory consumption of an application. If you want to verify my results, I’ve uploaded the massif log files. Remember that you can open compressed files seamlessly in Massif-Visualizer. The massif.out.data.bz2 file contains the test-data of the 16h Massif run.

You should probably use the latest Massif-Visualizer code though, since I’ve also optimized the performance of it considerably compared to the last released version 0.3. Furthermore, data files are now loaded in the background, showing a nice progress bar while doing that. If you open the big data file in 0.3 you’ll notice why I decided to optimize the visualizer :)

An interesting thing to note btw. is that the callgrind data format compresses files and function signatures, yielding much smaller data files and reducing the KCacheGrind’s memory consumption, esp. since it will automagically leverage the implicit sharing of Qt’s string classes.

Now it is probably time to stop slacking and start work-work again :) I do have quite a few ideas more for the next Massif-Visualizer though, especially an export functionality for the graphs is high on my TODO list!

» Tracking Memory Consumption Using Pmap

Fri, 03/16/2012 - 14:55

Massif is a really nifty tool which is very powerful, especially paired with my visualizer. The caveat of course is that it slows down the application considerably, I’ve seen anything up to a factor of 100… I see no alternative to Massif when it comes to investigating where your memory problems come from. But if you just want to see whether you have a problem at all, tracking the total memory consumption should suffice.

A few days ago, I came across pmap on Stack Overflow, which makes it easy to track the RSS memory consumption of an application using the -x switch. Of course I had to write some bash magic to automate this process and visualize the data using Gnuplot! Behold:

memory consumption of PhantomJS
memory consumption of a PhantomJS script over ~30min
usage

It’s simple, really: track_memory.sh $(pidof myapp).

The default timeout is ~1s between snapshots, you can pass a different timeout as second parameter. Bash’s sleep can also take float numbers such as 0.1 to get more snapshots for fast-running apps.

You can also run show_memory.sh mem.log.$(pidof myapp) while you are still tracking the memory. The gnuplot window that appears allows you to update the data intermittently, to zoom in and to create images such as the above.

Note: This kind of memory usage tracking costs nearly nothing, your application continues to work at full speed. Also be aware that this just shows the RSS memory consumption. Massif will always give you better, more detailed and accurate results. Still, I think this should already give you an idea on how your application behaves. If the graph goes up and up, you probably got a memory leak! Then it’s time to run Memcheck and/or Massif to find the issue and fix it!

track_memory.sh

You can find the most-recent version on GitHub: https://github.com/milianw/shell-helpers/blob/master/track_memory.sh

  1. #!/bin/bash
  2.  
  3. #
  4. # track memory of given application, identified by PID,
  5. # using pmap -x, to show RSS and Dirty memory usage.
  6. #
  7. # visualization can later on be done with the
  8. # show_memory.sh script.
  9. #
  10.  
  11. pid=$1
  12. sleep=$2;
  13.  
  14. if [[ "$sleep" == "" ]]; then
  15. sleep=1
  16. fi
  17.  
  18. if [[ "$(ps -p $pid | grep $pid)" == "" ]]; then
  19. echo "cannot find program with pid $pid"
  20. echo "track_memory.sh PID [SLEEP_TIMEOUT]"
  21. echo
  22. echo "example: track_memory.sh \$(pidof someapp) 0.1"
  23. exit
  24. fi
  25.  
  26. logfile=mem.log.$pid
  27.  
  28. echo "# $(ps -o command= -p $pid)" > $logfile
  29. echo "# $sleep" >> $logfile
  30.  
  31. cat $logfile
  32.  
  33. while [[ "$(ps -p $pid | grep $pid)" != "" ]]; do
  34. echo "snapshot " $pid
  35. pmap -x $pid | tail -n1 >> $logfile
  36. echo "$sleep"
  37. sleep $sleep;
  38. done
  39.  
  40. echo "done tracking, visualizing"
  41. $(dirname $0)/show_memory.sh "$logfile"
show_memory.sh

You can find the most-recent version on GitHub: https://github.com/milianw/shell-helpers/blob/master/show_memory.sh

  1. #!/bin/bash
  2.  
  3. #
  4. # visualize memory consumption over time
  5. # as recorded by pmap / track_memory.sh
  6. # script
  7. #
  8.  
  9. logfile=$1
  10.  
  11. if [ ! -f "$logfile" ]; then
  12. echo "cannot find memory logfile: $1"
  13. echo
  14. echo "usage: show_memory.sh LOGFILE"
  15. echo
  16. echo "example: show_memory.sh mem.log.12345"
  17. exit
  18. fi
  19.  
  20. title=$(head -n1 "$logfile")
  21. timeout=$(head -n2 "$logfile" | tail -n1)
  22.  
  23. title=${title/\# /}
  24. timeout=${timeout/\# /}
  25.  
  26. # total:
  27. # '$logfile' using 3 w lines title 'Kbytes', \
  28.  
  29. gnuplot -p -e "
  30. set title '$title';
  31. set xlabel 'snapshot ~${timeout}s';
  32. set ylabel 'memory consumption in kB';
  33. set key bottom right;
  34. plot \
  35. '$logfile' using 4 w lines title 'RSS' lt 1, \
  36. '$logfile' using 4 smooth bezier w lines title 'RSS (smooth)' lt 7, \
  37. '$logfile' using 5 w lines title 'Dirty' lt 2, \
  38. '$logfile' using 5 smooth bezier w lines title 'Dirty (smooth)' lt 3;
  39. ";
Future

The above is nice, but I’m wondering on whether one should not add this kind of utility to ksysguard: It already allows you to track the total memory consumption of your system, yet I did not find a way to just track a single application and visualize it’s memory consumption.

» KDevelop Forum & Screenshots

Mon, 02/27/2012 - 17:44

Hey all,

following the recent blog post on getting a forum for KDE software I decided to get one setup for KDevelop. Minutes after, it was all done, we now have a KDevelop Forum. Feel free to use it for discussions and user support around KDevelop and related applications. Development discussions etc. will still happen on our mailing list though.

To get the forum rolling, I’ve had the idea to use it for some crowdsourcing of KDevelop screenshots, see also the post on the KDevelop website: http://kdevelop.org/community/new-forum-screenshots .

» KDevelop 4.3.0 RC 1 Released

Sat, 02/25/2012 - 18:45

Hey all!

Please help us test KDevelop 4.3 RC1! Grab it while it’s hot: http://kdevelop.org/43/kdevelop-430-rc-1-released

This release comes with some more bug fixes and better support for some C++11 language features.

Cheers!

» KDevelop 4.3.0 Beta 2 Released

Tue, 02/14/2012 - 15:10

Hey all!

I’ve just posted the news on the KDevelop website: KDevelop 4.3.0 Beta 2 is released!

Please test it and report feedback as usual. I think it’s safe to assume that we will release 4.3.0 final in about 2-4 weeks from now.

Considering that my university semester is nearing its end, I will finally have more royal hacking time again! I’ll continue to squash bugs and improve the performance of KDevelop of course :) Most definitely I’ll try to further improve the C++11 support. But maybe I finally have some time again to work on “something bigger”, like helping Miha Čančula in writing a kick-ass unit-test integration for KDevelop (see unittest branches). Then I plan to finally release some more of our “playground” plugins, most notably CSS language support and QMake project management…

Stay tuned for a bright KDevelop future :]

PS: I’ll step up as a mentor for a KDevelop GSOC this year, yet I’m still wondering about a proper topic… Ideas?

» Massif Visualizer 0.3 released

Sun, 11/20/2011 - 19:17

Hey all!

I’m happy to announce the release of Massif-Visualizer 0.3. You can download the sources here:

http://download.kde.org/download.php?url=stable/massif-visualizer/0.3/src

Highlights of this release:

  • translations into 18 different languages
  • basic support for hiding of functions via context menu
  • basic support for custom allocators
  • configurable precision of memory consumption display
  • various optimizations, bug fixes and other improvements. take a look at the changelog for more information
Future Development

It took me much too long to get this release out and hope to do better in the future. Current git master already contains some new patches - try it out! I especially like the improved display of the callgraph which now aggregates the tails of the callgraph tree, i.e. the end of the backtrace which mostly starts main() etc.

If you have ideas for the future, or have any issues with Massif-Visualizer, report a bug on https://bugs.kde.org/ .

Packaging

I don’t want to waste my time on packaging and instead concentrate on development. So here again a public plead to distributors: Please include Massif-Visualizer in future releases and let users download it seamlessly through your package manager. Starting with this release, Massif-Visualizer releases will follow the usual KDE procedure and the source tarballs will be hosted on the KDE mirrors. Hope this makes it simpler for packagers!

Ubuntu users can use Aurélien Gâteau’s PPA: https://launchpad.net/~agateau/+archive/ppa . ArchLinux users you can get it via AUR, and Gentoo also has an overlay for it it seems. I also think that OpenSUSE has a package for it. Please add infos for $your-distro in the comments below.

Cheers