[mythtv-users] channel changes via script suddenly stopped working--diagnose help

Larry Roberts mythtv at american-hero.com
Sat Apr 13 16:41:38 UTC 2013


On 4/13/2013 12:05 PM, Stephen Worthington wrote:
> On Sat, 13 Apr 2013 11:27:57 -0400, you wrote:
>
>> On 4/13/2013 11:25 AM, Bill Meek wrote:
>>> On 04/13/2013 10:08 AM, Larry Roberts wrote:
>>>> So about a week or so ago my recordings all started occurring on the
>>>> same channel regardless of what channel they should have been
>>>> recorded on.
>>>> I have been using an IRBlaster along with a channel changing script
>>>> successfully for well over a year and then out of the blue with no known
>>>> changes this started.
>>>>
>>>> I have went into mythtv-setup and verified that the script is still
>>>> referenced and the default channel is still there.
>>>>
>>>> I have also ran a check against the databases to verify no corruption
>>>> there as well.
>>>>
>>>> I can manually run the cc.sh script just fine and it will tune the
>>>> output but for some reason mythtv is just not using the script now.
>>>>
>>>> I really have no idea how to diagnose what is going on in mythtv and
>>>> the script.
>>> Hi;
>>>
>>> On your running backend, type: mythbackend --setverbose system
>>>
>>> Then tailf your backend log and schedule a recording.
>>>
>>> You should see the cc.sh command as it's executed. Use --setverbose
>>> general to restore normal logging.
>>>
>> Great minds think alike :)  I found a post with a similar problem. Here
>> is the output
>>
>> 2013-04-13 11:22:14.050929 I [1795/1910] TVRecEvent system-unix.cpp:868
>> (Fork) - Managed child (PID: 2481) has started! *&
>> command=/usr/local/bin/cc.sh 18, timeout=0
>>
>>
>> SO I see that it has attempted to change the channel but for some reason
>> its not happening.  I know the script works as I can run it manually
>> just fine and it will tune.
>>
>> Do you happen to know what the timeout=0 value implies?
> A timeout value of 0 is commonly used in programming to mean no
> timeout.  But I do not know for sure if that is what is meant here.
>
> Perhaps there is a permissions problem, and the attempt to call cc.sh
> fails.  What user is mythbackend run from?  Is it the same user or the
> same group as the user where manually running cc.sh works?
>
> You could put some debug code in cc.sh to output to a log file every
> time it is called.  Then you can see if the call from mythbackend
> actually managed to call it.  For example:
>
> echo `date` "$@" >>\var\log\mythtv\cc.sh.log
>
> Make sure that \var\log\mythtv\cc.sh.log is world writable:
>
> touch \var\log\mythtv\cc.sh.log
> chmod a+rw \var\log\mythtv\cc.sh.log
>
> otherwise the writes to the log file might fail.
>
So I did that and gave it a try.  I can see the channel being passed to 
the file as I try to record.  This makes no sense as to why I can change 
channel at the command line but it doesnt work from a recording...
For completeness here is my perl script that I have been using.  so 
extra stuff has been changed over time so ignore some the commented 
stuff.  I'm going to go reboot my cable box to see if that makes a 
difference..
#!/usr/bin/perl
# Created by regx
# Simple perl script to change channels for Myth
# make sure to set this string to
# the corresponding remote in /etc/lircd.conf
open (CCFILE, '>>/var/log/mythtv/cc.log');
$remote_name = 'PaceDC50X';
#$remote_name = 'COMCASTDTA';
$channel=$ARGV[0];
@channel = split(//,$channel);
print CCFILE "$channel". "\n";
foreach(@channel){
         #print $_ . "\n";
         `irsend --device=/dev/lircd1 SEND_ONCE $remote_name $_`;
         sleep 1;
}sleep 1;
close (CCFILE);
#`irsend --device=/dev/lircd1 SEND_ONCE $remote_name ENTER`;




More information about the mythtv-users mailing list