[Howto] XBMC-Server on OMV - no GUI, only for MySQL-DB scan

  • Please read the following carefully!
    don't use this guide anymore!
    The XBMC-version will not be upgraded above 13.0
    Use this instead: http://forums.openmediavault.org/viewtopic.php?f=13&t=4906


    Thx to GutPilz
    -----------------------------------------------------------------------------------------------------------------------


    This guide describes, how to run a headless xbmc-server on OMV (amd64 only for now, sorry). The XBMC-server is only for the MySQL-Database scan and cannot play any files or music.
    You need some CLI experience for this guide ;)


    Info about the xbmc-server: http://forum.xbmc.org/showthre…19&pid=1117319#pid1117319


    The xbmc-server must be compiled by your own or you can use the version linked in this post (amd64 only). Eventually someone can provide a 32bit version?
    How to compile the xbmc-server:
    Guide over @ xbmc.org from KraVen: here
    xbmc-server.cpp and others here or here
    fix for Frodo 12.0: here
    The binary linked under 3. is compiled with:

    Code
    ./configure  --enable-shared-lib  --disable-debug --disable-vdpau  --disable-vaapi --disable-crystalhd  --disable-vdadecoder  --disable-vtbdecoder  --disable-openmax  --disable-joystick --disable-xrandr  --disable-rsxs  --disable-projectm --disable-rtmp  --disable-airplay --disable-airtunes --disable-dvdcss --disable-optical-drive  --disable-libbluray --disable-libusb  --disable-libcec  --disable-libmp3lame  --disable-libcap --disable-optical-drive --disable-libbluray --disable-ssh --disable-udev --disable-asap-codec --disable-afpclient --disable-nfs --disable-goom --disable-avahi --disable-upnp


    You must know, what you are doing! I'm not responsible, if you break your OMV-System!
    I repeat: It's for the 64bit-version only!This xbmc-server can NOT play any files and is only for MySQL-DB scan. It is _not_ the "normal" XBMC. If you know what you are doing, proceed.


    Please ask questions about the xbmc-server in the corresponding XBMC-Forum


    To get this to work, you need:
    1. One ore more XBMC-Clients - Frodo 12.0 is supported only
    2. a MySQL-Database for XBMC -> Howto thx to bootlegninja
    3. your XBMC-Clients already connected to your MySQL-DB -> Howto
    You have all this? OK, let's go:


    1. Install some needed stuff:

    Code
    apt-get install libsdl1.2debian-all libmicrohttpd5 libsmbclient libsdl-image1.2 libjasper1 libtinyxml2.5.3 libyajl1 liblzo2-2 libglu1-mesa libglew1.5 libpython2.6 libfribidi0 libpcrecpp0 libcdio10 libsamplerate0 libtag1c2a libhal1 libhal-storage1


    2. Install taglib 1.8
    Go to http://debian.oppserver.net/debian/#squeeze and search for taglib
    There are 3 files:
    - libtag1-vanilla
    - libtag1c2a
    - libtagc0
    I don't know which one is needed, so download and install all 3 ;)

    Code
    dpkg -i $packagename


    3. unpack the xbmc-server to the root directory (copys the files to their location)
    Download this file and unpack it to root with

    Code
    tar xvfz xbmc-server_Frodo_12.0_amd64.tar.gz -C /


    4. update the start scripts

    Code
    update-rc.d xbmc-server defaults


    5. Run the xbmc-server

    Code
    services xbmc-server start


    6. Connect to the xbmc-server's WebGUI via your preferred browser

    Code
    http://OMV-IP:8585


    User: "xbmc"
    Password:"xbmc"


    xbmc-server runs with portable-data under "/opt/xbmc-server/portable-data". You find the xbmc-server-log in "/opt/xbmc-server/portable-data/temp/xbmc.log"


    Please change the guisettings.xml (for password and WebGUI-Port), advancedsettings.xml and the sources.xml on all clients to fit your needs. More Info on XBMC-Wiki
    All XBMC-Clients needs the same sources for the database and the same db-version. If you set up user and pw for the smb-share, make sure you use this syntax for the smb-share:

    Code
    smb://user:password@Server/Path/to/media


    You can update your DB over the XBMC-WebGUI or over CLI with: (change the IP)
    Video-DB:

    Code
    curl -s -d '{"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}' -H 'content-type: application/json;' http://xbmc:xbmc@yourOMV-IP:8585/jsonrpc?VideoLibrary.Scan


    Music-DB:

    Code
    curl -s -d '{"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}' -H 'content-type: application/json;' http://xbmc:xbmc@yourOMV-IP:8585/jsonrpc?MusicLibrary.Scan


    If everything works, it should look like this:

    Zitat

    user@huntington:~$ curl -s -d '{"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}' -H 'content-type: application/json;' http://xbmc:xbmc@yourIP:8585/jsonrpc?VideoLibrary.Scan (Enter)
    {"id":1,"jsonrpc":"2.0","result":"OK"} (reply from the xbmc-server)
    user@huntington:~$


    and then the xbmc.log looks like this:

    Zitat

    ...
    19:43:36 T:140260291684096 NOTICE: Thread CVideoInfoScanner start, auto delete: false
    19:43:36 T:140260291684096 NOTICE: VideoInfoScanner: Starting scan ..
    19:43:47 T:140260291684096 NOTICE: VideoInfoScanner: Finished scan. Scanning for video info took 00:10
    19:45:19 T:140260641339296 NOTICE: Samba is idle. Closing the remaining connections


    I've got a ATV2 and a Windows-PC (both Frodo 12.0) synced over a MySQL-DB with xbmc-server.
    If you want, you can store the thumbnails on a SMB-share on the OMV-machine. So every client can get them and doesn't have to store them on its own:
    http://wiki.xbmc.org/index.php…Sync_thumbails_and_fanart
    I don't know, if it's neccessary for Frodo 12.0, but works on my Clients very nice.


    New libxbmc.so with Frodo 12.2 and upnp, NFS etc.:
    http://filebin.ca/vesuT5KyDnF/libxbmc.so.zip
    overwrite the old file in /lib


    Known issues:
    - xbmc-server will crash, if you browse the Database with the XBMC-WebGUI


    To do:
    - get this addon working -> XBMC Library Updater Addon


    Turorial-Version 0.3

    • Offizieller Beitrag

    Very interesting. Nice writeup. I will have to test this in a virtual machine. I'd be curious to see how the built-in dlna server compares to minidlna especially since I think it transcodes (?)

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.2 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4 | scripts 7.0.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Zitat von "ryecoaaron"

    Very interesting. Nice writeup. I will have to test this in a virtual machine. I'd be curious to see how the built-in dlna server compares to minidlna especially since I think it transcodes (?)


    It is compiled with "--disable-upnp" and "--disable-avahi" so I think it doesn't recode, but I'm compiling a new version atm with upnp- and avahi-support. If it's ready i send you a link to test the new libxbmc.so.

  • Just a quick note. I no longer have FTP access at SKSApps since it was hacked a while back. The XBMC server files I had there are no longer there. I've uploaded them here to correct that problem.

  • Thx for this. I got the files already from "excyle" over @ the xbmc-forums here
    Am I right that you fixed the OMV-MySQL guide i replied at xbmc.org also? Thx, I'll link it here, if you don't mind.

  • No prob. I have problems sharing what I have collected with my notes. If it makes it easier for someone else, I can be happy with that since I spent a long while frustrated when getting it all to work on OMV. And yes, I uploaded the "guide" on for MySQL settings for OMV on the headless server. It's up at http://bootlegninja.awardspace.com/xbmc-server/omvsql/



    Just a heads up for others, I coded nothing. Anything I post is work of Vicbitter, Odin, Maxim, Kraven and others. (sorry guys if I spelled your names wrong.) I just collect and organize to simplify.
    Also, just compiled a headless XBMC 13.0 Alpha1 using my notes with zero issues. One more note. xbmcVideoLibraryScan is optional. I compile it since I like to put it in a cron job for the system to scan hourly while it's on.

  • I tried to compile the current git version of xbmc on the current OMV-virtualbox vm.


    I've replaced the two files as described in post 1.
    I've compiled and installed taglib 1.8 from scratch.


    Here are my configure options:

    Code
    ./configure  --enable-shared-lib  --disable-debug --disable-vdpau  --disable-vaapi --disable-crystalhd  --disable-vdadecoder  --disable-vtbdecoder  --disable-openmax  --disable-joystick --disable-xrandr  --disable-rsxs  --disable-projectm --disable-rtmp  --disable-airplay --disable-airtunes --disable-dvdcss --disable-optical-drive  --disable-libbluray --disable-libusb  --disable-libcec  --disable-libmp3lame  --disable-libcap --disable-optical-drive --disable-libbluray --disable-ssh --disable-udev --disable-asap-codec --disable-afpclient --disable-nfs --disable-goom --enable-avahi --enable-upnp --enable-pic


    I've added "--enable-pic" after I got some errors. Apparently it has no effect.


    When I try to run "make" or "make CFLAGS="${CFLAGS} -fPIC", the result is the same.


    Code
    gcc -o /root/xbmc/system/players/dvdplayer/libdvdnav-x86_64-linux.so -shared -fPIC -rdynamic  -Wl,--soname,/root/xbmc/system/players/dvdplayer/libdvdnav-x86_64-linux.so  libdvdread/obj/*.o libdvdnav/obj/*.o -lm \
                    -Wl,--unresolved-symbols=ignore-all \
                    `cat /root/xbmc/xbmc/cores/DllLoader/exports/wrapper.def` /root/xbmc/xbmc/cores/DllLoader/exports/wrapper.o
    /usr/bin/ld: /root/xbmc/xbmc/cores/DllLoader/exports/wrapper.o: relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
    /root/xbmc/xbmc/cores/DllLoader/exports/wrapper.o: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    make[1]: *** [/root/xbmc/system/players/dvdplayer/libdvdnav-x86_64-linux.so] Error 1
    make[1]: Leaving directory `/root/xbmc/lib/libdvd'
    make: *** [dvdpcodecs] Error 2


    Any ideas how to fix this?



    edit:
    I've updated openmediavault to 0.4.28 and rebooted.
    After a "make clean" and configure without "--enable-pic" followed by a normal "make" this is the error I get:



    Seems to me some libraries are missing. Any pointers?



    edit:
    setting CFLAGS and CXXFLAGS = "-ldl" did the trick.

  • I have a limited setup, where only the mysql DB is running on the OMV box. But I do not like the permissions. The xbmc user is basically the database admin, which can do everything everywhere.


    I still in the process to figure out how to make it more secure. Unfortunately XBMC creates new databases so you need at least some permissions to do that. This is not a flaw of OMV or mysql, it is not really good design of XBMC. I should be able to create the databases on my own and tell XBMC what those databases are. Unfortunately the <name> xml tag does not work as expected. It does not define the name of the database to use, but instead defines the prefix for a database to use, that does not solve this issue.


    So I will keep you updated if I found a solution for that.

    Everything is possible, sometimes it requires Google to find out how.

  • run these commands:


    Code
    export CFLAGS="-ldl"
    export CXXFLAGS="-ldl"


    this will only work until you log out. if you want these variables set permanently, you have to add these commands to your .bashrc or .bash_profile.


    edit:
    I've also written about this here.

  • And thats the problem. the provided precompiled xbmc version is with disabled NFS!!


    tried to compile my self. cant do it. tried quite everything.


    can someone be that kind and would compile it for me - same settings just with enabled NFS ´?



    that'll be awesome

  • can u please check your config.

    Code
    15:43:10 T:140478007424768 WARNING: Create - Unsupported protocol(nfs) in nfs://192.168.0.107/export/NAS_HD/Medien/Movies/Dead Man Down (2013)/
    15:43:10 T:140478007424768   ERROR: Exists - Error checking for nfs://192.168.0.107/export/NAS_HD/Medien/Movies/Dead Man Down (2013)/


    this is what i get.
    just made a fresh install of xbmc-server with your new libxbmc.so

  • Gutz-Pilz: SMB has a very high overhead so like you said, it is recommended to use NFS on the raspberry pi due to the low overhead this native solution has on the Pi.


    However I did not encounter any stutter lately with SMB either. (If you want to be able to use the Library on other places too you might need to use SMB instead of NFS. e.g. Windows doesnt support NFS and I've not yet encountered any viable solution for it.)


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!