Bug 136867 - Process priority for moodbar is too low
Summary: Process priority for moodbar is too low
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-05 07:42 UTC by Mark Rose
Modified: 2008-07-22 12:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Rose 2006-11-05 07:42:14 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Ubuntu Packages

The process priority for the moodbar is too low. It seems to be set at nice 19 with no way to change it inside of Amarok. I already have an application running at nice 19 (distributed.net) and I'd like moodbar to have priority over it. Also, I'm running the moodbar collection scanning script at nice 15 -- I want this to take priority over distributed.net, obviously. Having any CPU consuming task running at higher than nice 19 prevents the moodbar from updating quickly inside of Amarok.

The option to change the nice priority isn't really required (it may confuse newbies), but setting it somewhere around 10 would allow the user(s) of the system to schedule tasks around it.
Comment 1 Mark Kretschmann 2006-11-05 08:00:02 UTC
Sounds like a sensible request to me. Niceness of 10 could be a good compromise.
Comment 2 Mark Rose 2006-11-05 08:05:16 UTC
Yes, that would be a perfect (and very easy) fix.
Comment 3 Christie 2007-03-12 09:12:38 UTC
Bear in mind that the nice value was deliberately set to 19 in the first place because the default value of 10 was crippling some systems when moods were being calculated... it's quite a CPU-intense process.

Much as I hate to say "make it an option", there needs to be some way for those of us who *need* it to have extremely low priority to be able to make it so. Perhaps a line in the config without a gui option? Not the best in terms of discoverability, but also not the first such setting for amarok.
Comment 4 Mark Rose 2007-03-12 09:18:35 UTC
Yeah, having as an option in a config file is a great idea.

I have the inverse problem: having moodbar set at 19 makes moodbar calculations excessively slow, as they're competing with idle tasks which I can't set any lower.
Comment 5 Mark Kretschmann 2007-03-12 09:44:54 UTC
Sorry, we won't be adding a config option for this. Either we find a value that works well for most users, or we can't change it.

Mark, what's the highest nice value that still yields acceptable performance for you? Please keep in mind that we are talking about the stable branch (1.x), where we cannot take any risks.
Comment 6 Mark Rose 2007-03-12 09:48:54 UTC
A nice value of 18 would be functional. Any lower would only be for flexibility.
Comment 7 Mark Kretschmann 2007-03-12 10:16:58 UTC
SVN commit 641676 by markey:

Give the moodbar process a higher priority (niceness of 18 instead of 19). Apparently 19 became to slow for some users.

BUG: 136867


 M  +1 -0      ChangeLog  
 M  +1 -1      src/moodbar.cpp  


--- branches/stable/extragear/multimedia/amarok/ChangeLog #641675:641676
@@ -5,6 +5,7 @@
 
 VERSION 1.4.6
   CHANGES:
+    * The moodbar process has been given a higher priority. (BR 136867)
     * Allow for lyrics scripts to specifiy site, site_url, and add_url from
       within the script. This will allow for "meta lyrics" scripts. Patch by
       Sergio Pistone <sergio_pistone@yahoo.com.ar>. (BR 141885)
--- branches/stable/extragear/multimedia/amarok/src/moodbar.cpp #641675:641676
@@ -471,7 +471,7 @@
   // don't think the mood data exists while the analyzer is
   // running.  Then rename the file later.
   m_currentProcess = new Amarok::Process( this );
-  m_currentProcess->setPriority( 19 );  // Nice the process
+  m_currentProcess->setPriority( 18 );  // Nice the process
   *m_currentProcess << KStandardDirs::findExe( "moodbar" ) << "-o"
                     << (m_currentData.m_outfile + ".tmp")
                     << m_currentData.m_infile;
Comment 8 Mark Rose 2007-03-12 10:26:58 UTC
Excellent. Thank you! :)