Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Users

Simultaneous IRblaster channel changes fubar'd

 

 

MythTV users RSS feed   Index | Next | Previous | View Threaded


fairlane at springcom

Dec 4, 2004, 9:54 AM

Post #1 of 3 (2548 views)
Permalink
Simultaneous IRblaster channel changes fubar'd

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");
> ~


_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


wmunson at rochester

Dec 4, 2004, 1:40 PM

Post #2 of 3 (2438 views)
Permalink
RE: Simultaneous IRblaster channel changes fubar'd [In reply to]

>
> I'm having an issue with simultaneous channel changes on a
> homebrew ir
> blaster.

Simplest way would be to have myth call a shell script that does a sleep(2)
and then executes your program. This will keep you from doubling up but it
adds time to every change. A better way would be to add support for a lock
file to your script. Thats what I did in my MyBlaster script and it works
well. Search the archives if you are interested in looking at my script.

Bill


fairlane at springcom

Dec 4, 2004, 2:57 PM

Post #3 of 3 (2430 views)
Permalink
Re: Simultaneous IRblaster channel changes fubar'd [In reply to]

William wrote:

>>I'm having an issue with simultaneous channel changes on a
>>homebrew ir
>>blaster.
>>
>>
>
>Simplest way would be to have myth call a shell script that does a sleep(2)
>and then executes your program. This will keep you from doubling up but it
>adds time to every change. A better way would be to add support for a lock
>file to your script. Thats what I did in my MyBlaster script and it works
>well. Search the archives if you are interested in looking at my script.
>
>Bill
>
>
A lock file sounds more elegant. If myth is trying to run both scripts
at the same time, and one is lockfiled, will the second script run as
soon as the lockfile is removed?
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

MythTV users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.