[mythtv-users] Simultaneous IRblaster channel changes fubar'd

Mark fairlane at springcom.com
Sat Dec 4 17:54:55 UTC 2004


I'm having an issue with simultaneous channel changes on a homebrew ir 
blaster.  I've got two Dish network satellite boxes, programmed to 
different IR codesets, being blasted with a set of parallel IR leds 
running off a single serial port and LIRC instance.  I have two separate 
channel.pl scripts that change one box or another depending on which one 
you need to change.  Everything works great if the boxes are asked to 
change at different times, but if myth has scheduled two programs at the 
same start time, the main box changes fine, and the second box doesn't 
change, or only gets one digit or so.  Is there any setting in myth I 
can set to delay calling the script or sleep command or something I can 
add to the second channel.pl script to make it hold off for 3-4 seconds 
so the first box can stop it's transmitting and the second one can then 
transmit?

The channel.pl script I'm using follows:

> #!/usr/bin/perl
>
> # make sure to set this string to
> # the corresponding remote in /etc/lircd.conf
> $remote_name = "JVC_RAW_1";
>
> sub change_channel {
>         my($channel_digit) = @_;
>         system ("irsend SEND_ONCE $remote_name $channel_digit");
>         sleep 1;
> }
>
> $channel=$ARGV[0];
> sleep 1;
> if (length($channel) > 3) {
>         change_channel(substr($channel,0,1));
>         change_channel(substr($channel,1,1));
>         change_channel(substr($channel,2,1));
>         change_channel(substr($channel,3,1));
> } elsif (length($channel) > 2) {
>         change_channel(substr($channel,0,1));
>         change_channel(substr($channel,1,1));
>         change_channel(substr($channel,2,1));
> } elsif (length($channel) > 1) {
>         change_channel(substr($channel,0,1));
>         change_channel(substr($channel,1,1));
> } else {
>         change_channel(substr($channel,0,1));
> }
> system ("irsend SEND_ONCE $remote_name cancel");
> ~




More information about the mythtv-users mailing list