New moodbar implementation

Christie Harris dangle.baby at gmail.com
Sun Aug 13 00:32:24 UTC 2006


On Wednesday 09 August 2006 18:02, Joe Rabinoff wrote:

After a fair bit of trouble-shooting and testing yesterday, I can happily say 
this implementation is a vast improvement over the exscalibar one.

> I think my code gets rid of a lot of the problems in the old moodbar:
>
>  * moodbar had memory leaks.
>    As I understand it, most of these leaks happened in the Exscalibar
>    library.  My patch does not use Exscalibar, and the analyzer is a
>    separate process anyway.  There is only one place in the entire
>    patch where I allocate something on the heap, so I dare you to
>    valgrind it.

a couple of teething problems with the analyser, but these are now sorted.

>
>  * moodbar was unstable.
>    It's not surprising, since moodbar support was hacked into the
>    Amarok source in a none-too-pretty fashion.  The code I wrote is
>    good, and is meant to be hard to break -- please take a look at it.
>    Again, since the analyzer is in a separate binary, that can no longer
>    crash Amarok.

I've had Amarok running for 15 hours playing a dynamic playlist and calcing 
moodbars - no problems at all.

>  * moodbar was memory-consuming eye-candy
>    First of all, I tried to make my code add as little overhead as
>    possible, except where you're actually displaying a Moodbar.  In any
>    case, in this patch, moodbar can be disabled at compile time or in the
>    config dialog if you think it's too big.

Amarok's not really using much more than it was previously, in the way of 
system resources.

>  * The new analyzer is marginally faster than the old one, and is also
>    more accurate (Gav wasn't calculating his Fourier transform correctly).

Can confirm this - much snappier, even hour long tracks only take about 2/3 of 
the time they used to, to calculate mood.

>  * From the forums and the irc channel, I know I'm not the only one who
>    misses the moodbar :)

If there's a phone in line, count me as a 'yes please' :) 

> I think the gstreamer solution is elegant, plus it already works, and works
> well.  That's my case for (1).  But I know nothing about packaging, as I
> don't use a distro, so I understand if it's not feasible.  In that case I
> can do (2) easily enough; the analyzer-binary package would be tiny and
> would require almost no maintenance.  I can look into (3) if you really
> want.  As for (4), since the code is all in one place now, it's easily
> enough converted into a plugin when the time comes, so since I've already
> done all the work, I see no reason not to re-implement the moodbar for the
> 1.4 series, as it is a popular feature.

Much as gstreamer shits me to tears, this works nicely - most of the 
gst-plugins required are contained in plugins-base and plugins-good - the 
only ones that might require separate installation are the music codecs - I'm 
not sure how different distros package those, but many of them can be 
installed individually under gentoo.


Cheers, Christie



More information about the Amarok mailing list