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 - sfrooster - 2013-05-10

(2013-05-06, 00:18)martyg7 Wrote: My XBMC-13.0-Alpha3 and cMyth 1.7.11 plugin load (for commercial skipping) is pretty nice!

I'm actually having a different experience.

I upgraded to these versions yesterday and last night had multiple crashes while trying to watch two different episodes of the same show (where previously I had almost node). Specifically, in the past, Xbmc would occasionally crash during unreproducable LiveTv operations, but last night one particular recording would crash Xbmc almost immediately upon watching. A second recording got to a point about 2/3 in where what seems like a comm skip operation also causes Xbmc to crash.

Maybe I need to rollback to 12.2 altogether, but is anyone else having issues?


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

@cfetzer
I decided to try and develop a fix for the instant recordings not ending on EPG endings. I created a patch file that will fix the issue and it is posted at the below location...
http://pastebin.com/fbvrbTZL

Basically what it does is looks for if the timer starts at 0 and this means that it is for an instant recording. I then search the database for the current program on the channel that the timer is for and I return a program object with the true end time in it. If the program is found in EPG then the myth recording rule end time is then adjusted to the correct end time based on EPG. If it is not found in EPG then the default instant recording duration from the main PVR options is used as a fallback.

To use the patch do the following...
- cd into the root of your xbmc-pvr-addons directory. I am using the latest from git://github.com/fetzerch/xbmc-pvr-addons.git
- copy the patch text from the above location into a new file named instant-recording-fix.patch
- run the below to apply the unified diff...
Code:
patch -p0 < instant-recording-fix.patch
- Compile and install as usual

This creates a manual recording rule in mythtv with the correct end time. You may have to run a 'make clean' when recompiling as I did. Seems to work well for me so hopefully this can find its way into the main codebase.


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

(2013-05-13, 06:50)Aubrien Wrote: @cfetzer
I decided to try and develop a fix for the instant recordings not ending on EPG endings. I created a patch file that will fix the issue and it is posted at the below location...
http://pastebin.com/fbvrbTZL

Basically what it does is looks for if the timer starts at 0 and this means that it is for an instant recording. I then search the database for the current program on the channel that the timer is for and I return a program object with the true end time in it. If the program is found in EPG then the myth recording rule end time is then adjusted to the correct end time based on EPG. If it is not found in EPG then the default instant recording duration from the main PVR options is used as a fallback.

To use the patch do the following...
- cd into the root of your xbmc-pvr-addons directory. I am using the latest from git://github.com/fetzerch/xbmc-pvr-addons.git
- copy the patch text from the above location into a new file named instant-recording-fix.patch
- run the below to apply the unified diff...
Code:
patch -p0 < instant-recording-fix.patch
- Compile and install as usual

This creates a manual recording rule in mythtv with the correct end time. You may have to run a 'make clean' when recompiling as I did. Seems to work well for me so hopefully this can find its way into the main codebase.

Very nice, I'll try this out tonight. Does this also fix instant recordings being named after the channel and not the actual show?


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

If you have EPG data for the channel then the name is after the show, but if you have no EPG then the name comes after the channel. Since it is a manual recording then it appends the date and time to the title as well. I also just figured out that the way the EPG screen shows a red dot for currently recording shows doesn't work with instant recordings. I tracked this down to a file in the main xbmc code at src/xbmc/xbmc/pvr/timers/PVRTimers.cpp

I found the method named CPVRTimers::GetTimerForEpgTag and edited it to say the following...
Code:
CFileItemPtr CPVRTimers::GetTimerForEpgTag(const CFileItem *item) const
{
  if (item && item->HasEPGInfoTag() && item->GetEPGInfoTag()->ChannelTag())
  {
    const CEpgInfoTag *epgTag = item->GetEPGInfoTag();
    const CPVRChannelPtr channel = epgTag->ChannelTag();
    CSingleLock lock(m_critSection);

    for (map<CDateTime, vector<CPVRTimerInfoTagPtr>* >::const_iterator it = m_tags.begin(); it != m_tags.end(); it++)
    {
      for (vector<CPVRTimerInfoTagPtr>::const_iterator timerIt = it->second->begin(); timerIt != it->second->end(); timerIt++)
      {
        CPVRTimerInfoTagPtr timer = *timerIt;
        if (timer->m_iClientChannelUid == channel->UniqueID() &&
            timer->m_bIsRadio == channel->IsRadio() &&
            timer->EndAsUTC() >= epgTag->EndAsUTC() &&
            (timer->StartAsUTC() <= epgTag->StartAsUTC() || (timer->StartAsUTC() > epgTag->StartAsUTC() && timer->IsRecording())))
        {
          CFileItemPtr fileItem(new CFileItem(*timer));
          return fileItem;
        }
      }
    }
  }

  CFileItemPtr fileItem;
  return fileItem;
}

I really only changed one line but I posted the entire method above since I didn't diff it yet.
Code:
(timer->StartAsUTC() <= epgTag->StartAsUTC() || (timer->StartAsUTC() > epgTag->StartAsUTC() && timer->IsRecording())))
Now I just got to figure out how to get this change in front of an xbmc dev to see if it can get committed. I have no idea where to start with getting something into the main xbmc code tree. But with the previous patch to the cmyth addon and the above fix to the main xbmc code instant recordings end on EPG correctly and the red dot shows up on the EPG grid view as it should for current recordings that were started after the beginning of the show.


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

Cool, thanks.

I'll recompile openelec tonight to include your changes. In regards to getting a devs attention I think your best bet would be to make a pull request on the xbmc git hub page, I'm pretty sure the whole xbmc team will be notified.


RE: New MythTV add-on using libcmyth - simora - 2013-05-16

XBMC 12.0 w/ 1.6.9

Took a while to nail this one down but I have found an issue.

If you are watching livetv on a channel and a recording is about to start the plugin kicks you off the tuner 30 seconds prior to recording. If you start viewing that channel immediately than the recording never actually starts but it also never ends. The process creates a stale "currently recording" program. This stale recording can be viewed through the home menu information as well as mythweb. The only way to clear that stale program is to restart mythtv-backend. If you however wait until the recording begins before restarting livetv playback than a different tuner is allocated and the recording is successful.

This can be reproduced if you tune the same channel immediately after being kicked off but I have not tested this process with any channel other than. My guess is that if you grab any channel that results in taking the first available tuner with the channel for the recorded show associated with it than you can reproduce the issue.

I find it an inconvenience to have to restart livetv when a show begins but I find it far more frustrating to have to find an available time when nothing is recording and the family isn't watching anything to restart my backend. Any fix for this that doesn't require patience on the part of my family is greatly appreciated.


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

Hi,

Is it possible to run 1.7.11 on 12.2? Im having to go backwards due to the problems with ffmpeg/VAAPI/MPEG-2 but i'd rather not lose the newer features.

Thanks!


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

(2013-05-18, 10:29)flitter2009 Wrote: Hi,

Is it possible to run 1.7.11 on 12.2? Im having to go backwards due to the problems with ffmpeg/VAAPI/MPEG-2 but i'd rather not lose the newer features.

Thanks!

No


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

Aubrien, Ive finally gotten around to trying your patches in OE3. The instant recording fix works very well, thanks! I like how the date is included in the title to differentiate between instant recordings and scheduled recordings. Any chance the sub title and description can be included aswell? Eg

Scheduled recording

Image

Instant recording

Image

Unfortunately the timer icon patch doesnt work as intended. After a instant recording is started I see this in the epg:

Image

Thanks for your work.


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

@teeedubb
I'll have a look at the description and the red dots on EPG throughout the week. I was having some issues with the description previously so I left it as you saw just to get something out there for others to play with. I'm currently adding a third tuner to my setup and it has caused me to have to rearrange my equipment rack a bit due to space so it may be later in the week before I can have a look at it.

In the last screenshot where it is 9:55; are the shows with red dots scheduled to be recorded later? I'm trying to determine if they should be check boxes instead of red dots or if they shouldn't have any markers on them at all. If you can tell me what you should have seen in the last screenshot I can probably get it working. Also, do you have any start early and end late settings in place? ex. start a minute early and end a minute late.


RE: New MythTV add-on using libcmyth - fetzerch - 2013-05-20

(2013-05-20, 06:28)Aubrien Wrote: @teeedubb
I'll have a look at the description and the red dots on EPG throughout the week. I was having some issues with the description previously so I left it as you saw just to get something out there for others to play with. I'm currently adding a third tuner to my setup and it has caused me to have to rearrange my equipment rack a bit due to space so it may be later in the week before I can have a look at it.

In the last screenshot where it is 9:55; are the shows with red dots scheduled to be recorded later? I'm trying to determine if they should be check boxes instead of red dots or if they shouldn't have any markers on them at all. If you can tell me what you should have seen in the last screenshot I can probably get it working. Also, do you have any start early and end late settings in place? ex. start a minute early and end a minute late.

Sry for the delayed answer. Thanks for your work, patches are always welcome. The patch looks fine to me, so
I'll push it into the development repository.

I'm still pretty sure that at some point xbmc sent the correct starttime instead of 0 and then the program would be found
by the FindProgram call. Anyway. With your addition, it should be more robust.

For the next time, you can fork my project on github, commit the change to a branch and create a pull request for my repository.
That way it's easier to review the patch.

Cheers Christian


RE: New MythTV add-on using libcmyth - fetzerch - 2013-05-20

(2013-05-16, 20:48)simora Wrote: XBMC 12.0 w/ 1.6.9

Took a while to nail this one down but I have found an issue.

If you are watching livetv on a channel and a recording is about to start the plugin kicks you off the tuner 30 seconds prior to recording. If you start viewing that channel immediately than the recording never actually starts but it also never ends. The process creates a stale "currently recording" program. This stale recording can be viewed through the home menu information as well as mythweb. The only way to clear that stale program is to restart mythtv-backend. If you however wait until the recording begins before restarting livetv playback than a different tuner is allocated and the recording is successful.

This can be reproduced if you tune the same channel immediately after being kicked off but I have not tested this process with any channel other than. My guess is that if you grab any channel that results in taking the first available tuner with the channel for the recorded show associated with it than you can reproduce the issue.

I find it an inconvenience to have to restart livetv when a show begins but I find it far more frustrating to have to find an available time when nothing is recording and the family isn't watching anything to restart my backend. Any fix for this that doesn't require patience on the part of my family is greatly appreciated.

Unfortunately this is a known issue. Before we've added the "conflict resolving" priority option we had this stale recording every time when LiveTV was active and a recording was about to start.
As you noticed, the issue is still there if you start LiveTV before you get the notification that the recording has actually started.
It was discussed here: http://forum.xbmc.org/showthread.php?tid=152511

From what I understood, it is also possible to force this problem using mythfrontend.
I stumbled on a patch in mythtv that had a comment on this: https://github.com/MythTV/mythtv/commit/14aa70771e85e401c68cac78a49b8ef344cce873

Quote:NB: the case where a user enters live TV immediately before a
recording is scheduled to start is still not handled gracefully.
Fixing that is a lot tougher and will likely mean involving the
scheduler in choosing which input to use for live TV.

Don't have a good idea how to workaround this, sry.


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

(2013-05-20, 06:28)Aubrien Wrote: @teeedubb
I'll have a look at the description and the red dots on EPG throughout the week. I was having some issues with the description previously so I left it as you saw just to get something out there for others to play with. I'm currently adding a third tuner to my setup and it has caused me to have to rearrange my equipment rack a bit due to space so it may be later in the week before I can have a look at it.

In the last screenshot where it is 9:55; are the shows with red dots scheduled to be recorded later? I'm trying to determine if they should be check boxes instead of red dots or if they shouldn't have any markers on them at all. If you can tell me what you should have seen in the last screenshot I can probably get it working. Also, do you have any start early and end late settings in place? ex. start a minute early and end a minute late.

Sorry, I never got back to finishing off that post, very poor form from me Confused My backend has been playing up lately so my scheduled recordings are out of whack, but Im pretty sure that Good Chef, Bad Chef (top row)was a scheduled recording and not live tv. TMNT was a instant recording made while recording GCBC. Nothing was scheduled after either. Recordings start 5 mins early and 20 minutes after. Would a debug log help?

Also, just to be sure, which line should the change be made in the xbmc code?


RE: New MythTV add-on using libcmyth - sfrooster - 2013-05-23

I've got two installs of Xbmc - one is frodo 12.2 and the other is gotham. I was having issues with recordings of a certain program causing the gotham install to crash immediately upon starting. This doesn't happen with the frodo install. So I built them each again, but the problem persists.

Sound familiar to anyone?


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

Probably something to do with it being in a alpha state...