[mythtvnz] Sky setup...

Stephen Worthington stephen_agent at jsw.gen.nz
Sat Jan 16 06:46:30 GMT 2010


On Sat, 16 Jan 2010 13:09:47 +1300, you wrote:

>There are a couple of approaches to sleeping for less than a second in
>perl. One is to use the usleep() function from Time::HiRes
>http://perldoc.perl.org/Time/HiRes.html; but getting that installed
>and available to your scripts might not be straightforward, depending
>on how they are being invoked.
>
>The other is to use a side-effect of the select() function; the fourth
>argument is a fractional timeout, so you can say
> select undef, undef, undef, 0.2;
>to get a 0.2 second delay.
>
>-jim

Thanks for those, I have saved them for the next time I am doing
delays in Perl.

In the mean time, though, I have switched to using a modified version
of the sky.sh script:

=======================================================================
#!/bin/sh

REMOTE_NAME=Pace_RC-30
cmd="$1"

# If things work OK with sleep 1, try this for faster channel changes:
# sleep 0.3
sleep_amt=0.5

case $cmd in
    [0-9]*)
    # make sure we unmute by hitting vol up
    /usr/bin/irsend SEND_ONCE $REMOTE_NAME Vol+
    sleep $sleep_amt
    for digit in $(echo $1 | sed -e 's/./& /g'); do 
        /usr/bin/irsend SEND_ONCE $REMOTE_NAME $digit
        sleep $sleep_amt
    done
    ;;

    *)
        /usr/bin/irsend SEND_ONCE $REMOTE_NAME $cmd
        ;;
esac
=======================================================================

I have only done a small amount of experimentation so far, but I found
I had to increase the sleep value substantially from the original 0.1
the script was using.  I also tried 0.3, but I was still getting
errors with that.  So far, 0.5 seconds seems OK.

To go with the new script, I had to change my freqid values.  So here
is my new channum.sh script, which also has the missing Country99
channel added:

=======================================================================
#!/bin/bash
# Set the channel numbers for MythTV channels.
source /etc/mythtv/mysql.txt
mysql -u $DBUserName -p$DBPassword -h $DBHostName $DBName << EOF
/*
update channel set channum =    1 where xmltvid = "tv1.freeviewnz.tv";
update channel set channum =    2 where xmltvid = "tv2.freeviewnz.tv";
update channel set channum =    3 where xmltvid = "tv3.freeviewnz.tv";
update channel set channum =    4 where xmltvid = "c4.freeviewnz.tv";
update channel set channum =    5 where xmltvid =
"prime.freeviewnz.tv";
update channel set channum =    6 where xmltvid =
"tvnz6.freeviewnz.tv";
update channel set channum =    7 where xmltvid =
"tvnz7.freeviewnz.tv";
update channel set channum =    8 where xmltvid =
"maori-tv.freeviewnz.tv";
update channel set channum =    9 where xmltvid =
"parliament.freeviewnz.tv";
update channel set channum =   13 where xmltvid =
"tv3-plus1.freeviewnz.tv";
update channel set channum =  501 where xmltvid =
"rnz-national.freeviewnz.tv";
update channel set channum =  502 where xmltvid =
"rnz-concert.freeviewnz.tv";
update channel set channum =  503 where xmltvid =
"basefm.freeviewnz.tv";
*/
update channel set channum = 1001, freqid=1 where xmltvid =
"tv1.sky.co.nz";
update channel set channum = 1002, freqid=2 where xmltvid =
"tv2.sky.co.nz";
update channel set channum = 1003, freqid=3 where xmltvid =
"tv3.sky.co.nz";
update channel set channum = 1004, freqid=4 where xmltvid =
"prime.sky.co.nz";
update channel set channum = 1005, freqid=5 where xmltvid =
"sky1.sky.co.nz";
update channel set channum = 1006, freqid=6 where xmltvid =
"uktv.sky.co.nz";
update channel set channum = 1007, freqid=7 where xmltvid =
"vibe.sky.co.nz";
update channel set channum = 1008, freqid=8 where xmltvid =
"living-channel.sky.co.nz";
update channel set channum = 1009, freqid=9 where xmltvid =
"food-tv.sky.co.nz";
update channel set channum = 1010, freqid=10 where xmltvid =
"comedy-central.sky.co.nz";
update channel set channum = 1011, freqid=11 where xmltvid =
"e.sky.co.nz";
update channel set channum = 1012, freqid=12 where xmltvid =
"c4.sky.co.nz";
update channel set channum = 1014, freqid=14 where xmltvid =
"mtv.sky.co.nz";
update channel set channum = 1019, freqid=19 where xmltvid =
"maori-tv.sky.co.nz";
update channel set channum = 1020, freqid=20 where xmltvid =
"movies1.sky.co.nz";
update channel set channum = 1021, freqid=21 where xmltvid =
"movies2.sky.co.nz";
update channel set channum = 1022, freqid=22 where xmltvid =
"movie-greats.sky.co.nz";
update channel set channum = 1023, freqid=23 where xmltvid =
"mgm.sky.co.nz";
update channel set channum = 1024, freqid=24 where xmltvid =
"tcm.sky.co.nz";
update channel set channum = 1025, freqid=25 where xmltvid =
"rialto.sky.co.nz";
update channel set channum = 1030, freqid=30 where xmltvid =
"sport1.sky.co.nz";
update channel set channum = 1031, freqid=31 where xmltvid =
"sport2.sky.co.nz";
update channel set channum = 1032, freqid=32 where xmltvid =
"sport3.sky.co.nz";
update channel set channum = 1033, freqid=33 where xmltvid =
"sport-highlights.sky.co.nz";
update channel set channum = 1034, freqid=34 where xmltvid =
"espn.sky.co.nz";
update channel set channum = 1035, freqid=35 where xmltvid =
"trackside.sky.co.nz";
update channel set channum = 1040, freqid=40 where xmltvid =
"disney-channel.sky.co.nz";
update channel set channum = 1041, freqid=41 where xmltvid =
"nickelodeon.sky.co.nz";
update channel set channum = 1042, freqid=42 where xmltvid =
"cartoon-network.sky.co.nz";
update channel set channum = 1045, freqid=45 where xmltvid =
"playhouse.sky.co.nz";
update channel set channum = 1051, freqid=51 where xmltvid =
"mindgames.sky.co.nz";
update channel set channum = 1062, freqid=62 where xmltvid =
"juice.sky.co.nz";
update channel set channum = 1063, freqid=63 where xmltvid =
"j2.sky.co.nz";
update channel set channum = 1070, freqid=70 where xmltvid =
"discovery.sky.co.nz";
update channel set channum = 1071, freqid=71 where xmltvid =
"crime-investigation.sky.co.nz";
update channel set channum = 1072, freqid=72 where xmltvid =
"nat-geographic.sky.co.nz";
update channel set channum = 1073, freqid=73 where xmltvid =
"history-channel.sky.co.nz";
update channel set channum = 1074, freqid=74 where xmltvid =
"documentary.sky.co.nz";
update channel set channum = 1075, freqid=75 where xmltvid =
"animal-plant.sky.co.nz";
update channel set channum = 1089, freqid=89 where xmltvid =
"stratos.sky.co.nz";
update channel set channum = 1090, freqid=90 where xmltvid =
"sky-news.sky.co.nz";
update channel set channum = 1091, freqid=91 where xmltvid =
"cnn.sky.co.nz";
update channel set channum = 1092, freqid=92 where xmltvid =
"fox-news.sky.co.nz";
update channel set channum = 1093, freqid=93 where xmltvid =
"bbc-world.sky.co.nz";
update channel set channum = 1094, freqid=94 where xmltvid =
"parliament.sky.co.nz";
update channel set channum = 1095, freqid=95 where xmltvid =
"cnbc.sky.co.nz";
update channel set channum = 1098, freqid=98 where xmltvid =
"weather-channel.sky.co.nz";
update channel set channum = 1099, freqid=99 where xmltvid =
"country99.sky.co.nz";
update channel set channum = 1111, freqid=111 where xmltvid =
"shine.sky.co.nz";
update channel set channum = 1200, freqid=200 where xmltvid =
"box-office.sky.co.nz";
update channel set channum = 1201, freqid=201 where xmltvid =
"box-office201.sky.co.nz";
update channel set channum = 1202, freqid=202 where xmltvid =
"box-office202.sky.co.nz";
update channel set channum = 1203, freqid=203 where xmltvid =
"box-office203.sky.co.nz";
update channel set channum = 1204, freqid=204 where xmltvid =
"box-office204.sky.co.nz";
update channel set channum = 1205, freqid=205 where xmltvid =
"box-office205.sky.co.nz";
update channel set channum = 1206, freqid=206 where xmltvid =
"box-office206.sky.co.nz";
update channel set channum = 1207, freqid=207 where xmltvid =
"box-office207.sky.co.nz";
update channel set channum = 1208, freqid=208 where xmltvid =
"box-office208.sky.co.nz";
update channel set channum = 1209, freqid=209 where xmltvid =
"box-office209.sky.co.nz";
update channel set channum = 1210, freqid=210 where xmltvid =
"box-office210.sky.co.nz";
update channel set channum = 1211, freqid=211 where xmltvid =
"box-office211.sky.co.nz";
update channel set channum = 1212, freqid=212 where xmltvid =
"box-office212.sky.co.nz";
update channel set channum = 1213, freqid=213 where xmltvid =
"box-office213.sky.co.nz";
update channel set channum = 1214, freqid=214 where xmltvid =
"box-office214.sky.co.nz";
update channel set channum = 1217, freqid=217 where xmltvid =
"playboy.sky.co.nz";
update channel set channum = 1218, freqid=218 where xmltvid =
"fresh.sky.co.nz";
update channel set channum = 1219, freqid=219 where xmltvid =
"spice-excess.sky.co.nz";
update channel set channum = 1300, freqid=300 where xmltvid =
"ktv1.sky.co.nz";
update channel set channum = 1301, freqid=301 where xmltvid =
"ktv2.sky.co.nz";
update channel set channum = 1302, freqid=302 where xmltvid =
"jtv.sky.co.nz";
update channel set channum = 1303, freqid=303 where xmltvid =
"ctv1.sky.co.nz";
update channel set channum = 1304, freqid=304 where xmltvid =
"ctv2.sky.co.nz";
update channel set channum = 1305, freqid=305 where xmltvid =
"ctv3.sky.co.nz";
update channel set channum = 1306, freqid=306 where xmltvid =
"ctv4.sky.co.nz";
update channel set channum = 1307, freqid=307 where xmltvid =
"ctv5.sky.co.nz";
update channel set channum = 1308, freqid=308 where xmltvid =
"ctv6.sky.co.nz";
update channel set channum = 1309, freqid=309 where xmltvid =
"ctv7.sky.co.nz";
update channel set channum = 1310, freqid=310 where xmltvid =
"cctv9.sky.co.nz";
update channel set channum = 1311, freqid=311 where xmltvid =
"real-good-life.sky.co.nz";
update channel set channum = 1312, freqid=312 where xmltvid =
"new-supremo.sky.co.nz";
update channel set channum = 1400, freqid=400 where xmltvid =
"nz-chart.music.sky.co.nz";
update channel set channum = 1401, freqid=401 where xmltvid =
"pop.music.sky.co.nz";
update channel set channum = 1402, freqid=402 where xmltvid =
"smooth.music.sky.co.nz";
update channel set channum = 1403, freqid=403 where xmltvid =
"grooves.music.sky.co.nz";
update channel set channum = 1404, freqid=404 where xmltvid =
"jazz.music.sky.co.nz";
update channel set channum = 1405, freqid=405 where xmltvid =
"house.music.sky.co.nz";
update channel set channum = 1406, freqid=406 where xmltvid =
"fifties-sixties.music.sky.co.nz";
update channel set channum = 1407, freqid=407 where xmltvid =
"party.music.sky.co.nz";
update channel set channum = 1408, freqid=408 where xmltvid =
"rock.music.sky.co.nz";
update channel set channum = 1410, freqid=410 where xmltvid =
"classical.music.sky.co.nz";
update channel set channum = 1411, freqid=411 where xmltvid =
"kids.music.sky.co.nz";
update channel set channum = 1412, freqid=412 where xmltvid =
"blues.music.sky.co.nz";
update channel set channum = 1413, freqid=413 where xmltvid =
"special.music.sky.co.nz";
update channel set channum = 1500, freqid=500 where xmltvid =
"kiwi.music.sky.co.nz";
update channel set channum = 1501, freqid=501 where xmltvid =
"national.radio.sky.co.nz";
update channel set channum = 1502, freqid=502 where xmltvid =
"concert-fm.radio.sky.co.nz";
update channel set channum = 1505, freqid=505 where xmltvid =
"tahu-fm.radio.sky.co.nz";
update channel set channum = 1506, freqid=506 where xmltvid =
"calvary.radio.sky.co.nz";
EOF

exit 0
=======================================================================



More information about the mythtvnz mailing list