Linux Giving XBMC highes priority to avoid video stutters?
#1
So long story made short I am running on some aged hardware here. Likewise it is being kept stripped down and focused on as little processes as possible. Namely I have an old 2.8Ghz single core Northwood P4 machine and only PCI slots (no AGP or PCI-E, crappy Dell that they decided to rip the AGP connector off the board) with a Geforce 6200 installed primarily for DVI output.

Right now the setup is simple. Latest 13.04 Ubuntu with nothing extra added except for obviously XBMC, Nvidia binary drivers, Samba, webmin, and a few lightweight programs with minimal usage. My primary user for running XBMC I have set to auto-login and the desktop manager set as XBMC so it boots straight into XBMC with nothing else visible beyond the BIOS, Grub, and a black screen before the XBMC startup screen.

My video material is restricted to 720p as this has shown to be the max the machine can handle with the skiploopfilter option. I have also done some extra tweaking and given xbmc a nice priority of -20 and an ionice of -c1. Despite cpu usage being in check (I see max around 75-80% on some videos and others as low as 40-50, rarely see in the 90s.

Despite all this though I have times where certain processes come in at normal priority and XBMC chokes even though it continues to hold the lions share of cpu usage. Is there possibly anything else I am missing to give XBMC an advantage here? I understand the hardware is practically ancient comparatively. This is hopefully temporary until I can grab a machine with a PCI-E slot and pick up a dirt cheap card with GPU offloading (which the current 6200 is not doing. I don't think it has any h264 support. At best it might do 720 or 1080 MPEG2, worst just dvd spec).

On a side note, something that has been nagging at me a bit: With the TV Shows listing (I don't know if it is skin specific or not, if so I am running Aeon currently) is it possible to have it sort the series list by most recently aired episodes? ie: If show (a) had an episode aired 2 days ago, show (b) had an episode aired 1 day ago, and show © aired an episode today, the order of the list would be ©, (b), (a).

Thanks!
Reply
#2
As long as there are other progs running on it, they will take some cpu/io, even with low prio. On such ancient hardware a little spike is probably enough for a stutter. So the only suggestions is disable absolutely everything else then xbmc and see if it makes a difference.
Reply
#3
I agree with wsnipex it seems to be "cpu/gpu power" related.
Can you inspect which processes are causing trouble (top, htop)? I assume you are running stock kernel? Have you tried without renicing anything?
Reply
#4
One of the main ones I've seen is I have Sabnzbd on here and when it goes into it's verify/unpacking mode it will cause a bunch of stuttering. Mind you, as already noted, XBMC has the highest priority both in CPU and IO while Sabnzbd is at standard running priority. IO-wise XBMC uses 1-3MB/s and the drives I am running on, while old, I have been able to push upwards of 30-40MB/s peak without a sweat. RAM is fine. 2GB in here and at most 512MB is being used. No swap usage yet to speak of.

Also I managed to grab this as root and curious if this is normal to being multiple xbmc processes running? Or am I goofing on something somewhere?
Code:
main      1726  0.0  0.0   2268   508 ?        Ss   Jun05   0:00 /bin/sh /usr/bin/xbmc-standalone
main      1951  0.0  0.0   4128   208 ?        Ss   Jun05   0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/bin/im-launch xbmc-standalone
main      1954  0.0  0.0   3876   396 ?        S    Jun05   0:00 /usr/bin/dbus-launch --exit-with-session /usr/bin/im-launch xbmc-standalone
main      2038  0.0  0.0   2268   520 ?        S    Jun05   0:00 /bin/sh /usr/bin/xbmc --standalone
main      2067 14.5  9.7 586552 200460 ?       S<l  Jun05 265:24 /usr/lib/xbmc/xbmc.bin --standalone[/code]
Reply
#5
Sab can use a whole lot of CPU and IO, specially with par and rar. I always had occasional stuttering on a fairly powerful 3-core AMD with nice +20 on it until I switched to a new htpc with SSD for system + HDD for data.
Reply
#6
As I suggested before try not to renice XBMC (low disk io can also be caused by eating cpu cycles). I understand your library is located on the machine running XBMC.
Set ionice -c 2 -n 0 for XBMC (you can't use realtime sched for processes running as normal user)
Set ionice -c 3 for Sab (idle sched)

(2013-06-06, 15:45)cr08 Wrote: Also I managed to grab this as root and curious if this is normal to being multiple xbmc processes running? Or am I goofing on something somewhere?

Yes, It is.
Reply
#7
I was getting issues (albeit in the menu's not in video) and I changed the scheduler from deadline to cfq and is shook the problem.



I think this covers it (google search) as I am not at home, and cant remember exactly how I changed it, it was al ong while ago :p

http://www.cyberciti.biz/faq/linux-chang...-harddisk/

dont know if it will help at all.
Reply
#8
There was a PR pulled recently which implements buffering of video frames, maybe it could help.
Reply
#9
(2013-06-06, 17:06)boulogne75 Wrote: As I suggested before try not to renice XBMC (low disk io can also be caused by eating cpu cycles). I understand your library is located on the machine running XBMC.
Set ionice -c 2 -n 0 for XBMC (you can't use realtime sched for processes running as normal user)
Set ionice -c 3 for Sab (idle sched)
No, I hear ya. I will have to wait and test it this coming monday and tuesday. SAB/Sickbeard seems to be pulling in the early morning hours which is good as majority of the time everyone is asleep but I want to get those corner cases tackled.

(2013-06-06, 17:21)Saner Wrote: I was getting issues (albeit in the menu's not in video) and I changed the scheduler from deadline to cfq and is shook the problem.



I think this covers it (google search) as I am not at home, and cant remember exactly how I changed it, it was al ong while ago :p

http://www.cyberciti.biz/faq/linux-chang...-harddisk/

dont know if it will help at all.
Thanks. I tackled this as well mostly because I am a heavy Android user and from experience deadline (which is what ubuntu is defaulted to on my system) is always the worst. Switched to cfq and see where it goes.

(2013-06-07, 13:15)negge Wrote: There was a PR pulled recently which implements buffering of video frames, maybe it could help.
I looked it up and it does look very promising as a performance boost. Can't wait to see it pushed into stable.

Another case I also noticed and I think might be wemin related is occasionally apt-show-version will crop up and cause video stuttering. I'm about 75% sure it is webmin triggering it so I'll have to dig through and see if I can disable it.
Reply

Logout Mark Read Team Forum Stats Members Help
Giving XBMC highes priority to avoid video stutters?0