Kodi Community Forum

Full Version: [RELEASE] MythBox for XBMC - a MythTV Front-end Python Script for XBMC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

A few weeks ago I started with the implemenation of a home xbmc
system. On the same system I use xbmc is a mythtv backend installed
and allmost all is working now for me ....

- LiveTV
- EPG
- Schedule recordings

There was one big problem for me I resolved with the writing of my dvd-ripper
script. I'm the author of this tool :-)

But one thing remains .....

I would like to burn recorded shows to dvd.

- I do save all recordings inside mythtv-backend in dvd quality (720x576)

My script can allready burn dvd's and transcode mpeg2.
What would be easyer ?

Expand Mythbox to burn to dvd or extend my scripts with communication
of Mythbox to pickup a recording and after transcoding make a burned dvd ?

- I may could help to produce the burning part inside Mythbox ...

But there is also a GPL Problem ....

My own code is gpl 3 licenced and Mythbox stands under the gpl 2.2
Could I use parts of the code to pickup a single recording from a backend
and later burn it to dvd ?

Waht would other think about to burn recordings from a mythtv-backend ?

This is my personal killer-application ....


Regards
Hans
beatbreaker Wrote:I'll give it a try and report back, thankyou. Are you playing recorded tV over samba? Mounting it locally usually solves it for me tho uve prob already tried

Yea, the problem seems to be intermittent. MythBox is working fine now. Thanks for the thought. I'm using NFS to mount the directories in question.
Did some more digging and it now seems like this might be a XBMC issue, not a MythBox issue. To be sure I would like to have some input on the following.

What I did was make a new script which I called MySQLTest. I inserted this code
Code:
import os
import sys

def addLibsToPythonPath():
    libs = []
    mysql = 'MySQLdb'          # Linux uses 1.2.2
    platform = 'linux64'
    for lib in [mysql, mysql + os.sep + platform]:
        libdir = os.getcwd() + os.sep + 'resources' + os.sep + 'lib' + os.sep + lib
        libs.append(libdir)
        print('MySQLTest: libdir += %s' % libdir)
    for path in libs:    
        sys.path.append(path)
        print('MySQLTest: syspath += %s' % path)
# Uncomment line below kills it
#    import MySQLdb
# The one below also kills it (it is imported from MySQLdb)
#    import _mysql

    return platform
        

base_path = os.getcwd()
platform = addLibsToPythonPath()
in a new default.py file and copied resources/lib/MySQLdb from MythBox to my new script dir. When I run the script it finishes OK, but if I uncomment either of the two import lines XBMC just dies and this is what I find in the xbmc.log:
Quote:23:11:45 T:556181568 M:3008380928 INFO: initializing python engine.
23:11:45 T:556181568 M:3008380928 DEBUG: Loading: /usr/share/xbmc/system/python/python24-x86_64-linux.so
23:11:45 T:556181568 M:3008274432 DEBUG: new python thread created. id=2
23:11:45 T:274483536 M:3008274432 DEBUG: Running thread 274483536
23:11:45 T:274483536 M:3008274432 DEBUG: thread start, auto delete: 0
23:11:45 T:274483536 M:3008274432 DEBUG: Python thread: start processing
23:11:45 T:556181568 M:3008274432 DEBUG: CGUIMediaWindow::GetDirectory (special://home/scripts/My Scripts/)
23:11:45 T:556181568 M:3008274432 DEBUG: ParentPath = [special://home/scripts/My Scripts/]
23:11:45 T:556181568 M:3008274432 DEBUG: Sort, sorting took 0 millis
23:11:45 T:556181568 M:3008274432 DEBUG: Load defaultFolderBackBig.png: 1.3ms (bundled)
23:11:45 T:556181568 M:3008274432 DEBUG: Load defaultFolderBig.png: 1.3ms (bundled)
23:11:45 T:556181568 M:3008274432 DEBUG: Load special://masterprofile/Thumbnails/Programs/eeff47fe.tbn: 9.3ms
23:11:45 T:556181568 M:3008274432 DEBUG: Load special://masterprofile/Thumbnails/Programs/9c170194.tbn: 5.0ms
23:11:45 T:556181568 M:3008274432 DEBUG: Load special://masterprofile/Thumbnails/Programs/6517ab68.tbn: 0.6ms
23:11:45 T:556181568 M:3008274432 DEBUG: Load list-focus.png: 0.0ms (bundled)
23:11:45 T:556181568 M:3008274432 DEBUG: Load DefaultScriptBig.png: 0.8ms (bundled)
23:11:45 T:274483536 M:3008274432 NOTICE: -->Python Interpreter Initialized<--
23:11:45 T:274483536 M:3008274432 NOTICE:
23:11:45 T:274483536 M:3008274432 DEBUG: Process - The source file to load is special://home/scripts/My Scripts/MySQLTest/default.py
23:11:45 T:274483536 M:3008274432 DEBUG: Process - Setting the Python path to /home/user/.xbmc/scripts/My Scripts/MySQLTest;/usr/share/xbmc/system/python/python24.zip;/usr/share/xbmc/system/python/lib/python24.zip;/usr/share/xbmc/system/python/lib/python2.4/;/usr/share/xbmc/system/python/lib/python2.4/plat-linux2;/usr/share/xbmc/system/python/lib/python2.4/lib-tk;/usr/share/xbmc/system/python/lib/python2.4/lib-dynload
23:11:45 T:274483536 M:3008274432 DEBUG: Process - Entering source directory /home/user/.xbmc/scripts/My Scripts/MySQLTest
23:11:45 T:274483536 M:3008274432 NOTICE: MySQLTest: libdir += /home/user/.xbmc/scripts/My Scripts/MySQLTest/resources/lib/MySQLdb
23:11:45 T:274483536 M:3008274432 NOTICE:
23:11:45 T:274483536 M:3008274432 NOTICE: MySQLTest: libdir += /home/user/.xbmc/scripts/My Scripts/MySQLTest/resources/lib/MySQLdb/linux64
23:11:45 T:274483536 M:3008274432 NOTICE:
23:11:45 T:274483536 M:3008274432 NOTICE: MySQLTest: syspath += /home/user/.xbmc/scripts/My Scripts/MySQLTest/resources/lib/MySQLdb
23:11:45 T:274483536 M:3008274432 NOTICE:
23:11:45 T:274483536 M:3008274432 NOTICE: MySQLTest: syspath += /home/user/.xbmc/scripts/My Scripts/MySQLTest/resources/lib/MySQLdb/linux64
23:11:45 T:274483536 M:3008274432 NOTICE:
23:11:45 T:274483536 M:3008274432 DEBUG: msvcrt.dll incomplete function _fdopen(...) called
23:11:45 T:274483536 M:3008245760 DEBUG: msvcrt.dll incomplete function _fdopen(...) called
23:11:45 T:274483536 M:3008245760 DEBUG: xbp_dlopen loading python lib /home/user/.xbmc/scripts/My Scripts/MySQLTest/resources/lib/MySQLdb/linux64/_mysql.so. flags: 2
23:11:45 T:274483536 M:3008245760 DEBUG: Loading: /home/user/.xbmc/scripts/My Scripts/MySQLTest/resources/lib/MySQLdb/linux64/_mysql.so
23:11:45 T:274483536 M:3007766528 DEBUG: RegisterExtensionLib, adding _mysql.so (0x7f57087cd160)
23:11:45 T:274483536 M:3007766528 DEBUG: xbp_dlsym - load symbol init_mysql
and then XBMC just dies and the window disappears.

It seems that XBMC can't handle loading the _mysql.so file. Anyone in agreement? Please if you could test it out on your amd64 installation would be good! I'm on Ubuntu 9.04 amd64 with XBMC 9.04.1 and MythBox SVN 1260.

Does anyone know where I could/should report such a XBMC issue?

EDIT: Found this. Haven't had the time to try that fix but I will stop posting to this thread. Sorry about the spamming!
EDIT2: The fix worked! Big Grin
Artebonz Wrote:I removed /home/user/.xbmc/scripts/My Scripts/MythBox/resources/lib/MySQLdb/MySQLdb and then copied /usr/lib/python2.6/site-packages/MySQdb to that location.

Then I removed _mysql.so in the MythBox "linux" directory and replaced it from one from my system.

Although my recordings crash when I try to play them, but, I believe thats a seperate issue (MythBox runs and LiveTV plays just fine for example).

Edit: The stability issue may be w/the xbmc-svn build I'm using?

Ok that fixed that issue with my system thankyou! Laugh I can now watch recorded TV, read the schedule, make and edit scheduled tasks,


BUT i can't watch live TV yet. I get an error Shocked

Code:
Error Catchall
Exception:argument 1 must be unicode or str
Function: <function onlnit at 0xa12f524>

Image

it's happening both on my frontend and combined backend (Mythbuntu and Archlinux respectively)

I'm on XBMC 9.04.1 r20736M
Just playing with this for the first time and I'm really impressed, thanks and congrats on the nice piece of work.

I've got two queries about the TV Guide:

1 . At the moment I'm getting 2 slots appearing for each channel, one correctly populated with my xmltv EPG data and the other just showing no data. Has any body seen this?
2. I've set my icons up in the channels folder but they're not being picked up - do I need to refresh the cache somehow?
gerner Wrote:Just playing with this for the first time and I'm really impressed, thanks and congrats on the nice piece of work.

I've got two queries about the TV Guide:

1 . At the moment I'm getting 2 slots appearing for each channel, one correctly populated with my xmltv EPG data and the other just showing no data. Has any body seen this?
2. I've set my icons up in the channels folder but they're not being picked up - do I need to refresh the cache somehow?

Thanks! Can you post a bug report @ the googlecode site w/ a screenshot and log file for #1. For #2, the TV guide screen needs to be rewritten to pull the icons from the mythtv server (similar to how the 'Watch TV' screen works in the latest release).
beatbreaker Wrote:Ok that fixed that issue with my system thankyou! Laugh I can now watch recorded TV, read the schedule, make and edit scheduled tasks,


BUT i can't watch live TV yet. I get an error Shocked

Code:
Error Catchall
Exception:argument 1 must be unicode or str
Function: <function onlnit at 0xa12f524>
Image

it's happening both on my frontend and combined backend (Mythbuntu and Archlinux respectively)

I'm on XBMC 9.04.1 r20736M

Can you create a bug report at the google code site along with the log file (really need this) containing the stack trace?
analogue Wrote:Can you create a bug report at the google code site along with the log file (really need this) containing the stack trace?

Done, let me know if you need anything else :p

http://code.google.com/p/mythbox/issues/detail?id=53
Hey guys,

I had a play around this the other day, it looks really nice - escpecially the ability to have a proper looking EPG.
It seems to take quite a while to fire up TV channels though.. after selecting I get the 'buffering' popup for around 10 seconds, then TV starts - If I reduce the buffer size the TV starts glitching out after a few seconds of viewing.

Is this normal ? Any way to speed it up at all ?

Cheers!
analogue Wrote:Thanks! Can you post a bug report @ the googlecode site w/ a screenshot and log file for #1. For #2, the TV guide screen needs to be rewritten to pull the icons from the mythtv server (similar to how the 'Watch TV' screen works in the latest release).

Sorry for the delay, finally got around to posting that issue with screenies: http://code.google.com/p/mythbox/issues/...1250858782

Let me know if you want more details or testing.
I really like mythbox.. this will make xbmc a much better option than mythfrontend. I've just begun trying mythbox, but I ran into a couple oddities:

- When selecting any recording, I get an error dialog [ Error: CATCHALL Exception: (8,'nodename nor servername provided or not known') Function: <function onInit at 0x146f44c0>]. Once I select OK to close the dialog, I can select Play and the recording plays fine.

- When trying to play a program that was still being recorded (not live-tv viewing, just selecting a recording that hasn't ended yet), It doesn't play smoothly. It behaves as if it cannot stream the program fast enough. It stutters, pauses to queue, plays smoothly for a couple seconds, stutters and repeats the process. After it stopped recording, I tried again and it worked fine.


- I get tearing in the playback of myth recordings. But, I am guessing that's more of an XBMC issue, not mythbox.

btw - this is on a Mac Mini running OS X
beatbreaker Wrote:I couldn't get it working on Arch Linux - filled out a report

http://code.google.com/p/mythbox/issues/...1&q=dlopen

errors:
Unknown dlopen() error
error python script failed
special://home/scripts/mythbox/default.py

Image

Image

I got the same error using Ubuntu 9.04 64 bit. I installed as instructed /home/william/.xbmc/scripts/MythBox/default.py.
I followed these instructions from http://code.google.com/p/mythbox/issues/...?id=2#c19:
I found a working _mysql.so in python-mysqldb for intrepid.
Download the python-mysqldb deb from
http://packages.ubuntu.com/intrepid/python-mysqldb and put
usr/lib/python-support/python-mysqldb/python2.4/_mysql.so in
/MythBox/resources/lib/MySQLdb/linux64
This got me going.
I have a few things that should be addressed.
1. Viewing the TV guide - I had several repeats of the same channel but only one channel had the information of the channel while the rest had no information. Also not all the channels were viewable. I'm not sure if this was due to the fact of the overrun of the channels without data.
2. During viewing the recorded programs, the second selection ( after selecting), the description should be available in full, not scrolled horizontally. I can see this due to the limitation of space before but when the program is singled out it should have the full description.
3. When using watch tv, the guide doesn't sort the channels in any order. This needs to be in some sort of orderly fashion.
4. Lastly, I'm not certain of the source, but the XBMC + Mythbox will close intermittently after a selection is made from recorded videos. I can't confirm this is just from recorded videos. This one isn't pinned on mythbox but still has to be addressed.
Hopefully this thread has given you some useful feedback. I'm not one to post this twice as you have requested to Google since I have spent a great deal of time testing your software for free, my time is as free as yours. I wish your endeavor the best.
Thanks
Hello

Just tried using MythBox SVN 1260 against mythtv 0.22.0~trunk21556-0ubuntu3 but it fails with "unsupported protocol 48". Does MythBox support 44 at the most (from what I read in the ChangeLog)?

Thanks..
probably a dumb question but does this script work with AEON-Hitcher's AEON skin ?

I've never installed MythTV or Linux , so before i go thru that headache it'd be nice to know that.

Thanks.
wally007 Wrote:probably a dumb question but does this script work with AEON-Hitcher's AEON skin ?

I've never installed MythTV or Linux , so before i go thru that headache it'd be nice to know that.

Thanks.

I can't say about the skin but if you've never installed Linux or MythTV before, then getting a skin to work might be the least of your problems. There's a steep learning curve on everything, aesthetics might have to take a back seat for a bit. I've done it myself recently but I needed lots of patience, It's paid off in the end though.