[mythtv-users] No signal lock when trying to watch live TV - HDHR DVB-C Telenet (Belgium)

Jan Ceuleers jan.ceuleers at gmail.com
Sat Oct 19 09:07:35 UTC 2019

On 19/10/2019 10:01, Stephen Worthington wrote:
> On Sat, 19 Oct 2019 08:44:14 +0200, you wrote:
>> On 18/10/2019 21:06, Klaas de Waal wrote:
>>> Setting /sys/dvbc_modulation to the correct value before starting
>>> mythbackend should be enough. It then should work with the
>>> "...auto..." tuning commands generated by mythtv.
>> For me setting /sys/dvbc_modulation before starting the backend isn't
>> enough. I have to issue explicit channel commands as well, such as
>> hdhomerun_config 1420577E set /tuner1/channel a8qam256-6875:298
>> I'll now try and find an appropriate event to use for this purpose.
> I think the event you will need is "Recording pending"
> (EventCmdRecPending in the settings table).  This happens shortly
> before a recording starts, and allows you to do things like wake up
> hard drives or power on a set to box.  Then the "Recording started"
> event happens (EventCmdRecStarted) when mythbackend actually starts
> using the tuner.

Thanks Stephen.

I've actually set the following as the handling script for 3 events (one
of which I know to be extraneous but I don't yet know which-one), namely
EventCmdRecStarted, EventCmdPlayChanged, and EventCmdLivetvStarted.

(I'm using database terminology above because the backend is currently
running and I can't stop it to check what names these events have in
mythtv-setup, but I did use the official method for configuring them).

I attach the script, and it needs to be called as an event handler with
%CARDID% and %CHANID% as parameters.

Thanks to you and Klaas for setting me on the right track.

Thx, Jan
-------------- next part --------------

# Call as event script with parameters %CARDID% and %CHANID%

# Parameters

/usr/bin/logger $0 $*
if [ "$1" == "%CARDID%" ] ; then
   exit 0

SOURCEID=`/usr/bin/mysql -umythtv -pmythtv -s -N -e "SELECT sourceid FROM capturecard WHERE cardid=$1;" mythconverg`

if [ "$SOURCEID" != "$OURSOURCEID" ] ; then
  exit 0

MPLEXID=`/usr/bin/mysql -umythtv -pmythtv -s -N -e "SELECT mplexid FROM channel WHERE chanid=$2 AND sourceid=$SOURCEID;" mythconverg`

FREQ=`/usr/bin/mysql -umythtv -pmythtv -s -N -e "SELECT frequency FROM dtv_multiplex WHERE mplexid=$MPLEXID;" mythconverg`

TUNER=`/usr/bin/mysql -umythtv -pmythtv -s -N -e "SELECT RIGHT(videodevice,1) from capturecard where cardid=$1;" mythconverg`

/usr/bin/logger Issuing command /usr/bin/hdhomerun_config $OURHDHRDEVICE set /tuner$TUNER/channel $OURDVBCMOD:$FREQ
/usr/bin/hdhomerun_config $OURHDHRDEVICE set /tuner$TUNER/channel $OURDVBCMOD:$FREQ

More information about the mythtv-users mailing list