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 - martyg7 - 2012-12-21

(2012-12-21, 22:13)janbar Wrote: Hi,

Probably you have a network issue. But also since we have limited the buffer size request depending of the backend response to avoid any break of show, this probem could occur. For me HD use 35~45 mb/s. Also you use a remote storage, so you need at least twice of the bandwidth. That means you need 70~100 mb/s. This is the reason why i said in a previous post you should have a gigabit network to manage these cases.
The best thing should be to use two different networks (so two ethernet cards on the backend) , one for the storage and the other for the remote client.
I will make a branch with an algorithm less aggressive for the buffer size. You could try it.
br.

Just to clarify, I have a single server with all my disk space built in.
I do not have a separate NAS box for my video captures.
(I understand how a separate LAN segment would be a good idea if that were the case)

I have tested with 2 separate targets (Win/Linux laptop and RPi card) connected to server via GigE.

Since I (only) see this issue using RPi PVR/Myth, and not RPi Videos/NFS, I'm pretty sure it's not my network.
Since I do not see the issue on Laptop/Win/XBMC or Laptop/Linux/Myth-frontend, I assume my issue is specific to RPi.

I thought it might be resource scheduling on the server side (mythbackend process)
but not being able to duplicate on Laptop/Linux with mythfrontend kind of eliminated that track for me.
(I did play some with process scheduling for mythbackend on the server, to no avail)

I am at your disposal for testing any fixes. Thanks for the prompt response!

EDIT: Oh, BTW my RPi is the 256M version, if that makes a difference.




RE: New MythTV add-on using libcmyth - janbar - 2012-12-22

(2012-12-21, 22:35)martyg7 Wrote: [quote='janbar' pid='1273151' dateline='1356120802']

Just to clarify, I have a single server with all my disk space built in.
I do not have a separate NAS box for my video captures.
(I understand how a separate LAN segment would be a good idea if that were the case)

I have tested with 2 separate targets (Win/Linux laptop and RPi card) connected to server via GigE.

Since I (only) see this issue using RPi PVR/Myth, and not RPi Videos/NFS, I'm pretty sure it's not my network.
Since I do not see the issue on Laptop/Win/XBMC or Laptop/Linux/Myth-frontend, I assume my issue is specific to RPi.

I thought it might be resource scheduling on the server side (mythbackend process)
but not being able to duplicate on Laptop/Linux with mythfrontend kind of eliminated that track for me.
(I did play some with process scheduling for mythbackend on the server, to no avail)

I am at your disposal for testing any fixes. Thanks for the prompt response!

EDIT: Oh, BTW my RPi is the 256M version, if that makes a difference.
Limit of buffer size is for LiveTV only:
I pushed on my git an update of buffer size limit. To get it type:
git cherry-pick 1b30079365232d6469f83504fc64e2c8313316f

Or pull my repo using the branch "livetv_buffer":
git clone https://github.com/janbar/xbmc-pvr-addons.git
git checkout livetv_buffer

then: "make clean" and recompile it.

br

But probably you need a bigger RPI (512M ?): If the issue is also for recording playback, then no way with this update.


RE: New MythTV add-on using libcmyth - twojciac - 2012-12-22

(2012-12-21, 19:49)martyg7 Wrote: I am tracking a persistent problem with MPEG2 playback on RPi.
This issue is specific to playback via the PVR interface.
I am using the cMyth plugin. Backend is MythTV 0.26 Debian over GigE.

When playing back a HD recording, playback pauses/rebuffers randomly.
Frequency of occurence is once about every 1-2 minutes.
Playback is through the PVR interface using the cMyth plugin.
All my feeds are captured using a HD Homerun on FIOS TV.

I can play the same files through the XBMC "Videos" interface with no issues.
(I have my MythTV captures cross-mounted via NFS)

I have reproduced this issue on OpenELEC and RaspBMC.

I cannot duplicate this issue using VLC on windows, over SMB share.
I cannot duplicate this issue using XBMC Frodo RC2 on Windows.
I cannot duplicate this issue using Myth frontend on my Linux laptop.

This only occurs on high bitrate (~18Mb/s) HD recordings.
I cannot reproduce on lower bitrate (~2.5Mb/s) SD recordings.

NOTE this issue is unrelated to the other playback issue documented in several
other threads, where a hard pause occurs at commercial breaks in recordings.

As far as I can tell, this is NOT a recent regression.
I still see this problem as of latest OpenELEC nightly (r12735)
which includes the latest cMyth plugin (v.1.6.6)

Sorry if this already being worked on, but I have spent a lot of time trying to
figure out this issue, and wanted to make sure this was written down.

Happy holidays to all the developers and contributors!

I'm seeing the same issue on a Win7 box running RC1 with a myth 0.26 backend. I have a GigE connection on both the frontend and backend device. When I play the mpg recording file directly from the SMB share, it works fine... no stuttering at all. Via the PVR addon, it buffers and stutters.


RE: New MythTV add-on using libcmyth - janbar - 2012-12-22

@martyg7
@twojciac

Hi, i tried HD playback (livetv) with 3 pvr clients at the same time. One over PLC network (200mb) (my osx), one over wifi 802.11 (my laptop ubuntu), and one on the backend host (my mediacenter mythbuntu). I did'nt see any buffering ! Also my backend runs on intel D425, so a small CPU. All my clients have a native h264 demux throw the GPU. So what happen for you ?
Think mythcommflag and transcode jobs need lot of resources of the backend. If you have these jobs and they are running , probably you could have overloaded backend. Else i see only network issue or your xbmc client has no enought resource to demux HD stream.
@martyg7
@twojciac

I retried with recording HD playback with 3 clients at the same time and no more buffering.


RE: New MythTV add-on using libcmyth - martyg7 - 2012-12-23

(2012-12-22, 18:32)janbar Wrote: I did'nt see any buffering ! Also my backend runs on intel D425, so a small CPU.

Thanks for the patch.

Turns out I had a screwy mythbackend process on my server.
I was watching it yesterday, and noticed the CPU consumption was out of whack.
I was seeing about 10% at idle, and 70% of a 2.8GHz core with one file playing back.
(This is without any transcode/commflag jobs or anything else running on the machine)
Seeing 70% << 100%, I didn't think much of it. ;-)

I saw nothing in the mythbackend.log which would indicate any kind of distress.
Anyway, I restarted the backend, and everything appears to be back to normal.

It appears there is a bug where stale threads linger and eat more and more CPU.
I have been running deb-multimedia 0.26.0-dmo12 (Wheezy)
Have upgraded to 0.26.0+fixes20121220-dmo1 (Sid) and will keep a close eye.

These things really make me feel like a schmuck. (Been fighting this for weeks)
Thanks for the guidance. Looking forward to future updates.



RE: New MythTV add-on using libcmyth - richardk - 2012-12-23

(2012-12-23, 16:06)martyg7 Wrote: Turns out I had a screwy mythbackend process on my server.
I was watching it yesterday, and noticed the CPU consumption was out of whack.
I was seeing about 10% at idle, and 70% of a 2.8GHz core with one file playing back.
(This is without any transcode/commflag jobs or anything else running on the machine)
Seeing 70% << 100%, I didn't think much of it. ;-)


I'm seeing the same phenomenon with my 0.26+fixes backend (MythBuntu 12.04). 105%-120% cpu while the PVR Manager is starting up and loading recordings, and for about five minutes after. (The MythTV backend is dual-core.) About 70% cpu while playing a recording, and this goes to about 4% while playing a recording after rebooting the backend.

If you Google "mythbackend high cpu" you'll find some reports of this, but most relate to a leap second that was inserted last summer, so not the same problem.

One post recommended " If you open MythTVBackend -> Capture Cards -> DVB card -> Record options and then untick the "Actively Scan for EIT Data" box, it should work." I'm not sure if this is relevant, but I have tried it and will report back.




RE: New MythTV add-on using libcmyth - bedouin - 2012-12-23

(2012-12-21, 01:39)janbar Wrote: Hi, please can you post the log between 23:10:00 and 23:14:00 ?
I need to view result of events "LIVETV_WATCH" and "DONE_RECORDING". Thanks.
Sorry for the delay, our 2nd baby was born on Friday, slightly distracted...here's a new log of the switchover-freeze, this time the programs switched over at 18:04.

xbmc201212231804.log




RE: New MythTV add-on using libcmyth - guitarguy987 - 2012-12-24

(2012-12-21, 21:14)janbar Wrote:
(2012-12-21, 18:30)guitarguy987 Wrote:
(2012-12-20, 04:12)Calabraun Wrote: I am having this exact same issue, with choppy SD video and HD is fine, using mythtv back end. Using MythTV .25 and I have a PVR-500 for SD. Did you happen to figure this out?

I did not figure this out yet. I assume it's a buffering issue, but am not sure.

Perhaps because I didn't attach a log file on my original post. I am still using a quite old version of the Add-On on my main TV that is working well enough for me...

Can anyone give us any insight into this? Is this a known problem? Would you like me to attach some log files?

Hi,
Yes i need log to see what happen. But first try with mythfrontend to check you haven't the issue with it. Also what is the version of the old addon you use without any problem. That could be help me. Thanks.
Edit: if you have the git commit , it would be nice

Hi janbar,

I have just tested with Mythfrontend, and the problem does not occur. Playback of the analog SD channels is smooth.

The version I have working is very old (sorry, I'm not super familiar with git, so I'll give you the info I have on that frontend machine, not even sure if it will help, I realize it's not even running Frodo, I'm still on Eden...):
I followed the directions on page 83 of this thread:

git clone https://github.com/tsp/xbmc.git
cd xbmc
git checkout Eden-pvr

git log gives me this as the latest:
commit ca07c7de3de22d6d1243eb927ddf9fdde0dd3b4d
Author: Tonny Petersen <tsp@person.dk>
Date: Sun Jun 24 15:57:46 2012 +0200

FIX: click on recording folder would play all files instead of showing content

This is working without the glitches for me, but I do have to tune several times to the analog channels because of the ReadLiveStream: Read 0 Bytes! problem. Anyways, hope this is useful info...

Glitchy version:

XBMC 12.0-RC2 Git:8e45737 (Compiled: Dec 20 2012)

Pastebin link to the log

Let me know if you need any more info, I'll do what I can.

Thanks and happy holidays!


RE: New MythTV add-on using libcmyth - c420 - 2012-12-24

(2012-12-24, 17:42)guitarguy987 Wrote:
(2012-12-21, 21:14)janbar Wrote:
(2012-12-21, 18:30)guitarguy987 Wrote: I did not figure this out yet. I assume it's a buffering issue, but am not sure.

Perhaps because I didn't attach a log file on my original post. I am still using a quite old version of the Add-On on my main TV that is working well enough for me...

Can anyone give us any insight into this? Is this a known problem? Would you like me to attach some log files?

Hi,
Yes i need log to see what happen. But first try with mythfrontend to check you haven't the issue with it. Also what is the version of the old addon you use without any problem. That could be help me. Thanks.
Edit: if you have the git commit , it would be nice

Hi janbar,

I have just tested with Mythfrontend, and the problem does not occur. Playback of the analog SD channels is smooth.

The version I have working is very old (sorry, I'm not super familiar with git, so I'll give you the info I have on that frontend machine, not even sure if it will help, I realize it's not even running Frodo, I'm still on Eden...):
I followed the directions on page 83 of this thread:

git clone https://github.com/tsp/xbmc.git
cd xbmc
git checkout Eden-pvr

git log gives me this as the latest:
commit ca07c7de3de22d6d1243eb927ddf9fdde0dd3b4d
Author: Tonny Petersen <tsp@person.dk>
Date: Sun Jun 24 15:57:46 2012 +0200

FIX: click on recording folder would play all files instead of showing content

This is working without the glitches for me, but I do have to tune several times to the analog channels because of the ReadLiveStream: Read 0 Bytes! problem. Anyways, hope this is useful info...

Glitchy version:

XBMC 12.0-RC2 Git:8e45737 (Compiled: Dec 20 2012)

Pastebin link to the log

Let me know if you need any more info, I'll do what I can.

Thanks and happy holidays!


tsp's is the old addon, you should use fetzerch's git instead.
This page will tell you how to build an upto date version
http://wiki.xbmc.org/index.php?title=PVR/Backend/MythTV/BuildFromSource




RE: New MythTV add-on using libcmyth - guitarguy987 - 2012-12-24

(2012-12-24, 17:56)c420 Wrote:
(2012-12-24, 17:42)guitarguy987 Wrote:
(2012-12-21, 21:14)janbar Wrote: Hi,
Yes i need log to see what happen. But first try with mythfrontend to check you haven't the issue with it. Also what is the version of the old addon you use without any problem. That could be help me. Thanks.
Edit: if you have the git commit , it would be nice

Hi janbar,

I have just tested with Mythfrontend, and the problem does not occur. Playback of the analog SD channels is smooth.

The version I have working is very old (sorry, I'm not super familiar with git, so I'll give you the info I have on that frontend machine, not even sure if it will help, I realize it's not even running Frodo, I'm still on Eden...):
I followed the directions on page 83 of this thread:

git clone https://github.com/tsp/xbmc.git
cd xbmc
git checkout Eden-pvr

git log gives me this as the latest:
commit ca07c7de3de22d6d1243eb927ddf9fdde0dd3b4d
Author: Tonny Petersen <tsp@person.dk>
Date: Sun Jun 24 15:57:46 2012 +0200

FIX: click on recording folder would play all files instead of showing content

This is working without the glitches for me, but I do have to tune several times to the analog channels because of the ReadLiveStream: Read 0 Bytes! problem. Anyways, hope this is useful info...

Glitchy version:

XBMC 12.0-RC2 Git:8e45737 (Compiled: Dec 20 2012)

Pastebin link to the log

Let me know if you need any more info, I'll do what I can.

Thanks and happy holidays!


tsp's is the old addon, you should use fetzerch's git instead.
This page will tell you how to build an upto date version
http://wiki.xbmc.org/index.php?title=PVR/Backend/MythTV/BuildFromSource

Yup, I have tested fetzerch's on another frontend, and that's the add-on that I'm having the analog SD glitches on. If it wasn't for that, I'd be using it on my main frontend. tsp's is working well enough for the moment, besides having to tune to the SD channels several times.

Anyways, my Raspberry Pi is on the truck for delivery right now, so I'll probably be testing Openelec sooner than later!


RE: New MythTV add-on using libcmyth - janbar - 2012-12-26

(2012-12-23, 19:13)bedouin Wrote:
(2012-12-21, 01:39)janbar Wrote: Hi, please can you post the log between 23:10:00 and 23:14:00 ?
I need to view result of events "LIVETV_WATCH" and "DONE_RECORDING". Thanks.
Sorry for the delay, our 2nd baby was born on Friday, slightly distracted...here's a new log of the switchover-freeze, this time the programs switched over at 18:04.

xbmc201212231804.log

Great news. Happy baby. I hev a look on the log, Thanks.
(2012-12-23, 19:13)bedouin Wrote:
(2012-12-21, 01:39)janbar Wrote: Hi, please can you post the log between 23:10:00 and 23:14:00 ?
I need to view result of events "LIVETV_WATCH" and "DONE_RECORDING". Thanks.
Sorry for the delay, our 2nd baby was born on Friday, slightly distracted...here's a new log of the switchover-freeze, this time the programs switched over at 18:04.

xbmc201212231804.log

Great news. Happy baby. I have a look on the log, Thanks.


RE: New MythTV add-on using libcmyth - Calabraun - 2012-12-27

(2012-12-24, 19:32)guitarguy987 Wrote:
(2012-12-24, 17:56)c420 Wrote:
(2012-12-24, 17:42)guitarguy987 Wrote: Hi janbar,

I have just tested with Mythfrontend, and the problem does not occur. Playback of the analog SD channels is smooth.

The version I have working is very old (sorry, I'm not super familiar with git, so I'll give you the info I have on that frontend machine, not even sure if it will help, I realize it's not even running Frodo, I'm still on Eden...):
I followed the directions on page 83 of this thread:

git clone https://github.com/tsp/xbmc.git
cd xbmc
git checkout Eden-pvr

git log gives me this as the latest:
commit ca07c7de3de22d6d1243eb927ddf9fdde0dd3b4d
Author: Tonny Petersen <tsp@person.dk>
Date: Sun Jun 24 15:57:46 2012 +0200

FIX: click on recording folder would play all files instead of showing content

This is working without the glitches for me, but I do have to tune several times to the analog channels because of the ReadLiveStream: Read 0 Bytes! problem. Anyways, hope this is useful info...

Glitchy version:

XBMC 12.0-RC2 Git:8e45737 (Compiled: Dec 20 2012)

Pastebin link to the log

Let me know if you need any more info, I'll do what I can.

Thanks and happy holidays!


tsp's is the old addon, you should use fetzerch's git instead.
This page will tell you how to build an upto date version
http://wiki.xbmc.org/index.php?title=PVR/Backend/MythTV/BuildFromSource

Yup, I have tested fetzerch's on another frontend, and that's the add-on that I'm having the analog SD glitches on. If it wasn't for that, I'd be using it on my main frontend. tsp's is working well enough for the moment, besides having to tune to the SD channels several times.

Anyways, my Raspberry Pi is on the truck for delivery right now, so I'll probably be testing Openelec sooner than later!

Just thought I would add a little more info on this issue. I have XBMC on three different machines, all accessing the same mythtv back end. They all have the same issue with the choppy SD video. If I run MythTV frontend on any of these machines, the SD video plays back fine. This is *only* SD video from Live TV. Recordings in both SD and HD play fine in XBMC using the MythTV PVR Addon.

Also, one of the machines I mentioned is the exact same system that the MythTV backend runs on. So even if I am running XBMC on the same machine, the issue still occurs.

Here is a log from my windows machine running xbmc during the time I was watching SD live tv having the issue.:
http://pastebin.com/2KeaKxAe





RE: New MythTV add-on using libcmyth - Nachteule - 2012-12-27

Read 0 Bytes! Problem

I also have the "AddOnLog: MythTV cmyth PVR Client: ReadLiveStream: Read 0 Bytes!" problem during LiveTV, using Frodo RC2 and pvr addon from fetzerch git and mythtv 0.26 on openSUSE 12.1

It always happens here nearly at the end of the movie (newer at the beginning or in the middle) and showing live-stream is behind the live tv receiving (using timeshift, playing was paused several times).

I looked to the mpg's which are written by mythbackend and i think, xbmc stops exactly at the end of the last mpg and can't get access to the new mpg.

Here is the part of my log (extra debug msg's are not activated):

14:11:00 T:139779299600128 DEBUG: CPVRRecordings - Update - updating recordings
14:11:03 T:139779271550720 DEBUG: AddOnLog: MythTV cmyth PVR Client: Process - Trigger PVR recording update: 2 recording(s)
14:11:03 T:139779299600128 DEBUG: CPVRRecordings - Update - updating recordings
14:13:42 T:139779299600128 DEBUG: CPVRTimers - Update - updating timers
14:17:02 T:139778380994304 INFO: AddOnLog: MythTV cmyth PVR Client: ReadLiveStream: Read 0 Bytes!
14:17:06 T:139778334275328 INFO: Previous line repeats 1 times.
14:17:06 T:139778334275328 WARNING: CDVDMessageQueue(audio)::Get - asked for new data packet, with nothing available
14:17:06 T:139778334275328 DEBUG: CSoftAEStream::Flush
14:17:07 T:139778380994304 INFO: AddOnLog: MythTV cmyth PVR Client: ReadLiveStream: Read 0 Bytes!
14:17:07 T:139778261804800 WARNING: CDVDMessageQueue(video)::Get - asked for new data packet, with nothing available
14:17:07 T:139778334275328 DEBUG: CSoftAEStream::Flush
14:17:07 T:139778261804800 INFO: CDVDPlayerVideo - Stillframe detected, switching to forced 25.000000 fps
14:17:07 T:139778261804800 DEBUG: CPullupCorrection: pattern lost on diff 200000.000000
14:17:08 T:139778334275328 DEBUG: CSoftAEStream::Flush
14:17:09 T:139778380994304 DEBUG: Previous line repeats 1 times.
14:17:09 T:139778380994304 INFO: AddOnLog: MythTV cmyth PVR Client: ReadLiveStream: Read 0 Bytes!

What i already did is putting the live-tv folder where mythbackend stores the live-tv files into a tmpfs (which remains totally in ram) but this makes no difference.


RE: New MythTV add-on using libcmyth - richardk - 2012-12-28

(2012-12-23, 17:02)richardk Wrote: If you Google "mythbackend high cpu" you'll find some reports of this, but most relate to a leap second that was inserted last summer, so not the same problem.

One post recommended " If you open MythTVBackend -> Capture Cards -> DVB card -> Record options and then untick the "Actively Scan for EIT Data" box, it should work." I'm not sure if this is relevant, but I have tried it and will report back.

Changing that setting on the backend seems to have solved the high cpu problem for me. I'm not sure why, since MythTV shouldn't be using the EIT at all, as it downloads all schedule information from Schedules Direct in the US.




RE: New MythTV add-on using libcmyth - janbar - 2012-12-29

(2012-12-23, 19:13)bedouin Wrote:
(2012-12-21, 01:39)janbar Wrote: Hi, please can you post the log between 23:10:00 and 23:14:00 ?
I need to view result of events "LIVETV_WATCH" and "DONE_RECORDING". Thanks.
Sorry for the delay, our 2nd baby was born on Friday, slightly distracted...here's a new log of the switchover-freeze, this time the programs switched over at 18:04.

xbmc201212231804.log
Hi,
Weird, 0.24 don't send awaited event to switch program. I updated my git to try to resolve it. You can test it by pull my branch. If it is resolved then fetzerch will pull it. To get and test it:

git clone https://github.com/janbar/xbmc-pvr-addons.git -b livetv_fix testaddon
cd testaddon
./bootstrap
./configure --enable-addons-with-dependencies
make clean zip

Then get the zip file and unzip it into ~/.xbmc/addons/ by replacing previous addon.

Br.
Congratulation for the 2nd Wink