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 - janbar - 2012-12-29

@Nachteule

See the previous post #1710 , it could resolve it also.


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

(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!
Hi, have you try to pause the playback few seconds (20 secs) and then play ? Is glitchy exist yet ?



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

@janbar
(2012-12-29, 01:06)janbar Wrote: @Nachteule

See the previous post #1710 , it could resolve it also.

Do you mean this patch? "LiveTV buffer size reduction should be less aggressive" I already had merged into my testing environment.

I think i located the problem, but could'n solve it right now:
In the function cmyth_livetv_chain_update() an old file name will be received from the backend (cmyth_recorder_get_cur_proginfo() requests this) which is already in the chain. The actual file will newer be inserted into the chain and so livetv stops.

Unfortunately i have no idea why the backend reports the old file to the client.



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

Timer can not be deactivated, but deleting works

If i deactivate a timer, the state goes to "error", however in the backend this timer is deactivated.

Following patch solves the problem, timer can be activated/deactivated:

Code:
--- pvrclient-mythtv.cpp-orig   2012-12-22 17:56:29.000000000 +0100
+++ pvrclient-mythtv.cpp        2012-12-27 22:18:23.496017163 +0100
@@ -974,7 +974,7 @@
       break;
     case RS_LATER_SHOWING:
     case RS_REPEAT:
-    case RS_INACTIVE:
+    //case RS_INACTIVE:
     case RS_NEVER_RECORD:
     case RS_OFFLINE:
     case RS_OTHER_SHOWING:
@@ -985,6 +985,7 @@
     case RS_LOW_DISKSPACE:
       tag.state = PVR_TIMER_STATE_ERROR;
       break;
+    case RS_INACTIVE:
     case RS_CANCELLED:
     case RS_MISSED:
     default:
Perhaps janbar or fetzerch can test it and merge it into git


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

(2012-12-29, 00:55)janbar Wrote: 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.
Hi janbar,

this seems to have fixed it - I tested it with a number of switchovers and it rolled over to the new recording without a glitch on my 0.24 MythTV installation. I know I need to upgrade Myth sometime, but the current installation runs too nicely for me to hurry.

Have a happy new year!


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

(2012-12-29, 01:18)janbar 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!
Hi, have you try to pause the playback few seconds (20 secs) and then play ? Is glitchy exist yet ?

Hi janbar,

So I tuned to one of the analog SD channels. When it started glitching, I paused for ~30 seconds. When I un-paused, there were a couple of glitches for ~15 seconds, then the playback was fine.

Log HERE , but there doesn't seem to be too much info in there, not sure if it'll help you out at all.

If you need me to test anything else, let me know! And thanks again for the hard work on this, it's really coming along nicely!


RE: New MythTV add-on using libcmyth - marker - 2012-12-30

I'm trying out OpenElec 3.0 Beta 6 with Mythbuntu 12.04.1 master and slave backends. If I go to the channels page and select one of them I am unable to connect. Here is what is displayed in the log during that time:

18:34:09 T:140634458670912 NOTICE: DVDPlayer: Opening: pvr://channels/tv/All TV channels/4.pvr
18:34:09 T:140634458670912 WARNING: CDVDMessageQueue(player):Tongueut MSGQ_NOT_INITIALIZED
18:34:09 T:140634458670912 NOTICE: CXBMCRenderManager::ResetRenderBuffer - using 5 render buffers
18:34:09 T:140633654155008 NOTICE: Thread CDVDPlayer start, auto delete: false
18:34:09 T:140633654155008 NOTICE: Creating InputStream
18:34:09 T:140633654155008 ERROR: AddOnLog: MythTV cmyth PVR Client: LibCMyth: (cmyth)cmyth_connect_addr: connect failed on port lds-distrib to '::1' (111)
18:34:09 T:140633654155008 ERROR: AddOnLog: MythTV cmyth PVR Client: LibCMyth: (cmyth)cmyth_conn_connect: cmyth_connect(::1, 6543, 65536) failed
18:34:09 T:140633654155008 ERROR: AddOnLog: MythTV cmyth PVR Client: LibCMyth: (cmyth)cmyth_conn_connect_recorder: cmyth_connect(::1, 6543, 65536) failed
18:34:09 T:140633654155008 ERROR: AddOnLog: MythTV cmyth PVR Client: LibCMyth: (cmyth)cmyth_recorder_get_recorder_id: no recorder connection
18:34:09 T:140633654155008 ERROR: CDVDPlayer::OpenInputStream - error opening [pvr://channels/tv/All TV channels/4.pvr]
18:34:09 T:140633654155008 NOTICE: CDVDPlayer::OnExit()
18:34:09 T:140633654155008 NOTICE: CDVDPlayer::OnExit() deleting input stream
18:34:09 T:140634458670912 NOTICE: CDVDPlayer::CloseFile()
18:34:09 T:140634458670912 WARNING: CDVDMessageQueue(player):Tongueut MSGQ_NOT_INITIALIZED
18:34:09 T:140634458670912 NOTICE: DVDPlayer: waiting for threads to exit
18:34:09 T:140634458670912 NOTICE: DVDPlayer: finished waiting

It looks like the frontend is trying to access the backend using an IPv6 loopback address but I have specified IPv4 addresses in mythtv-setup for both the master and slave backends. Is there something else I need to specify for this? I tried mythfrontend and am able to play live TV with that.

Thanks for your help.



RE: New MythTV add-on using libcmyth - marker - 2012-12-30

It turns out that I had a simple error in the configuration. Sorry for the trouble.

(2012-12-30, 04:49)marker Wrote: I'm trying out OpenElec 3.0 Beta 6 with Mythbuntu 12.04.1 master and slave backends. If I go to the channels page and select one of them I am unable to connect. Here is what is displayed in the log during that time:

18:34:09 T:140634458670912 NOTICE: DVDPlayer: Opening: pvr://channels/tv/All TV channels/4.pvr
18:34:09 T:140634458670912 WARNING: CDVDMessageQueue(player):Tongueut MSGQ_NOT_INITIALIZED
18:34:09 T:140634458670912 NOTICE: CXBMCRenderManager::ResetRenderBuffer - using 5 render buffers
18:34:09 T:140633654155008 NOTICE: Thread CDVDPlayer start, auto delete: false
18:34:09 T:140633654155008 NOTICE: Creating InputStream
18:34:09 T:140633654155008 ERROR: AddOnLog: MythTV cmyth PVR Client: LibCMyth: (cmyth)cmyth_connect_addr: connect failed on port lds-distrib to '::1' (111)
18:34:09 T:140633654155008 ERROR: AddOnLog: MythTV cmyth PVR Client: LibCMyth: (cmyth)cmyth_conn_connect: cmyth_connect(::1, 6543, 65536) failed
18:34:09 T:140633654155008 ERROR: AddOnLog: MythTV cmyth PVR Client: LibCMyth: (cmyth)cmyth_conn_connect_recorder: cmyth_connect(::1, 6543, 65536) failed
18:34:09 T:140633654155008 ERROR: AddOnLog: MythTV cmyth PVR Client: LibCMyth: (cmyth)cmyth_recorder_get_recorder_id: no recorder connection
18:34:09 T:140633654155008 ERROR: CDVDPlayer::OpenInputStream - error opening [pvr://channels/tv/All TV channels/4.pvr]
18:34:09 T:140633654155008 NOTICE: CDVDPlayer::OnExit()
18:34:09 T:140633654155008 NOTICE: CDVDPlayer::OnExit() deleting input stream
18:34:09 T:140634458670912 NOTICE: CDVDPlayer::CloseFile()
18:34:09 T:140634458670912 WARNING: CDVDMessageQueue(player):Tongueut MSGQ_NOT_INITIALIZED
18:34:09 T:140634458670912 NOTICE: DVDPlayer: waiting for threads to exit
18:34:09 T:140634458670912 NOTICE: DVDPlayer: finished waiting

It looks like the frontend is trying to access the backend using an IPv6 loopback address but I have specified IPv4 addresses in mythtv-setup for both the master and slave backends. Is there something else I need to specify for this? I tried mythfrontend and am able to play live TV with that.

Thanks for your help.




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

(2012-12-29, 01:39)Nachteule Wrote: @janbar
(2012-12-29, 01:06)janbar Wrote: @Nachteule

See the previous post #1710 , it could resolve it also.

Do you mean this patch? "LiveTV buffer size reduction should be less aggressive" I already had merged into my testing environment.

I think i located the problem, but could'n solve it right now:
In the function cmyth_livetv_chain_update() an old file name will be received from the backend (cmyth_recorder_get_cur_proginfo() requests this) which is already in the chain. The actual file will newer be inserted into the chain and so livetv stops.

Unfortunately i have no idea why the backend reports the old file to the client.
It is a MythTV "bug" since 0.25. So for this reason in the code we waiting for the event DONE_RECORDING and then we force a chain update. The old chain is not inserted because the url exists already. If you use 0.24 i have no idea what happen. I had a look on a log with 0.24 in a previous post about it. It seems to not send the event DONE_RECORDING at time. So i add a new patch to also use the old method to allow the chain update without waiting the event DONE_RECORDING. See my commit: "LiveTV chain is not updated with MythTV 0.24" (https://github.com/janbar/xbmc-pvr-addons/commit/4647f111e85c1131025ec857ff4917dd664f6adc) in my branch mainline.
But if you have MythTV 0.25 and up, you should not have this issue. It works perfectly !

(2012-12-29, 22:00)bedouin Wrote:
(2012-12-29, 00:55)janbar Wrote: 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.
Hi janbar,

this seems to have fixed it - I tested it with a number of switchovers and it rolled over to the new recording without a glitch on my 0.24 MythTV installation. I know I need to upgrade Myth sometime, but the current installation runs too nicely for me to hurry.

Have a happy new year!
Hi, great one thing resolved more. I make the PR for Christian. Happy new year Wink



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

@Nachteule, Bedouin has confirmed the patch is good for 0.24.


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

(2012-12-27, 16:00)Nachteule Wrote: 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.

If you have always this issue with 0.26, then i think you use an old commit of the addon. Take care about "make zip": the zip is not updated with lastest compiled binary. Use instead "make clean zip". And unzip directly the new addon into the folder ~/.xbmc/addons/
Br


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

(2012-12-29, 01:54)Nachteule Wrote: Timer can not be deactivated, but deleting works

If i deactivate a timer, the state goes to "error", however in the backend this timer is deactivated.

Following patch solves the problem, timer can be activated/deactivated:

Code:
--- pvrclient-mythtv.cpp-orig   2012-12-22 17:56:29.000000000 +0100
+++ pvrclient-mythtv.cpp        2012-12-27 22:18:23.496017163 +0100
@@ -974,7 +974,7 @@
       break;
     case RS_LATER_SHOWING:
     case RS_REPEAT:
-    case RS_INACTIVE:
+    //case RS_INACTIVE:
     case RS_NEVER_RECORD:
     case RS_OFFLINE:
     case RS_OTHER_SHOWING:
@@ -985,6 +985,7 @@
     case RS_LOW_DISKSPACE:
       tag.state = PVR_TIMER_STATE_ERROR;
       break;
+    case RS_INACTIVE:
     case RS_CANCELLED:
     case RS_MISSED:
     default:
Perhaps janbar or fetzerch can test it and merge it into git
Thanks, i check that.



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

(2012-12-29, 22:13)guitarguy987 Wrote:
(2012-12-29, 01:18)janbar 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!
Hi, have you try to pause the playback few seconds (20 secs) and then play ? Is glitchy exist yet ?

Hi janbar,

So I tuned to one of the analog SD channels. When it started glitching, I paused for ~30 seconds. When I un-paused, there were a couple of glitches for ~15 seconds, then the playback was fine.

Log HERE , but there doesn't seem to be too much info in there, not sure if it'll help you out at all.

If you need me to test anything else, let me know! And thanks again for the hard work on this, it's really coming along nicely!
Well, log show nothing. I think the problem could be a demux issue with SD. Check if you have checked "Always" in the playback setting:
System -> Settings -> Video -> Playback -> "Adjust display refresh rate to match video" = "Always"
and don't check "Sync playback to display".

If the display refresh rate is different of video then the client need to resample. The timer should be accurate else the playback go faster than the flow and you could have buffering issue. Also resampling video need lot of cpu. So for this reason always adjust display refresh rate with the video.
For instance i see only this way.

Also check System->Settings->System->Video output->Vertical blank sync: try Enabled during video playback



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

(2012-12-31, 02:07)janbar Wrote: If you have always this issue with 0.26, then i think you use an old commit of the addon. Take care about "make zip": the zip is not updated with lastest compiled binary. Use instead "make clean zip". And unzip directly the new addon into the folder ~/.xbmc/addons/
Br

Hi janbar,

thanks for your help

As i wrote at the beginning, i already use MythTv 0.26. I don't believe that i have an old commit, i fetched my version Dec 22 17:56 from fetzerch's git, and i already know about this "make zip" issue, however i don't use this because i only copy the new XBMC_MythTV_cmyth.pvr into XBMC's folder (make clean zip takes too much time on my HTPC).

Currently i'm using a workaround, i fetch up to 4 times for the correct proginfo, mostly i get the correct info at the 2nd try, however sometimes 4 requests are needed.
And that's my problem, i get the wrong (old) proginfo from backend. But the real new info is needed to put it into the chain.

In my point of view there could be 2 reasons for this behavior:
1) one or more old proginfo's are in the queue
2) backend send's the update requests too early and if the client asks for new proginfo, the new file does not exist and the old file will be received

If you would like to have a look to the full log (it's a log before i made any changes in source), you can download it here https://www.hidrive.strato.com/lnk/7OPAjr2P
The interesting part is around 01:40:00, at this time old show ends and new show begins

Happy new year to all



RE: New MythTV add-on using libcmyth - tdavis - 2012-12-31

(2012-12-12, 00:08)cfetzer Wrote:
(2012-12-11, 18:10)tdavis Wrote:
(2012-12-10, 21:55)cfetzer Wrote: Thanks, I've rebased the addons PR.

Excellent, it compiled up and appeared to get the EDL list.. more testing to see how well it works.

Thanks for the feedback. I'm using this for quite a while now and it's working fine. At least the XBMC/Addon part. It depends of cause on the comskip quality. So if your breaks appear to early or to late it needs configuration/fixes on the MythTV side.

Ok, I've just tried to rebuild to RC2, and both PR's don't work, so it needs to be rebased.

Also found that when using VDPAU decoding under Nvidia, it runs fast; that's why my commercial skips under xbmc are too early.