[LINUX] xbmc server: possible quick implementation?

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Croaker Offline
Member
Posts: 61
Joined: Mar 2010
Reputation: 0
Post: #11
pko66 Wrote:Hey spiff, bladesuk1, first my apologies for stepping to "explain" bladesuk1 modifications to spiff, maybe is not my place, but just trying to help...

I think that what bladesuk1 is trying to implement is a "server mode": me, and from the forum I think many other ppl, have an installation of several XBMC machines running with a central storage server (usually, a linux or windows not very powerful machine but with lots of hard disk space shared on the network). In that server, a MySQL daemon is used as a central repository for the database of the XBMC machines and a shared folder is used for storing media thumbnails. Also, usually some kind of (semi)automatic download process (flexget/transmission/couch potato/utorrent/whatever) adds new media continuously. The current XBMC architecture needs a XBMC instance (and only one, because two instances simultaneusly trying to update will break the database) to scrape the media and generate thumbnails.

The problem is, the server usually has not graphical capability to run XBMC, maybe the server does not even has an attached screen, so the database needs to be update from one of the clients manually (I have xbmc installed in my main windows computer just to do that). I think what blasesuk1 is trying to implement is a "server mode" xbmc that, simply, runs without GUI and does nothing but running the scrapers from time to time. That could be running in the server (or, maybe even better, in a virtual machine inside the server that could be virtually switched on and off when needed) and will update the database and create the thumbnails automatically whenever is needed. Maybe a "start, look for and scrape new media, optionally clean database and then exit when finished" mode could be included.

I, for one, would find that extremely useful.

Just want to second that as it describes my situation 100% Big Grin

- ubuntu server with MySQL, transmission, tvheadend, smb-shares, ...
- office-pc with embermm (and XBMC Eden testing, so not compatible with the others)
- 2 other XBMC boxes (Dharma for now, more to come, perhaps 1 OpenElec when they reach Eden)

so when new media arrives i have to
- unpack and move to correct folders (not automated this, not XBMC stuff)
- run renamer tool (also not XBMC stuff)
- run embermm and scrape (generates NFO+images)
- go to living room or get laptop running (start XBMC)
- start library update

as my collection grows nearly every day i have to perform those steps often and as the amount of data grows, some steps take a significant amount of time (1000+ movies, 20+ series about 5 modified often)

another crappy thing is this:
- new episodes arrive, but only english NFO data available, so take this for now
- XBMC shows en
- a week later german info is available, so getting that
- XBMC needs refresh and that kills the 'latest episodes' listing as the already watched go to the top of the list

this applies to movies too.
find quote
bladesuk1 Offline
Junior Member
Posts: 32
Joined: Jul 2011
Reputation: 0
Post: #12
it's exactly the situation you're talking about (albeit i'm not yet sharing thumbnails, but that's on the cards when i get some time). i'm basically trying to stop all of the graphical stuff from starting up by using a command line switch. yes, it's still a full installation of xbmc, but i'd hope that the scrapers and database interaction would be able to run headless... keep your fingers crossed!

yes, it would be nicer if all i was doing was running something to populate a database (the scraper utilities and so on) without any additional code overhead, but this side of the code isn't something that can currently be run independently as it stands. also, the database structures and so on change pretty much with every revision (what are we on, db revision 57 now or something like that?), so there's no way in hell you'd want to start writing a new entirely separate codebase to interact with those database changes as then you're maintaining the same code in two places. you'd have to essentially split the database management side of things off entirely and re-architect xbmc to use that project for the media server instead for that to work. occam's razor (for me) suggests keeping the code in the same place, and basically just not running anything that isn't required to do this and only this.

my initial post isn't up-to-date any more - the git revision was different to the dharma code i was looking at, so i've tried to switch to the git codebase instead. i'm most of the way there, but last time i tried it didn't start, and now i can't get the damn thing to compile. i'm pulling from git again, and i'm going to try from there to see what i can do. i'll let you know what happens Smile
find quote
Croaker Offline
Member
Posts: 61
Joined: Mar 2010
Reputation: 0
Post: #13
so *fingers_crossed* Smile
find quote
bladesuk1 Offline
Junior Member
Posts: 32
Joined: Jul 2011
Reputation: 0
Post: #14
haven't been able to test it as i'm currently remote, but *something* is running without a gui and hasn't fallen over for a while. if anyone else is in a position to try it out and see if it does what's expected, then by all means give it a go and let me know how you get on.

apply the patch, compile, and start it with xbmc --no-test --server and see what happens, i suppose!

anyways, here's the pastebin link:

http://pastebin.com/HzgEhdQ9
find quote
bladesuk1 Offline
Junior Member
Posts: 32
Joined: Jul 2011
Reputation: 0
Post: #15
and it looks like the webserver's running along with the eventserver, and it's connecting to the database. however, the jsonrpc side of things isn't starting up at the moment according to the logs:

ERROR: JSONRPC Server: Failed to bind serversocket

of course, there's no mention of which socket it's trying to use, and i've no idea if that's configurable anyway. still, it's a start, and proves that the general idea seems to be workable. if i can get the jsorpc server to start up, that should give us the back-end server that we want to play with Smile

i'm still getting masses of mysql server connections, mind - don't know what the hell's going on with that, but it might be a known bug:

http://trac.xbmc.org/ticket/12156
find quote
Montellese Online
Team-XBMC Developer
Posts: 2,789
Joined: Jan 2009
Reputation: 20
Location: Switzerland
Post: #16
bladesuk1 Wrote:ERROR: JSONRPC Server: Failed to bind serversocket

The standard TCP port used by the JSONRPC TCP server is 9090 and you can change it through advancedsettings.xml (see http://wiki.xbmc.org/index.php?title=Adv...jsonrpc.3E).

But even if the JSONRPC TCP server does not start you can still access JSONRPC through HTTP (see http://wiki.xbmc.org/index.php?title=JSON_RPC#HTTP).

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]
find quote
bladesuk1 Offline
Junior Member
Posts: 32
Joined: Jul 2011
Reputation: 0
Post: #17
i'd actually managed to find that out with a bit of digging and realised i already had something running on that port. bit of tweaking managed to get that sorted out and jsonrpc is now running happily, by all accounts.

the next question, of course, is whether anything actually works Wink

so far, i've verified that i can shut it down from the web interface (using, i assume the event server) so that's looking good. i need to trigger a library update next, but i'll be configuring all of my sources to match the other xmbc instances on my network first. not too bothered about trashing that - in the absolute worst case, it can be rebuilt from the metadata stored with the media files themselves. i've plugged mediafrontpage in front of it, and that seems to be able to see and stop the server, too, although i've not had a chance to test the library side of it yet.

anyone else used the patchfile to get it working for yourself yet? or has anyone found anything more out about the broken mysql connections side of things?
find quote
bladesuk1 Offline
Junior Member
Posts: 32
Joined: Jul 2011
Reputation: 0
Post: #18
well, it actually appears to be working as expected - i've got mediafrontpage talking to this back-end server quite happily, the json-rpc side of things included.

next trick will be putting together a daemon script to stop/start it cleanly, but other than that, i'm happy. i'm struggling to get curl to call the http-rpc interface - unauthorised, apparently.

any idea how i go about submitting this for inclusion in the mainline codebase?
find quote
gugahoi Offline
Fan
Posts: 716
Joined: Aug 2009
Reputation: 4
Post: #19
bladesuk1 Wrote:well, it actually appears to be working as expected - i've got mediafrontpage talking to this back-end server quite happily, the json-rpc side of things included.

next trick will be putting together a daemon script to stop/start it cleanly, but other than that, i'm happy. i'm struggling to get curl to call the http-rpc interface - unauthorised, apparently.

any idea how i go about submitting this for inclusion in the mainline codebase?

This is brilliant! I hope it gets implemented into the final Eden if it works as advertised! Thanks for this!

Maraschino - github - website
find quote
Robotica Offline
Posting Freak
Posts: 927
Joined: Aug 2010
Reputation: 3
Post: #20
You can create a pull request on github for inclusion... Great No-GUI-approach to have some extra xbmc power.. And can you tell something about the impact on system resources? And given your topic title, is this Linux-only?
(This post was last modified: 2011-11-21 04:21 by Robotica.)
find quote
Post Reply