Linux Recommended src configuration for Linux desktop that also acts as media server
#1
Hi all,

I have all my media loaded onto my desktop machine. The paths to the media configured in XBMC are currently filesystem paths
  • /var/local/media/video/TV Shows
  • /var/local/media/video/Movies
  • /var/local/media/audio/
The parent folder to all of these is exported via NFS
Eg. /var/local/media -> nfs://server/srv/nfs4/media
The notebook I had connected to my TV launched XBMC with a wrapper script that mounted an NFS share from the server to the same path on the notebook as the workstation. The metadata is provided by a MySQL database on the desktop/server specified in advancedsettings.xml.

Now, as I no longer have the notebook that was connected to the TV and there is an Android version of XBMC and I have an Android device with HDMI out, my understanding is that to use NFS on Android, one needs to configure the sources as NFS sources with NFS:// URLs.

This seems all well and good (I export all the metadata for my media to separate files to allow for easy importing should I need to rebuild the DB), but... it seems a little inefficient (and potentially problematic) to have the machine on which the media resides access itself via NFS. Is there a way to share the same media database, but have the Android client access it via NFS and the Linux desktop/server on which the media resides access it direct via the filesystem?

I'm thinking that if I configure the media sources to use NFS URLs and then on the desktop/server machine, to advanced settings I use path substitution as documented here:
http://wiki.xbmc.org/index.php?title=Path_substitution

Eg.
Code:
<advancedsettings>
<pathsubstitution>
  <substitute>
    <from>nfs://192.168.x.y/srv/nfs4/media/</from>
    <to>/var/local/media/</to>
  </substitute>
</pathsubstitution>
</advancedsettings>
Or would I need to explicitly match the specific source paths (is XBMC smart enough to see that the sources are subfolders of the specified substitution)?

... or am I thinking the wrong way about this?
Reply
#2
That would work.
Reply
#3
Thanks Smile ... On my desktop/server, I've implemented the advancedsettings.xml file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<advancedsettings>
  <videodatabase>
    <type>mysql</type>
    <host>127.0.0.1</host>
    <port>3306</port>
    <user>USERNAME</user>
    <pass>PASSWORD</pass>
    <name>xbmc_video</name>
  </videodatabase>
  <musicdatabase>
    <type>mysql</type>
    <host>127.0.0.1</host>
    <port>3306</port>
    <user>USERNAME</user>
    <pass>PASSWORD</pass>
    <name>xbmc_music</name>
  </musicdatabase>
  <pathsubstitution>
    <substitute>
      <from>nfs://SERVERLANIP/srv/nfs4/media/</from>
      <to>/var/local/media/</to>
    </substitute>
  </pathsubstitution>
</advancedsettings>
... I placed the same advancedsettings.xml file, less the pathsubstitution stanza and using the server's LAN IP instead of 127.0.0.1, into the userdata folder on my android device through a root adb shell. The sources.xml file now looks like this on both systems:
Code:
<sources>
    <programs>
        <default pathversion="1"></default>
    </programs>
    <video>
        <default pathversion="1"></default>
        <source>
            <name>TV Series</name>
            <path pathversion="1">nfs://SERVERLANIP/srv/nfs4/media/video/TV Series/</path>
        </source>
        <source>
            <name>Movies</name>
            <path pathversion="1">nfs://SERVERLANIP/srv/nfs4/media/video/Movies/</path>
        </source>
        <source>
            <name>Music Videos</name>
            <path pathversion="1">nfs://SERVERLANIP/srv/nfs4/media/video/Music Videos/</path>
        </source>
    </video>
    <music>
        <default pathversion="1"></default>
        <source>
            <name>Music</name>
            <path pathversion="1">nfs://SERVERLANIP/srv/nfs4/media/audio/</path>
        </source>
    </music>
    <pictures>
        <default pathversion="1"></default>
    </pictures>
    <files>
        <default pathversion="1"></default>
    </files>
</sources>
I also downgraded my desktop/server version of XBMC to match the Android version in use (12.2 release) and deleted the newer versions of database schema, refreshing/cleaning up the sources. Touch wood it seems to be working well Smile
Reply
#4
Ok.. after some testing, it turns out that using the pathsubstitution mentioned here BREAKS the config.

The Video -> Files view still sees files, but playback cannot see the files and searching for videos ("Search for new content") fails, stopping prematurely without obvious error.

Loopback NFS does appear to be working, but it still feels messy. Arguably this'd be a bug, no?

advancedsettings.xml now reads:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<advancedsettings>
  <videodatabase>
    <type>mysql</type>
    <host>127.0.0.1</host>
    <port>3306</port>
    <user>xbmc</user>
    <pass>PASSWORD</pass>
    <name>xbmc_video</name>
  </videodatabase>
  <musicdatabase>
    <type>mysql</type>
    <host>127.0.0.1</host>
    <port>3306</port>
    <user>xbmc</user>
    <pass>PASSWORD</pass>
    <name>xbmc_music</name>
  </musicdatabase>
<!--  <pathsubstitution>
    <substitute>
      <from>nfs://SERVERIP/srv/nfs4/media/</from>
      <to>/var/local/media/</to>
    </substitute>
  </pathsubstitution> -->
</advancedsettings>
Reply

Logout Mark Read Team Forum Stats Members Help
Recommended src configuration for Linux desktop that also acts as media server0