Kodi Community Forum
Always load a certain profile on xbmc startup - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: Always load a certain profile on xbmc startup (/showthread.php?tid=125960)



Always load a certain profile on xbmc startup - teeedubb - 2012-03-19

Hey all,

I'm mucking around with profiles to make it easier to switch between audio outputs, I want to setup a main profile which will be used the majority of the time to output 2ch analog audio via hdmi and and a second profile to output via s/pdif for surround/louder sound. I'd like xbmc to always launch with the hdmi profile, but it seems that xbmc loads which ever profile was last used. I've had a look through the wiki pages for advancedsettings.xml and profiles but didn't see anything relating to this and there seems to be no command line switches to load a particular profile.

Is this possible to always start xbmc with a particular profile?


RE: Always load a certain profile on xbmc startup - jmarshall - 2012-03-19

Not currently, nope. You could probably hack it by modifying profiles.xml using a script before XBMC starts, but that is not recommended.

A patch would be considered I would think - eg by having a alwaysloadatstart tag or similar in profiles.xml - no need for any UI necessarily.


RE: Always load a certain profile on xbmc startup - jhsrennie - 2012-03-19

You could use an autoexec.py script:

Code:
import xbmc

xbmc.executebuiltin("Loadprofile(hdmi)")

You'd need to put this in the userdata folder of all profiles.

JR



Re: Always load a certain profile on xbmc startup - teeedubb - 2012-03-20

Thanks I'll look into the autoexec.py method.

Just out of curiosity what programming language would I need to learn to make a patch such as the one jmarshall suggested? I'm guessing C/C++ from a quick glance at the xbmc development wiki?


RE: Always load a certain profile on xbmc startup - mad-max - 2012-03-20

Yep, it's C++


RE: Always load a certain profile on xbmc startup - xabih - 2013-05-25

(2012-03-19, 11:16)jhsrennie Wrote: You could use an autoexec.py script:

Code:
import xbmc

xbmc.executebuiltin("Loadprofile(hdmi)")

You'd need to put this in the userdata folder of all profiles.

JR

I'm trying to do this but this way XBMC is alwais changing from one profile to another Sad
It seems that autoexec.py executes when the the profile is loaded, not only once when XBMC is loaded.
I'm using OpeneELEC 3.0.3


RE: Always load a certain profile on xbmc startup - teeedubb - 2013-06-12

Maybe you shouldn't put the autoexec.py script to load a profile in the user data folder of the profile you want to load?

EDIT: on second thought that would defeat the purpose of profiles as only one profile would load...


RE: Always load a certain profile on xbmc startup - teeedubb - 2013-07-15

Just stumbled across this

http://forum.xbmc.org/showthread.php?tid=143455