HOW-TO synchronize your XBMC Media Center between every room in the house: Lifehacker

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Closed
noner Offline
Senior Member
Posts: 115
Joined: May 2011
Reputation: 0
Post: #391
Also for people struggling with this (and assuming you are not using separate databases for separate profiles)

As of Eden, you no longer need to either create the databases in MySQL or specify them in advancedsettings, XBMC will do that for you automatically. Just ensure that you grant permission for the MySQL 'xbmc' user to create databases and allow the user to connect from all hosts

As the MySQL root user, DO execute this:

Code:
grant all on *.* to 'xbmc'@'%' identified by 'xbmc';

DONT do this any more in MySQL:
Code:
create database xbmc_video;
create database xbmc_music;

In advancedsettings.xml, DONT put in the following lines:
Code:
<name>xbmc_video</name>
<name>xbmc_music</name>

To clarify further, your advancedsettings.xml should just look like this for the MySQL sections (for path substitutions or anything else you require you still need to add that in there in addition to whats below for the MySQL portion)

Code:
<videodatabase>
<type>mysql</type>
<host>IP_OF_YOUR_MYSQL_SERVER</host>
<user>xbmc</user>
<pass>xbmc</pass>
</videodatabase>

<musicdatabase>
<type>mysql</type>
<host>IP_OF_YOUR_MYSQL_SERVER</host>
<user>xbmc</user>
<pass>xbmc</pass>
</musicdatabase>

Eden will create everything for you
(This post was last modified: 2012-04-07 20:37 by noner.)
find
noner Offline
Senior Member
Posts: 115
Joined: May 2011
Reputation: 0
Post: #392
(2012-04-07 20:31)Finchy Wrote:  Ah, thanks. That has let me access it locally in SQLyog as root and allow priveledges for XBMC on xbmc_video and _audio. I still can't access remotely from my laptop though. Any ideas? SQLyog gets a "2003 error - cannot connect to MySQL server on 192.168.1.4 (10600)"

This is likely a firewall issue, ensure you have port 3306 open on both your laptop and on the server you are running MySQL on (assuming you did not change the default port that MySQL listens to)

Also, in your MySQL config file, ensure you dont have the following variables assigned - if you do, just get rid of them

Code:
bind-address
skip_networking
find
Finchy Offline
Senior Member
Posts: 164
Joined: Dec 2010
Reputation: 0
Post: #393
3306 is definately open in the firewall on both the WHS and the laptop, as TCP. Is that correct?

I don't have those two variables in my ini so that's ok.
Hmmm. Or maybe not. I just disabled the firewall on the WHS and I can connect. Strange. There's definately a rule for both in and out allowing 3306.
(This post was last modified: 2012-04-07 21:03 by Finchy.)
find
noner Offline
Senior Member
Posts: 115
Joined: May 2011
Reputation: 0
Post: #394
(2012-04-07 20:54)Finchy Wrote:  3306 is definately open in the firewall on both the WHS and the laptop, as TCP. Is that correct?

I don't have those two variables in my ini so that's ok.
Hmmm. Or maybe not. I just disabled the firewall on the WHS and I can connect. Strange. There's definately a rule for both in and out allowing 3306.

Try both TCP and UDP 3306. If Memory serves me it should only require TCP.

Are you sure its running on 3306?
find
Finchy Offline
Senior Member
Posts: 164
Joined: Dec 2010
Reputation: 0
Post: #395
Yes, deffo 3306 as the local SQLyog connects to it fine on that port. So create a second UDP rule for in and out, 3306?

Crap, that didn't work.

It's the Private Profile of the firewall. When I disable it completely in the WHS, or change inbound connects on private to allow it can connect from my laptop.
find
Finchy Offline
Senior Member
Posts: 164
Joined: Dec 2010
Reputation: 0
Post: #396
Ah, got the rules working now. I can connect from my laptop (thank F for that!)

So should I delete the xbmc_video and _audio tables to let Eden recreate them, and use the advanced settings layouts you've mentioned above?

Thanks, BTW! Smile
find
noner Offline
Senior Member
Posts: 115
Joined: May 2011
Reputation: 0
Post: #397
(2012-04-07 21:49)Finchy Wrote:  Ah, got the rules working now. I can connect from my laptop (thank F for that!)

So should I delete the xbmc_video and _audio tables to let Eden recreate them, and use the advanced settings layouts you've mentioned above?

Thanks, BTW! Smile

No problem

Yep, unless you are planning on using multiple MySQL db's for multiple profiles, its easier to just let XBMC manage the db's

You can leave the db's in MySQL, and just remove them from your advanced settings, and when XBMC starts up for the first time, it will create the video and music databases (which in Eden Final are called MyVideos60 and MyMusic18) and going forward when you need to upgrade XBMC, if required it will make copies of those db's and upgrade the copy
Also, maybe post your solution for the firewall issue in case someone else is struggling with it and it may help them
(This post was last modified: 2012-04-07 22:02 by noner.)
find
Finchy Offline
Senior Member
Posts: 164
Joined: Dec 2010
Reputation: 0
Post: #398
Well, it wasn't so much a solution as deleting the ones I had created and creating new ones for in and outbound. So just New Rule>Port>TCP, 3306>Allow>Private>Name of rule>Finish

The rules I did have in there were previously created by the MySQL installation, and I'd been changing the settings within the rules to try to get them to open up properly. It was through disabling all parts of the firewall (domain, private and public) and gradually enabling them that I worked out that the rules I had in there were not working, so I deleted them and re-created them as above.

I'm hoping that all the problems I've been having in trying to get it set up have been caused by this! Fingers crossed...! I suspect I'll be back soon....!
find
Finchy Offline
Senior Member
Posts: 164
Joined: Dec 2010
Reputation: 0
Post: #399
Back already! Big Grin

So with the advanced settings file, should I use this;

Code:
<advancedsettings>
    <videodatabase>
    <type>mysql</type>
    <host>192.168.1.4</host>
    <user>xbmc</user>
    <pass>xbmc</pass>
    </videodatabase>

    <musicdatabase>
    <type>mysql</type>
    <host>192.168.1.4</host>
    <user>xbmc</user>
    <pass>xbmc</pass>
    </musicdatabase>

<pathsubstitution>
  <substitute>
    <from>special://masterprofile/Thumbnails/</from>
    <to>smb://XBMCUser:password@192.168.1.4/XBMCthumbnails/</to>
  </substitute>
</pathsubstitution>

</advancedsettings>

The IP of the WHS/SQL server is 192.168.1.4, and I created a Windows user on the WHS called XBMCUser to have permissions to access the shares?

I'm going to do it from the ATV first as that seems to be more temperamental, so if I let that create the database and xml files I can then do the other PC later?
(This post was last modified: 2012-04-08 12:51 by Finchy.)
find
Finchy Offline
Senior Member
Posts: 164
Joined: Dec 2010
Reputation: 0
Post: #400
To carry that further, if I want to sync the other options as well (other than add-ons);

Code:
<advancedsettings>

    <videodatabase>
    <type>mysql</type>
    <host>192.168.1.4</host>
    <port>3306</port>
    <user>xbmc</user>
    <pass>xbmc</pass>
    </videodatabase>

    <musicdatabase>
    <type>mysql</type>
    <host>192.168.1.4</host>
    <port>3306</port>
    <user>xbmc</user>
    <pass>xbmc</pass>
    </musicdatabase>

<pathsubstitution>

  <substitute>
    <from>special://masterprofile/Thumbnails/</from>
    <to>smb://XBMCUser:password@192.168.1.4XBMCthumbnails/</to>
  </substitute>

  <substitute>
    <from>special://masterprofile/sources.xml</from>
    <to>smb://XBMCUser:password@192.168.1.4/XBMC-XML-Files/sources.xml</to>
  </substitute>
  <substitute>
    <from>special://masterprofile/mediasources.xml</from>
    <to>smb://XBMCUser:password@192.168.1.4/XBMC-XML-Files/mediasources.xml</to>
  </substitute>

  <substitute>
    <from>special://masterprofile/playlists/</from>
    <to>smb://XBMCUser:password@192.168.1.4/XBMC-XML-Files/Playlists/</to>
  </substitute>

  <substitute>
    <from>special://masterprofile/favourites.xml</from>
    <to>smb://XBMCUser:password@192.168.1.4/XBMC-XML-Files/favourites.xml</to>
  </substitute>

  <substitute>
    <from>special://masterprofile/RssFeeds.xml</from>
    <to>smb://XBMCUser:password@192.168.1.4/XBMC-XML-Files/RssFeeds.xml</to>
  </substitute>

</pathsubstitution>

</advancedsettings>

Should that then create the sources.xml, favourites.xml, etc as the paths and favourites, etc are added, so if I then add the same advancedsettings.xml to the other devices they should be the same?
(This post was last modified: 2012-04-08 14:19 by Finchy.)
find
Finchy Offline
Senior Member
Posts: 164
Joined: Dec 2010
Reputation: 0
Post: #401
Hmmm, not a good start. I've dropped that advancedsettings.xml file into the folder on the ATV2 and started XBMC. It's painfully slow. Took nearly 5 minutes to load, and when I've selected Videos it's been stuck on the screen for ten minutes with no response.
find
Finchy Offline
Senior Member
Posts: 164
Joined: Dec 2010
Reputation: 0
Post: #402
OK, so I've stripped down the advancedsettings.xml file to just;

<advancedsettings>

<videodatabase>
<type>mysql</type>
<host>192.168.0.4</host>
<user>xbmc</user>
<pass>xbmc</pass>
</videodatabase>

<musicdatabase>
<type>mysql</type>
<host>192.168.0.4</host>
<user>xbmc</user>
<pass>xbmc</pass>
</musicdatabase>

</advancedsettings>

but it's still hanging when I try to access Videos. Stuck now! Sad

Edit: I've tried it <port>3306</port> added as well, but still the same.
(This post was last modified: 2012-04-08 15:55 by Finchy.)
find
noner Offline
Senior Member
Posts: 115
Joined: May 2011
Reputation: 0
Post: #403
What skin are you using? Hardware on the ATV2 does not play well with some of the more processing intensive skins.

Also the first time you start XBMC with no db it will create all the tables and populate them while doing a library scan

And if you have a big library, SMB will be inherently slower than NFS.

In my personal case, I use SMB to share thumbnails across all my Win7 clients but for my ATV2 I use NFS. I have a decently sized library and its pretty spiffy
find
Finchy Offline
Senior Member
Posts: 164
Joined: Dec 2010
Reputation: 0
Post: #404
Transparency - I find it works well with the TV set to 720p (all of my stuff is 720p or lower).

NFS on the ATV? Don't you have to add each whole path manually? Not easy with an ATV remote!

OK, so the ATV is now responding, but very sluggish - are there any SQL optimisations that might help? It has created the sources.xml file on the WHS (yey!), but it's not created an thumbnails (or folders) in the XBMCthumbs folder. It's still only a quarter of the way through scanning the first folder - does it create the thumbs at the end or should it have done that by now?
find
noner Offline
Senior Member
Posts: 115
Joined: May 2011
Reputation: 0
Post: #405
IMO Confluence is the best skin on the ATV for doing the initial setup, and once you have everything up and running you can switch back to T!

Both SMB and NFS are completely capable of streaming larger files once you select the file to play, but for smaller files that need to be searched for (as in the case of thumbs) NFS is faster. I only use NFS for thumbs, and still use SMB for the actual library access

The CPU on the ATV is slow as crap, if its still in the middle of scanning your library, then it will likely be even slower. On top of that depending on what other scripts are running in the background will slow the process down even further.
find
Thread Closed