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 - fetzerch - 2013-04-22

Thanks for reporting. Can you check for every single step, if the backend behaves as expected? (using MythWeb, you can find out what is being recorded currently using which tuner)
Also, give the backend a couple of seconds to free tuners after stopping recordings.

A bit on the background:
The xbmc screens or the MythTV addon do not save tuner states. For new recordings, we pass a dataset to the backend with the channelid and the starttime. We have no influence on the tuner. That is selected by the backend.
For LiveTV, we do request a list of tuners and try to find the next free one. The algorithm should be more or less the same than MythFrontend uses. Its a bit tricky when it comes to virtual tuners. We have to make sure that one virtual tuner is not locked to a transponder multiplex by a second virtual tuner (representing the same hw tuner).

I can test this here as well, when I have more time.


RE: New MythTV add-on using libcmyth - Aubrien - 2013-04-26

(2013-04-20, 09:45)Aubrien Wrote: First on the TV Channels screen. I have 2 available tuners
- Go to the TV Channels screen and select a show and start recording. This works.
- Go to the TV Channels screen and select a second show and start simultaneously recording with the first show. This also works.
- Go to the TV Channels screen and select a third show and start recording. This does not work as expected and I get a recording conflict error. No problem yet...

OK so starting over I stop all recordings and free up both tuners. Now go to the EPG screen.
- Go to the EPG screen and select a show and start recording. This works.
- Go to the EPG screen and select a second show and start recording. This does NOT work and I get a recording conflict error.

Alright I figured out what was going on here. The first case that I showed that it worked for two tuners and didn't for the third as expected was leaving a recording conflict in my timers that I had to clear out by hand. It was hidden away on the timers screen and it was eating up a recording slot even though it was doing nothing at all except claiming conflict on the timers screen. The problem is that sometimes "Instant Recordings" as started from during live TV or from the TV channels screen get stuck and the only thing I can do to delete them is to actually restart the backend. I cant even clear them from MythWeb. Sounds like a mythTV issue but I guess the best solution is to stay away from instant recordings all together.

On that note...what is the point of instant recordings anyway? It seems to me that if I click record during live tv or from the TV channels screen that it should just record until the show is complete. Instead it creates a recording for 90 minutes and claims that the show I am watching will end in exactly 90 minutes no matter if that is true or not. Those "false recordings" then tend to get stuck in the backend if I try to stop them when the show actually ends instead of waiting for the 90 minutes to pass. Could this inconsistency between the shows actual ending and when you pass a false ending be what is causing these recording to sometimes get stuck and become undeleteable without a backend restart? Would it make sense to have instant recordings just end when the timeslot is over? I actually asked about this in another thread and I was told that it depends on the PVR addon...

http://forum.xbmc.org/showthread.php?tid=157030

What are your thoughts on this cfetzer?


RE: New MythTV add-on using libcmyth - Aubrien - 2013-04-26

(2013-04-20, 21:35)Aubrien Wrote: First on the EPG screen. I have 2 available tuners
- Go to the EPG screen and select a show and start recording. This works.
- Go to the EPG screen and select a second show and start simultaneously live TV but on a different channel than the first show. This also works so I have a show recording while I watch live TV on another channel. No problem yet...

OK so starting over I stop all recordings and live TV and free up both tuners. Now go to the TV Channels screen.
- Go to the TV Channels screen and select a show and start recording. This works.
- Go to the TV Channels screen and select a second show and start live TV. This does appear to work out first but a few seconds into live TV playback the original recording stops on tuner 1 and says Recording Complete. Tuner 2 continues with live TV as if nothing happened.

I also figured out what was happening here. I had been playing around with instant recording duration trying to make it end when shows end not way out to the right like I mentioned in the last post and I left it at 1 minute duration. So I also didn't know this at the time but the TV channels screen always does instant recording duration if you click record. So anyway the recording was ending a minute later which explains the behavior I saw.

One more question (sorry for the long posts!). On the TV channels screen you see a nice big red dot if a channel is being recorded. Cool. On the EPG screen you see a checkbox if a timer is scheduled for the future timeslot. Also cool. On the EPG screen if you tell it to record a show that is already currently playing it will indeed start the recording, but there is no checkbox to indicate that it is being recorded. You have to back out and go to the TV channels screen to see that the program is recording where you see the big red dot. Would it make sense to have a checkbox on the EPG screen for a show that is currently being recorded? Is this an issue (maybe a feature request) with the main PVR code that I should post elsewhere or is this related to the addon code?


RE: New MythTV add-on using libcmyth - RipT - 2013-04-26

Actually, in MythTV, whenever you watch Live TV, it is really a recording, and a new recording starts for every TV show listed in the guide. It will even do metadata lookups and commercial skipping if you've set those as defaults. It does this whenever you watch Live TV whether you ask it to record or not. The recordings are saved in whatever you have set up to be the Live TV folder in the backend setup (Uses the Default Folder if you haven't set anything up).

MythFrontend will pretty much do what you suggest by default if you start an "instant" recording in it. I'm not sure why the cmyth addon doesn't work the same way, but in theory it could. All MythFrontend really does is move the recording file from the Live TV folder to the regular recoding folder (actually it may just change something in the mysql database and not move the file at all). In fact, whatever you watch in Live TV stays in the recording folder for whatever period is set up in the backend, I believe it defaults to one day but could be as long as you want. You can move it to your regular recordings in the frontend if you want any time before it is deleted. I think Mythweb can do the same thing. So the cmyth "instant" recording is actually a different option that you don't really have in MythFrontend, although you could set up a timer based recording - it's not a one button kind of thing. What you're asking for is done by default if you just don't turn off the Live TV or change the channel.

I do agree that it would be a good option to be able to invoke the "record until the end of the show" type recording in cmyth, but I've seen enough times when the guide is wrong that the 90 minute instant recording option is useful also.


RE: New MythTV add-on using libcmyth - Aubrien - 2013-04-26

Yeah actually when I first clicked the record button during live tv I just figured that it would do as you mentioned and it would flag it to be moved from the livetv storage group to the recordings group and then additionally it would finish the recording out unless stopped. In my ideal world I could watch live tv, click record because I want to keep what I am watching, change to a different channel (using my second tuner then) while the original show kept recording on the first tuner and then moved to recordings storage group when complete. I was a little surprised when it just kept on recording past the end. I guess it does like cfetzer said a few posts ago and it passes a channel number and a time block (except the time block that it ends on is spoofed by adding the instant recording duration vice the epg ending time).

So I cant use the record button or the record from tv channels screen as it tends to tie up my tuner way past the end of a show. I have also tried to go to the EPG screen and then click on the current running show and select record. This in theory should create a timer for the current playing show that ends on EPG end. The problem is that that doesn't work either. If you start live tv on a channel, go to EPG screen and then click record for the same channel, and then the end result is everything just stops and leaves you sitting with no livetv and no recording and you get a timer stuck in mythtv that cannot be deleted unless you restart the backend. Ouch, this may be a bug. I just discovered it.


RE: New MythTV add-on using libcmyth - fetzerch - 2013-04-28

Hm. Actually for "instant recordings", the current codebase should already record until the end of the current show.
The default length (from Settings->Live TV->Recordings) is only a fallback for or add-on. It should be used only in case we cannot find a corresponding EPG entry and cannot determine the length of the show.
It used to work, so I have to check what's going on here.

There's indeed a bug in MythTV that can lock up the backend when a recording and Live TV are in conflict.
As a workaround, we added a 'Conflict handling' setting. The default will prefer recordings and stop Live TV to make sure that you don't miss a recording.

However I fear, this introduced a new issue for 'instant recordings'. If you press the recording button in Live TV, the player stops. You have to wait a couple of seconds until you can watch the channel again. Otherwise the backend will be locked again. MythFrontend handles instant recordings exactly as RipT explained. In the add-on, we kept it simpler and basically just add a new timer. I know that this needs to be fixed, but it's quite some effort, so it will take some time.


RE: New MythTV add-on using libcmyth - martyg7 - 2013-05-01

Is it possible to compile and load the 1.7.x cMyth plugin branch on top of XBMC 12.1?
Or do I have to rebase my entire frontend to the XBMC (13.x) development branch?

I am currently running OpenELEC 3.0.1 which has cMyth 1.6.9 preinstalled.
I would really like to have the MythTV commercial skip features enabled, but stay on a stable base.

Thanks for all the work you guys are doing on this plugin.


RE: New MythTV add-on using libcmyth - teeedubb - 2013-05-01

Commercial skip is Gotham only unfortunately.


RE: New MythTV add-on using libcmyth - martyg7 - 2013-05-02

OK, I have compiled and installed XBMC-13.0-Alpha3 and cMyth 1.7.11 plugin on top of my Debian 7.0 HTPC setup.
Everything appears to be working as well as on my OpenELEC 3.0.1 baseline.

Now the stupid question -
How do I enable/control the commercial skipping feature?
I cannot find any references to EDL in the setup menus, and the skip/forward keys seems to to work as before.
(Sorry if this seems obvious, but I'm stumped)

EDIT: I found this Wiki page http://wiki.xbmc.org/index.php?title=Edit_decision_list

EDIT: Manually skipping forward/back through scenes/commercials is done via up/down arrow (long skip) keys.

Is there a way to disable this feature, either globally or on a per-recording basis?

It would also be useful if there was a popup when skipping automatically occurs, similar to the way myhfrontend does it.


RE: New MythTV add-on using libcmyth - BigYesh - 2013-05-05

Hullo! I wasn't sure where to post this so I thought I'd just let people here know about an issue I have encountered. The code uses int8's to represent the priority of recordings, but this only has a range of -127 to 128. This seems adequate but MythTV can actually have priority values much higher than this due to a combination of per recording, per channel and per input priorities.

On my system 1.6.10 runs, but fails to retrieve any recordings or upcoming recordings as it throws an out of range error. I have been able to resolve this on my local systems by changing all the priority variables in socket.c to int32, as in MythTV, but this is obviously a bit of a hack.

Thanks for the amazing work on MythTV integration!


RE: New MythTV add-on using libcmyth - Aubrien - 2013-05-05

@martyg7
OpenElec is up to 3.0.2 as of recently but still no comskips. I was thinking about trying to compile a custom OpenElec to add this feature but I haven't ever done this so I don't have the actual formula for doing so at this time. Also I think even the newest 3.0.2 is using an older Confluence skin as there is no EPG sub option under LiveTV on the home screen. For the rPi OpenElec is pretty much the only good option though. I compiled xbmc for rasbian and I was having some issues with audio so I went back to OpenElec.

@BigYesh
That sounds like an easy enough fix so hopefully that change can find its way into the codebase soon. I imagine that others will start seeing that at some point too if it isn't corrected.


RE: New MythTV add-on using libcmyth - martyg7 - 2013-05-06

My XBMC-13.0-Alpha3 and cMyth 1.7.11 plugin load (for commercial skipping) is pretty nice!

It would be a keeper if I had the ability to disable auto-skip globally and/or on a per-program basis.

Could someone confirm this functionality has not yet been implemented, or point me to how this is done?

Thanks!


RE: New MythTV add-on using libcmyth - flitter2009 - 2013-05-06

I disable commercial detection in Myth when programming the recording for channels that don't have commercials. You can do this on a per program basis or disable the detection globally at the source.


Re: RE: - teeedubb - 2013-05-06

Never mind, tapatalk is acting strange...


RE: New MythTV add-on using libcmyth - Aubrien - 2013-05-06

(2013-04-28, 22:06)cfetzer Wrote: Hm. Actually for "instant recordings", the current codebase should already record until the end of the current show.
The default length (from Settings->Live TV->Recordings) is only a fallback for or add-on. It should be used only in case we cannot find a corresponding EPG entry and cannot determine the length of the show.
It used to work, so I have to check what's going on here.

I dug into this a bit to try and help and I found that when an instant recording is started that it sends a timer to the addon with a start time of 0 and an end time of the default length (from Settings->Live TV->Recordings). You then try to copy the data from the timer into a MythRecordingRule using PVRClientMythTV:TongueVRtoMythRecordingRule. At the top of this method you try and match it to something in EPG using...

Code:
bool programFound = m_db.FindProgram(timer.startTime, timer.iClientChannelUid, "%", &program);

This will never match for an instant recording however since it is trying to match it based on a start time of 0 (is that Jan 1 1970 in unix time?). Anyway, it goes through and makes adjustments for cases where start time is 0 but it never adjusts the end time under any condition. It simply copies it over to the recording rule from the timer...

Code:
rule.SetEndTime(timer.endTime);

So there are two things going on here...
1) It will always fail to match up an instant recording to something in EPG because of the 0 start time sent to m_db.FindProgram
2) Even if you do fix the issue where it can't ever match EPG up to the instant recording, it still has no effect on the end time as there is nothing but a direct copy from timer to recording rule.