No red dots or missed channel changes

Discussion in 'TiVo Series 1 - UK' started by occitan, Mar 27, 2004.

  1. Mar 27, 2004 #1 of 187
    occitan

    occitan New Member

    121
    0
    Nov 22, 2002
    irblast, inspired by LJs noreddot program, runs on the TiVo in the background and can send infrared signals to external set top boxes based on the current channel, recording state and system state.

    While it is possible to customise the behaviour, the default version will send the Backup key every minute when recording from a Sky Digibox, to remove the red dot (i.e it replaces noreddot) and it also resends the digits for the current channel number, two minutes into a recording. This will make sure that the set top box is definately on the right channel. No more missed recordings because the digibox has reset itself, or a chance IR interference cause it to miss the TiVo channel change.

    If you have no external set top boxes, i.e you just record from a TV aerial, it won't do anything for you. If you use FreeView or cable, some support is included for channel changing, and it is quite easy to add support for other boxes too. If you do, please send it back to me so I can include it in the main release.

    The program can be run from rc.sysint.author, so it will be restarted automatically when the TiVo reboots (which isn't currently possible with noreddot). It also handles priorities so that it doesn't adversly affect the current playback (some previous attempts to do this resulted in a warbling in the playback sound when the infrared signals were being sent).

    The program can be suspended using the TiVo remote, by three key presses, 0 Clear Clear.
    Restart IR sending using the key sequence 1 Clear Clear.

    Many many thanks go to LJ for his original noreddot program, and to Stuart Anderton for endpad (THE best addition to any TiVo). I've swiped the Log rotation code from endpad, which I think came from LJ originally, and I've swipped the 8 clear clear code to exit the program from LJ's noreddot.


    Options [default value]:
    keydelay_boxid=ms [1000] Delay between keys in milliseconds

    NB: delay between two identical digits = 1.5*ms


    Supported boxes

    Sky: 20006, 20010, 20016, 20017
    . noreddot - sends backup key during recordings
    . channel - sends SkyKey/Backup/Backup/channel digits/Backup after 2 mins into a recording
    Options [default value]:
    + skychanneldelay=n [2] Delay n minutes from start of recording to send channel change
    + skylivepoweroff [no] Power Off when not recording
    + skylivetv [no] Also send backup for live tv

    FreeView: 20031
    . channel - sends channel digits after 2 mins into a recording
    Options [default value]:
    + freeviewchanneldelay=n [2] Delay n minutes from start of recording to send channel change

    NTL: 20035
    . channel - sends channel digits after 2 mins into a recording (keydelay_20035 defaults to 300)
    Options [default value]:
    + ntlchanneldelay=n [2] Delay n minutes from start of recording to send channel change


    How to install

    Copy ir_1.2.1.tar to the TiVo using binary mode FTP then:

    cpio -i -H tar -u -d <ir_1.2.1.tar

    Run with:

    /var/hack/ir/irblast.tcl [options]

    Stop with:

    /var/hack/ir/irblast.tcl -stop

    or press 8 Clear Clear on the TiVo remote control.

    Auto-Run at startup in /etc/rc.d/rc.sysinit.author with the -forcestart flag:

    /var/hack/ir/irblast.tcl -forcestart [options] >> /dev/null &

    To create a rc.sysinit.author type :

    mount -o remount,rw /
    echo "/var/hack/ir/irblast.tcl -forcestart >> /dev/null &" >>/etc/rc.d/rc.sysinit.author
    chmod +x /etc/rc.d/rc.sysinit.author
    mount -o remount,ro /


    An example using options :

    /var/hack/ir/irblast.tcl -forcestart skychanneldelay=1 skylivetv >> /dev/null &


    A log file is created in /var/log/irblast.log and is cycled regularly. The previous log is also kept in /var/log/Oirblast.log Both these files can be consulted using TiVoweb. The log tells you what it got up to each minute, and what it tried to send if anything.

    An error file is also created for more serious startup errors in /var/log/irblast.err

    How it works

    On startup, irblast checks to see what set top boxes are attached, and extracts the Infrared codes for the digits 0 to 9 from the TiVo database for those boxes. For each box it finds, identified by the TiVo IR code (e.g 20016 for a Sky digibox), it looks in the directory /var/hack/ir for a file called Blast_ircode.itcl (e.g Blast_20016.itcl). If the file for a given box doesn't exist, it will not do anything if the TiVo is switched to a channel on that box.

    The Blast_ircode.itcl file contains a procedure that will be called to execute an action when that box is selected.

    irblast wakes up at 15 seconds past every minute, and checks what the TiVo is up to (15s ensures no clash with standard channel changes which happen on the minute). It will then call the procedure Blast_ircode for the current set top box with the following arguments :

    &nbsp;&nbsp;chnum&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;current&nbsp;channel&nbsp;number
    &nbsp;&nbsp;isrecording&nbsp;&nbsp;&nbsp;1&nbsp;if&nbsp;currently&nbsp;recording
    &nbsp;&nbsp;wasrecording&nbsp;&nbsp;1&nbsp;if&nbsp;was&nbsp;recording&nbsp;one&nbsp;minute&nbsp;ago
    &nbsp;&nbsp;newrecording&nbsp;&nbsp;1&nbsp;if&nbsp;this&nbsp;is&nbsp;a&nbsp;new&nbsp;recording
    &nbsp;&nbsp;lastchannel&nbsp;&nbsp;&nbsp;the&nbsp;channel&nbsp;number&nbsp;one&nbsp;minute&nbsp;ago
    &nbsp;&nbsp;newchannel&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;if&nbsp;the&nbsp;channel&nbsp;has&nbsp;changed
    &nbsp;&nbsp;elapsedmins&nbsp;&nbsp;&nbsp;the&nbsp;number&nbsp;of&nbsp;minutes&nbsp;since&nbsp;the&nbsp;recording&nbsp;began
    &nbsp;&nbsp;onstandby&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;if&nbsp;the&nbsp;TiVo&nbsp;is&nbsp;on&nbsp;standby

    The Blast_ircode procedure can then determine if it wants to do anything based on these parameters. To send a channel number it uses

    SendChannel $chnum

    To send a custom button sequence it uses

    SendButtons "ircode" {"buttonname1" "buttonname2" ...}

    Where ircode is the box number and buttonnameN is the name of a button to send. For each button name, a function IR_ircode_buttonname must be defined that returns the inrfared sequence for that button. For instance :

    SendButtons "88008" {"Cancel" "OK"}

    will call the following functions
    Code:
    proc IR_88008_OK {} {
    	return "0 36 9 0 105 99 99 48 48 99 99 102 99 99 99 99 51 45 51 45 51 366"
    }
    proc IR_88008_Cancel {} {
    	return "0 36 11 0 51 48 99 51 48 48 48 99 99 99 48 48 48 48 102 48 48 48 
            48 99 48 360"
    }
    
    The main file for Sky DigiBox is contained in Blast_SkyDigiBox.itcl, which is called from individual files for each of the ircode files related to digiboxes. That file sends the Backup button every minute during recordings, and resends the channel number after two minutes into a program.
    Code:
    	if { $isrecording } {
    	
    		# Send Backup key
    				
    		SendButtons "SkyDigiBox" {"Backup"}
    		
    		# Send Channel number after 2 minutes into program (only)
    		
    		if { $elapsedmins == 2 } {
    			SendChannel $chnum
    		}
    		
    	}
    
    Where the Backup button is defined by
    Code:
    proc IR_SkyDigiBox_Backup {} {
    	return "0 50 24 0 152 51 25 25 25 25 25 49 25 49 49 25 25 25 
       25 25 25 25 25  25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 49 49 
       25 25 25 25 25 25  25 25 49 25 25 600"
    }
    
    This behaviour for any box can be easilly changed by editing the Blast_ files. New boxes can be supported by adding new Blast_ files. If you add support for a new box, please PM me your file so I can add it to the main release.

    The quit signal is sent by creating the file /tmp/blastquit

    You can easilly add new buttons using the irtest command on the tivo plus a few tools on the internet. For more info, see here. Alternatively people have managed to convert codes from Pronto CCF files.

    Also included with the Blast files is one I use to keep a VCR awake, so the TiVo can record some French channels I can receive. This should help as a non-sky example for those that might want to add support for other boxes.

    Version History
    #
    # 1.2.1 29/03/04
    # Add option to set delay between keys being sent. Default 1000ms on per box basis
    # Update Blast_SkyPlusDigiBox to send Sky Backup Backup Digits Backup
    # Add 1s pause before sending Sky digits, and 3s after, to avoid problems with Backup
    # When sending digits, if one digit is the same as previous digit, wait 1.5 * wait time
    # Added Blast_20035 for ntl cable box, with default 300ms key delay
    #
    # 1.2 28/03/04
    # Add files for Sky+
    # Add option for sky delay before channel change, and sending backup during livetv
    # Add option to power down a sky box after a recording
    # Add option for freeview delay before channel change
    # Add remote control options to suspend and restart sending IR signals
    #
    # 1.1 27/03/04
    # First Public release
     

    Attached Files:

  2. Mar 27, 2004 #2 of 187
    LJ

    LJ New Member

    786
    0
    Nov 11, 2001
    West...
    Cool - just installing it now...

    [Edit: removed note about typo as it's now fixed :)]
     
  3. Mar 27, 2004 #3 of 187
    gyre

    gyre Wookie

    382
    0
    Nov 22, 2003
    Bristol, UK
    This looks well cool, and well flexible. Excellent!

    Can you explain why this will work spawned from rc.sysinit.author, but none of the other ones will? i.e. what did you do differently to get this to work?

    Thanks!

    -- gyre --
     
  4. Mar 27, 2004 #4 of 187
    sanderton

    sanderton TiVoer since 11/2000

    6,341
    0
    Jan 4, 2002
    Superb; installed and it does indeed survive a reboot.

    The command you are issuing is the same as one I tried and failed with. I guess it's the way the script that blasts is directly called from rc.sysinit.author, not via a shell script, which makes the difference?
     
  5. Mar 27, 2004 #5 of 187
    kweller

    kweller New Member

    137
    0
    Mar 10, 2002
    Near Dover,...
    This looks really interesting and I'm just about to install it, thanks.

    Any chance you can get it to send the 'Sky' button as well to wake up a Digibox that has been sent to a sleep by a software update/power cut/whatever? Grundig 20016 (or whichever one it is that sends the 'Sky' button after the channel change) doesn't work on my ancient Amstrad Digibox as channel digits are dropped.

    Kevin
     
  6. Mar 27, 2004 #6 of 187
    sanderton

    sanderton TiVoer since 11/2000

    6,341
    0
    Jan 4, 2002
    It should do that as it stands - the TiVo generated channel change will wake the box up; the second one after two minutes will chnage channels.
     
  7. Mar 27, 2004 #7 of 187
    vassilis

    vassilis Member

    62
    0
    Apr 28, 2002
    London
    Which keystroke file should be used with SKY+?
    I have tried it with mine. The script runs but the red dot is still there :(
     
  8. Mar 27, 2004 #8 of 187
    kweller

    kweller New Member

    137
    0
    Mar 10, 2002
    Near Dover,...
    I wondered that so before I posted I tested it manually by putting the Digibox into stand-by then sending it a channel number. The box remained in stand-by and would only wake up when I pressed the Sky or power on/off butons.

    I'm probaby showing my ignorance here but isn't that why TiVo added the Sky button to Grundig 20016?

    Kevin
     
  9. Mar 27, 2004 #9 of 187
    tivo_boj

    tivo_boj Tivo is getting old

    215
    0
    Feb 10, 2001
    Pitsea,...
    Any way of putting sky to sleep ( standby ) at the end of a recording. The reason I ask is the Sky box still has a tendancy lo lock up if left on for any long period of time. This happend when I went on holiday and thus it lost recordings.

    You have already put the code in that wakes it up, so putting it to sleep meands the box is only on when recording, doing a bit for saving power as well
     
  10. Mar 27, 2004 #10 of 187
    sanderton

    sanderton TiVoer since 11/2000

    6,341
    0
    Jan 4, 2002
    Yes it sends the Sky key; are you sure you are using 20016?
     
  11. Mar 27, 2004 #11 of 187
    kweller

    kweller New Member

    137
    0
    Mar 10, 2002
    Near Dover,...
    I think you missed the last sentence on my initial post Stuart, 20016 doesn't work on my Digibox as it caused channel digits to be missed.

    Kevin
     
  12. Mar 27, 2004 #12 of 187
    LJ

    LJ New Member

    786
    0
    Nov 11, 2001
    West...
    Looking good here. :)

    Spotted one minor wrinkle: on BBC1 when the script re-transmits the channel number it causes the red dot to be redisplayed until the next backup key is sent a minute later.

    My personal preference would be for the channel to be re-sent one minute into the recording rather than two. My Sony digibox times out after 8 seconds if it hasn't received enough digits to change channels. Do other digiboxes have the same timeout?
     
  13. Mar 27, 2004 #13 of 187
    sanderton

    sanderton TiVoer since 11/2000

    6,341
    0
    Jan 4, 2002
    My Panny is about that, yes. I'd have thought it would be universal.
     
  14. Mar 27, 2004 #14 of 187
    iankb

    iankb New Member

    6,468
    0
    Oct 9, 2000
    Reading, UK
    If the recording has soft padding at the front (courtesy of EndPad), does the second channel change occur 2 minutes after the padding starts, or 2 minutes after the scheduled start?

    I too would much prefer that it sent the second channel change after just one minute, or less. No STB would wait for more than 20 seconds to clear an incomplete change.
     
  15. Mar 27, 2004 #15 of 187
    tivo_boj

    tivo_boj Tivo is getting old

    215
    0
    Feb 10, 2001
    Pitsea,...
    What about channel search when the box has reset. This happens the first time you switch to a channel, and I believe takes more than a minute.

    Could the two minute be there to ensre you do not try and change channel while its searching for channels ( which would fail to change channels).

    Just a thought.

    Imy other question still stand - anyway this script could be used you switch the set to standbay after a recording .
     
  16. Mar 27, 2004 #16 of 187
    occitan

    occitan New Member

    121
    0
    Nov 22, 2002
    LJ, thanks for the heads up, I've corrected the typo in the instructions.

    It seems to be something to do with priorities. It wasn't working before because irtest wasn't able to get access to the microcontroller of the IR serial port.

    The key was getting irtest to work directly from tcl, which allowes the priorities to be adjusted, and simplified the exercise. Just like endpad or noreddot, irblast runs at a low priority so as not to drain the TiVo completely, but changes the priority just before issuing the irtest command, and then back again.

    [UPDATE: v1.2 now sends SkyKey, Backup, Backup, Digits, Backup]

    If you setup your TiVo to use 20016-SLOW to control your SkyBox (Choose GRUNDIG as your set top box manufacturer rather than AMSTRAD). This should then send the Sky key, followed by the channel change. And if it has trouble with the channel change, irblast will send the channel change again, so the recording will be on the right channel. Add endpad too to start recordings early and nothing should be missed.

    If this still doesn't work, then yes it is also possible to send the Sky Key too. Let me know if 20016-SLOW + irblast works for you.

    [UPDATE: v1.2 includes files 20017 and 20010 for Sky+ users]

    I don't have a Sky+ terminal to test, but guessed at what should be used for Sky+. I assumed that the TiVo will be set up as IR code 20017 and that the backup key would be the same.

    The script will send the backup key during a recording from a sky channel, by default it doesn't affect the LiveTV (incase you do want to use the interactive features). Of course it also won't affect existing recordings either, as the red dot is burn't into the TiVo recording.

    If you're still not seeing the effect of the backup key every minute, could you try these commands from the command prompt, while watching LiveTV, and let me know if either of them remove the red just after you press return.

    <snipped>

    [UPDATE: v1.2 includes the option skylivepoweroff which will do just that.

    In theory yes, all we need to do is capture the power off button for Sky, add the routine to return the IR sequence and rewrite Blast_SkyDigiBox
     
  17. Mar 27, 2004 #17 of 187
    occitan

    occitan New Member

    121
    0
    Nov 22, 2002
    [UPDATE: v1.2 now sends Backup key after digits to remove red dot]

    Good point, I'll add a Backup key after the channel change.

    [UPDATE: v1.2 now includes the option skychanneldelay=n which sets the number of minutes into a recording one should send the channel change, which is still 2 by default. if n is 0, NO channel change is sent]
     
  18. Mar 27, 2004 #18 of 187
    occitan

    occitan New Member

    121
    0
    Nov 22, 2002
    The timing is from the beginning of the recording, so if endpad adds two minutes soft padding to the beginning, the second channel change will be at the original start time (i.e two minutes after the padding starts).

    Also, if you are watching LiveTV and press record, then the channel change will be resent two minutes after the start of the recording buffer. If the live buffer includes more than two mins already, no channel change is sent.

    [UPDATE: v1.2 now allows the delay to be set skychanneldelay=n. By default the value is 2. If n=0, then no channel change is sent]
     
  19. Mar 27, 2004 #19 of 187
    iankb

    iankb New Member

    6,468
    0
    Oct 9, 2000
    Reading, UK
    Thanks, nice work.

    If you are adding command-line parameters, it would be nice to be able to switch off the channel change (e.g. if delay = 0 ?), since I get very reliable channel changes at the moment.
     
  20. Mar 27, 2004 #20 of 187
    vassilis

    vassilis Member

    62
    0
    Apr 28, 2002
    London
    The SKY+ back code is

    /sbin/irtest -t /dev/ttyS0 -- 0 54 0 23 144 48 24 24 24 24 24 48 24 48 48 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 48 24 24 48 24 24 48 48 24 24 24 24 24 24 24 24 48 24 24 6277

    Vassilis
     

Share This Page