[mythtv-users] Channel change script works, but not in mythtv
Jan Ceuleers
jan.ceuleers at gmail.com
Mon Jan 20 07:17:30 UTC 2014
On 01/19/2014 07:45 PM, Raymond Norton wrote:
> Any ideas?
Another attempt.
When you're successfully running your channel change script from the
command line, are you doing so as the same user as the one which runs
the backend (which is usually mythtv)?
If not, there may be relevant differences in the permissions and the
environment.
In addition to Bill's suggestion (turn on more verbose logging in myth)
I would also recommend adding logging to the channel change script
itself. Adding the following line to the beginning of your script will
log its invocation ($0) and its parameters ($*), so that you can verify
that the backend is calling the script in exactly the way that you are
expecting.
logger $0 $*
On my Ubuntu system, /usr/bin/logger is part of the bsdutils package.
Another suggestion. If you have more than one STB which needs to be
IR-controlled then there is a possibility of clashes between two
simultaneous channel changes. This needs to be resolved by means of a
locking mechanism that makes sure that one or the other channel change
sequence is fully executed before the other.
So the following sequence is bad:
# thread 1: set STB1 to channel 123
irsend SET_TRANSMITTERS 1
irsend Num1
# thread 2: set STB2 to channel 456
irsend SET_TRANSMITTERS 2
irsend Num2
irsend Num4
irsend Num3
irsend Num5
irsend Num6
because this will cause 1 to be sent on blaster 1 and 24356 on blaster 2.
The way I deal with this on my system is to use a script called
LircChannelChanger, written by Gary Buhrmaster (frequent contributor to
this list), which has all the locking built in.
http://www.mythtv.org/wiki/LircChannelChanger
I then call the script with wrappers such as:
#!/bin/bash
#
# Parameters:
# $1: channel number (e.g. 120)
~mythtv/powerup_stb /dev/videop0 1
~mythtv/LircChannelChanger --remote=digibox --transmitter=1
--delay=0.020 --digitprefix=Num $1
You might not need the layer of wrappers if you don't need to do
anything other than actually changing the channel; I also want to make
sure that the STB is powered on.
HTH, Jan
More information about the mythtv-users
mailing list