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 - watskooo - 2013-02-13

(2013-02-12, 21:23)janbar Wrote: @watskooo

I saw your log. You have an hung connexion (mythsocket...writeblock). This cause lot of cpu usage on backend. This is the issue i tried to resolve when frontend sleep. But here you don t suspend your frontend. So probably there had a network disconnection. To resolve it you need to reboot the backend.
Since few commits i changed the connexion type for the event handler to avoid this issue on suspend.
Christian, i made PR to avoid to download images when not exists yet. It could help also.

I'm sorry, my post wasn't completely accurate, and I've updated the original. I had only suspended openelec, not powered it off.


RE: New MythTV add-on using libcmyth - Powderking - 2013-02-13

And I seem to have done something wrong: I was able to download the zip, unzip it ran bootstrap, configure --enable-addons-with-dependencies and make zip.
But when I try to install it from zip in xbmc it tries to download it but gets stuck at 0%.

Do you have any ideas what I'm doing wrong?


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

(2013-02-13, 00:16)Powderking Wrote: And I seem to have done something wrong: I was able to download the zip, unzip it ran bootstrap, configure --enable-addons-with-dependencies and make zip.
But when I try to install it from zip in xbmc it tries to download it but gets stuck at 0%.

Do you have any ideas what I'm doing wrong?

Unzip it, and manually copy the contents into the directory where the addon is stored. It may be different on your system, but I manually copied to the directory /usr/lib/xbmc/addons/pvr.mythtv.cmyth.


RE: New MythTV add-on using libcmyth - Powderking - 2013-02-13

It's working now with the zip. I don't know what the problem was...

So I disbaled LiveTV and uninstalled cmyth addon.
Then I installed the debug-backend-cpu.

But to be honest I think it's slower than before. (Edit: No it's not. I've just tried with the old version I had installed before and it's about the same.)
Here's the xbmc-pvr-addons-debug-backend-cpu log:
http://xbmclogs.com/show.php?id=35179&hash=09704136

Btw I've noticed that shutting down xbmc takes also very long when I'm in the recordings screen or came out of it to the home screen of xbmc and then try to close xbmc (or shut down the pc).

In the log I opened xbmc, activated livetv and installed the plugin. Then waited until the pvr infos are ready and entered recordings. Then entered *All recordings.
After that I went back to the home screen by pressing esc and closed xbmc.

Hope this helps. Otherwise please let me know if I can do something else.


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

(2013-02-13, 00:49)Powderking Wrote: It's working now with the zip. I don't know what the problem was...

So I disbaled LiveTV and uninstalled cmyth addon.
Then I installed the debug-backend-cpu.

But to be honest I think it's slower than before. (Edit: No it's not. I've just tried with the old version I had installed before and it's about the same.)
Here's the xbmc-pvr-addons-debug-backend-cpu log:
http://xbmclogs.com/show.php?id=35179&hash=09704136

Btw I've noticed that shutting down xbmc takes also very long when I'm in the recordings screen or came out of it to the home screen of xbmc and then try to close xbmc (or shut down the pc).

In the log I opened xbmc, activated livetv and installed the plugin. Then waited until the pvr infos are ready and entered recordings. Then entered *All recordings.
After that I went back to the home screen by pressing esc and closed xbmc.

Hope this helps. Otherwise please let me know if I can do something else.

Some of us have noticed that the cpu time consumed by the mythbackend process while a video is playing increases over time. It would be great if you could watch this on your MythTV box (by running top), and report some results.

Over a period of several days, the cpu load for mythbackend on my system would increase from around 3% to as much as 90% when playing a HD program.


RE: New MythTV add-on using libcmyth - janbar - 2013-02-13

@Powderking

Hi, the dev repo address is:
https://github.com/fetzerch/xbmc-pvr-addons.git
And not opdenkamp (here you find the released !).
you must enable more debug in addon config, activate debug in xbmc system screen, then restart xbmc to test.
Once done. Think to disable more debug because it is very verbose,
Thanks.


RE: New MythTV add-on using libcmyth - Powderking - 2013-02-13

(2013-02-13, 02:40)richardk Wrote: Some of us have noticed that the cpu time consumed by the mythbackend process while a video is playing increases over time. It would be great if you could watch this on your MythTV box (by running top), and report some results.

Over a period of several days, the cpu load for mythbackend on my system would increase from around 3% to as much as 90% when playing a HD program.

My mythbackend machine is running all the time and so is mythbackend.
The htpc is shut down at least over night and in the evening I start it again.

Should I restart the server and watch a HD recording or should I leave the htpc running for a longer timer?


(2013-02-13, 10:28)janbar Wrote: @Powderking

Hi, the dev repo address is:
https://github.com/fetzerch/xbmc-pvr-addons.git
And not opdenkamp (here you find the released !).
you must enable more debug in addon config, activate debug in xbmc system screen, then restart xbmc to test.
Once done. Think to disable more debug because it is very verbose,
Thanks.

Ok, sorry.
I will try this repo this evening and enable the two debug log options.


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

(2013-02-13, 14:17)Powderking Wrote:
(2013-02-13, 02:40)richardk Wrote: Some of us have noticed that the cpu time consumed by the mythbackend process while a video is playing increases over time. It would be great if you could watch this on your MythTV box (by running top), and report some results.

Over a period of several days, the cpu load for mythbackend on my system would increase from around 3% to as much as 90% when playing a HD program.

My mythbackend machine is running all the time and so is mythbackend.
The htpc is shut down at least over night and in the evening I start it again.

Should I restart the server and watch a HD recording or should I leave the htpc running for a longer timer?

Now that you have the non-image addon installed, reboot your MythTV box to give it a fresh start. Then leave it running and watch how much cpu is consumed by the mythbackend process while videos are playing.


RE: New MythTV add-on using libcmyth - Powderking - 2013-02-13

Thanks for the explanation. I'll try to do this tonight as well.


RE: New MythTV add-on using libcmyth - janbar - 2013-02-13

(2013-02-13, 14:25)Powderking Wrote: Thanks for the explanation. I'll try to do this tonight as well.

Hi,

To install the dev version and to be shure it install, unzip manually the zip file generated by "make clean zip" into the addons folder of xbmc:

cd ~/.xbmc/addons/
rm -rf pvr.mythtv.cmyth
unzip <zipfile>

then restart xbmc and go to reconfigure addon and livetv. Restart again and it will be good.

(2013-02-13, 00:16)watskooo Wrote:
(2013-02-12, 21:23)janbar Wrote: @watskooo

I saw your log. You have an hung connexion (mythsocket...writeblock). This cause lot of cpu usage on backend. This is the issue i tried to resolve when frontend sleep. But here you don t suspend your frontend. So probably there had a network disconnection. To resolve it you need to reboot the backend.
Since few commits i changed the connexion type for the event handler to avoid this issue on suspend.
Christian, i made PR to avoid to download images when not exists yet. It could help also.

I'm sorry, my post wasn't completely accurate, and I've updated the original. I had only suspended openelec, not powered it off.

If you suspend the host of mythbackend, you must configure "pm" (linux) to stop backend before suspend and restart it on resume. If you need i can show you my configuration.
Actually suspending the host of xbmc is not supported and cause hang of backend (see previous post). We have a patch to resolve it but it needs an update of xbmc => Improvement "Addon Annoucement". This feature was not accepted for frodo Sad .
To solve it, you can also make of "pm" configuration to stop xbmc and restart it on resume. Easy to do and it avoid hang of backend.
So for instance if you suspend backend or frontend without "pm" config, it would cause backend hang on resume with lot of cpu usage ! To break this situation you must reboot backend.


RE: New MythTV add-on using libcmyth - Powderking - 2013-02-14

Sorry that I couldn't post already yesterday!

I have now installed xbmc-pvr-addons-debug-backend-cpu and have activated debugging for xbmc and additional debugging of the addon.

Atm I'm watching a 720p recording (don't have any 1080 recording).
mythbackend cpu usage is between 7% and 8%. After 15 min playback time the cpu usage went up to 10%-12%.
There will be a recording startin now. I can try it later again when there's no recording scheduled.
I think you wrote it should be a longer program for the test. Please let me know what kind of recording I should test.
I have some 720p of lengths around three hours which I could test...

I encountered some stuttering problem witha 720p over a powerline connection. But I think this is due to the connection.

Yesterday I had some problems with a program that paused frequently because it needed to cache data.
I have no idea what what this caused this issue. The htpc was connected via two GBit switches. The connection measured by iperf was as expected.


I will now compile the dev repo and post a log for the slow menu problem i have...


Edit: I completely forgot to upload the log. But it's 1.1GB Confused
Where can I upload it? I don't think I can copy/paste it to xbmclog?

Edit 2: Oh btw with this version xbmc can't be ended anymore. It freezed when I hit quit or shutdown.

Edit 3: With the nevest dev version my slow menu problems are gone Big Grin


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

@richardk:
I have pushed a small fix to master and to debug-backend-cpu that adjusts all tcp rcv buffers to a bigger value (128000).

I was seeing a socket error: "writeStringList: Error, No data written on writeBlock" on the backend and I think I've seen a similar one also in a log you posted.
Janbar told me that this error message usually goes hand in hand with a high load on the backend.

Therefore it could be somehow related to your problem. It would be nice if you could retest (if possible with both branches).
How is your experience currently without images. Did it fix the issue for you?

Thanks,
Christian


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

(2013-02-15, 00:59)cfetzer Wrote: @richardk:
I have pushed a small fix to master and to debug-backend-cpu that adjusts all tcp rcv buffers to a bigger value (128000).

I was seeing a socket error: "writeStringList: Error, No data written on writeBlock" on the backend and I think I've seen a similar one also in a log you posted.
Janbar told me that this error message usually goes hand in hand with a high load on the backend.

Therefore it could be somehow related to your problem. It would be nice if you could retest (if possible with both branches).
How is your experience currently without images. Did it fix the issue for you?

Thanks,
Christian

Thank you! I will build this today and begin testing. It would be great if others could test this also! Anyone?

I was doing more testing on the non-image addon. I want to make absolutely sure I don't post misleading results.

Right now, my MythTV system has been up for 39 hours, and I've tried to use it a lot. So far, I'm not seeing any significant increase in cpu usage on mythbackend, but I'm not sure it's been up long enough to conclude anything. I spent some time as an operating systems programmer (back in ancient times), and I know that performance problems do not happen in a linear fashion. It often takes some time for a threshold to be reached, and then things go to sh*t quickly.


RE: New MythTV add-on using libcmyth - simora - 2013-02-15

@cfetzer

About the addon not loading on my arm box... do you want me to open an issue on your github so any other dev contributors can take a look at it? I tried to go through the stack trace but I haven't been able to take a deep look at it assuming I know what I should be looking for.


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

(2013-02-15, 00:59)cfetzer Wrote: @richardk:
I have pushed a small fix to master and to debug-backend-cpu that adjusts all tcp rcv buffers to a bigger value (128000).

I was seeing a socket error: "writeStringList: Error, No data written on writeBlock" on the backend and I think I've seen a similar one also in a log you posted.
Janbar told me that this error message usually goes hand in hand with a high load on the backend.

Therefore it could be somehow related to your problem. It would be nice if you could retest (if possible with both branches).
How is your experience currently without images. Did it fix the issue for you?

Thanks,
Christian

This version of the addon worked for several hours. Then I got a box that said:

The PVR backend does not support this action Check the l...
An unexpected error occurred. Try again later or check the l...

I captured the log, and it's here:

http://pastebin.com/aVZJSwaq