Kodi Community Forum
Python and MythTV (a MythTV Front-End) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Python and MythTV (a MythTV Front-End) (/showthread.php?tid=2349)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39


- imthemp3king - 2005-02-09

(madtw @ feb. 08 2005,00:29 Wrote:the installation instructions are a little out of date in cvs.  here are some quick installation instructions:

1. upload the entire contents of the xbmcmythtv directory to your xbmc/scripts directory on your xbox.
2. run the mythtvmain.py script and go into the settings screen to specify your connection details and paths.
3. on the settings screen, make sure that the connections test successfully then save your settings.
4. you should now be able to use the rest of the buttons on the main menu displayed by mythtvmain.py.

optional installation includes adding a shortcut to the main xbmc menu:

1. add a new button entry into your xboxmediacenter.xml file that executes q:\scripts\xbmcmythtv\mythtvmain.py
2. update the xbmc/skin/project mayhem/pal/home.xml (or equivalent for your skin) to increase numbuttons by 1.
3. reboot xbox to show the skin change.
i hate to sound like a dummy, but when you say the "entire contents" of the xbmcmyth directory, do you mean the language, skin, and test folders as well or do i still drop those contents into the corresponding folders in the xbmc folder on the xbox?  i did both and both times, when i tried to run mythtvmain.py, it said it was running and then it does nothing.  i replaced version 0.15_fixed with the cvs and now nothing works (which isn't saying much yet as i have still to be able to watch anything, but i was at least able to get into the gui)  i also just copied the xbmcmyth folder the the xbmc\scripts folder on the xbox and that didn't work either.  i am using a build of xbmc from the 4th of february and the latest cvs of xbmcmyth.  my backend is mythtv 0.16.  one other question about the settings.  what exactly is the prefix path setting?  is that the share on the backend where the recordings reside?

thanks


- madtw - 2005-02-10

ok, i guess i could have been clearer in my instructions. for step 1, i meant upload the xbmcmythtv directory and all sub directories to the xbmc/scripts. so the filesystem should look like:

Quote:xbmc/
scripts/
xbmcmythtv/
language/
skin/

within the scripts directory, you should have a subdirectory called xbmcmythtv and within that you would have the *.py files. under the xbmcmythtv directory, you would have a language directory and a skin directory.

note: you should *never* have to overwrite xbmc files with this installation method. if you find yourself overwriting files that came with xbmc, then you are doing something wrong and you will most likely mess up your xbmc install.

the old way of installing stuff into the xbmc directories made it more difficult to uninstall everything if you don't want to use the scripts.

technically speaking, you do not need to upload the contents of the "test" directory. the files in the directory are only used for emulation testing outside of xbmc. however, it won't hurt if you upload the test directory with everything else.

my current setup that works fine is a feb 3, 2005 build of xbmc, myth tv 0.16, and the latest cvs of xbmcmythtv.

the path prefix should be a string that can be prepended in front of the myth generated recording filenames (e.g. 1014_20040713103000_20040713110000.nuv) to access the files remotely for playback. the live prefix should be the prefix needed to access the dir where myth will generate the ringbuffer files. with my setup, these two directories happen to be the same. if you happen to share the directory using smb, then it should be a smb share path prefix.

if you use the special value '%h' somewhere in the path prefix, then the scripts will replace the '%h' with the hostname stored in the mythdatabase. this is in case you have multiple backends that record shows. this assumes the remote share name is the same on all hosts. if you only have one backend, you don't need to use the '%h' value - you can put in the hostname explicitly. (if your myth database has fully qualified domain names in the recorded.hostname column, then the scripts will strip the domain from the hostname before replacing %h. this was a bug/feature request from someone that had fqdn hostnames in myth but was sharing using netbios/smb and the fqdn was not the same as the netbios hostname.)

i should note that the prefix can begin with "smb://", "xns://", "xbms://" or anything else supported by xbmc. i have only tested with "smb://" but the others should work as well...


- Loto_Bak - 2005-02-12

nice work madtw and dev crew
im excited to see the guide skinned up so i can test out live tv!

looks like mythtv 0.17 was released today. hopefully there arnt many protocol changes Wink


- imthemp3king - 2005-02-12

i put an old version of xbmc on one of my xbox's and the 0.15_fixed xbmcmythtv in all the right locations.  it loads up ok, and i go to the recorded shows menu and press the green button to select the show i want to view, i hear some activity on the hard drive and then nothing.  i see no activity on the tv.  it freezes up on the selection i chose and i have to power off the xbox and then power it back on.  here is a snippet of the xbmc log file:
Quote:12-02-2005 11:03:19 info fillindefaulticon(aqtbrowser.py)
12-02-2005 11:03:19 info fillindefaulticon(eurotv.py)
12-02-2005 11:03:19 info fillindefaulticon(gamesaves.py)
12-02-2005 11:03:19 info fillindefaulticon(gametrailers.py)
12-02-2005 11:03:19 info fillindefaulticon(ifilmbrowser.py)
12-02-2005 11:03:19 info fillindefaulticon(xbmcmail.py)
12-02-2005 11:03:19 info fillindefaulticon(xsp 26 11 04 beta 1.py)
12-02-2005 11:03:19 info fillindefaulticon(data)
12-02-2005 11:03:19 info fillindefaulticon(eurotv)
12-02-2005 11:03:19 info fillindefaulticon(gamesaves)
12-02-2005 11:03:19 info fillindefaulticon(gametrailers)
12-02-2005 11:03:19 info fillindefaulticon(ifilmbrowser)
12-02-2005 11:03:19 info fillindefaulticon(images)
12-02-2005 11:03:19 info fillindefaulticon(launchbrowser)
12-02-2005 11:03:19 info fillindefaulticon(xbmcmythtv)
12-02-2005 11:03:19 info fillindefaulticon(mytv.py)
12-02-2005 11:03:19 info fillindefaulticon(mytvlivetv.py)
12-02-2005 11:03:19 info fillindefaulticon(mytvrecorded.py)
12-02-2005 11:03:19 info fillindefaulticon(mytvschedule.py)
12-02-2005 11:03:19 info fillindefaulticon(mytvscheduleshow.py)
12-02-2005 11:03:19 info fillindefaulticon(mytvsettings.py)
12-02-2005 11:03:19 info fillindefaulticon(mytvshow.py)
12-02-2005 11:03:19 info fillindefaulticon(mytvstatus.py)
12-02-2005 11:03:22 debug loadlibrarya('zlib.pyd')
12-02-2005 11:03:22 debug executing entrypoint at: 0xc484ff - dll: zlib.pyd
12-02-2005 11:03:22 debug loadlibrary('zlib.pyd') returning: 0x927540
12-02-2005 11:03:22 debug kernel32!getprocaddress(0x927540, 'initzlib') => 0xc42210
12-02-2005 11:03:23 info -->python initialized<--
12-02-2005 11:03:23 info
12-02-2005 11:03:23 info fillindefaulticon(aqtbrowser.py)
12-02-2005 11:03:23 info fillindefaulticon(eurotv.py)
12-02-2005 11:03:23 info fillindefaulticon(gamesaves.py)
12-02-2005 11:03:23 info fillindefaulticon(gametrailers.py)
12-02-2005 11:03:23 info fillindefaulticon(ifilmbrowser.py)
12-02-2005 11:03:23 info fillindefaulticon(xbmcmail.py)
12-02-2005 11:03:23 info fillindefaulticon(xsp 26 11 04 beta 1.py)
12-02-2005 11:03:23 debug loadlibrarya('_sre.pyd')
12-02-2005 11:03:23 info fillindefaulticon(data)
12-02-2005 11:03:23 info fillindefaulticon(eurotv)
12-02-2005 11:03:23 info fillindefaulticon(gamesaves)
12-02-2005 11:03:23 info fillindefaulticon(gametrailers)
12-02-2005 11:03:23 info fillindefaulticon(ifilmbrowser)
12-02-2005 11:03:23 info fillindefaulticon(images)
12-02-2005 11:03:23 info fillindefaulticon(launchbrowser)
12-02-2005 11:03:23 info fillindefaulticon(xbmcmythtv)
12-02-2005 11:03:23 debug executing entrypoint at: 0xc5a3cb - dll: _sre.pyd
12-02-2005 11:03:23 info fillindefaulticon(mytv.py)
12-02-2005 11:03:23 debug loadlibrary('_sre.pyd') returning: 0x9a7090
12-02-2005 11:03:23 info fillindefaulticon(mytvlivetv.py)
12-02-2005 11:03:23 debug kernel32!getprocaddress(0x9a7090, 'init_sre') => 0xc5a120
12-02-2005 11:03:23 info fillindefaulticon(mytvrecorded.py)
12-02-2005 11:03:23 info fillindefaulticon(mytvschedule.py)
12-02-2005 11:03:23 info fillindefaulticon(mytvscheduleshow.py)
12-02-2005 11:03:23 info fillindefaulticon(mytvsettings.py)
12-02-2005 11:03:23 info fillindefaulticon(mytvshow.py)
12-02-2005 11:03:23 info fillindefaulticon(mytvstatus.py)
12-02-2005 11:03:23 debug loadlibrarya('_ssl.pyd')
12-02-2005 11:03:23 debug executing entrypoint at: 0xcae951 - dll: _ssl.pyd
12-02-2005 11:03:23 debug loadlibrary('_ssl.pyd') returning: 0x96eb90
12-02-2005 11:03:23 debug kernel32!getprocaddress(0x96eb90, 'init_ssl') => 0xc61aa0
12-02-2005 11:03:26 error texture manager unable to load file: q:\skin\project mayhem\media\panel-settings.png
12-02-2005 11:03:26 error texture manager unable to load file: q:\skin\project mayhem\media\panel-settings.png
12-02-2005 11:04:07 info traceback (most recent call last):
12-02-2005 11:04:07 info   file "q:\scripts\mytvrecorded.py", line 260, in oncontrol
12-02-2005 11:04:07 info     showdetails.init( self, self.rowinfo[rowindex] )
12-02-2005 11:04:07 info   file "q:\scripts\mytvshow.py", line 135, in init
12-02-2005 11:04:07 info     gui.debug( \
12-02-2005 11:04:07 info   file "q:\python\lib\mythtv.py", line 398, in starttime
12-02-2005 11:04:07 info     return ctime2mythtime(self.__data[11])
12-02-2005 11:04:07 info   file "q:\python\lib\mythtv.py", line 18, in ctime2mythtime

and here are the settins i have in xbmcmythtv
Quote:<mytv>
<host>10.0.0.10</host>
<database>mythconverg</database>
<port>3306</port>
<user>mythtv</user>
<password>mythtv</password>
<mythtvport>6543</mythtvport>
<mythtvstatusport>6544</mythtvstatusport>
<mythtvprotocol>13</mythtvprotocol>
<pathprefix>smb://10.0.0.10/recordings</pathprefix>
<livetvprefix>smb://10.0.0.10/buffer</livetvprefix>
<localcopypath>f:\videos\</localcopypath>
</mytv>

i have lowered the cache size on the xbox as well to 512k so it shouldn't take very long to begin playing video.  
thanks for all your help


- madtw - 2005-02-13

i'm guessing it is a date formatting issue or perhaps a protocol issue in that the incorrect number of fields are being returned compared to what the code is expecting. i also had a number of lockups with 0.15_fixed, mythtv 0.16, and older versions of xbmc. i would recommend using the latest cvs... but you can always have a go at fixing the code in the older versions if you prefer to use that.

adjusting the video cache for the recorded shows is not as critical as it is for the live tv. the issue you are having is because of bugs in the code... not with your cache settings.


- sgtstadanko - 2005-02-13

jhey guys. just upgraded from .16 tio ,17 on the myth side. went in changed the protocol to 14 in settings.xml, fired her up and she works great still. whats the status on "live tv" working?

thanks,
bill


- walterb1 - 2005-02-13

sorry to repeat this question but ..

i get an error:

error
(10057, socket is not connected)

i use mythtv 0.16
xbmc 2/3/05 build

mythtv is functional on my gentoo linux box 2.6.9-r1
all shares are available on the xbox.
any help is appreciated.
i am so close!!
thanks


- sgtstadanko - 2005-02-13

(sgtstadanko @ feb. 13 2005,13:20 Wrote:jhey guys. just upgraded from .16 tio ,17 on the myth side. went in changed the protocol to 14 in settings.xml, fired her up and she works great still. whats the status on "live tv" working?

thanks,
bill
ok..with live tv i am digging around in the logs and have found a couple of problems. one, the settings.xml file, you have to put a trailing "/" after the livetv path to the backend. otherwise it doesn't parse the path to the ringbuffer file on the myth backend. no problem there just added one. however, xbmcmythtv is looking for the wrong ringbuffer name. in my case it is looking for "ringbuf3.nuv" when on the myth backend the file is named "ringbuf1.nuv" . i couldnt find where to edit this in the scripts to fix and i don't know if this is by design to use multiple backend tuners? also, in the xbmc.log i can see the following:
13-02-2005 11:17:08 info mplayer playConfusedmb://mythtv:[email protected]/mythtv/tv/ringbuf3.nuv cachesize:8192
13-02-2005 11:17:09 info flipping bi-directional subtitles disabled
13-02-2005 11:17:09 info stating file smb://mythtv:[email protected]/mythtv/tv/ringbuf3.nuv.conf
13-02-2005 11:17:09 info stating file q:\mplayer\ringbuf3.nuv.conf
13-02-2005 11:17:09 error cmplayer::openfile() smb://mythtv:[email protected]/mythtv/tv/ringbuf3.nuv failed
13-02-2005 11:17:15 debug freeing fs segment @ 0x8b1fc0
13-02-2005 11:17:15 info mplayer playConfusedmb://mythtv:[email protected]/mythtv/tv/ringbuf3.nuv cachesize:8192
13-02-2005 11:17:15 debug initializing fs_seg..
13-02-2005 11:17:15 debug fs segment @ 0xe30010
13-02-2005 11:17:15 info flipping bi-directional subtitles disabled
13-02-2005 11:17:15 info stating file smb://mythtv:[email protected]/mythtv/tv/ringbuf3.nuv.conf
13-02-2005 11:17:15 info stating file q:\mplayer\ringbuf3.nuv.conf
13-02-2005 11:17:15 error cmplayer::openfile() smb://mythtv:[email protected]/mythtv/tv/ringbuf3.nuv failed
13-02-2005 11:20:42 debug freeing fs segment @ 0xe30010
13-02-2005 11:20:42 info mplayer playConfusedmb://mythtv:[email protected]/mythtv/tv/ringbuf3.nuv cachesize:8192
13-02-2005 11:20:43 debug initializing fs_seg..
13-02-2005 11:20:43 debug fs segment @ 0xe30010
13-02-2005 11:20:43 info flipping bi-directional subtitles disabled
13-02-2005 11:20:43 info stating file smb://mythtv:[email protected]/mythtv/tv/ringbuf3.nuv.conf
13-02-2005 11:20:43 info stating file q:\mplayer\ringbuf3.nuv.conf
13-02-2005 11:20:43 error cmplayer::openfile() smb://mythtv:[email protected]/mythtv/tv/ringbuf3.nuv failed
13-02-2005 11:21:14 debug freeing fs segment @ 0xe30010
13-02-2005 11:21:14 info mplayer playConfusedmb://mythtv:[email protected]/mythtv/tv/ringbuf3.nuv cachesize:8192
13-02-2005 11:21:14 debug initializing fs_seg..
13-02-2005 11:21:14 debug fs segment @ 0xe30010
13-02-2005 11:21:14 info flipping bi-directional subtitles disabled
13-02-2005 11:21:14 info stating file smb://mythtv:[email protected]/mythtv/tv/ringbuf3.nuv.conf
13-02-2005 11:21:14 info stating file q:\mplayer\ringbuf3.nuv.conf
13-02-2005 11:21:14 error cmplayer::openfile() smb://mythtv:[email protected]/mythtv/tv/ringbuf3.nuv failed


no idea what this *.conf file is either. almost there so any help would be great...
bill


- madtw - 2005-02-14

update to the latest cvs... i made some fixes this weekend (e.g. trailling slash, hostname expansion, etc). i also added in a new setting so that you can specify the mininum ring buffer size before the xbmc video player is launched. that way you can play around with the xbmc cache settings and the ring buffer minimum size until you reach a happy medium with caching of video versus time it takes to start playing live tv.

as for the wrong ring buffer filename problem you mentioned, i haven't had the problem with my setup. the script gets the name of the ringbuffer file from the myth backend so i'm a bit surprised that it gets this wrong. on my setup, the ring buffer filename is ringbuf7.nuv so we haven't hard coded the name of the ring buffer in the scripts. i'm not saying that the logic is correct in the script... but it isn't as simple as fixing a hard coded value. if you launch the mythtvlivetv.py script manually (i.e. not from mythtvmain.py). it will slow it down a lot but the screen will log all the myth protocol stuff to help in debugging.

the .conf stuff is xbmc behavior... i'm guessing you can specify configuration options for each video file if you like. so xbmc checks to see if such a file exists whenever it launches any video file.


- madtw - 2005-02-14

(walterb1 @ feb. 13 2005,09:02 Wrote:i get an error:

error
(10057, socket is not connected)
ok, this problem means that the xbox was unable to connect to either the mythbackend or mysql server. there are many reasons why this might be the case but here are some suggestions:

1. make sure you entered a fully qualified domain name for your backend server or the correct ip address. a name like 'banshee' will not work because the dns lookup on the xbox requires a fqdn to work. instead you will have to specify something like "banshee.house.net" or "10.1.2.3".
2. make sure all the server port numbers are correct.
3. make sure the mythbackend is running and the mysql database is up.
4. this might be obvious but make sure your xbox is connected to the network and is getting an ip address on your lan. (this should be the case since you said your shares were working.)


- mirth - 2005-02-14

(walterb1 @ feb. 13 2005,16:02 Wrote:<snip>
error
(10057, socket is not connected)
</snip>
i had this problem before. i provided a post a while back in the thread, but here is my solution:

mysql isn't automatically configured listen for network connections. i had to edit /etc/mysql/my.cnf and edit out the skip-networking line and then restart mysqld.


- beef - 2005-02-15

this clearly rocks and since you all know what you are talking about im gonna ask my question right here, hope thats ok.

i have an 2000 server as fileserver atm and was thinking of making it my new stream-comp/digitalvcr. (was hoping to keep running 2k server if possible)
all i want to know is what analog tv-turnercard you all recommend. ive seen so many different and id like to make the right choice right away so it will save me time later.

ex. a analog tv-turnercard that is compatible with the program needed to control the whole thing from my xboxes.

id appreciate all response to my reply, and o man i cant wait til i get it up and running so i can contribute to this thread for real.

cheers guys and keep up the grand work.

/beef

ps. what's the correct name of the program and the plugin that i need on the serverside?


- sgtstadanko - 2005-02-15

(madtw @ feb. 14 2005,05:15 Wrote:update to the latest cvs... i made some fixes this weekend (e.g. trailling slash, hostname expansion, etc). i also added in a new setting so that you can specify the mininum ring buffer size before the xbmc video player is launched. that way you can play around with the xbmc cache settings and the ring buffer minimum size until you reach a happy medium with caching of video versus time it takes to start playing live tv.

as for the wrong ring buffer filename problem you mentioned, i haven't had the problem with my setup. the script gets the name of the ringbuffer file from the myth backend so i'm a bit surprised that it gets this wrong. on my setup, the ring buffer filename is ringbuf7.nuv so we haven't hard coded the name of the ring buffer in the scripts. i'm not saying that the logic is correct in the script... but it isn't as simple as fixing a hard coded value. if you launch the mythtvlivetv.py script manually (i.e. not from mythtvmain.py). it will slow it down a lot but the screen will log all the myth protocol stuff to help in debugging.

the .conf stuff is xbmc behavior... i'm guessing you can specify configuration options for each video file if you like. so xbmc checks to see if such a file exists whenever it launches any video file.

ok..loaded up the latest cvs and ran live tv. it still plays for like maybe 2 seconds before dropping back to the tv listings. here is what i am getting in my backend log during the event:
2005-02-14 19:39:51.788 adding: xbox as a client (events: 0)
2005-02-14 19:40:37.440 changing from none to watchinglivetv
waited too long for recorder to pause
changing to 7
[1] 24580
2005-02-14 19:40:39.571 ret_pid(24579) child(24579) status(0x0)
2005-02-14 19:40:39.573 external tuning program exited with no error
2005-02-14 19:40:45.537 changing from watchinglivetv to none
2005-02-14 19:40:46.180 unknown socket
2005-02-14 19:40:48.755 mainserver::handleannounce playback
2005-02-14 19:40:48.756 adding: xbox as a client (events: 0)
2005-02-14 19:40:48.780 changing from none to watchinglivetv
waited too long for recorder to pause
changing to 7
[1] 24590
2005-02-14 19:40:50.919 ret_pid(24589) child(24589) status(0x0)
2005-02-14 19:40:50.920 external tuning program exited with no error
2005-02-14 19:40:55.669 changing from watchinglivetv to none
2005-02-14 19:40:56.530 mainserver::handleannounce playback
2005-02-14 19:40:56.531 adding: xbox as a client (events: 0)
2005-02-14 19:40:56.553 changing from none to watchinglivetv
waited too long for recorder to pause


when i run mythtvlivetv.py from the scripts folder, it crashes xbmc with:

14-02-2005 19:41:09 warning emergency recovery console starting...
14-02-2005 19:41:09 fatal xbmc fatal error:
14-02-2005 19:41:09 fatal exception_access_violation (0xc0000005)
14-02-2005 19:41:09 fatal at 0x002125b7

yikes....

h

any ideas on how to keep it from dropping out?


- madtw - 2005-02-15

i had some dropout problems initially. i ended up setting up the minimum ring buffer size to 750000 bytes. also, i went into the xbmc cache settings (under system) and adjusted the following:

video cache - dvd rom 8192kb
- local 1024kb
- internet 1024kb
unknown type cache - internet 1024kb

i didn't try playing around to figure out which one was used for myth... but i'm guessing it is just the local one. (note: i didn't actually change the dvd rom setting - this was the default that came with xbmc.)

if you still get drop outs, try increasing the min ring buffer size past 1024kb (e.g. 2097152). that way the scripts will wait until the ring buffer is 2mb in size before xbmc tries to cache 1mb from the beginning.


- sgtstadanko - 2005-02-15

woohoo...that did it. thanks madtw :kickass: