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


- madtw - 2005-04-12

(stilger @ april 11 2005,18:07 Wrote:when updating to a new xbmcmythtv i rename or delete the current directory and just copy my settings file over.

when using the commerical skip it should automatically skip them when they come up. i should not need to do anything correct? (maybe i am missing something on how to use them.)
your method for upgrading sounds ok.

yep, commercial skipping should happen automatically after you answer "yes" in the dialog. when commercial skipping takes place, you will first see the pause button popup and if you wait a little (3-10 seconds), it should unpause hopefully after or near the end of a commercial. i've had some problems with certain shows (e.g. csi) where the scenes are very dark and the myth backend has marked the start of a commercial in the dark scene when there wasn't a commercial. sitcoms seem to work the best for commercial skipping (from a myth tv point of view).

if you don't get any commercial skipping at all, then i'm guessing the onplaybackstarted() method in mythtvrecordedshowdetails.py is exiting prematurely. you could try changing some of the "debug" calls to "xbmc.output" to see what is going on. also, at the end of the function, you'll see some commented out exception handling code. you could try uncommenting the code to see if you get an exception popup...


- elminster - 2005-04-12

hi all,

i updated to xbmc 11/04/05 and tried using against the latest mythtv cvs. unfortunately things don't work with protocol 15.

i did however remove everything and revert back to 0.17 as suggested by madtw and things are a little better now.

i'm getting some invalid operand stuff at the moment when i select live tv but from an early question that suggests a problem with my database so i'm gonna clear it and see what happens. i'll let you know. would that also cause a problem with 'status'? i know that used to work, is it still supposed too?

also to help others if you get nt_status_object errors its likely to be your samba shares are not right. i had this because i was using the wrong directory in my paths.

good work madtw


- philled - 2005-04-12

(madtw @ april 11 2005,16:10 Wrote:the copy is done using the myth tv protocol whereas playback is normally done using smb.  my guess is that either the name of your host is weird or not being populated correctly in the myth database by the myth tv backend.  you have two options: fix the backend so that it stamps the recorded shows with the right host name or change your path prefix replacing '%h' with either the ip or the correct host name.
thanks for that. i think i've already done the 2nd option - if i hadn't then i wouldn't be able to copy the files to the xbox, so i think bit's done already.

when you say the host name may be weird, do you mean the name of the xbox or the mythtv backend? also, could you please explain what you mean by fixing the backend to stamp with the correct host name. i don't understand what gets "stamped". the nuv files don't have any hostname info in them. do you mean the "hostname" column in the recorded table? perhaps this is the problem as its value is "elm.edwards.home" whereas the smb:// string i used has the ip address rather than the hostname. does the smb:// string _have_ to include whatever's in that column?

regards,
phill


- Phunck - 2005-04-12

i just added tvtome support to my ooba script in v0.4... here's the latest unofficial release of ooba (v0.4). it has not been tested on my box yet, only in the emulator.

http://www.deviantart.com/view/16987987/


- elminster - 2005-04-12

well i cleared out my database and managed to get things working again, all except status, however when i performed a mythfilldatabase to populate all my channel data, things got broken again. im now getting the operand error again when selecting live tv? btw im using a dvb card

i'll increase log levels tomorrow and see what i can find.


- ahmose - 2005-04-12

elminster,
i'm having the same issue. live tv doesn't work for me either. i get the same errors.
i'll let you know if i figure out what the problem is.
btw, the mythtv script is great, thanks for the great work.


- madtw - 2005-04-13

philled: yes, i meant that the hostname populated in the recorded table in the myth database may not be correct and if you have %h in the path prefix, it could build the path incorrectly. the recorded hostname and the smb path prefix do not have to match. the only time you may want to use %h is if you have multiple servers running the mythbackend software (this is untested since i only have one myth server). here is an example of my setup:

- recorded hostname 'banshee'
- samba server runs on banshee advertises "mythtv" service which is a folder containing nuv and live tv ring buffer files
- path on the filesystem where nuv and live tv ring buffer are created is actually /myth/tv/

my recorded prefix is "smb://%h/mythtv". i could also specify a prefix of "smb://10.1.1.5/mythtv" assuming the ip of banshee is 10.1.1.5. note: i also have a dns server running for my lan...

when you copy a file, the only path that is used from the settings is the local path. so if your recorded prefix or live tv prefix is setup incorrectly, it won't affect the copy. copying files using smb.py was extremely slow so i rewrote it to use the myth protocol instead.


- madtw - 2005-04-13

(elminster @ april 12 2005,14:57 Wrote:well i cleared out my database and managed to get things working again, all except status, however when i performed a mythfilldatabase to populate all my channel data, things got broken again. im now getting the operand error again when selecting live tv? btw im using a dvb card
if someone posts the relevant xbmc log, it'll help in figuring out what is going on. is the operand error a python error or a mysql error? it sounds like a data issue since live tv works fine here...


- Loto_Bak - 2005-04-13

in regards to browsing recorded programs,

i agree the current listing is combersome...
have you taken a look at the music library view in xbmc? it is a music database view that could possibly be applied to mythtv. i would assume show title, and record date are available. perhaps channel/network information is available as well. using this branching query system allows alot of expandability. i'll illustrate it below...
Quote:show titles /
--------title1/
--------title2/
----------------season1/
----------------season2/
(i dont know if season/episode info is available in myth)
date/
--------2005/
----------------march/
----------------april/
------------------------01/
------------------------02/
------------------------03/
network/
--------cbc/
--------abc/
--------chan04/
----------------show title/ or show date/

at the top of each catagory would be an option for 'all shows' so for example i wanted all shows recorded in april 05 i would go
->date ->05 ->april ->all shows
or all shows on channel 4
->network->chan04 ->all shows

it allows the end user to be as specific or general as they want their query to be. since myth runs a mysql db it should be easy to generate the queries


- philled - 2005-04-13

i'm trying to get the python version of mythfrontend (xbmcmythtv) working on my xbox. i feel like i'm _very_ nearly there. i can view a the program guide, a list of recordings and i can select one to see more detail and a still image of it. however, when i come to play the recording i hear the xbox disk stir but then nothing happens. no error
messages on screen, nothing moves, nada. it just stays there on the detail program screen.

in the backend log i see this:
2005-04-13 23:59:30.538 mainserver::handleannounce playback
2005-04-13 23:59:30.539 adding: xbox as a client (events: 0)
2005-04-13 23:59:30.545 unknown socket
2005-04-13 23:59:38.841 mainserver::handleannounce playback
2005-04-13 23:59:38.843 adding: xbox as a client (events: 0)
2005-04-13 23:59:42.097 mainserver::handleannounce filetransfer
2005-04-13 23:59:42.099 adding: xbox as a remote file transfer
2005-04-13 23:59:42.174 unknown socket
2005-04-13 23:59:43.699 mainserver::handleannounce playback
2005-04-13 23:59:43.700 adding: xbox as a client (events: 0)
2005-04-13 23:59:43.715 mainserver::handleannounce filetransfer
2005-04-13 23:59:43.716 adding: xbox as a remote file transfer
2005-04-13 23:59:46.129 unknown socket

i'm assuming that the problem is the "unknown socket" line, but i have no idea what it means nor what i need to do to get this working.

can anyone help?

regards,
phill


- elminster - 2005-04-13

hiya thanks for the reply, he is my xbmc.log on log level 0:

13-04-2005 19:46:11 info activating window id: 13000
13-04-2005 19:46:16 info traceback (most recent call last):
13-04-2005 19:46:16 info file "q:\scripts\xbmcmythtv\mythtvmain.py", line 56, in oncontrol
13-04-2005 19:46:16 info mythtvlivetv.showwindow();
13-04-2005 19:46:16 info file "q:\scripts\xbmcmythtv\mythtvlivetv.py", line 56, in showwindow
13-04-2005 19:46:16 info win.loadprograms()
13-04-2005 19:46:16 info file "q:\scripts\xbmcmythtv\mythtvlivetv.py", line 140, in loadprograms
13-04-2005 19:46:16 info channellistcontrol.additem(
13-04-2005 19:46:16 info file "q:\scripts\xbmcmythtv\mythtvprogram.py", line 104, in formattedchannel
13-04-2005 19:46:16 info value += " " + self.callsign()
13-04-2005 19:46:16 info typeerror: unsupported operand type(s) for +=: 'nonetype' and 'str'

hope this sheds some light on the problem?

edit----

looking in the python script it see this is where its having trouble:

def formattedchannel( self ):
"""returns chanstr callsign for display purposes"""
value = self.chanstr()
if self.callsign():
value += " " + self.callsign()
return value

now there other def's (dunno what a def is, not a programmer :-( ) like def formattedairdate( self ): and def formattedorigairdate( self ):

so i looked in my programs table and found airdate and origairdate columns (forgive me if im not using the right terminology) but no channel column so i guess this is the problem.

this is a little odd though right? i installed 0.17 not cvs mythtv just like madtwHuh

i have a chanid which is a primary key??


- madtw - 2005-04-14

(philled @ april 13 2005,08:24 Wrote:i'm assuming that the problem is the "unknown socket" line, but i have no idea what it means nor what i need to do to get this working.
nope, the unknown socket line is not the problem... i get that in my logs and everything works. here is a sample from my logs and no problems occurred on the python frontend:

Quote:2005-04-12 00:01:08.794 adding: xbox as a client (events: 0)
2005-04-12 00:01:48.000 mainserver::handleannounce filetransfer
2005-04-12 00:01:48.002 adding: xbox as a remote file transfer
2005-04-12 00:01:48.034 could not open /myth/tv//1052_20050411193000_20050411200000.nuv.png. 0 retries remaining.
2005-04-12 00:01:50.343 mainserver::handleannounce filetransfer
2005-04-12 00:01:50.348 adding: xbox as a remote file transfer
2005-04-12 00:01:50.504 unknown socket
2005-04-12 00:01:56.937 mainserver::handleannounce playback



- madtw - 2005-04-14

elminster: the problem is the line "value = self.chanstr()" is supposed to return a string containing the channel number. if it returns none (which is the python equivalent of null), then the concatenation of the callsign onto a none value will fail (because the + operator is not defined for a none and a string - only string + string). the real question is why are you not getting a channel number back from your myth database... it should always be populated! the query to retrieve live tv program names does a join between the program and channel tables.

if you want to fix it temporarily, you can change the line to:

Quote:value = ""
if self.chanstr():
value += self.chanstr()

are you sure you don't have some old xbmcmythtv files somewhere on your xbox (e.g. in the xbmc/python/lib directory)?


- ahmose - 2005-04-14

clearing the channels database fixed it for me. i did a mythtv-setup and mythfilldatabase and it works great now.
thanks for the help


- philled - 2005-04-14

(madtw @ april 14 2005,01:41 Wrote:
(philled @ april 13 2005,08:24 Wrote:i'm assuming that the problem is the "unknown socket" line, but i have no idea what it means nor what i need to do to get this working.
nope, the unknown socket line is not the problem... i get that in my logs and everything works.  here is a sample from my logs and no problems occurred on the python frontend:

Quote:2005-04-12 00:01:08.794 adding: xbox as a client (events: 0)
2005-04-12 00:01:48.000 mainserver::handleannounce filetransfer
2005-04-12 00:01:48.002 adding: xbox as a remote file transfer
2005-04-12 00:01:48.034 could not open /myth/tv//1052_20050411193000_20050411200000.nuv.png.  0 retries remaining.
2005-04-12 00:01:50.343 mainserver::handleannounce filetransfer
2005-04-12 00:01:50.348 adding: xbox as a remote file transfer
2005-04-12 00:01:50.504 unknown socket
2005-04-12 00:01:56.937 mainserver::handleannounce playback
that's a bummer. i've been trying to get this working for the past week now. my linux mythbackend/frontend works beautifully. my new xbox frontend that has xbmcmythtv on it is a vsn 1.0 or 1.1 (not sure) running unleashx and xbmc dated 1st apr 2005. i've tried both 0.17.1 and 0.17.2 versions of xbmcmythtv and neither of them will play the selected recording. i can select the recording from a list and see the details of it plus the still image, but when i try to play it i get a short burst of disk activity and then nothing - very frustrating! does anyone have any suggestions on how i can sort this out or get some debugging info to find out what's wrong?

regards,
phill