MySQL vs UPnP sharing

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
steve1977 Offline
Posting Freak
Posts: 1,769
Joined: Dec 2006
Reputation: 0
Post: #1
Understand that some people use MySQL database for sharing. With UPnP sharing being part of Frodo release, is there still a need for MySQL?

In other words, what are the respective pros and cons of the two solutions?

Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 12 GB DDR3 | 256 GB SSD, 40 TB (1 x 4 TB, 6 x 3TB, 9 x 2 TB)
HTPC 1: Apple Mac Mini (mid-2011) | Intel Core i5 2.5 GHz | 4GB DDR3 | 500 GB
HTPC 2: Apple Mac Mini (mid-2007) | Intel Core 2 Duo 2.0 GHz | 4 GB DDR2 | 16 GB SSD
find quote
Ned Scott Offline
Team-XBMC Wiki Guy
Posts: 18,326
Joined: Jan 2011
Reputation: 221
Location: Arizona, USA
Post: #2
Actually, UPnP has been in XBMC for a while now, but it hasn't really been pushed as a solution for library sharing all that much (sort of a hidden gem of XBMC), and there have been a number of UPnP related bugs and issues that are now resolved or greatly improved upon for Frodo.

MySQL makes a shared database between XBMC devices appear as if it were the same local database that XBMC normally uses (SQLite), for the most part. However, a UPnP share is currently seen as just a file share that also provides its own metadata. While things like watched status and resume points can be added to UPnP (which is the plan for after Frodo), they currently don't work. Things like smart playlists, various add-ons, and other features of XBMC will only work with the local library, for the time being.

So right now MySQL is a feature win. However, it requires installing and setting up a MySQL server, which can be a challenge for some, or even just a challenge because of the OS or environment they are in. Not to toot my own horn, but I set up a good large part of our MySQL guide, but I don't have a MySQL server set up right now because it's kinda a pain in the ass for me. Some of that has actually changed in the last few months, since I know a little more as I get older, so now I know how to install MySQL on more devices, and I have more options (one of the issues I had was that the only stable/always-on server I had was an aging PPC G5 Mac. The MySQL server version for it seemed to have issues, and the G5 needed to be retired when it can, so it still wouldn't be a long term solution. Now I have more options).

UPnP is as easy as flipping a switch (more or less). If you have an existing library, with sources from any location (as long as they work on the host XBMC install), then you should be able to feed all that back to another XBMC device on-the-fly. No extra installs, no fussing with settings. Further more, multiple XBMC devices could have their own shared library. I should share to a roommate's XBMC and he could share to mine, allowing us access to two libraries at the same time without either of us having to modify them. This is really great if you just happen to be stopping by someone's place and want to share your library (say, on a laptop) on their home theater with their XBMC (though it does work fairly well with some other UPnP clients).

There's also some developmental/technical reasons that MySQL isn't really liked by some XBMC devs (and for good reason), so the general feeling is that something like UPnP (if not UPnP itself) should some day be a replacement for MySQL. UPnP will be grown and improved upon in XBMC, allowing it to do the same things as MySQL, and people should one day have the best of both worlds.

That being said, there are many ideas being tossed around by the team for a library sync system in XBMC, with UPnP just being one option. It's the strongest one at the moment, because we know that a good deal of the UPnP improvements are going to happen (or have already happened but just have not been reviewed/merged into XBMC yet) no matter what (more or less).

For XBMC v12 Frodo, MySQL is still a great solution. It's not always a pain in the butt and can be fairly easy for some (probably most) setups. UPnP sharing in XBMC is also a great solution. Maybe both will even stay in XBMC and serve different purposes.

You can make easy links to the XBMC wiki using double brackets around words: [[debug log]] = debug log, [[Add-on:YouTube]] = Add-on:YouTube, [[Adding videos to the library]] = Adding videos to the library, [[userdata]] = userdata, etc
find quote
steve1977 Offline
Posting Freak
Posts: 1,769
Joined: Dec 2006
Reputation: 0
Post: #3
First of all, thanks so much for your helpful reply. This clarifies a lot of my thinking and also supports my decision to start "playing" with UPnP once final Frodo is out. It appears the way to go.

Apologies for the double-post from the dev thread, but let me add this one as well here. May be insightful not only for me, but also for a broader audience looking into UPnP as the "hidden gem" you were describing. Any chance to help confirm whether my understandin below is correct?

1) The library can reside on one computer only, which serves via UPnP ("XBMC A"). "XBMC B" does not need to have an own library function (but receives everything from "XBMC A")

2) Poster and fanart caching happen only on "XBMC A". So, I save a lot of disk space on "XBMC B" as it no longer needs to cache images. However, "XBMC B" will also be a bit slower in displaying posters.

3) Library update is ONLY used on "XBMC A", everything happens automatically on "XBMC B" and I don't need to hit "update library" or "clean library"

4) Watched flags are not synced yet between "XBMC A" and "XBMC B", but this may be possible at later stage. Right now, both "XBMC A" and "XBMC B" have their own watched flags, which are not in sync.

5) If I change a poster on "XBMC A", it will automatically also change on "XBMC B". I cannot change posters on "XBMC B" with the set-up described in (1)

6) If I turn off "XBMC A", I won't see any movies in the library of "XBMC B"

Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 12 GB DDR3 | 256 GB SSD, 40 TB (1 x 4 TB, 6 x 3TB, 9 x 2 TB)
HTPC 1: Apple Mac Mini (mid-2011) | Intel Core i5 2.5 GHz | 4GB DDR3 | 500 GB
HTPC 2: Apple Mac Mini (mid-2007) | Intel Core 2 Duo 2.0 GHz | 4 GB DDR2 | 16 GB SSD
find quote
Ned Scott Offline
Team-XBMC Wiki Guy
Posts: 18,326
Joined: Jan 2011
Reputation: 221
Location: Arizona, USA
Post: #4
I think all of those are correct, but I'm not entirely sure about 2, if XBMC will cache art from UPnP sources or not.

You can make easy links to the XBMC wiki using double brackets around words: [[debug log]] = debug log, [[Add-on:YouTube]] = Add-on:YouTube, [[Adding videos to the library]] = Adding videos to the library, [[userdata]] = userdata, etc
find quote
ixian Offline
Donor
Posts: 96
Joined: May 2008
Reputation: 2
Post: #5
MySQL is easier than you think - I keep 4 XBMC boxes in sync with it. Upgraded all to RC2 now - took a day or so for thumbnails to really sort themselves out but now everything is good.

I have a Synology NAS, so installing MySQL is a snap - there's a one-click package for it, and since the Syno box is a low-power-draw NAS it's always available. The Synology box also auto-updates it when needed - I cannot recommend those things enough, btw. However if you don't have it or a NAS like it it's easy enough to set up a light instance on your "primary" XBMC box or whatever.

I'm looking forward to expanded UPNP support as well but for now the MySQL shared library is the best.
find quote
wimble Offline
Member
Posts: 53
Joined: Dec 2012
Reputation: 0
Post: #6
I've just got set up (in the last couple of weeks) on a Raspberry Pi (which was why I discovered XBMC in the first place), Linux, Windows, and my Galaxy 2 phone (android), all playing media that's on a single separate NAS drive. With a single MySQL database, it's incredibly obvious that each XBMC install must use the same network access path to the media, and the only requirements are that the database and the NAS itself must be online.

With UPnP, I'm not currently clear whether the first XBMC installation actually operates as a server which then relays the media to the others, or whether it simply gives them the path to the media. If it's acting as a server, then my phone can display stuff which is local to any of the other machines (or vice versa), because my phone is talking to the Windows machine (for example). But that would also double my total network traffic, if the Windows machine is, in turn pulling the data from the NAS. On the other hand, if they're only passing the paths around, then each player could be passing on paths which are inaccessible to the other players.

So I'd quite like a clarification over that, and I can certainly see there being choices to be made.
find quote
steve1977 Offline
Posting Freak
Posts: 1,769
Joined: Dec 2006
Reputation: 0
Post: #7
Those are very good questions and shows that I'm not the only one eager to understand how the upnp solution really works.

Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 12 GB DDR3 | 256 GB SSD, 40 TB (1 x 4 TB, 6 x 3TB, 9 x 2 TB)
HTPC 1: Apple Mac Mini (mid-2011) | Intel Core i5 2.5 GHz | 4GB DDR3 | 500 GB
HTPC 2: Apple Mac Mini (mid-2007) | Intel Core 2 Duo 2.0 GHz | 4 GB DDR2 | 16 GB SSD
find quote
Ned Scott Offline
Team-XBMC Wiki Guy
Posts: 18,326
Joined: Jan 2011
Reputation: 221
Location: Arizona, USA
Post: #8
The UPnP A/V server in XBMC sends the video streams itself, so it would double the bandwidth in a situation where the serving XBMC install is pulling content from another networked source. It would be possible to have XBMC, via UPnP (maybe?) or perhaps something else, send URLs to other XBMC installs. For the time being, to work with most UPnP clients and to be a zero configuration service, as well as a file server, UPnP operates by sending the video from XBMC.

I don't have any high bitrate HD content to test with, such as a bluray ISO, but all my HD content is able to work via UPnP over a 100 meg ethernet connection even with it pulling from one computer and pushing to another at the same time.

You can make easy links to the XBMC wiki using double brackets around words: [[debug log]] = debug log, [[Add-on:YouTube]] = Add-on:YouTube, [[Adding videos to the library]] = Adding videos to the library, [[userdata]] = userdata, etc
find quote
protocol77 Offline
Fan
Posts: 633
Joined: Jun 2011
Reputation: 2
Post: #9
i have had no real issues with my sql setup either i run 3 htpc's on it all connected to my server which is just running windows 8 pro

i installed mysql and entered the commands as indicated on the xbmc wiki page then created the advancedsettings.xml as required then simply copied that to the userdata folder on each machine and then scanned the items in on one machine then copied the sources.xml from that machine into the others right next to the advancedsettings.xml and there you have it all are sharing fanart metadata and watched statuses

and whenever xbmc gets upgraded and the mysql changes from say myvideos70 to myvideos75 it simply creates that new database and gradually copies all the information it was storing on the previous database over to the new one automatically for you then you can choose to delete the old one or just leave it there in case of a needed downgrade

all in all when i first set it up it was my first time using mysql and one of the very few times using cmd prompt commands and still found it easy to use and accomplish
(This post was last modified: 2012-12-26 04:53 by protocol77.)
find quote
Ned Scott Offline
Team-XBMC Wiki Guy
Posts: 18,326
Joined: Jan 2011
Reputation: 221
Location: Arizona, USA
Post: #10
I should also point out that back when I had a Windows XP HTPC that stayed on all the time, setting that up as a UPnP server was very painless.

You could probably see it as UPnP is an on-the-fly solution, while MySQL is a more long term solution. Want to share something really quick without setting all that up or rescanning the library? UPnP. Which is not to say that UPnP can't be used as a long term solution, but MySQL supports more XBMC features (smart playlists, various add-ons that access the video DB, etc).

You can make easy links to the XBMC wiki using double brackets around words: [[debug log]] = debug log, [[Add-on:YouTube]] = Add-on:YouTube, [[Adding videos to the library]] = Adding videos to the library, [[userdata]] = userdata, etc
find quote
steve1977 Offline
Posting Freak
Posts: 1,769
Joined: Dec 2006
Reputation: 0
Post: #11
Thanks Ned and all. What makes UPnP magic and hopefully the long-term solution is its simplicity and amazing potential applicability in the future. Let me just share a few potential applications if UPnP is fully implemented and alive:

* Sharing the library with just a few clicks (every normal user could do)
* Long-waited transcoding functionality
* Sharing to about any device you can imagine (Samsung TVs, etc); without XBMC client though, but accessing XBMC library
* All the functionality you state above is technically feasible and may see the light soon (smart playlists, add-ons, watchflags)

Plus, there is at least one excited developer and there may be more jumping on this train. If this is fully implemented, who would ever talk about Plex again?

Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 12 GB DDR3 | 256 GB SSD, 40 TB (1 x 4 TB, 6 x 3TB, 9 x 2 TB)
HTPC 1: Apple Mac Mini (mid-2011) | Intel Core i5 2.5 GHz | 4GB DDR3 | 500 GB
HTPC 2: Apple Mac Mini (mid-2007) | Intel Core 2 Duo 2.0 GHz | 4 GB DDR2 | 16 GB SSD
find quote
dhead Offline
Donor
Posts: 518
Joined: May 2010
Reputation: 1
Post: #12
UPNP also can used to push/stream content to an XBMC client and control it.
If you've got an Android device I recommend trying BubbleUPNP.
find quote
wimble Offline
Member
Posts: 53
Joined: Dec 2012
Reputation: 0
Post: #13
Thanks for the clarification, Ned. That's what I suspected. And, as yet, I don't have any high bitrate media to clog my network with, so it's not much of an issue either. However, would it also cause a CPU load increase? Which could conceivably be a problem, if the serving XBMC was on a Pi.

However, it's just occurred to me that I could, conceivably, use this for remote access to my home media onto my Phone. I've managed to do this via NFS already, but UPnP would be much simpler.

And, possibly, in the future, it might be arrangable for the UPnP server to be smart enough to stream the media directly when it has to, and send URLs when it can (eg. if the source is non-local), giving us the best of both worlds.

But it does sound like there are some fantastic capabilities, just waiting to be exploited Smile
find quote
ixian Offline
Donor
Posts: 96
Joined: May 2008
Reputation: 2
Post: #14
The hardest part of the mySQL setup (or MariaDB, for that matter, they both work), really, is figuring out where to run it, since you'll want it on something that's always on. That's what make light NAS's perfect for it.

UPNP will be nice for a variety of reasons but if the actual XBMC host does the video streaming that's going to be a non-starter for a lot of people, particularly those with a NAS - who are also the target audience for sharing.

I like the central db. All my watched status get updated, resumes work everywhere, etc. I'll probably stick with it and as UPNP evolves use it for stuff like (hopefully) mobile streaming and the like. No reason to not have both right?
find quote
PV_XBMC Offline
Senior Member
Posts: 131
Joined: Aug 2010
Reputation: 0
Post: #15
(2012-12-26 09:25)dhead Wrote:  UPNP also can used to push/stream content to an XBMC client and control it.
If you've got an Android device I recommend trying BubbleUPNP.

In what scenario do you suggest using BubbleUPNP?

1) NAS content -> XBMC UPnP -> BubbleUPNP android
2) NAS content -> XBMC UPnP -> BubbleUPNP server -> BubbleUPNP android
3) NAS content -> XBMC UPnP -> BubbleUPNP server -> XBMC android

In all this scenarios is possible share XBMC library also on mobile phone or tablet android outside (thru the internet). Am I right?

Is possible control transcoding option on BubbleUPNP server thru XBMC android or is possible set up various profiles with various transcoding on BubbleUPNP server and then choose right one on XBMC android?
(This post was last modified: 2012-12-30 13:05 by PV_XBMC.)
find quote
Post Reply