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

Mailing List Archive: MythTV: Users

Can I pass parameters to my channel changing script?

 

 

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


jan.ceuleers at gmail

Apr 29, 2012, 2:41 AM

Post #1 of 12 (1566 views)
Permalink
Can I pass parameters to my channel changing script?

Hi.

My cable provider is forcing me to switch to digital. I currently have
four HVR-1900 tuners connected to analogue cable. These are set up in
Myth as tuners belonging to a single video source.

I will be transitioning two of these tuners to a new (yet to be created)
video source, and will connect them to a couple of set-top boxes instead
of straight to the cable.

Since these STBs are identical I need to control them with dedicated IT
blasters. So my problem is how to tell the channel changing script which
STB to change the channel on.

I see that the LIRC channel change script on the wiki [1] is capable of
receiving a blaster number on its command line, but how do I pass it to
that script from Myth? Of course I looked on the wiki and googled.

Of course, I could create a separate video source for each STB. But I'd
rather not do that since it's redundant from the scheduler's point of
view: I'd have to load the XMLTV data into the database twice (and more
if I ever get a third/fourth STB).

[1]: http://www.mythtv.org/wiki/LircChannelChanger

Thanks, Jan
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


mtdean at thirdcontact

Apr 29, 2012, 5:19 AM

Post #2 of 12 (1528 views)
Permalink
Re: Can I pass parameters to my channel changing script? [In reply to]

On 04/29/2012 05:41 AM, Jan Ceuleers wrote:
> Hi.
>
> My cable provider is forcing me to switch to digital. I currently have
> four HVR-1900 tuners connected to analogue cable. These are set up in
> Myth as tuners belonging to a single video source.
>
> I will be transitioning two of these tuners to a new (yet to be
> created) video source, and will connect them to a couple of set-top
> boxes instead of straight to the cable.
>
> Since these STBs are identical I need to control them with dedicated
> IT blasters. So my problem is how to tell the channel changing script
> which STB to change the channel on.
>
> I see that the LIRC channel change script on the wiki [1] is capable
> of receiving a blaster number on its command line, but how do I pass
> it to that script from Myth? Of course I looked on the wiki and googled.
>
> Of course, I could create a separate video source for each STB.

Channel change script is defined per capture card--specifically so you
don't have to create separate Video Sources for the same source of TV.

> But I'd rather not do that since it's redundant from the scheduler's
> point of view: I'd have to load the XMLTV data into the database twice
> (and more if I ever get a third/fourth STB).

Just set up a different script for each capture card or--assuming the
script you're using accepts the "blaster number" before the channel
number--change your external channel change script for each capture card to:

my_channel_change_script <blasternumber>

and let MythTV stick the channel number on the end after that.

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


octoberblu3 at gmail

Apr 29, 2012, 12:05 PM

Post #3 of 12 (1520 views)
Permalink
Re: Can I pass parameters to my channel changing script? [In reply to]

On Sun, Apr 29, 2012 at 8:19 AM, Michael T. Dean
<mtdean [at] thirdcontact> wrote:
> Just set up a different script for each capture card or--assuming the script
> you're using accepts the "blaster number" before the channel number--change
> your external channel change script for each capture card to:
>
> my_channel_change_script <blasternumber>
>
> and let MythTV stick the channel number on the end after that.
>
> Mike
>

This is what I ended up doing before moving all of my recording to a
CableCard tuner.

But just as a forewarning, consider the case when you are trying to
transmit on both transmitters at the same time. (Say two recordings
fire up at once.) You need to either make sure the irsend
SET_TRANSMITTERS command come before each key sent, or use some sort
of touchfile locking to only allow one script at a time.

Good luck,
Patrick
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


gary.buhrmaster at gmail

Apr 29, 2012, 1:12 PM

Post #4 of 12 (1518 views)
Permalink
Re: Can I pass parameters to my channel changing script? [In reply to]

On Sun, Apr 29, 2012 at 19:05, Patrick Oglesby <octoberblu3 [at] gmail> wrote:
....
> But just as a forewarning, consider the case when you are trying to
> transmit on both transmitters at the same time.  (Say two recordings
> fire up at once.)  You need to either make sure the irsend
> SET_TRANSMITTERS command come before each key sent, or use some sort
> of touchfile locking to only allow one script at a time.

You have to do locking, otherwise you can have a race condition.

My recollection is that at least two of the scripts on the wiki
support locking to avoid this particular issue. The one I
use (full disclosure, I wrote it, so it is clearly biased to
what *I* needed) is called LircChannelChanger. There are
others, and the issue has been discussed on this list
previously (although I do not know if those scripts were
added to the wiki).

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


jan.ceuleers at gmail

Apr 30, 2012, 12:34 AM

Post #5 of 12 (1512 views)
Permalink
Re: Can I pass parameters to my channel changing script? [In reply to]

On 29/04/12 22:12, Gary Buhrmaster wrote:
> On Sun, Apr 29, 2012 at 19:05, Patrick Oglesby<octoberblu3 [at] gmail> wrote:
> ....
> You have to do locking, otherwise you can have a race condition.
>
> My recollection is that at least two of the scripts on the wiki
> support locking to avoid this particular issue. The one I
> use (full disclosure, I wrote it, so it is clearly biased to
> what *I* needed) is called LircChannelChanger. There are
> others, and the issue has been discussed on this list
> previously (although I do not know if those scripts were
> added to the wiki).

Thanks Gary. I do indeed plan to use your script as the basis for mine.

I'll have to do some hacking though, because I also want to save some
power by powering the STBs down when not in use, so I'll have to power
them up from the channel changing script as well.

Mike, happy to hear that the channel changing script is a property of
the tuner rather than of the video source. When I'm done I'll go and
make this clear on the wiki though, because it says in several places
that it's in the video sources.

Cheers, Jan
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


huffcslists at gmail

Apr 30, 2012, 4:09 AM

Post #6 of 12 (1513 views)
Permalink
Re: Can I pass parameters to my channel changing script? [In reply to]

On Sun, Apr 29, 2012 at 3:12 PM, Gary Buhrmaster
<gary.buhrmaster [at] gmail> wrote:
> On Sun, Apr 29, 2012 at 19:05, Patrick Oglesby <octoberblu3 [at] gmail> wrote:
> ....
>
> You have to do locking, otherwise you can have a race condition.
>
> ....

I have been using the script "change-channel-lirc.pl" for three of my
Comcast DTAs. I had not considered the issue of a race condition
before now and in over a year of usage I have seen no evidence of such
an issue. I don't see anything in this script to prevent this
problem, but scanning through my mythbackend.log files, it looks like
the cases where multiple recordings start at the same time is handled
by mythbackend issuing the tuning commands in sequential order, rather
than concurrently. Have I just been lucky (perhaps due to using a
single-core processor for most of the time and only recently upgrading
to a dual core CPU) or is the risk of a race condition not so
clear-cut?

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


briandlong at gmail

Apr 30, 2012, 5:12 AM

Post #7 of 12 (1510 views)
Permalink
Re: Can I pass parameters to my channel changing script? [In reply to]

On Mon, Apr 30, 2012 at 3:34 AM, Jan Ceuleers <jan.ceuleers [at] gmail>wrote:

> On 29/04/12 22:12, Gary Buhrmaster wrote:
>
>> On Sun, Apr 29, 2012 at 19:05, Patrick Oglesby<octoberblu3 [at] gmail>
>> wrote:
>> ....
>> You have to do locking, otherwise you can have a race condition.
>>
>> My recollection is that at least two of the scripts on the wiki
>> support locking to avoid this particular issue. The one I
>> use (full disclosure, I wrote it, so it is clearly biased to
>> what *I* needed) is called LircChannelChanger. There are
>> others, and the issue has been discussed on this list
>> previously (although I do not know if those scripts were
>> added to the wiki).
>>
>
> Thanks Gary. I do indeed plan to use your script as the basis for mine.
>
> I'll have to do some hacking though, because I also want to save some
> power by powering the STBs down when not in use, so I'll have to power them
> up from the channel changing script as well.
>
> Mike, happy to hear that the channel changing script is a property of the
> tuner rather than of the video source. When I'm done I'll go and make this
> clear on the wiki though, because it says in several places that it's in
> the video sources.
>

Jan, before you go to the extra effort, make sure the STBs actually pull
less power when "powered off". The reason I say this is that most STBs
pull the same amount of power once they are plugged in whether or not the
power light is on. The power button in my experience only disables the
outputs (like component, HDMI, DVI, etc). The STB still pulls 20-30W of
power meaning your effort to power off when idle might be wasted.

/Brian/


jan.ceuleers at gmail

Apr 30, 2012, 5:26 AM

Post #8 of 12 (1505 views)
Permalink
Re: Can I pass parameters to my channel changing script? [In reply to]

On 30/04/12 14:12, Brian Long wrote:
> On Mon, Apr 30, 2012 at 3:34 AM, Jan Ceuleers <jan.ceuleers [at] gmail
> <mailto:jan.ceuleers [at] gmail>> wrote:
> I'll have to do some hacking though, because I also want to save
> some power by powering the STBs down when not in use, so I'll have
> to power them up from the channel changing script as well.
>
> Jan, before you go to the extra effort, make sure the STBs actually pull
> less power when "powered off". The reason I say this is that most STBs
> pull the same amount of power once they are plugged in whether or not
> the power light is on. The power button in my experience only disables
> the outputs (like component, HDMI, DVI, etc). The STB still pulls
> 20-30W of power meaning your effort to power off when idle might be wasted.

Thanks Brian. My STBs have a power-saving setting that causes them to
really power down after having been on standby for a programmable amount
of time. They then take a while to boot, so I'll need a smart variant of
the black-detection script that's also out there [1].

[1]:
http://evuraan.blogspot.com/2008/01/how-to-ensure-set-top-box-stb-is.html

Cheers, Jan
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


wepprop at gmail

Apr 30, 2012, 5:49 AM

Post #9 of 12 (1511 views)
Permalink
Re: Can I pass parameters to my channel changing script? [In reply to]

On Apr 30, 2012, at 2:34 AM, Jan Ceuleers <jan.ceuleers [at] gmail> wrote:
>
> I'll have to do some hacking though, because I also want to save some power by powering the STBs down when not in use, so I'll have to power them up from the channel changing script as well.
>
Check before you go to the bother of switching STB's off and on - my satellite receivers use exactly the same amount of power when they are "off" as they do when they are "on". The only thing "off" does is kill the output and turn off the front panel LED.
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


octoberblu3 at gmail

Apr 30, 2012, 7:32 AM

Post #10 of 12 (1504 views)
Permalink
Re: Can I pass parameters to my channel changing script? [In reply to]

On Mon, Apr 30, 2012 at 7:09 AM, Craig Huff <huffcslists [at] gmail> wrote:
> On Sun, Apr 29, 2012 at 3:12 PM, Gary Buhrmaster
> <gary.buhrmaster [at] gmail> wrote:
>> On Sun, Apr 29, 2012 at 19:05, Patrick Oglesby <octoberblu3 [at] gmail> wrote:
>> ....
>>
>> You have to do locking, otherwise you can have a race condition.
>>
>> ....
>
> I have been using the script "change-channel-lirc.pl" for three of my
> Comcast DTAs.  I had not considered the issue of a race condition
> before now and in over a year of usage I have seen no evidence of such
> an issue.  I don't see anything in this script to prevent this
> problem, but scanning through my mythbackend.log files, it looks like
> the cases where multiple recordings start at the same time is handled
> by mythbackend issuing the tuning commands in sequential order, rather
> than concurrently.  Have I just been lucky (perhaps due to using a
> single-core processor for most of the time and only recently upgrading
> to a dual core CPU) or is the risk of a race condition not so
> clear-cut?
>
> Craig.


If you have separate devices for each STB, then you will never have
this problem. It can happen when you have 2 or more transmitters from
a single lirc device, like many of the mceusb receiver/transmitters
out there.

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


huffcslists at gmail

Apr 30, 2012, 8:18 AM

Post #11 of 12 (1501 views)
Permalink
Re: Can I pass parameters to my channel changing script? [In reply to]

Like the three ports in use on my USB IguanaIR?

Craig.


jan.ceuleers at gmail

May 7, 2012, 11:17 AM

Post #12 of 12 (1372 views)
Permalink
Re: Can I pass parameters to my channel changing script? [In reply to]

On 30/04/12 09:34, Jan Ceuleers wrote:

> Mike, happy to hear that the channel changing script is a property of
> the tuner rather than of the video source. When I'm done I'll go and
> make this clear on the wiki though, because it says in several places
> that it's in the video sources.

Done:

http://www.mythtv.org/wiki/LIRC#IR_Transmission_.28from_MythTV.29


Jan
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/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.