<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 2, 2015 at 6:12 AM, Dan Wilga <span dir="ltr"><<a href="mailto:mythtv-users2@dwilga-linux1.amherst.edu" target="_blank">mythtv-users2@dwilga-linux1.amherst.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000"><span class="">
    <div>On 2/25/15 11:26 AM, Karl Newman wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">On Wed, Feb 25, 2015 at 6:54 AM, Dan
            Wilga <span dir="ltr"><<a href="mailto:mythtv-users2@dwilga-linux1.amherst.edu" target="_blank">mythtv-users2@dwilga-linux1.amherst.edu</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Ideally,
              there would be some way for the channel change script to
              tell Myth, "I can't tune that" and have the recording
              marked as "failed". Looking at the Myth source code, I
              don't think it does anything with the script return value,
              so I guess there's nothing to be done in this regard.<br>
              <br>
            </blockquote>
            <div>It must do something with the channel change script
              return value, because I just had some recordings fail
              because my channel change script returned an error. They
              showed up in Myth as grayed out with 0 bytes, so it was
              obvious they had failed. It tripped me up, actually,
              because the channel change script failure was only logged
              as an info status under the channel logging group, so I
              didn't see the error in the log. I submitted a patch to
              change a failure to be logged as an error under general
              (so it will be seen with the default logging options) and
              it's been incorporated into master.<br>
              <br>
            </div>
            <div>So, in your case, if the channel change script can
              detect the failure and propagate that as a nonzero script
              exit code, it should be picked up by Myth.<br>
            </div>
          </div>
        </div>
      </div>
    </blockquote></span>
    Hi Jon,<br>
    <br>
    I'm attaching a revised version of your script which returns a
    non-zero status if tuning fails. In addition to the case where Myth
    is trying to tune to an unsubscribed channel, it also handles the
    case where the receiver is not working for some reason, since it
    relies on a specific return value from the upnp endpoint.<br>
    <br>
    When Myth sees a non-zero return value it leaves behind a zero-byte
    recording. While this is less-than-great, at least it does
    reschedule the program to record again at another time.<br>
  </div></blockquote><div><br></div><div>You may also be interested in the patch to log a channel change failure as an error. Here's the ticket: <a href="https://code.mythtv.org/trac/ticket/12374">https://code.mythtv.org/trac/ticket/12374</a> but don't use the patch I attached to that ticket. I did it blindly and it doesn't compile. Use this patch instead: <a href="https://code.mythtv.org/trac/changeset/d8e11b227ec494a29a4a7831ad0e1787bec4e9f9/mythtv?format=diff&new=d8e11b227ec494a29a4a7831ad0e1787bec4e9f9">https://code.mythtv.org/trac/changeset/d8e11b227ec494a29a4a7831ad0e1787bec4e9f9/mythtv?format=diff&new=d8e11b227ec494a29a4a7831ad0e1787bec4e9f9</a><br></div><div>It's in Master but I don't think it's been backported. But it applies cleanly to 0.27.4 at least.<br><br></div><div>Karl<br></div></div></div></div>