Kodi Community Forum
New MythTV add-on using libcmyth - 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)
+---- Forum: PVR (https://forum.kodi.tv/forumdisplay.php?fid=136)
+---- Thread: New MythTV add-on using libcmyth (/showthread.php?tid=110694)



RE: New MythTV add-on using libcmyth - MvonSchantz - 2013-02-20

(2013-02-20, 21:35)richardk Wrote: I was hoping that some other folks who've experienced the slowdowns could also test this, but that doesn't seem to be happening.

Sorry for being late to the show! I didn't notice until today, that I was having exactly the same problem. I had been running my backend for a couple of weeks without restarting it, and suddenly today, my recordings were stuttering like crazy when I tried to watch them. Looking at my cpu usage for the backend, it was howering between 85% and 99%. Since I only do SD recordings from an analog source, I guess I could run with excessive cpu usuage for quite some time until there just wasn't enough resources left for playback.

I've now compiled and installed the debug-backend-cpu branch and restarted my backend. Just installing the debug-backend-cpu plugin and restarting XBMC didn't do anything good, but restarting the backend lowered the cpu usage to between 0% and 1%. Now, the real question is, will it stay there?


RE: New MythTV add-on using libcmyth - richardk - 2013-02-21

(2013-02-20, 22:22)cfetzer Wrote: Thanks a lot for that clarification. I had to ask, just to make sure under all circumstances that we won't end up fixing something at the wrong end.
And if you see improvements, we probably have found the wrongly behaving component already.

1-2. It's good to know, that the addon causes in general a bit higher cpu load on the backend. Think might be related to several things and is most likely really difficult to solve. It could be due to different buffer sizes, different usage of the mythtv protocol, timings, ...
I agree, it's an issue, but low prio for now.

3. Ok then janbar's last patch optimized things in our image cacheing component and indeed seems to have an influence on the increased load.

Could you check if you see MythSocket errors in the backend log? If so, it might help if you could enable debug logging in the addon and post logs of both, backend and xbmc, for the timeranges where you see the socket errors.

Here you go. At 17:24:43, I see

Feb 20 17:24:43 MythTV mythlogserver: mythbackend[2088]: W ProcessRequest mainserver.cpp:5841 (connectionClosed) MainServer: Unknown socket closing MythSocket(0x9e2add0)

It seems to have occurred while the PVR manager was still starting up.

Here is the full log:

http://pastebin.com/3Legb0Wx

And the XBMC debug log (which seems to be too big for pastebin):

https://docs.google.com/file/d/0B5684fzvNkYvZlRMU3JYcVFiUVk/edit?usp=sharing


RE: New MythTV add-on using libcmyth - richardk - 2013-02-23

(2013-02-20, 23:52)MvonSchantz Wrote:
(2013-02-20, 21:35)richardk Wrote: I was hoping that some other folks who've experienced the slowdowns could also test this, but that doesn't seem to be happening.

Sorry for being late to the show! I didn't notice until today, that I was having exactly the same problem. I had been running my backend for a couple of weeks without restarting it, and suddenly today, my recordings were stuttering like crazy when I tried to watch them. Looking at my cpu usage for the backend, it was howering between 85% and 99%. Since I only do SD recordings from an analog source, I guess I could run with excessive cpu usuage for quite some time until there just wasn't enough resources left for playback.

I've now compiled and installed the debug-backend-cpu branch and restarted my backend. Just installing the debug-backend-cpu plugin and restarting XBMC didn't do anything good, but restarting the backend lowered the cpu usage to between 0% and 1%. Now, the real question is, will it stay there?

Any results to report after several days?

My backend has now been up for almost ten days. I'm seeing divergent mythbackend cpu load numbers depending on the recording being played, and quite a bit of variation during the playing of a single recording. For some recordings, it's 15% -20%, for others it's 30% to slightly over 40%. (I'm running the latest compiled version from "master".)

While this is much higher than immediately after a boot, it's not high enough to cause problems. And it doesn't seem to be increasing dramatically anymore.

So the current version of the addon will probably work fine for everyone except those with a really old and slow backend system.

Unfortunately, version 1.6.8 did not make it into OpenELEC 2.99.3 (RC3). It still shows 1.6.7. It would be really unfortunate if it doesn't get into the final release, since it's been improved so much.

I'm thinking of rebooting my backend and watching what happens when it's touched only by the latest addon code. Before I do that, cfetzer, is there anything else you'd like me to test with a backend that's been up for a while?


RE: New MythTV add-on using libcmyth - st2000 - 2013-02-23

(2012-10-04, 01:45)markcs Wrote:
(2012-10-03, 17:30)cfetzer Wrote: "Client speaks protocol version 8 but we speak 72" should not cause any problems and is in libcmyth from the beginning. libcmyth tries to connect with different versions until it gets an OK from the server. Not nice, and maybe something to be redone at some point.

@markcs: Aubrien is right, your xbmc version must contain this commit: https://github.com/xbmc/xbmc/commit/465c6927594b239e8ae22687d5962669c849e72c
A current nightly or freshly built version should do it.

Thanks for your replies.
- I did a git pull on both xbmc and the xbmc-pvr-addons (from fetzerch's repository) but both were up to date.
- I deleted the db files in userdate/Database directory.
- I thought my problem may be due to an 'old' install of xbmc that was from the ppa repository for ubuntu. I removed all traces I could find of xbmc under /usr/local/share/xbmc and /usr/share/xbmc
- I reinstalled.

I can enable the addon, but when I try to go into any of the Live TV menu's, i'm told the addon has not started.

...clip...

Thanks!

Has this been resolved?:

"Client speaks protocol version 8 but we speak 7*"

I am having the problem too.

My client is mythbox running as an addon to raspbmc which I just created yesterday (i.e. fresh download of all files) on 2013.02.22. My mythback end is running version .26.

-thanks

version information:
raspbmc-rls-1.0-hardfp-b20130208-u20130208
MythTV Version : v0.26.0 Network Protocol : 75


RE: New MythTV add-on using libcmyth - fetzerch - 2013-02-24

(2013-02-23, 15:33)richardk Wrote:
(2013-02-20, 23:52)MvonSchantz Wrote:
(2013-02-20, 21:35)richardk Wrote: I was hoping that some other folks who've experienced the slowdowns could also test this, but that doesn't seem to be happening.

Sorry for being late to the show! I didn't notice until today, that I was having exactly the same problem. I had been running my backend for a couple of weeks without restarting it, and suddenly today, my recordings were stuttering like crazy when I tried to watch them. Looking at my cpu usage for the backend, it was howering between 85% and 99%. Since I only do SD recordings from an analog source, I guess I could run with excessive cpu usuage for quite some time until there just wasn't enough resources left for playback.

I've now compiled and installed the debug-backend-cpu branch and restarted my backend. Just installing the debug-backend-cpu plugin and restarting XBMC didn't do anything good, but restarting the backend lowered the cpu usage to between 0% and 1%. Now, the real question is, will it stay there?

Any results to report after several days?

My backend has now been up for almost ten days. I'm seeing divergent mythbackend cpu load numbers depending on the recording being played, and quite a bit of variation during the playing of a single recording. For some recordings, it's 15% -20%, for others it's 30% to slightly over 40%. (I'm running the latest compiled version from "master".)

While this is much higher than immediately after a boot, it's not high enough to cause problems. And it doesn't seem to be increasing dramatically anymore.

So the current version of the addon will probably work fine for everyone except those with a really old and slow backend system.

Unfortunately, version 1.6.8 did not make it into OpenELEC 2.99.3 (RC3). It still shows 1.6.7. It would be really unfortunate if it doesn't get into the final release, since it's been improved so much.

I'm thinking of rebooting my backend and watching what happens when it's touched only by the latest addon code. Before I do that, cfetzer, is there anything else you'd like me to test with a backend that's been up for a while?

Sorry for the late response. I checked your log, but that socket error should be fine. We need to know the backend version and mythbackend prints this error when we try to get it. Should be harmless. Do you see any of those errors? "writeStringList: Error, No data written on writeBlock)"?

I still believe that there's something wrong in how we setup/use the socket connections to the backend. But it's very difficult and time consuming to debug.

Sure just reboot the backend. I'd be interested as well what happens if you only run the latest addon code. I really hope you are right and the current version works for most of the people.

(2013-02-23, 19:34)st2000 Wrote:
(2012-10-04, 01:45)markcs Wrote:
(2012-10-03, 17:30)cfetzer Wrote: "Client speaks protocol version 8 but we speak 72" should not cause any problems and is in libcmyth from the beginning. libcmyth tries to connect with different versions until it gets an OK from the server. Not nice, and maybe something to be redone at some point.

@markcs: Aubrien is right, your xbmc version must contain this commit: https://github.com/xbmc/xbmc/commit/465c6927594b239e8ae22687d5962669c849e72c
A current nightly or freshly built version should do it.

Thanks for your replies.
- I did a git pull on both xbmc and the xbmc-pvr-addons (from fetzerch's repository) but both were up to date.
- I deleted the db files in userdate/Database directory.
- I thought my problem may be due to an 'old' install of xbmc that was from the ppa repository for ubuntu. I removed all traces I could find of xbmc under /usr/local/share/xbmc and /usr/share/xbmc
- I reinstalled.

I can enable the addon, but when I try to go into any of the Live TV menu's, i'm told the addon has not started.

...clip...

Thanks!

Has this been resolved?:

"Client speaks protocol version 8 but we speak 7*"

I am having the problem too.

My client is mythbox running as an addon to raspbmc which I just created yesterday (i.e. fresh download of all files) on 2013.02.22. My mythback end is running version .26.

-thanks

version information:
raspbmc-rls-1.0-hardfp-b20130208-u20130208
MythTV Version : v0.26.0 Network Protocol : 75

This thread is about the XBMC PVR addon for mythtv. MythBox is something different and its support thread is this one: http://forum.xbmc.org/showthread.php?tid=43115&page=81&highlight=mythbox

The error that you are seeing is not really an error. It means that the version of mythbox you are running is too old
and does not support your backend version. The last posts of the linked thread above suggest to upgrade from this repo https://github.com/mitchcapper/mythbox

Another alternative would be to switch to our addon which is a bit better integrated into xbmc. Read http://wiki.xbmc.org/index.php?title=PVR/Backend/MythTV if you are interested. (Haven't used mythbox for a long time, so I cannot tell if our addon suits your needs)


RE: New MythTV add-on using libcmyth - richardk - 2013-02-24

(2013-02-24, 18:43)cfetzer Wrote: Sorry for the late response. I checked your log, but that socket error should be fine. We need to know the backend version and mythbackend prints this error when we try to get it. Should be harmless. Do you see any of those errors? "writeStringList: Error, No data written on writeBlock)"?

I still believe that there's something wrong in how we setup/use the socket connections to the backend. But it's very difficult and time consuming to debug.

Sure just reboot the backend. I'd be interested as well what happens if you only run the latest addon code. I really hope you are right and the current version works for most of the people.

I did find a couple of those errors, but only a couple:

Code:
richard@MythTV:/var/log/mythtv$ grep writeStringList mythbackend.log
Feb 20 18:36:50 MythTV mythlogserver: mythbackend[2088]: E ProcessRequest mythsocket.cpp:375 (writeStringList) MythSocket(9c0ba50:78): writeStringList: Error, No data written on writeBlock (925 errors)#012#011#011#011starts with: 245432  0[]:[]458[]:[]Leverage[]:[][]:[][]:[]0[]:[]0[]:[][]:...
Feb 20 21:00:28 MythTV mythlogserver: mythbackend[2088]: E CoreContext mythsocket.cpp:344 (writeStringList) MythSocket(9ee4bc8:-1): writeStringList: Error, socket went unconnected.#012#011#011#011We wrote 0 of 692 bytes with 1 errors#012#011#011#011starts with: 684     BACKEND_MESSAGE[]:[]RECORDING_LIST_CHANGE UPDATE[]:[...

After 10 days of uptime, I'm still seeing the mythbackend cpu load increase gradually. Playing some recordings is now taking 60% - 70% cpu. So there is still a problem, and I'm guessing that it would eventually result in stuttering or buffering. But it would now take a while (weeks?) to get to that point. It may be that most users restart their systems before that.

The current version of the addon is a huge improvement, so I do hope it gets out to users soon!


RE: New MythTV add-on using libcmyth - richardk - 2013-02-24

(2013-02-24, 19:53)richardk Wrote:
(2013-02-24, 18:43)cfetzer Wrote: Sorry for the late response. I checked your log, but that socket error should be fine. We need to know the backend version and mythbackend prints this error when we try to get it. Should be harmless. Do you see any of those errors? "writeStringList: Error, No data written on writeBlock)"?

I still believe that there's something wrong in how we setup/use the socket connections to the backend. But it's very difficult and time consuming to debug.

Sure just reboot the backend. I'd be interested as well what happens if you only run the latest addon code. I really hope you are right and the current version works for most of the people.

I did find a couple of those errors, but only a couple:

Code:
richard@MythTV:/var/log/mythtv$ grep writeStringList mythbackend.log
Feb 20 18:36:50 MythTV mythlogserver: mythbackend[2088]: E ProcessRequest mythsocket.cpp:375 (writeStringList) MythSocket(9c0ba50:78): writeStringList: Error, No data written on writeBlock (925 errors)#012#011#011#011starts with: 245432  0[]:[]458[]:[]Leverage[]:[][]:[][]:[]0[]:[]0[]:[][]:...
Feb 20 21:00:28 MythTV mythlogserver: mythbackend[2088]: E CoreContext mythsocket.cpp:344 (writeStringList) MythSocket(9ee4bc8:-1): writeStringList: Error, socket went unconnected.#012#011#011#011We wrote 0 of 692 bytes with 1 errors#012#011#011#011starts with: 684     BACKEND_MESSAGE[]:[]RECORDING_LIST_CHANGE UPDATE[]:[...

After 10 days of uptime, I'm still seeing the mythbackend cpu load increase gradually. Playing some recordings is now taking 60% - 70% cpu. So there is still a problem, and I'm guessing that it would eventually result in stuttering or buffering. But it would now take a while (weeks?) to get to that point. It may be that most users restart their systems before that.

The current version of the addon is a huge improvement, so I do hope it gets out to users soon!

After rebooting the mythbackend cpu load is back to about 3% when playing a HD video.


RE: New MythTV add-on using libcmyth - sfrooster - 2013-02-26

(2013-02-19, 20:53)richardk Wrote:
(2013-02-19, 20:06)sfrooster Wrote: I don't know what you're running for a backend (mine is only a Zotac MAG), but I'm at the point of a daily reboot. The need *may* be exacerbated by some network latency (one xbmc node is across a 100 ft cable run serviced by a cable/ethernet bridge) - once the CPU usage creeps up a little, I start to see excessive buffering on the remote node. The less remote node (which is harware identical to the other) is less... fragile.

I'm running MythTV on an older system based on an Athlon 64X2 5000 cpu, with 2GB of memory. It's connected to my XBMC frontend across a wired gigabit Ethernet connection.

With the latest versions of the addon, I haven't needed daily reboots, but something is making the mythbackend cpu load incrase slowly.

I'm going to try to avoid rebooting, and see if the load keeps increasing and (if so) how much.

I've built and migrated to a new backend. It's a quad-core i5 with 8 GB running on ubuntu 12.04 32 bit (issues with 12.10, and mythbuntu, so I fell back to the an OS I *knew* was working), so the backend HW should no longer be an issue.

I'm still running the cmyth addon I built from source on 2/17.

I'll be watching to see if there are any stuttering issues, creeping cpu etc. At this point it's been up 27 hours and myth cpu usage is at ~ 23%-29% with one tv watching Live TV.


RE: New MythTV add-on using libcmyth - Bpoppe - 2013-02-26

Hey all. I just got a Raspberry Pi on Saturday and already have it up and running, connected to my Mythbox. I'm running Myth 0.26 on my back end and Raspbmc as the distro for the RBPi. Im using the MythTv PVR add-on. The only question I have is how do I enable comm skipping on XBMC? I read through a few pages of this thread and couldn't seem to find anything.

Thanks in advance for any help you can provide.


RE: New MythTV add-on using libcmyth - fetzerch - 2013-02-26

(2013-02-26, 05:16)Bpoppe Wrote: Hey all. I just got a Raspberry Pi on Saturday and already have it up and running, connected to my Mythbox. I'm running Myth 0.26 on my back end and Raspbmc as the distro for the RBPi. Im using the MythTv PVR add-on. The only question I have is how do I enable comm skipping on XBMC? I read through a few pages of this thread and couldn't seem to find anything.

Thanks in advance for any help you can provide.

Not possible atm: http://forum.xbmc.org/showthread.php?tid=110694&pid=1340562#pid1340562
But it should be added to the nightlies in the next merge window early next month.


RE: New MythTV add-on using libcmyth - st2000 - 2013-02-26

(2013-02-26, 05:16)Bpoppe Wrote: Hey all. I just got a Raspberry Pi on Saturday and already have it up and running, connected to my Mythbox. I'm running Myth 0.26 on my back end and Raspbmc as the distro for the RBPi. Im using the MythTv PVR add-on. The only question I have is how do I enable comm skipping on XBMC? I read through a few pages of this thread and couldn't seem to find anything.

Thanks in advance for any help you can provide.

How did you get that to work (watching myth 0.26 recordings on Raspbmc/mythbox)?

I built my raspbmc / mythbox Raspberry Pi 4 days ago using a fresh store bought SDCard and found that it only supported up to mythtv protocol 70. Let me know if I am wrong, but I think that is older then can possibly work for any mythbackend 0.26 release. So I pulled the latest mythbox from the mythbox GIT repository. That version supports up to myth protocol 74. Sadly, my 0.26 mythbackend is already using myth protocol 75. I added some to code to mythbox to see if I could fake out the mythbackend, but it does not appear to work. Here are my changes:

---------------------------------------------
477,484d476
< class Protocol75(Protocol74):
<
< def version(self):
< return 75
<
< def protocolToken(self):
< return "SweetRock"
<
518,519c510
< 74: Protocol74(), # 0.26
< 75: Protocol75() # 0.26
---
> 74: Protocol74() # 0.26
---------------------------------------------

-thanks


RE: New MythTV add-on using libcmyth - fetzerch - 2013-02-26

(2013-02-26, 15:23)st2000 Wrote:
(2013-02-26, 05:16)Bpoppe Wrote: ...Im using the MythTv PVR add-on...

How did you get that to work (watching myth 0.26 recordings on Raspbmc/mythbox)?

I built my raspbmc / mythbox Raspberry Pi 4 days ago using a fresh store bought SDCard and found that it only supported up to mythtv protocol 70. Let me know if I am wrong, but I think that is older then can possibly work for any mythbackend 0.26 release. So I pulled the latest mythbox from the mythbox GIT repository. That version supports up to myth protocol 74. Sadly, my 0.26 mythbackend is already using myth protocol 75. I added some to code to mythbox to see if I could fake out the mythbackend, but it does not appear to work.
...

He's not using mythbox, he's using XBMC's PVR feature and the MythTV addon.
Please take mythbox support questions to their support thread here: http://forum.xbmc.org/showthread.php?tid=43115&page=81&highlight=mythbox


RE: New MythTV add-on using libcmyth - Bpoppe - 2013-02-26

Correct - I'm using the MythTV PVR add-on and not Mythbox.

Thanks for the commskipping info. Right now I haven't setup the nightly build install, but looks like I might have to. The sooner I can get commskipping put on the RBPi, the higher the WAF (Wife Acceptance Factor) goes. Let me know if there's something I can do to help - I don't know much about programming for Linux, but can test stuff and let you know what happens when it breaks!


RE: New MythTV add-on using libcmyth - pgjensen - 2013-02-26

I saw in the latest changelog for v1.6.9 through GIT "Fixed recovering from backend connection loss on Windows."

I compiled this version and put it on all of my stations, but noticed just last night that when the computer was asleep overnight and I came back to LIVE TV, it just sat there spinning and every 30s or so it'd show a red error that the backend connection was lost. It loops for 2-3 minutes and then just stops. Was the change above for a different problem?


RE: New MythTV add-on using libcmyth - fetzerch - 2013-02-26

(2013-02-26, 22:54)pgjensen Wrote: I saw in the latest changelog for v1.6.9 through GIT "Fixed recovering from backend connection loss on Windows."

I compiled this version and put it on all of my stations, but noticed just last night that when the computer was asleep overnight and I came back to LIVE TV, it just sat there spinning and every 30s or so it'd show a red error that the backend connection was lost. It loops for 2-3 minutes and then just stops. Was the change above for a different problem?

The problem I fixed was when restarting the backend, the addon still tried to use the socket connection.
That could lead into a crash or printing weird characters into the log, and I had to restart xbmc.
The commit that took care of this was: https://github.com/fetzerch/xbmc-pvr-addons/commit/6cdef4ccfc9a0a884f039f762e2f8880dec6d5cc

I think your problem is related to Sleep/Resume which is not really supported right now since the addon does not know that xbmc is going to sleep.
That situation should improve as soon as https://github.com/xbmc/xbmc/pull/2250 and https://github.com/opdenkamp/xbmc-pvr-addons/pull/171 are accepted.