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

Set new CPU Priority for omxplayer
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
Set new CPU Priority for omxplayer
11th Jan, 2013, 04:57 AM
Post: #1
namtih Offline
Tester
Posts: 269
Joined: Dec 2012
Reputation: 28
Set new CPU Priority for omxplayer
Does anyone know which file contains the omxplayer call?
I wanted to check if I can edit the call to lower the CPU priority (nice -n -10 omxplayer...).

The reason is to hopefully get a smoother playback, when some background processes are running. Had some troubles yesterday evening with parallel running openvpn, pyload (-> python) and high CPU usage of the current NTFS-3G driver.
Find all posts by this user
Quote this message in a reply
11th Jan, 2013, 05:02 AM
Post: #2
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
RE: Set new CPU Priority for omxplayer
To start with, can you share the NTFS-3G driver?

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
11th Jan, 2013, 05:08 AM
Post: #3
namtih Offline
Tester
Posts: 269
Joined: Dec 2012
Reputation: 28
RE: Set new CPU Priority for omxplayer
Sorry, I don't understand what you mean?
It's the standard builtin ntfs-3g driver set via fstab.
Code:
UUID=DA205B73205xxxxx /mnt/hdd  ntfs-3g noatime,nodiratime,async,rw       0       0

And that's the result with 2 parallel downloads. So you see, no much CPU left for the omxplayer to get a smooth playback.
http://www.imagebanana.com/view/wdobkkj8/top.jpg

So the idea was to assign more CPU usage/priority to the omxplayer, as I wasn't able to find methods to optimize the openvpn or python runtime.
And unfortunately we didn't get the new NTFS driver running yet.
Find all posts by this user
Quote this message in a reply
11th Jan, 2013, 05:14 AM
Post: #4
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
RE: Set new CPU Priority for omxplayer
Quote:And unfortunately we didn't get the new NTFS driver running yet.

I thought you did.

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
11th Jan, 2013, 05:23 AM
Post: #5
namtih Offline
Tester
Posts: 269
Joined: Dec 2012
Reputation: 28
RE: Set new CPU Priority for omxplayer
No, not really.
I only got a nice fullscreen of error messages and realized that this is too big for my Linux skills after 3 days of trying Confused

gizag pointed out that the driver in the first post was wrong and that he would perhaps give the new version a try. But until now no new post from him, so I think he also had no luck yet.

Just got the tip in the XBMC IRC channel that the omxplayer isn't using any CPU power. So the next try would be XBMC itself and/or the xbmc.bin.
Find all posts by this user
Quote this message in a reply
11th Jan, 2013, 06:39 AM
Post: #6
namtih Offline
Tester
Posts: 269
Joined: Dec 2012
Reputation: 28
RE: Set new CPU Priority for omxplayer
I've added the following line to the "do_start" function in "etc/init.d/xbmc":
Code:
renice -10 -p $(pgrep xbmc.bin)

But the CPU priority is still 0 after a restart.
When I execute the command in the command line it's working fine. Can anyone please help with the init script?
Find all posts by this user
Quote this message in a reply
11th Jan, 2013, 06:08 PM
Post: #7
raspberry_pd Offline
Registered
Posts: 97
Joined: Dec 2012
Reputation: 6
RE: Set new CPU Priority for omxplayer
To improve playback, wouldn't you increase the priority assigned to xbmc.bin, rather than lower it? AFAIK this would be how it's done in Windows. Of course it may be inverse in Linux. Just curious.
Find all posts by this user
Quote this message in a reply
11th Jan, 2013, 07:03 PM
Post: #8
namtih Offline
Tester
Posts: 269
Joined: Dec 2012
Reputation: 28
RE: Set new CPU Priority for omxplayer
Yep, it's inverse in Linux:
http://www.nixtutor.com/linux/changing-priority-on-linux-processes/
Quote:The Linux niceness scale goes from -20 to 19. The lower the number the more priority that task gets.



CurlyMo, can you please help how to edit the start script to set a new CPU priority of "-10" for the xbmc.bin process?
I wasn't able to get it working.
Find all posts by this user
Quote this message in a reply
11th Jan, 2013, 08:59 PM
Post: #9
raspberry_pd Offline
Registered
Posts: 97
Joined: Dec 2012
Reputation: 6
RE: Set new CPU Priority for omxplayer
(11th Jan, 2013 07:03 PM)namtih Wrote:  Yep, it's inverse in Linux:
http://www.nixtutor.com/linux/changing-priority-on-linux-processes/

The Linux niceness scale goes from -20 to 19. The lower the number the more priority that task gets.

Thanks for the explanation namtih. It's really nice to have someone willing to help educate, rather than troll of flame people for asking questions. Asking questions is just as valid a means of learning as RTFMing.
Find all posts by this user
Quote this message in a reply
11th Jan, 2013, 09:07 PM
Post: #10
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
RE: Set new CPU Priority for omxplayer
Quote:CurlyMo, can you please help how to edit the start script to set a new CPU priority of "-10" for the xbmc.bin process?
I wasn't able to get it working.

Look into the '-N' flag of start-stop-daemon

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
11th Jan, 2013, 09:25 PM
Post: #11
raspberry_pd Offline
Registered
Posts: 97
Joined: Dec 2012
Reputation: 6
RE: Set new CPU Priority for omxplayer
Quote: -N, --nicelevel int
This alters the priority of the process before starting it.

http://linuxreviews.org/man/start-stop-daemon/
Find all posts by this user
Quote this message in a reply
12th Jan, 2013, 12:23 AM
Post: #12
namtih Offline
Tester
Posts: 269
Joined: Dec 2012
Reputation: 28
RE: Set new CPU Priority for omxplayer
(11th Jan, 2013 09:07 PM)CurlyMo Wrote:  Look into the '-N' flag of start-stop-daemon

Thanks, got it working now.
I set it to "-10" and will give a feedback in some days if it made any difference.
Find all posts by this user
Quote this message in a reply
20th Jan, 2013, 06:47 PM
Post: #13
namtih Offline
Tester
Posts: 269
Joined: Dec 2012
Reputation: 28
RE: Set new CPU Priority for omxplayer
I don't know the exact reason, but since setting this value I had several freezes while watching a movie or video addons. The complete Pi just froze.
I don't understand why setting another nicevalue is causing this, but at the moment I can't recommend to set/change this value.
Find all posts by this user
Quote this message in a reply
20th Jan, 2013, 07:56 PM
Post: #14
CurlyMo Offline
Registered
Posts: 3,501
Joined: Dec 2012
Reputation: 202
RE: Set new CPU Priority for omxplayer
Pretty simple, the nice value is limiting the CPU XBMC can use. Due to the lack of power, the RPi doesn't have enough resources to let XBMC run smoothly while limited in CPU power.

pilight - modular domotica solution
Visit this user's website Find all posts by this user
Quote this message in a reply
20th Jan, 2013, 08:00 PM
Post: #15
namtih Offline
Tester
Posts: 269
Joined: Dec 2012
Reputation: 28
RE: Set new CPU Priority for omxplayer
But I set it from 0 to -10. So I assigned a higher/more priority to the XBMC process. So why got the stability worse?
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: 10th May, 2025, 06:53 PM Powered By MyBB, © 2002-2025 MyBB Group.