• 1
  • 13
  • 14
  • 15(current)
  • 16
  • 17
  • 18
[AppleTV2] MySQL database / library support?
Odon Wrote:I don't really know if it has been talked about, but i've found a way to use the same Video database for both AppleTV2 official release and Nigthly build (DB Version >42): mysql-proxy. It can be used to fake database response to a query.

Install mysql-proxy (see link above) (for debian, just: apt-get install mysql-proxy)

Create a lua script:
Code:
function read_query( packet )
   print(proxy.connection.client.src.address)
   if string.byte(packet) == proxy.COM_QUERY then
     local query = string.sub(packet, 2)
     if string.match(string.upper(query), '^%s*SELECT IDVERSION FROM VERSION')
     then
       proxy.response.type = proxy.MYSQLD_PACKET_OK
       proxy.response.resultset = {
         fields = {
                    {
                      type = proxy.MYSQL_TYPE_INT,
                      name = "idVersion",
                    },
                  },
         rows = { { 42 } }
       }
       return proxy.PROXY_SEND_RESULT
     else
       return proxy.PROXY_SEND_QUERY
     end
   end
end

and then launch mysql-proxy with this script, in my case:
Code:
/usr/bin/mysql-proxy --max-open-files 1024 --proxy-lua-script=/etc/mysql/XBMCatv42.lua --proxy-address=0.0.0.0:3307 --proxy-backend-addresses=127.0.0.1:3306

where:
- /etc/mysql/XBMCatv42.lua is the path to my script
- 127.0.0.1:3306 is the address of mysql server (here, same host for both mysql and mysql-proxy)
- 0.0.0.0:3307 configure mysql-proxy to wait for connection on port 3307
- --max-open-files 1024 is to avoid a critical error i had when launching mysql-proxy

(on debian, you can edit /etc/default/mysql-proxy to enable launch start and change option with previous ones)

Then in your ATV2 advancedsettings.xml change mysql address and port to mysql-proxy address / port only for video DB (or music DB won't work anymore) (eventually add <port>...</port> if missing).

To avoid potential side effect you can add a default value to the new field since DB version 42 (I think it can avoid problem when updating DB from ATV2)
Code:
ALTER TABLE `xbmc_video`.`settings` CHANGE COLUMN `VerticalShift` `VerticalShift` FLOAT NULL DEFAULT 0.0  ;
if your mysql proxy is on the same as the mysql host then itd be the same IP for the proxy, correct?
also, - 0.0.0.0:3307 configure mysql-proxy to wait for connection on port 3307 - do i need to put something in place of those 0s?

windows people, how can i setup it to run that entire command without command prompt?
Reply
hernandito Wrote:In Ubuntu, the "substitute thing does not work. For this to work, you need to first auto-mount your smb share at boot time and then create a symlink from the local XBMC Thubnails to your shared Thumbnails... read my post here:

http://lime-technology.com/forum/index.p...ic=11473.0

Look at Step 3 under XBMC Live... same procedure applies for Ubuntu.


got it ll working even on ipad Smile
good guide
Reply
rflores2323 Wrote:man this seems really complicated. I am going to be getting another atv2 tomorrow for my bday (bedroom setup) and wanted to get this working with my revo, atv2 living room, and atv2 bedroom. Is there a full how to on doing this as I see bits an pcs of information. I did see the lifehacker tutorial but its does not mention the problem with thumbnails or the skip-name-resolve to the MySQL settings in my.ini

Happy Birthday...

I am running XBMC with an ATV2 with remote thumbnails and displaying works quite well. I think the skin you use has something to do. I use Xperience, and I display movies in Wall format. Not instant to display thumbnails, but something like 1 to 2 seconds... faster than my eye can scan the movie thumbs. Try my tutorial linked above...
Reply
Thumbs Up 
haffi Wrote:got it ll working even on ipad Smile
good guide

Big Grin
Reply
hernandito Wrote:In Ubuntu, the "substitute thing does not work. For this to work, you need to first auto-mount your smb share at boot time and then create a symlink from the local XBMC Thubnails to your shared Thumbnails... read my post here:

http://lime-technology.com/forum/index.p...ic=11473.0

Look at Step 3 under XBMC Live... same procedure applies for Ubuntu.

The unRaid technology looks really cool but imma want at least raid-5 (or better yet, raid-50) on my library. Anything else out there??
Reply
TheRealDL Wrote:The unRaid technology looks really cool but imma want at least raid-5 (or better yet, raid-50) on my library. Anything else out there??

Unraid is what I use for my media... but the MySQL idea applies to many platforms, including various NAS devices and such. I wrote the guide to apply the Lifehacker guide to unRAID. So between LF guide and my guide, many should be able to go all the way to centralize your media library among a variety of XBMC devices within a network.

Let's not hijack the thread to discuss media storage...
Reply
I still have resuming issues. XBMC always asks me if i want to resume a file if i stopped it before and if i confirm it starts from the beginning most of the time. would it make sense to clean the database and start from scratch? I'm using official builds but i had one test run with a nightly build a few weeks ago. might that be the problem?
Reply
thesuffering Wrote:if your mysql proxy is on the same as the mysql host then itd be the same IP for the proxy, correct?

In advancedsetting.xml, yes.

thesuffering Wrote:also, - 0.0.0.0:3307 configure mysql-proxy to wait for connection on port 3307 - do i need to put something in place of those 0s

0.0.0.0 means mysql proxy will wait for connection on every interface of its host. Less secure but more compliant with changing IP. If your mysql-proxy host as a static IP, you can just put it here.

thesuffering Wrote:windows people, how can i setup it to run that entire command without command prompt?

Create a text file with .bat extension and the command line, then create a link to this file un Start => Start-Up folder.
Reply
hey they guys. i have ran into a roadblock =/
my atv 2 on 4.2.1 was running sluggish so i restore and jb again
i recently imported my data back to xbmc along with advancedsettings.xml
but i keep getting "error recentlyadded.py" everytime im at the main menu
if i delete advancedsettings.xml all is good and shows recents but as soon as its added again it goes back to that error and fails to show recents

any suggestions??
Reply
Odon Wrote:In advancedsetting.xml, yes.



0.0.0.0 means mysql proxy will wait for connection on every interface of its host. Less secure but more compliant with changing IP. If your mysql-proxy host as a static IP, you can just put it here.



Create a text file with .bat extension and the command line, then create a link to this file un Start => Start-Up folder.

i got this when i tried typing it manually via command prompt, your thoughts?

Code:
C:\mysql-proxy\bin>mysql-proxy --max-open-files 1024 --proxy-lua-script=xbmcatv.
lua --proxy-address=0.0.0.0:3307 --proxy-backend-addresses=192.168.254.251:3306

2011-03-14 16:22:36: (critical) admin-plugin.c:569: --admin-username needs to be
set
2011-03-14 16:22:36: (critical) mainloop.c:267: applying config of plugin admin
failed
2011-03-14 16:22:36: (critical) mysql-proxy-cli.c:596: Failure from chassis_main
loop. Shutting down.

C:\mysql-proxy\bin>
Reply
I've got a weird problem.. maybe it has been adressed before, but I'll give it a shot:

I put all of my Thumbnails in my smb, did all the advancedsettings.xml changes and all.

However, ATV2 keeps on re-creating the thumbnails folder @ usersettings folder.
Granted, it READS the samba share, but it then downloads them back to the ATV2, making the whole work quite useless (the point obviously is to avoid using the remarkably small local hard drive in favor of the samba's)

Hope someone could orient me a little.

Regards Smile
Reply
thesuffering Wrote:i got this when i tried typing it manually via command prompt, your thoughts?

Code:
C:\mysql-proxy\bin>mysql-proxy --max-open-files 1024 --proxy-lua-script=xbmcatv.
lua --proxy-address=0.0.0.0:3307 --proxy-backend-addresses=192.168.254.251:3306

2011-03-14 16:22:36: (critical) admin-plugin.c:569: --admin-username needs to be
set
2011-03-14 16:22:36: (critical) mainloop.c:267: applying config of plugin admin
failed
2011-03-14 16:22:36: (critical) mysql-proxy-cli.c:596: Failure from chassis_main
loop. Shutting down.

C:\mysql-proxy\bin>

My MySql server runs on Linux, so i can't try to solve your issue by testing, but 2 things you should test:
- either remove "--max-open-files 1024". I had to set it to avoid an issue on my Debian system. It may not be required on Windows.
- or try to run Command Line in administrator mode.
Reply
Odon Wrote:My MySql server runs on Linux, so i can't try to solve your issue by testing, but 2 things you should test:
- either remove "--max-open-files 1024". I had to set it to avoid an issue on my Debian system. It may not be required on Windows.
- or try to run Command Line in administrator mode.

i tried both, didnt work :-( hopefully the new unofficial builds from keith will get up the the same as the xbmc nightlies so they are on the same db version. windows doesnt want to play nice with me
Reply
So, I've got some problems:

I used a advancedsettings.xml:

Image

But when I see the error log:

Code:
03:00:02 T:223514624 M:163139584  NOTICE: No advancedsettings.xml to load (special://masterprofile/advancedsettings.xml)
Any idea? Sad
Reply
SunnyynnuS Wrote:So, I've got some problems:

I used a advancedsettings.xml:

Image

But when I see the error log:

Code:
03:00:02 T:223514624 M:163139584  NOTICE: No advancedsettings.xml to load (special://masterprofile/advancedsettings.xml)
Any idea? Sad
That looks like it may be a permissions related issue. In ssh type
chmod a+rw advancedsettings.xml
Reply
  • 1
  • 13
  • 14
  • 15(current)
  • 16
  • 17
  • 18

Logout Mark Read Team Forum Stats Members Help
[AppleTV2] MySQL database / library support?1