2011-02-01, 10:30
I thought I'd share how I've set up my iPad using two different profiles, one for use on my home network accessing my MYSQL database, the other for use when travelling. These notes are written from the perspective of using an iPad, but I think it might be relevant for iphone users too.
I have two use cases for xbmc on my iPad:
1. When I'm using the iPad at home, chances are I want to access the same library I have available on my htpc, streaming my media from my networked storage.
2. When i'm on the move, e.g. train, plane or away from home, I'm interested in playing media that i've copied over to the iPad disk.
For scenario one I use the Master profile. First I set up a Mysql database for my video and music libraries as used by my htpc. This is well documented on lifehacker here and there's some detailed posts on this forum, including some excellent tips for speeding up the music views here. Next I set up my advancedsettings.xml for the master profile as follows:
The path substitution setting allows clients to switch library paths with locally defined ones, so using the above example paths read from the database will have '/media/Goods/' replaced with 'smb://MEDIABOB/goods/'. This feature is only available in iOS releases built after this commit, i.e. after the first official release, and is a great way to make local fast filesystem scans available to networked devices.
Finally, rename the master profile to At Home so we know how it's been set up.
Before going any further, if you haven't already, add some media to the disk of the mobile device (Tip: you may already have some music in your /var/mobile/Media/ITunes_Control/Music folder). I created new 'movie' and 'TV' folders in /var/mobile and put my files there - easy to access from within xbmc as this is the home directory.
Time now to set up a new profile called Travelling, setting the profile to use seperate media info and media sources. For mine I set it to use the directory 'local' within the profiles folder. Finally I set some nice pictures for each profile and set the use login screen option so I can choose which library to use when starting up xbmc on my iPad.
Now we want to set up our media sources for the travelling profile. I exited from xbmc and re-launched (I had some issues selecting the profile without a restart). On starting xbmc pick the travelling profile. Add sources for movies, tv and music to point to the local media. DO NOT RUN THE AUTOMATED SCANS at this point. Once you've set up your sources, quit xbmc.
Using iFile or similar, move an advancedsettings.xml to the directory selected for your travelling profile, this should specify a local sqlite DB. Mine looks like this:
Okay, now you're ready to scan your local media. Launch xbmc, select the travelling profile and scan the media from sources set up a moment ago.
Hey presto, all being well, you should now have a dual purpose xbmc installation, ready to launch with local or networked media.
Notes:
1. There's probably plenty of ways of skinning this cat. These instructions worked for me though, so hopefully should help someone else out there.
2. Not sure why the advancedsettings.xml should be required for the travelling profile, I was expecting default sqlite behaviour to apply, but it does appear necessary.
Any questions or suggestions for improvements please shout.
I have two use cases for xbmc on my iPad:
1. When I'm using the iPad at home, chances are I want to access the same library I have available on my htpc, streaming my media from my networked storage.
2. When i'm on the move, e.g. train, plane or away from home, I'm interested in playing media that i've copied over to the iPad disk.
For scenario one I use the Master profile. First I set up a Mysql database for my video and music libraries as used by my htpc. This is well documented on lifehacker here and there's some detailed posts on this forum, including some excellent tips for speeding up the music views here. Next I set up my advancedsettings.xml for the master profile as follows:
PHP Code:
<advancedsettings>
<videodatabase>
<type>mysql</type>
<host>mysql-server</host>
<name>xbmc_video</name>
<user>xbmc</user>
<pass>***</pass>
</videodatabase>
<musicdatabase>
<type>mysql</type>
<host>mysql-server</host>
<name>xbmc_music</name>
<user>xbmc</user>
<pass>***</pass>
</musicdatabase>
<pathsubstitution>
<substitute>
<from>/media/Goods/</from>
<to>smb://MEDIABOB/goods/</to>
</substitute>
</pathsubstitution>
</advancedsettings>
The path substitution setting allows clients to switch library paths with locally defined ones, so using the above example paths read from the database will have '/media/Goods/' replaced with 'smb://MEDIABOB/goods/'. This feature is only available in iOS releases built after this commit, i.e. after the first official release, and is a great way to make local fast filesystem scans available to networked devices.
Finally, rename the master profile to At Home so we know how it's been set up.
Before going any further, if you haven't already, add some media to the disk of the mobile device (Tip: you may already have some music in your /var/mobile/Media/ITunes_Control/Music folder). I created new 'movie' and 'TV' folders in /var/mobile and put my files there - easy to access from within xbmc as this is the home directory.
Time now to set up a new profile called Travelling, setting the profile to use seperate media info and media sources. For mine I set it to use the directory 'local' within the profiles folder. Finally I set some nice pictures for each profile and set the use login screen option so I can choose which library to use when starting up xbmc on my iPad.
Now we want to set up our media sources for the travelling profile. I exited from xbmc and re-launched (I had some issues selecting the profile without a restart). On starting xbmc pick the travelling profile. Add sources for movies, tv and music to point to the local media. DO NOT RUN THE AUTOMATED SCANS at this point. Once you've set up your sources, quit xbmc.
Using iFile or similar, move an advancedsettings.xml to the directory selected for your travelling profile, this should specify a local sqlite DB. Mine looks like this:
PHP Code:
<advancedsettings>
<musicdatabase>
<type>sqlite3</type>
<host>/var/mobile/Library/Preferences/XBMC/userdata/Database</host>
<name>MyMusic7</name>
</musicdatabase>
<videodatabase>
<type>sqlite3</type>
<host>/var/mobile/Library/Preferences/XBMC/userdata/Database</host>
<name>/MyVideos34</name>
</videodatabase>
</advancedsettings>
Okay, now you're ready to scan your local media. Launch xbmc, select the travelling profile and scan the media from sources set up a moment ago.
Hey presto, all being well, you should now have a dual purpose xbmc installation, ready to launch with local or networked media.
Notes:
1. There's probably plenty of ways of skinning this cat. These instructions worked for me though, so hopefully should help someone else out there.
2. Not sure why the advancedsettings.xml should be required for the travelling profile, I was expecting default sqlite behaviour to apply, but it does appear necessary.
Any questions or suggestions for improvements please shout.