<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jun 11, 2022 at 5:47 PM Mike Perkins <<a href="mailto:mikep@randomtraveller.org.uk">mikep@randomtraveller.org.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 11/06/2022 20:55, John Hoyt wrote:<br>
>>    My 2 cents, do a lockout in the external channel changer script. IE when<br>
>> it starts, check for a flag if the flag is there, just exit.<br>
>> CONECPT  code<br>
>> # start of script<br>
>> If exists /tmp/channel_changer_running then exit<br>
>> touch /tmp/channel_changer_running<br>
>> do your channel changing<br>
>> # cleanup<br>
>> if exists  /tmp/channel_changer_running then rm -f<br>
>> /tmp/channel_changer_running<br>
>> ....<br>
>> Just a thought..<br>
>><br>
> <br>
> Jim, thanks for the suggestion!  I actually implemented this this morning<br>
> with the following code:<br>
> <br>
> # Check is Lock File exists, if not create it and set trap on exit<br>
>   if { set -C; 2>/dev/null >~/channelchange.lock; }; then<br>
>     trap "rm -f ~/channelchange.lock" EXIT<br>
>   else<br>
>     logger "ir_channel_change lirc channel change lock file exists… exiting"<br>
>     sleep 10<br>
>     exit<br>
>   fi<br>
> <br>
> I've noticed that the double channel change occurs every time I restart the<br>
> backend.  I think it also semi-randomly occurs when the backend goes days<br>
> without recording - but this is wild speculation (and could have had some<br>
> updates via apt-get in between causing a backend restart).<br>
> <br>
> I've actually been seeing the issue for months via wrong channel changes -<br>
> just hadn't seen it occur nearly as regularly.<br>
> <br>
In that log snippet you posted, there are actually /three/ channel change requests logged, the first <br>
for ch 510 and the other two for ch 550.<br>
<br>
This bug strikes me as either a flag left set or perhaps not initialized correctly at boot/reboot - <br>
maybe at other times. I do not know the code.<br></blockquote><div><br></div><div>The call for 510 is the backend completing a to change to my "default" channel (which I don't think it used to unless commanding live tv).</div><div><br></div><div>The call for 550 is the correct channel for the requested recording. </div></div></div>