View Full Version : Automaticly disable services
ultrabrutal
2006-12-23, 21:42
Importent request for HD playback...
Since it's required to turn off services while playing back 720p material, it would be nice if XBMC automaticly stopped services and started them again when video is paused or stopped. (This would also help on AVC/x264 playback at lower resolutions).
All services which affect CPU use should be stopped (maybe also memory resourced?)... From the top of my mind:
- FTP Server
- Web Server
- RSS feed
- Xbox Autodetection
- KAI
- Auto temperature/fan control
- LCD
If any of these doesn't affect CPU use at all, they should be left out and if there are more I forgot they should be included.
Some logic should be decided on how to tell if it's needed to stop services before playback.
Rules:
A. if Horizontal resolution is 1280. (vertical does not matter since it can be any depending on source of encode)
B. if Codec is AVC/x264
more rules?
So basicly it's just a matter of:
1. Store current service start/stopped state.
2. Stop services
3. Play video
4. When done, stopped or paused: Restart services from info gathered in 1.
You get the picture...
More info here: Viewing downloaded 720p (HDTV) video content? (http://xbmc.org/forum/showthread.php?t=22216&page=1)
I have not played with xbmc's user profiles.
Are settings like the above included when defining and switching amongst them? For example, is something like 'ftp server enabled' considered a 'per user' setting? Could one thus define "normal" and "HD" user profiles that adjusted all the settings at once?
ultrabrutal
2007-01-01, 16:31
Don't think that is a good idea if not available now.
HD should be available for all users (just a "resolution") and services should just be stopped if needed automaticly and restarted when done, stopped or paused.
Movies could be marked with a HD overlay in the menu so that you know that if you start this movie, certain services are stopped while played back.
I think this is a good idea and would love to see it.
I will say that I DL a lot of videos from the net and very, very few are 720p. Most videos are 640 max and they run fine. The 720s are smooth sometimes and will freeze and such a lot... that is streaming from my PC, not sure what they will do on the local xbox drive.
El Piranna
2007-01-01, 19:37
Maybe an option as "light out front led when playing" one...
if you think this is a good idea, feel free to implement it.
i for one think it's utter nonsense.
ultrabrutal
2007-01-02, 20:27
spiff, do you care to elborate on why it's nonsense?
well, i think its nonsenes to introduce tons of potential issues just to gain a small amount of resources that won't help a bit for hd decoding. if hd decoding was *almost* possible it might make sense but the fact of the matter is that its orders off (not counting special made / low bitrate files).
not all parts of the code is made for this (due to the complexities of threading and the cut down support for killing threads in the xbox kernel), not all services you list are easily stoppable, they won't be sucking much cpu (if at all) while idle, mostly just memory.
ultrabrutal
2007-01-02, 23:25
I have to disagree about it being nonsense - at least to some of us...
HD decoding IS very possible, but ofcourse only if you encode movies so that the Xbox hardware is able to decode them like you say.
FullHD movies in TS (mpeg2 or x264) format is ofcourse not possible. But if you take such a movie and reencode it as XviD you can get 1280x544 (720 OAR) with AC3/DTS and high bitrate video. This looks much better than the DVD!
For these files, disabling the services in the GUI has a huge advantage! 0 framedrops vs loads! All for the price of disabling some services that you don't really need or want when playing back movies anyways. If encodes should work with every single services running, the penalty to the parameters of the encode, will be so sevire that quality loss will be very visible. That would be sad. Only alternative really is to manually stop and start services which has become a pain just with our tests...
I'm not familiar with the code, but if it's possible through the settings why is it not easy when playing back videos, to disable all or some of the services?
Plugh can much better explain what the gain is by disabling services. He has conducted a huge number of tests and even made changes to XviD codec for XBMC use. If a dev won't take on this task, maybe he will?
spiff, yes hd xvid is possible, but you basically have to dedicate all available cpu resources to the task, and carefully encode it to constrain peak demands.
and sorry brutal, but my plate is full; still things I want to do with the codec, and I'm also working on some fixes to the custom firmware for my linksys router / nas server.
The wiki on 'user profiles' says "These individual profiles allow you to customize the environment for multiple users, allowing for such functionality as: [...] Unique network settings " which seems to imply that these might be (or could possibly be included as) per-user settings. Unfortunately, the wiki examples don't show any such network settings. Hence my question above...
I'm knowledgable enough to recognize that doing this on the fly (particularly loading / unloading dlls) would be problematic / lots of special case code. On the other hand since the profile system is already in place, incorporating any missing settings as 'per-user' would allow you to switch amongst 'config sets' without having to go through all the gui pages switching things back and forth. A compromise, but something that could probably be done without to much effort within the existing framework (assuming it isn't already - need to identify which "Unique network settings" are settable, and how).
i did the profile support. ALL settings are configurable per profile. 100 %. reason for this is that a profile is just a clone of the userdata dir. i say it's a much better path.
reason i say that some of those settings aren't too happy about being switched is my experience from the dev'ing of profiles. sure, they may work if you change them once in a while in settings, but if you stress the threaded stuff issues pops up. issues you don't always see.
i still uphold my view on this. its too much for too little gain.
i did the profile support. ALL settings are configurable per profile. 100 %. reason for this is that a profile is just a clone of the userdata dir. i say it's a much better path.Could you expand on that statement? The wiki about user profiles or profile.xml doesn't show any such settings. For example, how does one create one profile with ftp server enabled, and another with it disabled?
reason i say that some of those settings aren't too happy about being switched is my experience from the dev'ing of profiles. sure, they may work if you change them once in a while in settings, but if you stress the threaded stuff issues pops up. issues you don't always see.Interesting - might explain some of the occasional oddball results I encountered during my cpu usage studies, where I was switching setting on/off and playing test clips...
Thanks!
Oh wait a minute - 'clone of the userdata dir' !
So you are talking about seperate versions of
guisettings.xml and advancedsettings.xml ?
Hmmm... Is there a way to have common sources and database between two profiles? Keywords in profiles.xml perhaps?
see,
profile.xml is just the profile stuff. it defines locks and directories basically.
that directory is a clone of the userdata dir. for instance, it has guisettings.xml. guisettings.xml holds the enable ftp or not setting.
follow now? 100% everything is per profile, with fallback logic to the default user for missing stuff (used for e.g. keymap.xml).
sharing sources and databases are options in the create profile wizard.
and yes, they are stored in profiles.xml (<hasdatabases> <hassources> <canwritedatabases> and <canwritesources> iirc)
Cool. Makes sense now.
'brutal, et.al. -
ref. this -> http://xboxmediacenter.com/wiki/index.php?title=Profiles
Config your gui settings the way you want them normally; this is your 'default profile'.
Then create a new profile, call it "HD xvid" or "No Overhead" or whatever. Set "Media Info" and "Media Sources" to "Shared with Default". When done creating it, activate it. Modify gui settings to turn stuff off. Done.
Now when you boot, you'll come up in default config; you activate the new profile when needed, and can switch back when through.
That sound about right spiff? (can't test it until I swap a new hdd into my xbox.)
ultrabrutal
2007-01-03, 22:53
plugh, I'm on it ;) Going to set up a HD user now and play around...
Nice work spiff, I guess we can "live" with having to pick a "HD user" before playing back our HD encodes. But basicly you're saying that if you need a new user you should reboot and chose and not switch while running - because some services are problematic to turn off/on during run?
Sidenode; I'm going to do a image quality compare between;
- original mpeg2 ts at 1920x1080p (13,7 gb)
- 4xbmc xvid encode at 1280x544 (< 4 gb) (plugh's xbmc-smb profile)
- dvd-r mpeg at 720x480/576 (4.37 gb) (don't recall if it's pal or ntsc ver I have)
and post sample images for people to see what can be achived with HD in XBMC now compared to DVD's.
ultrabrutal
2007-01-04, 01:19
DVD vs 4XBMC (HD) vs TS
http://xbmc.org/forum/showthread.php?t=24013
El Piranna
2007-01-04, 01:40
I was thinking about... I don't know how HD codec is implemented, but i don't have a HD TV (crt PAL 19" from middle 80's... :p ), so it's possible only decode "visible" pixels? It's said, why my XBox should decode all HD data to later only show a little fragment? Could be possible "adapt" (or better, configure) so it only decode the final real quality without all this CPU usage skipping decode of dropped pixels? Maybe could be a solution for a lot of us...
ultrabrutal
2007-01-04, 08:26
Don't think you can do that with Xvid. However I will almost bet you too can see a difference with higher resolution scaled down compared to video encoded at the low resolution. This has been the case with even the best encoded movies like LOTR! The HD movie shown at 720x480 looked much more detailed than the DVD encoded at 720x480!
are you saying I'm gonna have to re-encode the Extended Editions again? ARGH! hehe :)
ultrabrutal
2007-01-04, 09:53
No I'm not. You'll probably end up with the same quality or worse because MPEG2 codec is NOT lossless. However resizing on the fly from a higher quality source will give better output since you do not reencode to anything - you just resize. Try the theory in a photo editing program