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-02-26

yeah, i've noticed that loading the live tv screen takes a while and i only have ~60 channels. the query that is being used is extremely inefficient. that was rubenonrye's baby so i haven't looked at it much... once i finish this commercial skip stuff i may look at it. in the meantime feel free to offer patches to improve performance. i don't think xbmc gives you page spinner click events though so your suggestion may not work. also, even if you could page the stuff, it isn't the network transfer of the channel information that is slowing it down... i think it is the various joins in the query that are making it slow (and the joins would still be done when paging).


- LazyBoy - 2005-02-26

madtw,

thanks for replying, but the cache and ring buffer size changes
didn't do it for me.

i don't think my problem is smb configuration either. my live tv
is going to the same directory (and smb share) as my recorded
shows, and they play fine. i double checked and saw the
ringbuf1.nuv file created there when i tried to watch live tv.

i also tried adding a trailing / to the live tv prefix. (from an
old post; probably an obsolete work around.)

i'm using a dotted quad (192.168.12.100) for my
primary host ip entry and smb://%h/media/mythtv
for recorded show and live tv prefixes. (trailing /
for the latter.)

the xmbc log below shows a live tv attempt followed
by a recorded show success. it looks like the name
used for live tv is being mangled somewhere. the
recorded show log shows the name "stimpy" which
is my backend (the .100 box). but the xbox doesn't
know that and i don't have local dns entries, so it
must have gotten it from the backend.

so i'm guessing that the backend is contacted at the
primary host ip and returns the string to be used in %h,
but it's getting scrambled in the live tv case??

thanks for any help,
lb


26-02-2005 16:26:16 debug freeing fs segment @ 0x821010
26-02-2005 16:26:16 info mplayer playConfusedmb://192/media/mythtv/\ringbuf1.nuv cachesize:1024
26-02-2005 16:26:18 error smbdirectory->getdirectory: unable to open directory : 'smb://192/media/mythtv/\'
unix_err:'2743' nt_err : 'c0000022' error : 'access denied'
26-02-2005 16:26:18 debug initializing fs_seg..
26-02-2005 16:26:18 debug fs segment @ 0x821010
26-02-2005 16:26:20 info filesmb->open: unable to open file : 'smb://xbox:xbox@192/media/mythtv//ringbuf1.nuv'
unix_err:'2743' nt_err : 'c0000022' error : 'access denied'
26-02-2005 16:26:20 info flipping bi-directional subtitles disabled
26-02-2005 16:26:20 info stating file smb://192/media/mythtv/\ringbuf1.nuv.conf
26-02-2005 16:26:21 info stating file q:\mplayer\\ringbuf1.nuv.conf
26-02-2005 16:26:23 info filesmb->open: unable to open file : 'smb://xbox:xbox@192/media/mythtv//ringbuf1.nuv'
unix_err:'2743' nt_err : 'c0000022' error : 'access denied'
26-02-2005 16:26:23 error cmplayer::openfile() smb://192/media/mythtv/\ringbuf1.nuv failed
26-02-2005 16:37:04 debug freeing fs segment @ 0x821010
26-02-2005 16:37:04 info mplayer playConfusedmb://stimpy/media/mythtv/1005_20050203210000_20050203220000.nuv cachesize:1024
26-02-2005 16:37:04 debug initializing fs_seg..
26-02-2005 16:37:04 debug fs segment @ 0x821010
26-02-2005 16:37:05 info flipping bi-directional subtitles disabled
26-02-2005 16:37:05 info stating file smb://stimpy/media/mythtv/1005_20050203210000_20050203220000.nuv.conf
26-02-2005 16:37:05 info stating file q:\mplayer\1005_20050203210000_20050203220000.nuv.conf
26-02-2005 16:37:05 notice start led control
26-02-2005 16:37:06 debug created video textures (0)


- LazyBoy - 2005-02-27

i fixed my live tv problem by commenting out two lines in mythtvlivetv.py.

host = s.getsetting( "mythtv_host" )
# if sre.match( "^[ss][mm][bb]:", fullpath ):
# host = sre.sub( '\..*$', '', host )
fullpath = sre.sub( '\%h', host, fullpath )


i believe the intent is to reduce an fqdn to a simple name. adding a digit test would be more appropriate than removing them, but i'm not a python programmer.

thanks for the scripts though. this is a great improvement over booting linux.

just curious. how many people are actively working on this? what features are we likely to see next?

thanks again,
lb


- madtw - 2005-02-27

my bad... yeah, i should've put a digit check in there. thanks for finding that, i'll fix it in cvs shortly. i have dns setup for my lan so i never hit that scenario in my testing.

the name stimpy is coming from the mythbackend. when a show is recorded it keeps track of which host recorded the show. this is in case you have multiple backends recording, then the primary backend can find the shows on the appropriate backend. if you ever go to such a configuration, you might want to get myth to stick the ip address into the database instead of the name.

euphorical, rubenonrye, and myself have worked on it in the last few months. however, i haven't heard from the other two in a few weeks now so i guess they're busy with other things. Smile

i'm currently working on getting commercial skipping working. it seems to be working for the most part... but i've found that myth isn't always detecting the commercials correctly. also, mplayer seeking in xbmc is not as accurate as i'd hoped so i've had to tweak the code a little. seeking becomes progressively less accurate the further you get into the file. i'm almost ready to check the python code back into cvs... however, it requires some c++ patches to xbmc code as well and i'm not sure how long that'll take to be accepted into the xbmc cvs tree.

the next stuff on the list might be the program guide and the ability to make changes to upcoming shows that may or may not be recorded. i'd also like to expose more xbmc gui controls to python.


- luigi - 2005-02-28

thanks for all the scripts madtw, this is definately the way to go, best of both worlds...
while you take a look at the code for the previous post, i suspect we may have another bug to iron out. i'm getting the "unkown socket error", but it appears to be coming from an alternate source to previous posts, even after comenting out the two lines suggested for the fqdn check code...
xbmc logs indicate
error cmplayer::openfile() smb://192.168.0.4/livetv\ringbuf1.nuv failed
basically were getting a backslash instead of a forward slash. this looks to me to be originating from the code somehow, as it's only livetv that has the issue. i've taken a look at the code, but i'm not much good at it.
looking forward to seeing the program guide in action!


- madtw - 2005-02-28

technically, all the '/'s in the path are incorrect. the xbox is based on a win32 core and the path separator is '\'. fortunately, xbmc normalizes the path if it contains a mixture of '/' and '\' so i don't think that is your problem. if you still think that is your problem, replace all occurences of "os.sep" with "'/'" and see if it helps.

when you say "unknown socket" error... what do you mean? i have "unknown socket" being logged in the mythbackend.log all the time... but everything works fine.


- luigi - 2005-02-28

thanks for the quick reply.
the "unkown socket" appears in the logs alongside the ...
"waited too long for recorder to pause", i thought that they were linked, but as you have stated they aren't, and yes i can see success assoicated with the entries also.
no "os.sep" found in mythlivetv.py, are you suggesting i try this on all scripts?
i've followed the previous posts and tried to tweak the cache settings, but not had any success with livetv...don't get a picture at all just a momentary paused in the gui scrolling.

i think there might also be some issue with the way the live tv program info is parsed. i found one channel entry last night that continually caused the box to freeze by just highlighting it.

one thing to note is that i don't have the setting for unknown type cache - internet, not sure if this is necessary.
i've also set the path manually etc etc. i have been able to do this using mythtv frontend from the xbox, so the backend server is cool.
i'll keep at it a while and see what i come up with.


- madtw - 2005-02-28

if you have the latest cvs version of mythtvlivetv.py, you will find os.sep on line 73. this is where it builds the live tv path from your live tv prefix setting and the ring buffer file name returned by the myth backend.

if you don't think tweaking the xbmc cache settings is doing anything, try cranking up the min buf size in the xbmcmythtv settings to a value like 8388608. it will make xbmc wait until the ring buffer file is 8mb in size before it starts playing it. if that works, then you can start lowering the value until you get a good balance between reliable live tv playback and reduced time to start viewing. keep in mind that with such a large value, it might take 15-20 seconds before you get any video playback.

as for the program names that cause xbmc to freeze... i seem to remember finding a few problems like that earlier. if you can capture the title, sub title and description of the show that would help. when i saw this earlier, it had to do with non-ascii characters (e.g. french accented letters).


- luigi - 2005-02-28

thanks again madtw,
i must have typo'd on the search & replace for os.sep. i replaced os.sep with "/"and this surely fixes the issue. i reversed the change and tested this scientifically, so at least in my set-up scenario the "\" is a factor.
there seems to be a significant level of visual drop out in livetv were audio comes through but visual fails (from onset), with the min ring buffer at 8388608. retrying the livetv connection generally fixes the problem and lowering the min ring buffer tends to diminish such events (short term observation).
interesting that even with livetv all working i still get... waited too long for recorder to pause in mythbackend log.

thanks again.

lui


- e332 - 2005-02-28

hi

i was wondering which codec is best to use for the live tv viewing in xbmcmyth, rtmpg or mpeg4? assuming cpu on backend is no problem, just considdering the support for each codec in mplayer ( modified dll).

thanks

keep up the good work.


- stilger - 2005-02-28

just wanted to say thanks for such an awesome script and ask a few questions.

1. has anyone experienced their backend locking up when using this python script?

2. i have also noticed on a few different occasions that when going into recorded shows it can sometime not open correctly. a good example is that one of the recorded shows i have has a name of "gymnastics". when entering recorded shows i got an error that i had to click ok on. the error description had the word gymnastics in it. (this is all from memory.)

i will try to keep better logs and descriptions of this problem going forward.

3. also, has anyone been able to put a bookmark on a recorded show when using the python interface to open it? when i try it acts like it does it but it does not show on the bookmarks.

thanks.


- Wob - 2005-03-01

hey madtw,
thanks for the reply, i have since realised that if i just watch and don't fast forward the watching of recordings works fine. that is good enough for now, having it not quick out when it hits the end (just stop, like in mythtv) would be nice, but i am not that picky.
thanks again for all the hard work, keep it up.

cheers,
beau


- madtw - 2005-03-02

(luigi @ feb. 28 2005,04:25 Wrote:there seems to be a significant level of visual drop out in livetv were audio comes through but visual fails (from onset), with the min ring buffer at 8388608. retrying the livetv connection generally fixes the problem and lowering the min ring buffer tends to diminish such events (short term observation).
this sounds like an issue that xbmc had a while back... are you running a very recent version? i haven't experienced any visual drop outs or audio/video problems with a feb 3, 2005 build of xbmc.


- Wob - 2005-03-02

ok, another question. this has been a problem for me since the interface change, but i just haven't been that bothered with it.

i can not view the status page, i get an error on screen "argument 1 must be unicode or str" with an ok option. then i just get returned to the main screen. i have inculded text from my log.

currently running the latest cvs (downloaded last night)

02-03-2005 18:28:41 info traceback (most recent call last):
02-03-2005 18:28:41 info file "q:\scripts\xbmcmythtv\mythtvmain.py", line 63, in oncontrol
02-03-2005 18:28:41 info mythtvstatus.showwindow()
02-03-2005 18:28:41 info file "q:\scripts\xbmcmythtv\mythtvstatus.py", line 30, in showwindow
02-03-2005 18:28:41 info win.refresh()
02-03-2005 18:28:41 info file "q:\scripts\xbmcmythtv\mythtvstatus.py", line 86, in refresh
02-03-2005 18:28:41 info self.controls['subscription'].control.addlabel( \
02-03-2005 18:28:41 info typeerror: argument 1 must be unicode or str


- madtw - 2005-03-03

in order to display status from the backend, i have to parse the html that is returned as a result of connecting to the status port on the myth tv backend. obviously the html that your backend is generating is different than what i saw from my backend. can you connect to your myth tv backend status port with a browser, save the html, and send it to me?

otherwise, try commenting out the lines dealing with the "subscription" field to see if the screen comes up.