• 1
  • 52
  • 53
  • 54(current)
  • 55
  • 56
  • 58
xbmc minified as a server?
(2014-07-24, 18:12)wernerb Wrote:
(2014-07-24, 18:00)blauter78 Wrote:
(2014-07-01, 18:55)XBL. Wrote: This is what I use to add the sources (already replaced the paths with your paths). You probably want to check the options.

You can also add the sources from a client, which is probably a bit easier if you want to configure the options for each source.

Code:
INSERT INTO `path` (`strPath`, `strContent`, `strScraper`, `strHash`, `scanRecursive`, `useFolderNames`, `strSettings`, `noUpdate`, `exclude`, `dateAdded`) VALUES
('nfs://192.168.0.107/export/NAS_HD/Medien/Movies/', 'movies', 'metadata.themoviedb.org', NULL, 1, 1, '<settings><setting id="RatingS" value="IMDb" /><setting id="TrailerQ" value="No" /><setting id="certprefix" value="Rated " /><setting id="fanart" value="true" /><setting id="keeporiginaltitle" value="true" /><setting id="language" value="en" /><setting id="tmdbcertcountry" value="nl" /><setting id="trailer" value="true" /></settings>', 0, 0, NULL),
('nfs://192.168.0.107/export/NAS_HD/Medien/TV Shows/', 'tvshows', 'metadata.tvdb.com', NULL, 0, 0, '<settings><setting id="absolutenumber" value="false" /><setting id="dvdorder" value="false" /><setting id="fanart" value="true" /><setting id="language" value="en" /><setting id="posters" value="false" /></settings>', 0, 0, NULL);

OK, so I compiled XBMC 14.0-ALPHA1 into docker container running on Ubuntu 12.04 and everything seems to be working. This is running under VMWare, so I shared my videos, pictures and music over (as test) and is mounted as /mnt/hgfs. I then used -v /mnt/hgfs:/media in my run command and used the above script to add /media/video and /media/music as sources. I finally added cron entry to update the library at regular intervals. Just did this as a quick proof of concept to replace Serviio. I am able to browse content on all my dlna/upnp devices including other XBMC boxes and so far, all content has been able to play.

However, I do have a couple questions. Why do I have to add sources in the database? I originally wanted to test pure upnp setup which my understanding wouldn't even need centralized DB. I tried leaving out DB configuration and only use sources.xml but had no luck in doing so. I also am not quite sure how to add picture source through XML or DB. Is there a way I can add my pictures library as a local source and share via upnp?

Hi! Good question. What you do is the following:

1. Setup xbmc on your computer (download it as normal, install as normal)
2. Configure the sources there with the GUI, adding pictures, video locations etc.
3. Enable UPnP Server and other services and test them in your network
4. Then simply copy over the userdata folder from your computer to your server and link that with the docker container (-V ~/.userdata:.. look at the example)
5. Copy over advancedsettings.xml to the userdata folder (from the xbmc docker container) and remove the section about mysql.
6. Run your container

Your xbmc server will then start and it will be identical to the xbmc you had configured on your PC.
Effectively you configure everything through gui and once satisfied you shutdown and copy the library/database/settings to the docker container where it will run as a headless server.
No need to configure anything manually with xml or db.

That's a great idea, thanks. I will give it a try.
Reply
fyi: https://github.com/xbmc/xbmc/pull/5071
Reply
(2012-06-01, 12:31)edhen Wrote: I am currently in blueprint process for managing multiple xbmc's via a central mysql database located on a server. I am currently designing a webui that manages every xbmc system through the server. my question really regards to how i could get xbmc locally on the server without UI etc just so i can make system calls via json or exec commands from php to update the library and obtain library information aswell as have the thumbs etc stored locally... The server i am currently working with is Ubuntu Server.

I opened a thread on a new DB format that works as a shared DB... your contribution would be great. I under the development subforum.
I already proposed the first logical view of the DB

I think having a good shared DB will be better than having a headless XBMC as MySQL (or any other DB) can run on NAS and other platforms
If you think I'm useful please use the +/- button to raise my reputation
Reply
(2014-07-26, 08:26)wsnipex Wrote: fyi: https://github.com/xbmc/xbmc/pull/5071
I don't have a github account, so I can't post there. But they are aware of this thread, right? I've read the first few posts and it seems they're looking to repeat a lot of work that has already been done (or maybe I'm missing the point - I'm no developer).

(2014-07-26, 23:31)m.savazzi Wrote: I opened a thread on a new DB format that works as a shared DB... your contribution would be great. I under the development subforum.
I already proposed the first logical view of the DB

I think having a good shared DB will be better than having a headless XBMC as MySQL (or any other DB) can run on NAS and other platforms
OP has been banned.

Also, sure, a more streamlined DB is always welcome, but that won't replace a headless XBMC. The whole point of a headless XBMC is that we can do the scraping and what not on our NAS (or other server kind of system).
Reply
Err sounds like reinventing the wheel.?

The existing MySQL db format works fine as a shared db, no new dev required.
Reply
how would i go abouts disabling the version check addon for headless?
iOS XBMC users PLEASE use the advanced search function before starting a new thread. Make sure to click on 'XBMC for iOS Specific Support' so your results are narrowed down correctly.

Please make sure to visit the Sticky section for common issues/questions/etc. Also, XBMC for iOS information
Reply
Have you guys checked out using MediaBrowser as the server and a plugin called XBMB3C to connect xbmc clients to it? It's developed now to a level where there is no need for using the xbmc local database for anything. All info such as watched status per user etc is synched and available on any of the multiple clients it has (ios, roku etc)

There's even a fair few skins that have been modded to fully integrate the xbmb3c addon.

Have a look here: http://mediabrowser.tv/community/index.p...tham-repo/
Reply
Sounds a lot like PleXBMC, which allows you to use XBMC with Plex media server. What most people in this topic are looking for (at least I do) is native XBMC support.
Reply
I see this comment in the plans for Helix:

Quote:Library:
Improve XBMC's database schema for flexibility and add abstraction to support different backends
Change the preferred extension for metadata import/export files from .nfo to .xml as standard for XBMC
As a developer working with MediaBrowser, this sounds very interesting. Is there a thread somewhere with more details?

I think it makes a lot of sense to handle the server-based DB functionality the same way the Live TV functionality was added - a good API to provide hooks for multiple solutions.

xnappo
Reply
(2014-08-04, 19:14)xnappo Wrote: I see this comment in the plans for Helix:
Quote:Library:
Improve XBMC's database schema for flexibility and add abstraction to support different backends
Change the preferred extension for metadata import/export files from .nfo to .xml as standard for XBMC
As a developer working with MediaBrowser, this sounds very interesting. Is there a thread somewhere with more details?
Right now the active development discussions looks to be this other thread so I would join that discussion if I was you:

http://forum.xbmc.org/showthread.php?tid=200911


but for reference you should also checkout all of these threads:

http://forum.xbmc.org/showthread.php?tid=128054

http://forum.xbmc.org/showthread.php?tid=165024

http://forum.xbmc.org/showthread.php?tid=141169
https://github.com/garbear/xbmc/commits/photolibrary

http://forum.xbmc.org/showthread.php?tid=155304
https://github.com/declankenny/Video_Database_Proposal

http://forum.xbmc.org/showthread.php?tid=73831
http://wiki.xbmc.org/index.php?title=Dat...Schema_4.0
http://wiki.xbmc.org/index.php?title=Dat...hema_4.0/a

http://forum.xbmc.org/showthread.php?tid=165929

http://forum.xbmc.org/showthread.php?tid=105147
http://forum.xbmc.org/showthread.php?tid=54061

http://forum.xbmc.org/showthread.php?tid=37449

http://forum.xbmc.org/showthread.php?tid=51605

http://forum.xbmc.org/showthread.php?tid=199805

As far as I can tell none of these previous ideas and concepts have yet made it into mainline.
Reply
(2014-07-27, 10:39)XBL. Wrote:
(2014-07-26, 08:26)wsnipex Wrote: fyi: https://github.com/xbmc/xbmc/pull/5071
I don't have a github account, so I can't post there. But they are aware of this thread, right? I've read the first few posts and it seems they're looking to repeat a lot of work that has already been done (or maybe I'm missing the point - I'm no developer).

(2014-07-26, 23:31)m.savazzi Wrote: I opened a thread on a new DB format that works as a shared DB... your contribution would be great. I under the development subforum.
I already proposed the first logical view of the DB

I think having a good shared DB will be better than having a headless XBMC as MySQL (or any other DB) can run on NAS and other platforms
OP has been banned.

Also, sure, a more streamlined DB is always welcome, but that won't replace a headless XBMC. The whole point of a headless XBMC is that we can do the scraping and what not on our NAS (or other server kind of system).

I am reading forum, and the PR is not doubling the efforts. Its utilizing the shared library patches. And the intent is that with the --headless would be the same as shared library, depending on how much is compiled in. Further down the road we would also produce more than one alternative binary.

EDIT. Basically what I want to achieve is to get the shared library patch out there and fix up the APIs so its usable as headless from scratch. I.e. make webinterfaces be able to set it all up.
If you have problems please read this before posting

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

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
I've built and ran the Frodo xbmc-server successfully a while ago.
Now I want to move to Gotham because of DB changes and whatnot, and I followed this instructions below, but the version banner of xbmc-server sais:
Code:
XBMC Media Center 12.3 Git:20131212-9ed3e58
Copyright (C) 2005-2011 Team XBMC - http://www.xbmc.org

I was expecting 13. something, ideally I wanted to build Gotham 13.1 which seems stable currently.

(2014-05-13, 20:21)echasslau Wrote:
(2014-05-09, 15:27)echasslau Wrote: Why not create a github fork? If nobody is willing I can do this

Ok, here we go:
Code:
# 1. environment
sudo add-apt-repository ppa:team-xbmc/unstable
sudo add-apt-repository ppa:team-xbmc/xbmc-ppa-build-depends
sudo apt-get update
sudo apt-get build-dep xbmc

# 2. sources
git clone git://github.com/escoand/xbmc-server.git
cd xbmc-server/
git remote add upstream git://github.com/xbmc/xbmc.git

# 3. taglib
make -C lib/taglib
sudo make -C lib/taglib install

# 4. initial checkout Gotham branch
git checkout -b Gotham origin/Gotham

# 5. checkout master or Gotham branch
git checkout [master|Gotham]

# 6. update master or Gotham branch
git pull upstream [master|Gotham]

# 7. clean if you build before
make clean

# 8. build libxbmc
./bootstrap
./configure --enable-shared-lib --disable-debug --disable-vdpau --disable-vaapi --disable-crystalhd --disable-vtbdecoder --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-pulse --disable-alsa
make

# 9. build xbmc-server
cd xbmc/
make -f make_xbmc-server all
make -f make_xbmcVideoLibraryScan all

If you wan't to update just redo step 5-9.

Pull Request to get it integrated into upstream are welcome: https://github.com/escoand/xbmc-server

I've also tried to checkout xbmc directly and applied the patches from the excellent docker file from wernerb. The result was much the same.
So I think that I checked out the wrong branch of the XBMC repo, or I don't understand their branching/tagging entirely?
Reply
(2014-08-12, 14:49)fizze Wrote: I've built and ran the Frodo xbmc-server successfully a while ago.
Now I want to move to Gotham because of DB changes and whatnot, and I followed this instructions below, but the version banner of xbmc-server sais:
Code:
XBMC Media Center 12.3 Git:20131212-9ed3e58
Copyright (C) 2005-2011 Team XBMC - http://www.xbmc.org

I was expecting 13. something, ideally I wanted to build Gotham 13.1 which seems stable currently.

(2014-05-13, 20:21)echasslau Wrote:
(2014-05-09, 15:27)echasslau Wrote: Why not create a github fork? If nobody is willing I can do this

Ok, here we go:
Code:
# 1. environment
sudo add-apt-repository ppa:team-xbmc/unstable
sudo add-apt-repository ppa:team-xbmc/xbmc-ppa-build-depends
sudo apt-get update
sudo apt-get build-dep xbmc

# 2. sources
git clone git://github.com/escoand/xbmc-server.git
cd xbmc-server/
git remote add upstream git://github.com/xbmc/xbmc.git

# 3. taglib
make -C lib/taglib
sudo make -C lib/taglib install

# 4. initial checkout Gotham branch
git checkout -b Gotham origin/Gotham

# 5. checkout master or Gotham branch
git checkout [master|Gotham]

# 6. update master or Gotham branch
git pull upstream [master|Gotham]

# 7. clean if you build before
make clean

# 8. build libxbmc
./bootstrap
./configure --enable-shared-lib --disable-debug --disable-vdpau --disable-vaapi --disable-crystalhd --disable-vtbdecoder --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-pulse --disable-alsa
make

# 9. build xbmc-server
cd xbmc/
make -f make_xbmc-server all
make -f make_xbmcVideoLibraryScan all

If you wan't to update just redo step 5-9.

Pull Request to get it integrated into upstream are welcome: https://github.com/escoand/xbmc-server

I've also tried to checkout xbmc directly and applied the patches from the excellent docker file from wernerb. The result was much the same.
So I think that I checked out the wrong branch of the XBMC repo, or I don't understand their branching/tagging entirely?

Definitely sounds like something went wrong with your branch checkout.

Try the following single command:

Code:
git clone https://github.com/xbmc/xbmc.git -b Gotham --depth=1
Reply
Weeee!
Thanks wernerb, that worked. Now the version banner shows 13.2.
It stars, but segfaults after a few seconds. The final lines in the xbmc.log are:

Quote:19:00:51 T:140134960048000 NOTICE: initialize done
19:00:51 T:140134441105152 NOTICE: Thread VideoInfoScanner start, auto delete: false

I've had to copy settings.xml and linux.xml into the system/settings folder, otherwise it wouldn't start.
Do I need to remove/replace any other files coming from a frodo minified install?
Yes, I did replace the /lib/libxbmc.so and did a ldconfig.

I've got a advancedsettings.xml in my portable_data/userdata folder. I've removed all other XML files, so I'm on default settings.

After a few seconds, xbmc fails with:
Quote:Sep 8 19:17:17 kernel: [4101574.165138] EventServer[18820]: segfault at 0 ip 00007fc3bc61f27d sp 00007fc3a67332b0 error 4 in libxbmc.so[7fc3bbc73000+1897000]

This is my XBMC logfile:

Code:
19:16:58 T:140478681692032  NOTICE: special://profile/ is mapped to: special://masterprofile/
19:16:58 T:140478681692032  NOTICE: -----------------------------------------------------------------------
19:16:58 T:140478681692032  NOTICE: Starting XBMC (13.2 Git:20140901-867305b). Platform: x86 Linux 64-bit
19:16:58 T:140478681692032  NOTICE: Using Release XBMC x64 build, compiled Sep  8 2014 by GCC 4.8.1 for x86 Linux 64-bit 3.11.10
19:16:58 T:140478681692032  NOTICE: Running on Linux 64-bit (Ubuntu 13.10, 3.11.0-26-generic x86_64)
19:16:58 T:140478681692032  NOTICE: Host CPU: Intel(R) Core(TM) i5-4570S CPU @ 2.90GHz, 4 cores available
19:16:58 T:140478681692032  NOTICE: special://xbmc/ is mapped to: /opt/xbmc-server/
19:16:58 T:140478681692032  NOTICE: special://xbmcbin/ is mapped to: /opt/xbmc-server
19:16:58 T:140478681692032  NOTICE: special://masterprofile/ is mapped to: /opt/xbmc-server/portable_data/userdata
19:16:58 T:140478681692032  NOTICE: special://home/ is mapped to: /opt/xbmc-server/portable_data
19:16:58 T:140478681692032  NOTICE: special://temp/ is mapped to: /opt/xbmc-server/portable_data/temp
19:16:58 T:140478681692032  NOTICE: The executable running is: /opt/xbmc-server/xbmc-server
19:16:58 T:140478681692032  NOTICE: Local hostname: frazzle
19:16:58 T:140478681692032  NOTICE: Log File is located: /opt/xbmc-server/portable_data/temp/xbmc.log
19:16:58 T:140478681692032  NOTICE: -----------------------------------------------------------------------
19:16:58 T:140478681692032   ERROR: DBus: Error org.freedesktop.DBus.Error.ServiceUnknown - The name org.freedesktop.UPower was not provided by any .service files
19:16:58 T:140478681692032  NOTICE: load settings...
19:16:58 T:140478681692032  NOTICE: CAESinkOSS::EnumerateDevicesEx - No OSS mixer device present: /dev/mixer
19:16:58 T:140478681692032  NOTICE: No Devices found - retry: 4
19:17:00 T:140478681692032  NOTICE: CAESinkOSS::EnumerateDevicesEx - No OSS mixer device present: /dev/mixer
19:17:00 T:140478681692032  NOTICE: No Devices found - retry: 3
19:17:01 T:140478681692032  NOTICE: CAESinkOSS::EnumerateDevicesEx - No OSS mixer device present: /dev/mixer
19:17:01 T:140478681692032  NOTICE: No Devices found - retry: 2
19:17:03 T:140478681692032  NOTICE: CAESinkOSS::EnumerateDevicesEx - No OSS mixer device present: /dev/mixer
19:17:03 T:140478681692032  NOTICE: No Devices found - retry: 1
19:17:04 T:140478681692032  NOTICE: CAESinkOSS::EnumerateDevicesEx - No OSS mixer device present: /dev/mixer
19:17:04 T:140478681692032  NOTICE: Found 0 Lists of Devices
19:17:04 T:140478681692032  NOTICE: CAESinkOSS::EnumerateDevicesEx - No OSS mixer device present: /dev/mixer
19:17:04 T:140478681692032  NOTICE: No Devices found - retry: 4
19:17:06 T:140478681692032  NOTICE: CAESinkOSS::EnumerateDevicesEx - No OSS mixer device present: /dev/mixer
19:17:06 T:140478681692032  NOTICE: No Devices found - retry: 3
19:17:07 T:140478681692032  NOTICE: CAESinkOSS::EnumerateDevicesEx - No OSS mixer device present: /dev/mixer
19:17:07 T:140478681692032  NOTICE: No Devices found - retry: 2
19:17:09 T:140478681692032  NOTICE: CAESinkOSS::EnumerateDevicesEx - No OSS mixer device present: /dev/mixer
19:17:09 T:140478681692032  NOTICE: No Devices found - retry: 1
19:17:10 T:140478681692032  NOTICE: CAESinkOSS::EnumerateDevicesEx - No OSS mixer device present: /dev/mixer
19:17:10 T:140478681692032  NOTICE: Found 0 Lists of Devices
19:17:10 T:140478681692032  NOTICE: No settings file to load (special://xbmc/system/advancedsettings.xml)
19:17:10 T:140478681692032  NOTICE: Loaded settings file from special://profile/advancedsettings.xml
19:17:10 T:140478681692032  NOTICE: Contents of special://profile/advancedsettings.xml are...
                                            <advancedsettings>
                                              <videolibrary>
                                                <backgroundupdate>true</backgroundupdate>
                                              </videolibrary>
                                              <musiclibrary>
                                                <backgroundupdate>true</backgroundupdate>
                                              </musiclibrary>
                                              <videodatabase>
                                                <type>mysql</type>
                                                <host>x.y.z.q</host>
                                                <port>xxxx</port>
                                                <user>user</user>
                                                <pass>pass</pass>
                                                <name>name</name>
                                              </videodatabase>
                                              <musicdatabase>
                                                <type>mysql</type>
                                                <host>x.y.z.q</host>
                                                <port>xxxx</port>
                                                <user>user</user>
                                                <pass>pass</pass>
                                                <name>other_name</name>
                                              </musicdatabase>
                                            </advancedsettings>
19:17:10 T:140478681692032 WARNING: VIDEO database configuration is experimental.
19:17:10 T:140478681692032  NOTICE: Default DVD Player: dvdplayer
19:17:10 T:140478681692032  NOTICE: Default Video Player: dvdplayer
19:17:10 T:140478681692032  NOTICE: Default Audio Player: paplayer
19:17:10 T:140478681692032  NOTICE: Disabled debug logging due to GUI setting. Level 0.
19:17:10 T:140478681692032  NOTICE: Log level changed to 0
19:17:10 T:140478681692032  NOTICE: Loading player core factory settings from special://xbmc/system/playercorefactory.xml.
19:17:10 T:140478681692032  NOTICE: Loaded playercorefactory configuration
19:17:10 T:140478681692032  NOTICE: Loading player core factory settings from special://masterprofile/playercorefactory.xml.
19:17:10 T:140478681692032  NOTICE: special://masterprofile/playercorefactory.xml does not exist. Skipping.
19:17:10 T:140478402258688  NOTICE: Thread ActiveAE start, auto delete: false
19:17:10 T:140478393865984  NOTICE: Thread AESink start, auto delete: false
19:17:10 T:140478402258688  NOTICE: CAESinkOSS::EnumerateDevicesEx - No OSS mixer device present: /dev/mixer
19:17:10 T:140478402258688  NOTICE: No Devices found - retry: 4
19:17:12 T:140478402258688  NOTICE: CAESinkOSS::EnumerateDevicesEx - No OSS mixer device present: /dev/mixer
19:17:12 T:140478402258688  NOTICE: No Devices found - retry: 3
19:17:14 T:140478402258688  NOTICE: CAESinkOSS::EnumerateDevicesEx - No OSS mixer device present: /dev/mixer
19:17:14 T:140478402258688  NOTICE: No Devices found - retry: 2
19:17:15 T:140478402258688  NOTICE: CAESinkOSS::EnumerateDevicesEx - No OSS mixer device present: /dev/mixer
19:17:15 T:140478402258688  NOTICE: No Devices found - retry: 1
19:17:17 T:140478402258688  NOTICE: CAESinkOSS::EnumerateDevicesEx - No OSS mixer device present: /dev/mixer
19:17:17 T:140478402258688  NOTICE: Found 0 Lists of Devices
19:17:17 T:140478313920256  NOTICE: Thread AESinkNull start, auto delete: false
19:17:17 T:140478681692032  NOTICE: Running database version Addons16
19:17:17 T:140478681692032  NOTICE: ADDONS: Using repository repository.xbmc.org
19:17:17 T:140478681692032  NOTICE: Running database version Addons16
19:17:17 T:140478681692032  NOTICE: Running database version ViewModes6
19:17:17 T:140478681692032  NOTICE: Running database version Textures13
19:17:17 T:140478681692032  NOTICE: Running database version xbmc_music46
19:17:17 T:140478681692032  NOTICE: Running database version xbmc_movies78
19:17:17 T:140478681692032  NOTICE: Running database version TV22
19:17:17 T:140478681692032  NOTICE: Running database version Epg7
19:17:17 T:140478681692032 WARNING: JSONRPC: Could not parse type "GUI.Property.Value"
19:17:17 T:140478681692032 WARNING: JSONRPC: Could not parse type "Setting.Details.SettingList"
19:17:17 T:140478681692032  NOTICE: initialize done
19:17:17 T:140478298466048  NOTICE: Thread VideoInfoScanner start, auto delete: false
19:17:17 T:140478681692032  NOTICE: ES: Starting event server
19:17:17 T:140478287922944  NOTICE: Thread EventServer start, auto delete: false
19:17:17 T:140478287922944  NOTICE: ES: Starting UDP Event server on 0.0.0.0:9777
19:17:17 T:140478287922944  NOTICE: UDP: Listening on port 9777
19:17:17 T:140478279530240  NOTICE: Thread TCPServer start, auto delete: false


edit:
After I dug through this thread I found a few fixes (guisettings.xml, advancedsettings.xml) and after further disabling services I get a different log message. The server still segfaults though.
The final lines in the xbmc.log are:
Code:
09:04:03 T:139805209810688   DEBUG: XBMC Version Check: Version 0.1.21 started
09:04:03 T:139805209810688    INFO: CPythonInvoker(0, /opt/xbmc-server/addons/service.xbmc.versioncheck/service.py): script successfully run
09:04:03 T:139805209810688    INFO: Python script stopped
09:04:03 T:139805209810688   DEBUG: Thread LanguageInvoker 139805209810688 terminating
09:04:03 T:139805727848320   DEBUG: started alarm with name: checkatboot
09:04:03 T:139805727848320   DEBUG: started alarm with name: checkwhilerunning
09:04:03 T:139805209810688  NOTICE: Thread AlarmClock start, auto delete: false
09:04:04 T:139805727848320   DEBUG: LogindUPowerSyscall - Received unknown signal NameAcquired
09:04:04 T:139805727848320   DEBUG: Checking repositories for updates (triggered by XBMC.org Add-ons)
09:04:04 T:139805201417984  NOTICE: Thread JobWorker start, auto delete: true
09:04:04 T:139805201417984   DEBUG: CFileCache::Open - opening <addons/gotham/addons.xml.md5> using cache

When I remove the repository.xbmc.org folder from the addon folder, it doesn't segfault. But only if I disable the webserver and all other network interfaces.
As soon as I enable them again, the segfault returns.

The repository segfaults when it tries to check for updates, so I conclude that there is something broken in the network libraries in XBMC.

I'm running it on Ubuntu server 13.10. The minified XBMC-server of Frodo ran perfectly stable on the same box.

Any idea what's going on here?


Edit2:
I found out that the patches from Docmeth2 in post #623 here don't apply anymore.
Since I don't care about UPnP I manually applied the fix to xbmc/network/Network.cpp. That did seem to do the trick.
Yay!
Reply
@fizze, I suspect that the reason it segfaulted for you with Gotham is because of the sneaky XBMC_GLOBAL_REF macro...the trick this macro uses does not work across binaries. In this case, xbmc-server and libxbmc.so have different opinions about what g_application is, so when xbmc-server calls g_application.Create(), this does _not_ initialize the version that libxbmc.so sees. I ran into this issue trying to initialize UPnP (which I do care about :-)

Here's a patch that fixes the crash for me:

Code:
From 847020fc00baebd8a8cc2ee7ce2b05a87b5f5e8d Mon Sep 17 00:00:00 2001
From: Ryan Saunders <[email protected]>
Date: Sun, 21 Sep 2014 15:39:30 -0700
Subject: [PATCH] XBMC_GLOBAL_REF macro is unsafe to use across module
boundaries, as it results in each module getting its own copy of the global
(in this case, xbmc-server and libxbmc.so). Fix this by creating a
GetApplicationInstance() function implemented in libxbmc.so, and call this
function from xbmc-server.

---
xbmc/Application.cpp               |  5 +++++
xbmc/Application.h                 |  2 ++
xbmc/settings/AdvancedSettings.cpp |  5 +++++
xbmc/settings/AdvancedSettings.h   |  2 ++
xbmc/xbmc-server.cpp               | 30 +++++++++++++++---------------
xbmc/xbmcVideoLibraryScan.cpp      | 34 +++++++++++++++++-----------------
6 files changed, 46 insertions(+), 32 deletions(-)

diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index 43bc778..a6f0be6 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -5861,3 +5861,8 @@ void CApplication::CloseNetworkShares()
   CSFTPSessionManager::DisconnectAllSessions();
#endif
}
+
+CApplication& GetApplicationInstance()
+{
+  return g_application;
+}
diff --git a/xbmc/Application.h b/xbmc/Application.h
index 15e86c8..bd73552 100644
--- a/xbmc/Application.h
+++ b/xbmc/Application.h
@@ -474,3 +474,5 @@ protected:

XBMC_GLOBAL_REF(CApplication,g_application);
#define g_application XBMC_GLOBAL_USE(CApplication)
+
+CApplication& GetApplicationInstance();
diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp
index eff43dd..058ef5d 100644
--- a/xbmc/settings/AdvancedSettings.cpp
+++ b/xbmc/settings/AdvancedSettings.cpp
@@ -1373,3 +1373,8 @@ void CAdvancedSettings::SetExtraLogsFromAddon(ADDON::IAddon* addon)
   }
   CLog::SetExtraLogLevels(m_extraLogLevels);
}
+
+CAdvancedSettings& GetAdvancedSettings()
+{
+  return g_advancedSettings;
+}
diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h
index 3995f35..9291e17 100644
--- a/xbmc/settings/AdvancedSettings.h
+++ b/xbmc/settings/AdvancedSettings.h
@@ -410,3 +410,5 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler
};

XBMC_GLOBAL(CAdvancedSettings,g_advancedSettings);
+
+CAdvancedSettings& GetAdvancedSettings();
diff --git a/xbmc/xbmc-server.cpp b/xbmc/xbmc-server.cpp
index 479f528..8107fa3 100644
--- a/xbmc/xbmc-server.cpp
+++ b/xbmc/xbmc-server.cpp
@@ -55,9 +55,9 @@ int main(int argc, char* argv[])

   //this can't be set from CAdvancedSettings::Initialize() because it will overwrite
   //the loglevel set with the --debug flag
-  g_advancedSettings.m_logLevel     = LOG_LEVEL_NORMAL;
-  g_advancedSettings.m_logLevelHint = LOG_LEVEL_NORMAL;
-  CLog::SetLogLevel(g_advancedSettings.m_logLevel);
+  GetAdvancedSettings().m_logLevel     = LOG_LEVEL_NORMAL;
+  GetAdvancedSettings().m_logLevelHint = LOG_LEVEL_NORMAL;
+  CLog::SetLogLevel(GetAdvancedSettings().m_logLevel);

   CLog::Log(LOGNOTICE, "Starting XBMC Server..." );

@@ -75,38 +75,38 @@ int main(int argc, char* argv[])
   sigaction(SIGCHLD, &sa, NULL);
#endif
   setlocale(LC_NUMERIC, "C");
-  g_advancedSettings.Initialize();
+  GetAdvancedSettings().Initialize();

-  if (!g_advancedSettings.Initialized())
-    g_advancedSettings.Initialize();
+  if (!GetAdvancedSettings().Initialized())
+    GetAdvancedSettings().Initialize();

#ifndef _WIN32
   CAppParamParser appParamParser;
   appParamParser.Parse((const char **)argv, argc);
#endif
-  if (!g_application.Create())
+  if (!GetApplicationInstance().Create())
   {
     fprintf(stderr, "ERROR: Unable to create application. Exiting\n");
     return -1;
   }
-  if (!g_application.Initialize())
+  if (!GetApplicationInstance().Initialize())
   {
     fprintf(stderr, "ERROR: Unable to Initialize. Exiting\n");
     return -1;
   }

   // Start scanning the Video Library for changes...
-  g_application.StartVideoScan("");
+  GetApplicationInstance().StartVideoScan("");

   // Run xbmc
-  while (!g_application.m_bStop)
+  while (!GetApplicationInstance().m_bStop)
   {
     //-----------------------------------------
     // Animate and render a frame
     //-----------------------------------------
     try
     {
-      g_application.Process();
+      GetApplicationInstance().Process();
       //reset exception count
       processExceptionCount = 0;

@@ -124,19 +124,19 @@ int main(int argc, char* argv[])
     }

     // If scanning the Video Library has finished then ask XBMC to quit...
-  //  if (!g_application.IsVideoScanning()) g_application.getApplicationMessenger().Quit();
+  //  if (!GetApplicationInstance().IsVideoScanning()) GetApplicationInstance().getApplicationMessenger().Quit();

     // Sleep for a little bit so we don't hog the CPU...

     Sleep(50);
     // printf(".");
-  } // !g_application.m_bStop
+  } // !GetApplicationInstance().m_bStop

-  g_application.Destroy();
+  GetApplicationInstance().Destroy();

   printf("\n\nExiting XBMC Server...\n");

   CLog::Log(LOGNOTICE, "Exiting XBMC Server..." );

-  return g_application.m_ExitCode;
+  return GetApplicationInstance().m_ExitCode;
}
diff --git a/xbmc/xbmcVideoLibraryScan.cpp b/xbmc/xbmcVideoLibraryScan.cpp
index 9773cec..7cdca16 100644
--- a/xbmc/xbmcVideoLibraryScan.cpp
+++ b/xbmc/xbmcVideoLibraryScan.cpp
@@ -53,9 +53,9 @@ int main(int argc, char* argv[])

   //this can't be set from CAdvancedSettings::Initialize() because it will overwrite
   //the loglevel set with the --debug flag
-  g_advancedSettings.m_logLevel     = LOG_LEVEL_DEBUG;
-  g_advancedSettings.m_logLevelHint = LOG_LEVEL_DEBUG;
-  CLog::SetLogLevel(g_advancedSettings.m_logLevel);
+  GetAdvancedSettings().m_logLevel     = LOG_LEVEL_DEBUG;
+  GetAdvancedSettings().m_logLevelHint = LOG_LEVEL_DEBUG;
+  CLog::SetLogLevel(GetAdvancedSettings().m_logLevel);

#ifdef _LINUX
   // Prevent child processes from becoming zombies on exit if not waited upon. See also Util::Command
@@ -67,27 +67,27 @@ int main(int argc, char* argv[])
   sigaction(SIGCHLD, &sa, NULL);
#endif
   setlocale(LC_NUMERIC, "C");
-  g_advancedSettings.Initialize();
+  GetAdvancedSettings().Initialize();

#ifndef _WIN32
   CAppParamParser appParamParser;
   appParamParser.Parse((const char **)argv, argc);
#endif

-  if (!g_advancedSettings.Initialized())
+  if (!GetAdvancedSettings().Initialized())
   {
-    g_advancedSettings.m_logLevel     = LOG_LEVEL_DEBUG;
-    g_advancedSettings.m_logLevelHint = LOG_LEVEL_DEBUG;
-    g_advancedSettings.Initialize();
+    GetAdvancedSettings().m_logLevel     = LOG_LEVEL_DEBUG;
+    GetAdvancedSettings().m_logLevelHint = LOG_LEVEL_DEBUG;
+    GetAdvancedSettings().Initialize();
   }

-  if (!g_application.Create())
+  if (!GetApplicationInstance().Create())
   {
     fprintf(stderr, "ERROR: Unable to create application. Exiting\n");
     return -1;
   }

-  if (!g_application.Initialize())
+  if (!GetApplicationInstance().Initialize())
   {
     fprintf(stderr, "ERROR: Unable to Initialize. Exiting\n");
     return -1;
@@ -106,22 +106,22 @@ int main(int argc, char* argv[])
   printf("Starting Video Library Scan\n\n");

   // Start scanning the Video Library for changes...
-  g_application.StartVideoScan("");
+  GetApplicationInstance().StartVideoScan("");

   // Run xbmc
-  while (!g_application.m_bStop)
+  while (!GetApplicationInstance().m_bStop)
   {
     //-----------------------------------------
     // Animate and render a frame
     //-----------------------------------------
     lastFrameTime = XbmcThreads::SystemClockMillis();
-    g_application.Process();
+    GetApplicationInstance().Process();

     // Frame move the scene
-    if (!g_application.m_bStop) g_application.FrameMove(true, false);
+    if (!GetApplicationInstance().m_bStop) GetApplicationInstance().FrameMove(true, false);

     // If scanning the Video Library has finished then ask XBMC to quit...
-    if (!g_application.IsVideoScanning())
+    if (!GetApplicationInstance().IsVideoScanning())
     {
        CApplicationMessenger::Get().Quit();
     } else {
@@ -136,9 +136,9 @@ int main(int argc, char* argv[])

   CLog::Log(LOGNOTICE, "Finished Video Library Scan..." );

-  m_ExitCode = g_application.m_ExitCode;
+  m_ExitCode = GetApplicationInstance().m_ExitCode;

-  g_application.Destroy();
+  GetApplicationInstance().Destroy();

   printf("\n\nFinished Video Library Scan...\n");

--
1.9.1
Reply
  • 1
  • 52
  • 53
  • 54(current)
  • 55
  • 56
  • 58

Logout Mark Read Team Forum Stats Members Help
xbmc minified as a server?9