Headless Kodi

  Thread Rating:
  • 5 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
topfs2 Offline
Team-Kodi Developer
Posts: 4,548
Joined: Dec 2007
Reputation: 17
Post: #1
I've recently been trying to gather up some patches and fix those things that depend on the gui in kodi so that we may at one point have a headless version of Kodi.

In general my goal is to split out my efforts over multiple PRs so that master gets better and better.
But for those interested I have pulled in all needed patches for my initial headless version of kodi on a base of Helix. Which can be found over at my repository https://github.com/topfs2/xbmc/tree/helix_headless

The initial attempt here is not to compile down a stripped version of kodi just for headless use, but rather to disable the gui on start. This means that it can replace a Helix and if its headless or not is only choosen via the startup argument --headless.

When headless uPnP and Webserver are default to on, as what point is headless if you can't connect to it Smile

To run after compile simply
Quote:/path/to/kodi --headless

Please let me know of any bugs and crashes when running in headless so we can get headless into master ASAP!

TODO
  • Fix param parsing on windows #33
  • Fix "Can't open display" #15


Cheers,
Tobias

If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
(This post was last modified: 2015-01-15 12:27 by topfs2.)
find quote
sparklyballs Offline
Senior Member
Posts: 143
Joined: Feb 2012
Reputation: 1
Post: #2
(2014-12-23 01:42)topfs2 Wrote:  I've recently been trying to gather up some patches and fix those things that depend on the gui in kodi so that we may at one point have a headless version of Kodi.

In general my goal is to split out my efforts over multiple PRs so that master gets better and better.
But for those interested I have pulled in all needed patches for my initial headless version of kodi on a base of Helix. Which can be found over at my repository https://github.com/topfs2/xbmc/tree/helix_headless

The initial attempt here is not to compile down a stripped version of kodi just for headless use, but rather to disable the gui on start. This means that it can replace a Helix and if its headless or not is only choosen via the startup argument --headless.

When headless uPnP and Webserver are default to on, as what point is headless if you can't connect to it Smile

To run after compile simply
Quote:/path/to/kodi --headless

Please let me know of any bugs and crashes when running in headless so we can get headless into master ASAP!

Cheers,
Tobias

Could this be dockerised as there is a lot of interest on this over on the unraid forum as they have a docker base in the beta of uraid 6 and unraid and xbmc have been happy bedfellows for a long time.

ignore my silly question, lol.
it's a branch of source, got confused and thought it was something else.

just about to run a build.

ignore my silly question, lol.
it's a branch of source, got confused and thought it was something else.

just about to run a build.

my configure options,

./configure \
--enable-nfs \
--enable-upnp \
--enable-ssh \
--enable-libbluray \
--disable-debug \
--disable-vdpau \
--disable-vaapi \
--disable-crystalhd \
--disable-vdadecoder \
--disable-vtbdecoder \
--disable-openmax \
--disable-joystick \
--disable-rsxs \
--disable-projectm \
--disable-rtmp \
--disable-airplay \
--disable-airtunes \
--disable-dvdcss \
--disable-optical-drive \
--disable-libusb \
--disable-libcec \
--disable-libmp3lame \
--disable-libcap \
--disable-udev \
--disable-libvorbisenc \
--disable-asap-codec \
--disable-afpclient \
--disable-goom \
--disable-fishbmc \
--disable-spectrum \
--disable-waveform \
--disable-avahi \
--disable-non-free \
--disable-texturepacker \
--disable-pulse \
--disable-dbus \
--disable-alsa \
--disable-hal && \


do these look good to you ? anything else to disable, my personal choice is for bluray enabled as i have a lot of bluray rips.
(This post was last modified: 2014-12-23 01:52 by sparklyballs.)
find quote
sparklyballs Offline
Senior Member
Posts: 143
Joined: Feb 2012
Reputation: 1
Post: #3
(2014-12-23 01:42)topfs2 Wrote:  I've recently been trying to gather up some patches and fix those things that depend on the gui in kodi so that we may at one point have a headless version of Kodi.

In general my goal is to split out my efforts over multiple PRs so that master gets better and better.
But for those interested I have pulled in all needed patches for my initial headless version of kodi on a base of Helix. Which can be found over at my repository https://github.com/topfs2/xbmc/tree/helix_headless

The initial attempt here is not to compile down a stripped version of kodi just for headless use, but rather to disable the gui on start. This means that it can replace a Helix and if its headless or not is only choosen via the startup argument --headless.

When headless uPnP and Webserver are default to on, as what point is headless if you can't connect to it Smile

To run after compile simply
Quote:/path/to/kodi --headless

Please let me know of any bugs and crashes when running in headless so we can get headless into master ASAP!

Cheers,
Tobias


is there a default port for the webserver (8080 presumably) and/or can it be set by advancedsettings.xml file ?
find quote
sparklyballs Offline
Senior Member
Posts: 143
Joined: Feb 2012
Reputation: 1
Post: #4
Apologies if this has already been covered but can i make a suggestion if it hasn't ?


Seeing as a current use for headless version of kodi is in a mysql setup (i know it's gonna be phased out at some stage) and the only current way to change those settings is through advancedsettings.xml, can one be generated with a headless install by default so it just needs editing to suit.
find quote
xexe Offline
Posting Freak
Posts: 764
Joined: Sep 2008
Reputation: 5
Post: #5
What is the purpose of server.xml?

Having problems getting your TV shows recognized?

Try my extra TV show matching REGEX here
find quote
jjd-uk Offline
Team-Kodi Member
Posts: 6,116
Joined: Oct 2011
Reputation: 146
Post: #6
(2014-12-23 03:10)sparklyballs Wrote:  Apologies if this has already been covered but can i make a suggestion if it hasn't ?


Seeing as a current use for headless version of kodi is in a mysql setup (i know it's gonna be phased out at some stage) and the only current way to change those settings is through advancedsettings.xml, can one be generated with a headless install by default so it just needs editing to suit.
That's not right, all settings can be changed via JSON-RPC however that's not very end user friendly, and not many of the remote app & webui app devs have picked up on this, the only one might be the official iOS remote app. Settings management via JSON is something we should perhaps promote more in preparation for headless.
find quote
sparklyballs Offline
Senior Member
Posts: 143
Joined: Feb 2012
Reputation: 1
Post: #7
(2014-12-23 13:19)jjd-uk Wrote:  
(2014-12-23 03:10)sparklyballs Wrote:  Apologies if this has already been covered but can i make a suggestion if it hasn't ?


Seeing as a current use for headless version of kodi is in a mysql setup (i know it's gonna be phased out at some stage) and the only current way to change those settings is through advancedsettings.xml, can one be generated with a headless install by default so it just needs editing to suit.
That's not right, all settings can be changed via JSON-RPC however that's not very end user friendly, and not many of the remote app & webui app devs have picked up on this, the only one might be the official iOS remote app. Settings management via JSON is something we should perhaps promote more in preparation for headless.

I wasn't aware that it could be changed through JSON, but definitely agree on the not very user friendly aspect.

I do hope that the advancedsettings.xml file will still be read, (if not created) or a default webui baked in will give us access to change various settings etc....

whilst if settings were possible through 3rd party apps, i think it would be inifinitely more preferalbe to be able to do it "inhouse" easily without any reliance on 3rd party stuff.
find quote
sparklyballs Offline
Senior Member
Posts: 143
Joined: Feb 2012
Reputation: 1
Post: #8
(2014-12-23 13:28)sparklyballs Wrote:  
(2014-12-23 13:19)jjd-uk Wrote:  
(2014-12-23 03:10)sparklyballs Wrote:  Apologies if this has already been covered but can i make a suggestion if it hasn't ?


Seeing as a current use for headless version of kodi is in a mysql setup (i know it's gonna be phased out at some stage) and the only current way to change those settings is through advancedsettings.xml, can one be generated with a headless install by default so it just needs editing to suit.
That's not right, all settings can be changed via JSON-RPC however that's not very end user friendly, and not many of the remote app & webui app devs have picked up on this, the only one might be the official iOS remote app. Settings management via JSON is something we should perhaps promote more in preparation for headless.

I wasn't aware that it could be changed through JSON, but definitely agree on the not very user friendly aspect.

I do hope that the advancedsettings.xml file will still be read, (if not created) or a default webui baked in will give us access to change various settings etc....

whilst if settings were possible through 3rd party apps, i think it would be inifinitely more preferalbe to be able to do it "inhouse" easily without any reliance on 3rd party stuff.


Although, and this is purely from my personal perspective, this JSON setting up of mysql settings could be something i could make use of in a docker for unraid, and on that i have some questions.

can JSON take variables cos i could pass them through from template based docker app on unraid and then not worry about user-friendiless at all.

what are the JSON "commands" (don't know the proper term) to change mysql settings, ip, port, user, pass, etc.....

and lastly, although not directly related to this, what is a good test that kodi.bin is up and ready to accept JSON etc.... cos of the way docker works would need to know this before attempting to pass commands to it, currently i just sleep for 45 seconds before sed'ing advancedsettings.xml. it's not very elegant.
find quote
topfs2 Offline
Team-Kodi Developer
Posts: 4,548
Joined: Dec 2007
Reputation: 17
Post: #9
(2014-12-23 10:47)xexe Wrote:  What is the purpose of server.xml?

It contains override settings which are in effect when you run in headless mode, so it probably should be named headless.xml

(2014-12-23 01:46)sparklyballs Wrote:  
(2014-12-23 01:42)topfs2 Wrote:  I've recently been trying to gather up some patches and fix those things that depend on the gui in kodi so that we may at one point have a headless version of Kodi.

In general my goal is to split out my efforts over multiple PRs so that master gets better and better.
But for those interested I have pulled in all needed patches for my initial headless version of kodi on a base of Helix. Which can be found over at my repository https://github.com/topfs2/xbmc/tree/helix_headless

The initial attempt here is not to compile down a stripped version of kodi just for headless use, but rather to disable the gui on start. This means that it can replace a Helix and if its headless or not is only choosen via the startup argument --headless.

When headless uPnP and Webserver are default to on, as what point is headless if you can't connect to it Smile

To run after compile simply
Quote:/path/to/kodi --headless

Please let me know of any bugs and crashes when running in headless so we can get headless into master ASAP!

Cheers,
Tobias

Could this be dockerised as there is a lot of interest on this over on the unraid forum as they have a docker base in the beta of uraid 6 and unraid and xbmc have been happy bedfellows for a long time.

ignore my silly question, lol.
it's a branch of source, got confused and thought it was something else.

just about to run a build.

ignore my silly question, lol.
it's a branch of source, got confused and thought it was something else.

just about to run a build.

my configure options,

./configure \
--enable-nfs \
--enable-upnp \
--enable-ssh \
--enable-libbluray \
--disable-debug \
--disable-vdpau \
--disable-vaapi \
--disable-crystalhd \
--disable-vdadecoder \
--disable-vtbdecoder \
--disable-openmax \
--disable-joystick \
--disable-rsxs \
--disable-projectm \
--disable-rtmp \
--disable-airplay \
--disable-airtunes \
--disable-dvdcss \
--disable-optical-drive \
--disable-libusb \
--disable-libcec \
--disable-libmp3lame \
--disable-libcap \
--disable-udev \
--disable-libvorbisenc \
--disable-asap-codec \
--disable-afpclient \
--disable-goom \
--disable-fishbmc \
--disable-spectrum \
--disable-waveform \
--disable-avahi \
--disable-non-free \
--disable-texturepacker \
--disable-pulse \
--disable-dbus \
--disable-alsa \
--disable-hal && \


do these look good to you ? anything else to disable, my personal choice is for bluray enabled as i have a lot of bluray rips.

The intent of my branch is to run without any disables, i.e. a fully functional kodi but with the GUI disabled. So its fully possible to play music on it etc.
This is because we/I am aiming towards platforms were GUI is available but you might not want to run it. For example if you have kodi installed on your windows box it could potentially always boot up in headless mode, starting kodi via menu would simply trigger the GUI creation and "exit" would mean that it simply closes the GUI while headless remains. Much like how steams big picture behaves.

However, in a NAS environment it will always be beneficial to disable, as there is never a GUI available, and packages with gui makes no sense. But thats not my personal main goal, as that should be very possible to do no matter.

If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
find quote
sparklyballs Offline
Senior Member
Posts: 143
Joined: Feb 2012
Reputation: 1
Post: #10
(2014-12-23 13:39)topfs2 Wrote:  
(2014-12-23 10:47)xexe Wrote:  What is the purpose of server.xml?

It contains override settings which are in effect when you run in headless mode, so it probably should be named headless.xml

(2014-12-23 01:46)sparklyballs Wrote:  
(2014-12-23 01:42)topfs2 Wrote:  I've recently been trying to gather up some patches and fix those things that depend on the gui in kodi so that we may at one point have a headless version of Kodi.

In general my goal is to split out my efforts over multiple PRs so that master gets better and better.
But for those interested I have pulled in all needed patches for my initial headless version of kodi on a base of Helix. Which can be found over at my repository https://github.com/topfs2/xbmc/tree/helix_headless

The initial attempt here is not to compile down a stripped version of kodi just for headless use, but rather to disable the gui on start. This means that it can replace a Helix and if its headless or not is only choosen via the startup argument --headless.

When headless uPnP and Webserver are default to on, as what point is headless if you can't connect to it Smile

To run after compile simply

Please let me know of any bugs and crashes when running in headless so we can get headless into master ASAP!

Cheers,
Tobias

Could this be dockerised as there is a lot of interest on this over on the unraid forum as they have a docker base in the beta of uraid 6 and unraid and xbmc have been happy bedfellows for a long time.

ignore my silly question, lol.
it's a branch of source, got confused and thought it was something else.

just about to run a build.

ignore my silly question, lol.
it's a branch of source, got confused and thought it was something else.

just about to run a build.

my configure options,

./configure \
--enable-nfs \
--enable-upnp \
--enable-ssh \
--enable-libbluray \
--disable-debug \
--disable-vdpau \
--disable-vaapi \
--disable-crystalhd \
--disable-vdadecoder \
--disable-vtbdecoder \
--disable-openmax \
--disable-joystick \
--disable-rsxs \
--disable-projectm \
--disable-rtmp \
--disable-airplay \
--disable-airtunes \
--disable-dvdcss \
--disable-optical-drive \
--disable-libusb \
--disable-libcec \
--disable-libmp3lame \
--disable-libcap \
--disable-udev \
--disable-libvorbisenc \
--disable-asap-codec \
--disable-afpclient \
--disable-goom \
--disable-fishbmc \
--disable-spectrum \
--disable-waveform \
--disable-avahi \
--disable-non-free \
--disable-texturepacker \
--disable-pulse \
--disable-dbus \
--disable-alsa \
--disable-hal && \


do these look good to you ? anything else to disable, my personal choice is for bluray enabled as i have a lot of bluray rips.

The intent of my branch is to run without any disables, i.e. a fully functional kodi but with the GUI disabled. So its fully possible to play music on it etc.
This is because we/I am aiming towards platforms were GUI is available but you might not want to run it. For example if you have kodi installed on your windows box it could potentially always boot up in headless mode, starting kodi via menu would simply trigger the GUI creation and "exit" would mean that it simply closes the GUI while headless remains. Much like how steams big picture behaves.

However, in a NAS environment it will always be beneficial to disable, as there is never a GUI available, and packages with gui makes no sense. But thats not my personal main goal, as that should be very possible to do no matter.


I ran my build last night and had a little explore with it earlier, not certain if it is a vagary of docker but i had to start it, let it run for a few minutes and then stop/start it again before i could get the web interface and ping it from sickbeard etc...

That aside though, it seems stable when browsing music in the web app which in headless trips it up sometimes.
find quote
jjd-uk Offline
Team-Kodi Member
Posts: 6,116
Joined: Oct 2011
Reputation: 146
Post: #11
(2014-12-23 13:28)sparklyballs Wrote:  whilst if settings were possible through 3rd party apps, i think it would be inifinitely more preferalbe to be able to do it "inhouse" easily without any reliance on 3rd party stuff.

That is part of the plan I believe.

The author of the Chorus webui has joined the Team with the aim of using it as a basis of a new default webui, as part of this we also want the settings management, however lack of time has been an issue in getting this done.
find quote
sparklyballs Offline
Senior Member
Posts: 143
Joined: Feb 2012
Reputation: 1
Post: #12
(2014-12-23 01:42)topfs2 Wrote:  I've recently been trying to gather up some patches and fix those things that depend on the gui in kodi so that we may at one point have a headless version of Kodi.

In general my goal is to split out my efforts over multiple PRs so that master gets better and better.
But for those interested I have pulled in all needed patches for my initial headless version of kodi on a base of Helix. Which can be found over at my repository https://github.com/topfs2/xbmc/tree/helix_headless

The initial attempt here is not to compile down a stripped version of kodi just for headless use, but rather to disable the gui on start. This means that it can replace a Helix and if its headless or not is only choosen via the startup argument --headless.

When headless uPnP and Webserver are default to on, as what point is headless if you can't connect to it Smile

To run after compile simply
Quote:/path/to/kodi --headless

Please let me know of any bugs and crashes when running in headless so we can get headless into master ASAP!

Cheers,
Tobias



i've just made a separate ubuntu 14.04 VM specfically for playing with kodi builds and i'm gonna use it for this first , as far as dependencies go should i be looking to the kodi ppa and installing build-dep or getting the dependencies seperately ?
find quote
wsnipex Offline
Team-Kodi
Posts: 6,350
Joined: Jun 2011
Reputation: 163
Post: #13
you can use build-dep if you add the ppa with add-apt-repository -s
find quote
Woerd88 Offline
Member
Posts: 76
Joined: Oct 2012
Reputation: 3
Post: #14
Very interesting feature, topfs2 Big Grin
I was think about the android platform:
Would it be possible to run kodi as a service, and run the gui in an activity?
This would improve listening to music on a android device in the background, because with the current architecture the playback stops when you leave kodi.
find quote
pgjensen Offline
Senior Member
Posts: 105
Joined: Dec 2008
Reputation: 2
Post: #15
Steps I took to get this working:

1) cd
2) git clone https://github.com/topfs2/xbmc.git kodi-helix-headless
3) cd kodi-helix-headless/
4) git checkout helix_headless
5) ./bootstrap
6) ./configure --prefix=/opt/kodi-helix-headless/
7) make
8) sudo make install
9) /opt/kodi-helix-headless/lib/kodi/kodi.bin --headless &
Can't open display

** keeps running! **
(This post was last modified: 2014-12-24 07:51 by pgjensen.)
find quote
Post Reply