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.
Done. I apologize if I did it in the wrong place. :-)

One question... I obviously know nothing about programming and even less about how scripts interact with XBMC. But I assume that somewhere in the script code, there's a line or two that tells XBMC it should start playing the given file. Why isn't it as easy as having the script execute some other command instead?

I'm not criticizing, just curious!
theophile Wrote:Done. I apologize if I did it in the wrong place. :-)

One question... I obviously know nothing about programming and even less about how scripts interact with XBMC. But I assume that somewhere in the script code, there's a line or two that tells XBMC it should start playing the given file. Why isn't it as easy as having the script execute some other command instead?

I'm not criticizing, just curious!

Well, theres all sorts of integration issues that need to be considered which might or might not be valid:

- xbmc would most likely have to relinquish control of lirc so the mythtv player can assume control
- window focus issues - do xbmc and mythtv play nice when spawned as a child process
- screen resolution change issues
- running in fullscreen or windowed mode issues
- contention over activity timeout issues (dimming/going to sleep/screensaver, etc)
- correct configuration of mythtv using its frontend to get it to 'behave' when launched from xbmc

I'm sure are plenty more that I haven't even thought of...
Hey All,

I am trying to get the script working I am on SVN 17369 as of this morning. I dwnlded the latest mythbox svn untarred it to .xbmc/scripts

rebooted and click on Mythbox it just says running for a split second and thats it. If I run debug, it pops up the python script and says something about loading module error and then cannot input os, no module from os.

I am on 8.10 base install with and Mythtv runs ok from the myth:// protocol I can watch live etc..

Sorry I have no log to post as I take that mythbox cannot get by the opening script to start thus it is not creating a log by the looks of it.

the actual error

traceback (last call)
in line 1
no module threading

then down the debug in line of default.py script line 24

traceback (last call)
import os
no module os


Thanks,

Dave
I finally got mythtv working, and the only reason i was trying to do so is to be able to watch tv from my xbmc machine outside. I setup mythtv on my media storage server (which is not my xbmc machine). both are running on ubuntu 8.10.

to make things clearer:
- storage server (192.168.1.5) has mythtv (with nexus-s card) running on it
- xbmc (192.168.1.4) has mythbox on it (with no mythtv installtions locally)

mythbox can get all the info (channel list, whats going on with the tuners, etc..) but can not play live tv (note that im very new to mythtv and relativly new to both xbmc and linux).

i read here one post where the recording dir from mythtv (which remote) is mounted on the xbmc machine to be used / accessed to play... ?!
megacrypto Wrote:i read here one post where the recording dir from mythtv (which remote) is mounted on the xbmc machine to be used / accessed to play... ?!

I'm not 100% I understand what you're saying, but anyway, yes you have to mount the recordings locally for mythbox to find them. So you have to mount the recordings on 192.168.1.5 to your local box 192.168.1.4 with for example sshfs, samba, nfs, and then point mythbox to the dir.
i did a fresh install (have 8.10 mini on xbmc-htpc machine (svn 17574) & 8.10 desktop on myth-machine) this is the log when i try to run the svript:
Code:
16:14:52 T:3068806960 M:363421696    INFO: initializing python engine.
16:14:52 T:3068806960 M:363421696   DEBUG: Loading: /usr/share/xbmc/system/python/python24-i486-linux.so
16:14:52 T:3068806960 M:363421696   DEBUG:   msg: 'import site' failed; use -v for traceback
16:14:52 T:3068806960 M:363429888   DEBUG: new python thread created. id=2
16:14:52 T:2759773072 M:363429888   DEBUG: Running thread 2759773072
16:14:52 T:2759773072 M:363429888   DEBUG: thread start, auto delete: 0
16:14:52 T:2759773072 M:363429888   DEBUG: Python thread: start processing
16:14:52 T:2759773072 M:363429888   DEBUG:   msg: 'import site' failed; use -v for traceback
16:14:52 T:2759773072 M:363429888  NOTICE: -->Python Interpreter Initialized<--
16:14:52 T:2759773072 M:363429888  NOTICE:
16:14:52 T:3068806960 M:363429888   DEBUG: CGUIMediaWindow::GetDirectory (special://home/scripts)
16:14:52 T:3068806960 M:363429888   DEBUG:   ParentPath = [special://home/scripts]
16:14:52 T:3068806960 M:363429888   DEBUG: Sort, sorting took 0 millis
16:14:52 T:3068806960 M:363429888   DEBUG: Load defaultFolderBackBig.png: 5.4ms (bundled)
16:14:52 T:3068806960 M:363429888   DEBUG: Load defaultFolderBig.png: 3.1ms (bundled)
16:14:52 T:3068806960 M:363315200   DEBUG: Load list-focus.png: 0.1ms (bundled)
16:14:52 T:2759773072 M:363315200  NOTICE: Traceback (most recent call last):
16:14:52 T:2759773072 M:363315200  NOTICE:   File "/home/xbmc/.xbmc/scripts/MythBox/default.py", line 24, in ?
16:14:52 T:2759773072 M:363315200  NOTICE:
16:14:52 T:2759773072 M:363315200  NOTICE: import os
16:14:52 T:2759773072 M:363315200  NOTICE: ImportError
16:14:52 T:2759773072 M:363315200  NOTICE: :
16:14:52 T:2759773072 M:363315200  NOTICE: No module named os
16:14:52 T:2759773072 M:363315200  NOTICE:
16:14:52 T:2759773072 M:363315200   ERROR: Scriptresult: Error
16:14:52 T:3068806960 M:363315200   DEBUG: Load special://masterprofile/Thumbnails/Programs/4faaddf4.tbn: 13.6ms
16:14:53 T:2759773072 M:363286528  NOTICE: Traceback (most recent call last):
16:14:53 T:2759773072 M:363286528  NOTICE:   File "<string>", line 1, in ?
16:14:53 T:2759773072 M:363286528  NOTICE: ImportError
16:14:53 T:2759773072 M:363286528  NOTICE: :
16:14:53 T:2759773072 M:363286528  NOTICE: No module named threading
16:14:53 T:2759773072 M:363286528  NOTICE:
16:14:53 T:2759773072 M:363286528    INFO: Python script stopped
16:14:53 T:2759773072 M:363286528   DEBUG: staticThread, deleting thread graphic context
16:14:53 T:2759773072 M:363286528   DEBUG: Thread 2759773072 terminating
16:14:53 T:3068806960 M:363286528   DEBUG: python thread 2 destructed
16:14:53 T:3068806960 M:363286528    INFO: Python, unloading python24.dll because no scripts are running anymore
16:14:53 T:3068806960 M:363286528   DEBUG: UnloadExtensionLibs, clearing python extension libraries
16:14:53 T:3068806960 M:363286528   DEBUG: Unloading: python24-i486-linux.so
16:14:53 T:3068806960 M:363429888   DEBUG: CGUIMediaWindow::GetDirectory (special://home/scripts)
16:14:53 T:3068806960 M:363429888   DEBUG:   ParentPath = [special://home/scripts]
16:14:53 T:3068806960 M:363429888   DEBUG: Sort, sorting took 0 millis
16:14:53 T:3068806960 M:363429888   DEBUG: Load defaultFolderBackBig.png: 1.6ms (bundled)
16:14:53 T:3068806960 M:363429888   DEBUG: Load defaultFolderBig.png: 1.4ms (bundled)
16:14:53 T:3068806960 M:363429888   DEBUG: Load list-focus.png: 0.1ms (bundled)
16:14:53 T:3068806960 M:363429888   DEBUG: Load special://masterprofile/Thumbnails/Programs/4faaddf4.tbn: 7.3ms
16:14:54 T:3068806960 M:363429888   DEBUG: Update - NEW at 406915:000000037ff07bdc 00 Back mceusb (Back)
16:14:54 T:3068806960 M:363429888   DEBUG: OnKey: 216 pressed, action is 9
16:14:54 T:3068806960 M:363429888   DEBUG: CGUIMediaWindow::GetDirectory ()
16:14:54 T:3068806960 M:363429888   DEBUG:   ParentPath = []
16:14:54 T:3068806960 M:363429888   DEBUG: Sort, sorting took 0 millis
16:14:54 T:3068806960 M:363429888   DEBUG: Load list-focus.png: 0.1ms (bundled)
16:14:54 T:3068806960 M:363429888   DEBUG: Load defaultHardDiskBig.png: 2.2ms (bundled)
16:14:54 T:3068806960 M:363429888   DEBUG: Update - NEW at 407469:000000037ff07bdc 00 Back mceusb (Back)
16:14:54 T:3068806960 M:363429888   DEBUG: OnKey: 216 pressed, action is 9
16:14:54 T:3068806960 M:363429888   DEBUG: CGUIWindowManager::PreviousWindow: Deactivate
I've added the script to the XBMC Favorites repo, eventhough I haven't been able to test it myself because I don't have a MythTV server running at the moment. Still, fantastic that someone is bringing PVR control to XBMC Smile
Just in case anyone on this thread is interested in what XBMC Media Center supports "out-of-the-box" for MythTV integration the wiki page now has pretty screenshots.

http://wiki.xbmc.org/?title=MythTV
I'm a long time user of MythTV and just installed XBMC SVN on Fedora 10 tonight. I'm looking forward to a fresher looking front-end and am trying to get Mythbox going. Has anyone ever received an error message "Errno 17: File exists: 'T:\\script_data' when trying to save the Mythbox script settings? I can run the script setup in XBMC and Test Settings works. Just can't seem to save the settings. I suspect it is related to this? http://forum.xbmc.org/showthread.php?tid...cript_data

Any idea how to resolve this problem?

Thanks
Shaky Wrote:I'm a long time user of MythTV and just installed XBMC SVN on Fedora 10 tonight. I'm looking forward to a fresher looking front-end and am trying to get Mythbox going. Has anyone ever received an error message "Errno 17: File exists: 'T:\\script_data' when trying to save the Mythbox script settings? I can run the script setup in XBMC and Test Settings works. Just can't seem to save the settings. I suspect it is related to this? http://forum.xbmc.org/showthread.php?tid...cript_data

Any idea how to resolve this problem?

Thanks

well, my previous problem is now solved, but im getting the same "Errno 17: File exists: 'T:\\script_data' when i try to save the settings .. im running xbmc pre-0.4 svn:17600M
I just installed a slightly older version (XBMC-8.10.src.tar.gz from sourceforge). Seems to have solved the unable to save problem.
It is too bad this doesn't work on the xbox. xbmcmythtv has run out of gas and the one mentioned by dtierney still stutters on the xbox and is far short of xbmcmythtv. It is disappointing that so many folks have moved away from the xbox as a platform. Oh well.
Shaky Wrote:I'm a long time user of MythTV and just installed XBMC SVN on Fedora 10 tonight. I'm looking forward to a fresher looking front-end and am trying to get Mythbox going. Has anyone ever received an error message "Errno 17: File exists: 'T:\\script_data' when trying to save the Mythbox script settings? I can run the script setup in XBMC and Test Settings works. Just can't seem to save the settings. I suspect it is related to this? http://forum.xbmc.org/showthread.php?tid...cript_data

Any idea how to resolve this problem?

Thanks

If you edit line 392 of the MythBox file "MythBox/resources/src/util.py" like below, it should work.

Originally it looks like this:

return xbmc.translatePath("T:\\script_data") + os.sep + os.path.basename(self.getScriptDir())

Change it to look like this:

return "special://masterprofile/script_data/MythBox"

I'm using the SVN from a few days ago on linux, and it works fine for me. Probably not the best way to do it, but I'm sure the dev will come up with a better solution when MythBox is next updated.

Cheers!
.
rottgrub Wrote:If you edit line 392 of the MythBox file "MythBox/resources/src/util.py" like below, it should work.

Originally it looks like this:

return xbmc.translatePath("T:\\script_data") + os.sep + os.path.basename(self.getScriptDir())

Change it to look like this:

return "special://masterprofile/script_data/MythBox"

This seems to work. Thanks for sharing!