Qball's Weblog

GMPC, Now with extra bling

Tags gmpc 

This is something I wanted since I saw it on an ARCHOS music player. The implementation turned up differently, but it still looks nice.

New gmpc feature, backdrops. GMPC will put a ‘darkend’ version of the artist image in the background of the now-playing screen. This gives an extra ‘bling’ to the now-playing view.
See the screenshot below:

However the there is one serious warning you should take into account before enabling this option.
The (worst-case) memory usage of GMPC may increase dramatically. This is desired behavior!!!!!

Long-ish explanation:
GMPC has an internal pixbuf cache, this cache keeps images around for a little while. This pixbuf cache makes sure that if you f.e. Play one album, it won’t reload the same image each time (also if another instance of the image exists with the same size it will reuse the cached pixbuf, it will reload the image when it needs another size, to get the best quality). The background image uses the same async image loading system and therefor also the pixbuf cache. The background image can be very large and easily take up several MB of memory, if you start skipping through your collection, the pixbuf cache may grow rapidly (keeping the backdrops around for a little while). There is no leak! If no image is referenced for 10 seconds, GMPC will remove all the unused entries from the cache. So GMPC might be using 100MB of memory, and 10 seconds later only 17MB, this is desired behavior.

If this is no problem (As it should not be for most hardware) you can enable the backdrop by opening ~/.config/gmpc/gmpc.cfg and setting:

?View Code INI
[Now Playing]

Later an option will be added for this.

p.s. I plan to add an option that will always free unused images if the cache grows beyond a certain size.

edit: you can now enable this under preferences->interface -> advanced. Enable it and restart gmpc.