<html dir="ltr"><head></head><body style="text-align:left; direction:ltr;"><div>On Fri, 2022-06-10 at 09:09 -0400, John Hoyt wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">On Sun, Jun 5, 2022 at 10:12 AM John Hoyt <<a href="mailto:john.hoyt@gmail.com">john.hoyt@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div dir="ltr">Recently I've been having a random error where my STB records the wrong channel.  I thought the error was on the STB side and tried to modify my channel change script to accommodate new STB features (unsuccessfully of late).<div><br></div><div>Upon digging into the problem deeper, I've discovered that mythtv seems to be semi-randomly sending 8 digits to the channel change script vs the 4 I've set it up to (caught by logging looking at the lirc logging in syslog).  For example, if the channel was supposed to be 0685, mythbackend would provide 00668855.</div></div><br></blockquote><div><br></div><div>Digging into this further this morning, I've eliminated the channel change script by adding syslog outputs to the script.  Running as a user, the script only ever sends commands once.  The only time I see the double send is when mythbackend commands it.</div><div><br></div><div>What I've found is that the channel change script is somehow getting called twice as I'm seeing two messages indicating that the script was called in syslog (see "Attempting to change channels lines").</div><div><br></div><div>If I've tracked the issue down (if I am guessing right) to lirc trying to perform both commands interleaved.  In the log output below, the two "Sending: SEND_ONCE Motorola_QIP6200-2 KEY_EXIT" demonstrate this as I send the "EXIT" key to way up the STB from it's standby state.  In the script, I only issue "EXIT" once then move on to channel changes.</div><div><br></div><div>Could this be a bg in mythbackend?  If not, any thoughts on what could be issuing the second channel change command?</div><div><br></div><div>Any thoughts on a way to lockout lirc / irsend to only accepting one command at a time?</div><div><br></div><div>In the log below, I've highlighted what I believe to be the repeated / interleaved irsend requests.</div><div><br></div><div>Thanks as always for the help!</div><div>John</div><div><br></div><div><br></div><div>aaa</div></div></div></blockquote><div>John,</div><div>  My 2 cents, do a lockout in the external channel changer script. IE when it starts, check for a flag if the flag is there, just exit.</div><div>CONECPT  code</div><div># start of script</div><div>If exists /tmp/channel_changer_running then exit</div><div>touch /tmp/channel_changer_running</div><div>do your channel changing</div><div># cleanup</div><div>if exists <span style="font-size: 18.666666px;"> </span><span style="font-size: 18.666666px;">/tmp/channel_changer_running then rm -f </span><span style="font-size: 18.666666px;">/tmp/channel_changer_running</span></div><div><span style="font-size: 18.666666px;">....</span></div><div><span style="font-size: 18.666666px;">Just a thought..</span></div><div><span style="font-size: 18.666666px;"><br></span></div><div><span style="font-size: 18.666666px;">Jim</span></div></body></html>