Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

Ability to throttle background processes?
Thank you for your donation

Pages (2): 1 2 Next »
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Ability to throttle background processes?
25th Feb, 2013, 01:53 AM
Post: #1
2twisty Offline
Registered
Posts: 33
Joined: Feb 2013
Reputation: 3
Ability to throttle background processes?
Since the Pi is limited in processing power, it would be helpful if certain background processes could be assigned a lower priority, such as library scanning.

I have thousands of TV episodes and several hundred movies in my collection, and while the Pi is scanning the disks to include them in the library, the CPU is at 70-90% utilization.

Some of this excess overhead is because I'm using NTFS for the drives. I'm going to convert to ext4, but even then, it would be nice to be able to tell the Pi that library scanning takes a back seat to playback.

Unfortunately, since XBMC is monolithic, I can't use available linux tools to control process priority. This is something that would have to be implemented in the code.

Is this something that should be requested of the XBMC devs? In that world, Pi and Android users are the minority, and most users have plenty of processing power to fly through a library update. I fear that asking in that community would result in no action since there are so few of us who would really benefit from that capability.

Ideas?
Find all posts by this user
Quote this message in a reply
25th Feb, 2013, 01:55 AM
Post: #2
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
RE: Ability to throttle background processes?
https://github.com/xbianonpi/xbian/issues/87

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
25th Feb, 2013, 02:20 AM
Post: #3
BartOtten Offline
Registered
Posts: 815
Joined: Jun 2012
Reputation: 29
Re: Ability to throttle background processes?
This is no solution to the library scanner as you can't start and stop it without killing xbmc.....or can you.. (guess it can...maybe belese knows how to do it)
Find all posts by this user
Quote this message in a reply
25th Feb, 2013, 02:21 AM
Post: #4
rikardo1979 Offline
Management
******
Posts: 3,545
Joined: Dec 2012
Reputation: 190
RE: Ability to throttle background processes?
(25th Feb, 2013 02:20 AM)BartOtten Wrote:  This is no solution to the library scanner as you can't start and stop it without killing xbmc.....or can you.. (guess it can...maybe belese knows how to do it)

you should be able stop scanning library manually, if im not mistaken Wink

~~~~>>>Please always follow rules and read before you post<<<~~~~
Find all posts by this user
Quote this message in a reply
25th Feb, 2013, 03:38 AM
Post: #5
belese Offline
Moderator
******
Posts: 650
Joined: Jan 2013
Reputation: 38
RE: Ability to throttle background processes?
No you can't, only start it.

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
25th Feb, 2013, 03:41 AM
Post: #6
2twisty Offline
Registered
Posts: 33
Joined: Feb 2013
Reputation: 3
RE: Ability to throttle background processes?
So, adding the ability to stop the scan is something that would have to be implemented by the XBMC maintainers?

If there was a way to stop and start the scan, or better yet, PAUSE it, we could tweak our screensaver modes to run the scan only when the system is idle.
Find all posts by this user
Quote this message in a reply
25th Feb, 2013, 03:44 AM
Post: #7
rikardo1979 Offline
Management
******
Posts: 3,545
Joined: Dec 2012
Reputation: 190
RE: Ability to throttle background processes?
(25th Feb, 2013 03:38 AM)belese Wrote:  No you can't, only start it.

yes you can Wink 100% sure as I just did it
Just start scan your media to library, than when is scanning evoke contextual menu as you are still on the source what you scanning and select Stop scanning
Cool

~~~~>>>Please always follow rules and read before you post<<<~~~~
Find all posts by this user
Quote this message in a reply
25th Feb, 2013, 03:48 AM
Post: #8
rikardo1979 Offline
Management
******
Posts: 3,545
Joined: Dec 2012
Reputation: 190
RE: Ability to throttle background processes?
(25th Feb, 2013 03:41 AM)2twisty Wrote:  So, adding the ability to stop the scan is something that would have to be implemented by the XBMC maintainers?

If there was a way to stop and start the scan, or better yet, PAUSE it, we could tweak our screensaver modes to run the scan only when the system is idle.

Start/Stop scan files into library is already in XBMC for some years, read my post above Wink

~~~~>>>Please always follow rules and read before you post<<<~~~~
Find all posts by this user
Quote this message in a reply
25th Feb, 2013, 03:53 AM
Post: #9
belese Offline
Moderator
******
Posts: 650
Joined: Jan 2013
Reputation: 38
RE: Ability to throttle background processes?
Sorry misreaded
Yes, you can manually, but not with an xbmc api.

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
28th Feb, 2013, 11:22 AM
Post: #10
BartOtten Offline
Registered
Posts: 815
Joined: Jun 2012
Reputation: 29
RE: Ability to throttle background processes?
2twisty: could you be so kind to request the api change / feature?
Find all posts by this user
Quote this message in a reply
28th Feb, 2013, 11:57 AM
Post: #11
2twisty Offline
Registered
Posts: 33
Joined: Feb 2013
Reputation: 3
RE: Ability to throttle background processes?
I assume you mean that I should make the request at the XBMC github, right?

https://github.com/xbmc/xbmc/issues/2318
Find all posts by this user
Quote this message in a reply
28th Feb, 2013, 07:03 PM
Post: #12
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
RE: Ability to throttle background processes?
We already have an issue like this on our github.

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
1st Mar, 2013, 12:30 AM
Post: #13
2twisty Offline
Registered
Posts: 33
Joined: Feb 2013
Reputation: 3
RE: Ability to throttle background processes?
OK. After I posted this on their github, they told me that they only take bug reports on github and closed it -- they asked that I post it to their forum, instead.

So, here's the link. If you would find this feature useful as an exposed feature in JSON, please pop in an comment so that they know that others would find this useful.

http://forum.xbmc.org/showthread.php?tid=157860
Find all posts by this user
Quote this message in a reply
1st Mar, 2013, 12:36 AM
Post: #14
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
RE: Ability to throttle background processes?
Now i understand what you did Smile Awaiting their response.

As far as i can see in the code this is already supported:
Code:
else if (execute.Equals("updatelibrary") && params.size())
  {
    if (params[0].Equals("music"))
    {
      if (g_application.IsMusicScanning())
        g_application.StopMusicScan();
      else
        g_application.StartMusicScan(params.size() > 1 ? params[1] : "");
    }
    if (params[0].Equals("video"))
    {
      if (g_application.IsVideoScanning())
        g_application.StopVideoScan();
      else
        g_application.StartVideoScan(params.size() > 1 ? params[1] : "");
    }
  }

This part is executed with the updatelibrary function, if will check if a scan is already running and if it isn't starts the scan. If it is it will stop the scan. So you just need to run the updatelibrary function twice i think. Also the core of XBMC has no such thing as pausing the scan and continuing it:

Code:
void Start(const CStdString& strDirectory, int flags);
  void FetchAlbumInfo(const CStdString& strDirectory, bool refresh=false);
  void FetchArtistInfo(const CStdString& strDirectory, bool refresh=false);
  bool IsScanning();
  void Stop();

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
1st Mar, 2013, 01:50 AM
Post: #15
2twisty Offline
Registered
Posts: 33
Joined: Feb 2013
Reputation: 3
RE: Ability to throttle background processes?
That might work. So, does IsScanning() return a bool as to the state of scanning?

This function works like the Uncertainty Principle. The act of measuring its state will change its state.

I'd much rather see discrete start and stop commands.

So, is IsScanning() exposed by API? If so, we could use it to measure the state by changing it...but that's not ideal.

Generally, scans are short and only picking up new items, so maybe this is considered an annoyance only during initial scan or a complete library rebuild.
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Pages (2): 1 2 Next »
Post Reply 


  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 13th May, 2025, 01:22 AM Powered By MyBB, © 2002-2025 MyBB Group.