Version history
===============
Version 1.10  - 20030919    Added support for SU1278 tuner ('Tuner').
Version 1.09  - 20030912    Added local INI file option. If a local 'TTPClineBudget.ini'
                            file exists then it is used instead of the applications ini
                            file.
                            Added log capability ('LogLevel': only supported when
                            local INI file is used) and 'LogClear'.
                            Added 'HandleMdApi' setting which makes the driver
                            handle some additional MDAPI calls.
Version 1.08  - 20030905    Possible range check error when debug form is showing
                            resolved (videorate).
                            'CSA' setting allows for using an external software
                            common scramble algorithm DLL instead of the
                            internal mechanism.
Version 1.07  - 20030905    'TSBufferSize' is internally changed to the maximum
                            size possible if requested buffer is too large.
                            Termination behaviour corrected: when driver was
                            terminated it was 'stalled' if the program tuned on
                            did not have 'packets'.
                            Changing the channel wil reset the 'Overtaken' counter.
Version 1.06  - 20030903    Added 'TSBufferSize' setting for setting the buffer size.
Version 1.05  - 20030829    Added 'DisplayOff' setting for having no video/audio
                            output at all (mainly for recording purposes as 'slave').
                            Added special remote control codes to support this
                            setting by means of the remote.
                            Manual DiSEqC commands form within debug form now also 
                            refresh frequency / polarization / symbolrate to make 
                            sure channel is re-tuned on.
                            De-initialization of 'slaves' modified so the 'master'
                            keeps operating when a 'slave ' is terminated.
                            Remote control also supports multiple devices now.
                            Range check eror when debug form is active and packet
                            count overflows resolved.
Version 1.04  - 20030820    Support for multiple instances of WinSTB (watching/
                            recording multiple programs of the same provider).
                            'DisplayDuringRecording' setting now locally handled
Version 1.03  - 20030819    Added lower possible thread
                            priorities (mainly for testing buffering).
                            Option to select the streams to use for recording.
                            DiSEqC 1.2 issues a 'stop movement' at initialization.
                            Video rate indication.
                            External software common scramble algorithm DLL 
                            no longer supported (this is now handled internally).
                            The internal handler corrects some 'hickups' appearing
                            in some programs when using an old version of this
                            external DLL.
Version 1.02t - 20030813    Additional buffering added.
                            LNB1 settings used for DiSEqC 1.2
                            Only valid PIDs are recorded.
Version 1.01t - 20030810    Added priority mechanism which increases
                            reliability dramatically.
Version 1.00t - 20030809    Early test release.




For the last update or for more information visit the author at
   www.majority.nl
Author: 
  Marcel Majoor
E-mail:
  m.majoor@majority.nl



This is the README file for the TechnoTrend PC-line budget driver (also
known as WinTV NOVA, WinTV-NOVA-CI-s model 546 and SkyStar3(?)) for WinSTB.

Contents of this package:
  Drivers\SAA7146A.SYS     Driver for DVB-S card
  Drivers\SAA7146A.INF     Install file for driver
  TTPCLINEBUDGET.DLL       Driver support for WinSTB
  README.TXT               This file
  INTERVIDEO.GRF           Sample graphics filter file using InterVideo decoder
  CYBERLINK.GRF            Sample graphics filter file using CyberLink decoder


Feautures:
  . Supports the remote control as supplied with some cards (supports EVERY RC5 type
    remote control)
  . DiSEqC control (also supports positioner control but has not been fully tested)
  . Signal level quality indication (indication only)
  . Supports recording of the transport stream (.ts) (use PVAStrumento to
    convert it to an audio/video stream for further processing)
    Note: PVAStrumento only supports streams with both audio and video,
          so recordings from radio (with audio only) can not be converted with PVAStrumento!
  . Software common scrambling algorithm supported. Does not need an external handler (DLL)
    for this to work.


Known issues (NOT necessarily related to the driver!):
  . On some channels (eg. data channels) WinSTB (the application) 
    stops with an error.
    This is because of an error of the audio filter.
    This happens when using the CyberLink audio decoder (as in
    CYBERLINK.GRF) This does NOT happen with the InterVideo audio
    decoder (as used in INTERVIDEO.GRF).
  . When using remote control some commands are not handled properly
    (by application ?), especially Red/Green/Blue/EPG commands.
    This is an application 'problem'. Adding <ProcessMessages>
    in the driver seems to change the behaviour.... (no <ProcessMessages>
    have been added in the driver though since it is application related).


Installation:
  To make WinSTB work with this card the following has to be done:
  1. Install the **device driver** as supplied in the 
     WinSTB_directory\DRIVERS\TTPCLINEBUDGET\DRIVER subdirectory.
     Most likely there is already another device driver for the card, so this one
     has to be replaced by the new one ('update' the original device driver).
     The SAA7146A.SYS device driver works for Windows 98/W2000/XP systems and
     identifies itself as 'SAA7146A generic driver' or 'SAA7146A'.
  2. Make sure the TTPCLINEBUDGET.DLL file is located in the following
     directory:
     WinSTB_directory\DRIVERS\TTPCLINEBUDGET\
  3. Change the driver selection of WinSTB by editing the 'settings.ini' file
     to:
     [Hardware]
     DVBType=TTPClineBudget

     Note: DON'T use the hardware setup utility build-in WinSTB to change
           the DVB hardware because the application has no knowledge of
           the existence of the driver and hence will not display the
           driver option. This might change in future releases of WinSTB.
  4. Install DirectX 9 if it has not already been installed on your system.
  5. Make sure the WINSTB.GRF is 'operable'. 
     First make sure that the file 'usrc.ax' has been registered using 'register.bat'.
     The default supplied WINSTB.GRF with WinSTB typically needs a decoder 
     attached to it to get a picture and sound.
     The two sample GRF files in this package can be used if either an InterVideo
     decoder is installed or a CyberLink decoder (see 'known issues' for using the
     CyberLink decoder). Copy them to the WinSTB directory with the name 
     'WINSTB.GRF' to have WinSTB use it.
     You can always make your own GRF file, but you need Microsofts GraphEdit to
     do this.


NOTE NOTE NOTE
The driver tries to locate a setting from it's local ini file first
(TTPClineBudget.ini) and if no definition exists it tries to use the
applications ini file (WinSTB.ini).


The following rules apply to the local ini file (and not necessarily to the
applications ini file):
A parameter can be enclosed in either ' or " to indicate a string - this allows
the inclusion of spaces and such.
Each definition can be followed by a comment, which is inidcated by a ';'.
Examples
  [Debug]
  xxx= 'Yes'   ; This will translate into Yes without any quotes!
  xxx= '"Yes'  ; This will translate into "Yes
  xxx= Yes     ; This will translate into Yes
  xxx= "Yes "  ; This will translate into Yes  with a trailing space!

The driver uses settings which are not case sensitive. This means that 'Yes' and
'yes' are interpreted the same by the driver (this is not necessariliy the case
for the WinSTB application!).



Remote control:
  The driver supports any RC5 type infrared remote control
  using the supplied infrared receiver of the card (it is assumed
  the DVB-S card has been supplied with both a receiver and an
  infrared control here).
  Only limitation is that only the standard RC5 protocol is supported
  and not the extended protocol (this is a limitation of the hardware
  on the card, and not of the driver).

  [Remote]
  Device=?   Identifies the device type (0..31)
             Use '0' (TV) here for the original supplied remote control
  Key?=?     Where the first '?' stands for the command code (0..63) and the second
             '?' for the command (text) send to the application.
  
  Extended/Alternative method:
  KeyXxYy=?  Where 'Xx' is the device type (always two characters, value in decimal)
             and Yy is the commands code (always two characters, value in decimal)
             The '?' is the text for the command to send to the application
             Example:
               Key0315=Up    -> device 3, command 15, 'Up' send to the application
  
  Note: First the extended settings are searched for and when it is not found the
        original setup is used.

  The text you can send to the application are (these are not necessarily supported, or
  have an actual function):
    Power TV Radio Mute 1 2 3 4 5 6 7 8 9 0  Red Green Yellow Blue White Back Menu Up Down
    Left Right Ok VolumeUp ProgUp Question EPG VolumeDown ProgDown FullScreen RCL
    lRed lGreen lYellow lBlue ?

  
  Below is a sample which can be used with the original remote.
  Some have a different function assigned to them then maeked on the remote.
    FYI: The layout/codes generated by the original remote are
           TV         CH+         RADIO         -->  15  32  12
          VOL-    FULL SCREEN     VOL+          -->  17  46  16
          MUTE        CH-         SOURCE        -->  13  33  34
            1          2            3           -->  1   2   3
            4          5            6           -->  4   5   6
            7          8            9           -->  7   8   9
         RESERVED      0         MINIMIZE       -->  30  0   38
    
    Device=0
    Key0=0
    Key1=1
    Key2=2
    Key3=3
    Key4=4
    Key5=5
    Key6=6
    Key7=7
    Key8=8
    Key9=9
    Key12=Menu
    Key13=Mute
    Key15=Back
    Key16=Right
    Key17=Left
    Key30=EPG
    Key32=Up
    Key33=Down
    Key34=Red
    Key38=RCL
    Key46=Ok
    
    Alternatives for above:
    Key0000=0
    Key0001=1
    Key0002=2
    ....
    Key0046=Ok
                         
    
    Special remote control commands:
    Key??=DisplayOn        Switches the realtime video/audio on    (freeze on)
    Key??=DisplayOff       Switches the realtime video/audio off   (freeze off)
                           (equivalent with 'DisplayOff' setting)
    Key??=DisplayToggle    Toggles the realtime video/audio on/off (freeze toggle)
    
    
    
Debug form:
  The driver has a debug screen which can be enabled by adding the following line:

  [Debug]
  TTPClineBudgetForm=Yes
  
  The debug screen of the driver can also be used to control DiSEqC devices. This
  is handy if one wants to setup the positions of satellites for a positioner or
  want to have some manual control.
  
  Notes on some of the information items:
  PIDs box:               These are the currently active PIDs (as set for the active channel)
  Packet buffers:         The number of buffers received. A single buffer consists of 1024
                          packets of 188 bytes each (about 200Kb).
  ms/buffer:              Time spacing in ms for each packet buffer arriving.
  Overtaken:              Indicates that data would have been lost if no additional buffering
                          was available. This value is incremented everytime the driver 
                          already has data available before previous data has been processed.
                          Buffering time currently is about 0.4 seconds.
  RC5:                    Shows the last received remote control code (+ repeat indication 
                          and command as send to application). 'RC5 0 43' means 'device 0', '
                          command 43'.
  Filter calls:           Number of single packets send to the different filters.
  Filters defined:        Displays the number of filters and the PID identications for 
                          these filters. These are typically the same as the PIDs in
                          the PIDs box with some additions (eg. EPG).
  Estimated video rate:   Shows an approximation of the bitrate of the current video stream.
  Debug:                  Miscellaneous
    
    
DiSEqC:
  The driver itself also supports DiSEqC 1.2, meaning that it can control a positioner
  using satellite positions (instead of using DiSEqC 1.0 which only supports
  a positioner with 4 positions).
  For this the [DiSEqC] section is used.
  
  [DiSEqC]
  DiSEqCType=1.2         Set this to 1.2 for positioner control
  LNB?Source=?           The driver uses the number in LNB?Source for the
                         satellite selection.
  Example:
  LNB56Source=E19.2S Astra 1B,1C,1E,1F,1G,1H    will send position '56' to the positioner.
  
  Note: Although the driver supports this, the application may not allow for it.
        This is an untested feature.
        For the type of LNB (LOF1/LOF2) the settings for LNB1 are used.
  
  When using DiSEqC devices which are cascaded, the DiSEqC commands need to be repeated,
  so the commands are passed on properly. If two DiSEqC devices are cascaded the
  repeat is typically set to '1'. For three cascaded devices the repeats should be set
  to '2', etc. The following setting makes the number of repeats variable:
  [DiSEqC]  
  RepeatCommand=1        Sets repeats to '1' (default)
    
    
    
Additional settings used by the driver:
  [Hardware]
  ThreadPriority=        Default is 'Default'.
                         The priority used for processing the data.
                         Valid values are: 'Lowest', 'Low', 'Normal', 'Default', 'High', 
                         'Highest, 'Realtime'.
                         The default setting used is 'High' (same as 'Default')
                         Note: For time critical operations set this to 'Realtime'
                         The low priority settings can be used to test the buffering 
                         capability of the system (you should see an increase of the
                         'Overtaken' counter if the debug screen of the driver is shown.
  
  [Hardware]
  Tuner=                 Default is 'BSRU6'.
                         Sets the tuner control the driver uses.
                         Valid values: 'SU1278'
                         If the driver does not work with the TTPCline budget card then it might
                         be due to a different tuner.
                         Note: This is an optional setting. When during initialization an error
                               is detected then the alternative tuner is used, so in a way
                               'detection' is automatically. Setting this to the correct tuner
                               only speeds things up (this applies to setting it to 'SU1278' only
                               because 'BSRU6' is used by default).

  [Recording]
  IncludeInTSRecording=  Default is 'Video, Audio, PMT, PCR'.
                         The stream types to be included in the recording are given here.
                         The indicated streams are only recorded if they are 'activated'
                         by the application!
                         Example:
                           IncludeInTSRecording=audio,video,pmt,pcr
                         This, by the way, is the default; all the major streams belonging 
                         to the current program are recorded.
                         The streams which can be included are:
                           audio, video, pmt, pcr, ecm, sid, ac3, teletext
                         Note: You typically need at least 'audio,video,pmt' if you use
                               PvaStrumento to convert the stream. 
                         Note: Some plugins can remove certain streams from being processed.
                               If this is the case then these are not recorded!

  [Debug]                               
  TTPClineBudgetSlave=   Default is 'Yes'.
                         The driver supports a slave mechanism, so multiple instances of
                         WinSTB (eg. it has been started multiple times) are supported. This
                         allows simultaneous watching or recording of different programs,
                         although they must be from the same provider.
                         If this settings is set to 'Yes' it will act as a slave if there is
                         already an instance of WinSTB running. If set to 'No' then it will
                         always act as a master. Note that two instances both acting as master
                         will result in incorrect behaviour.
                         If the first instance of WinSTB is started it will act as a master.
                         When a second instance (or third or fourth..) is started it will be
                         set as a slave. The slaves have no control over the hardware.
                         Beware that the master must be closed as the last one. If it is closed
                         before the slaves are closed, errors might occur.
                         Requirement for successful recordings:
                           'ThreadPriority=Realtime'
                         Advice:
                           . Use different copies of WinSTB for each program. This way the settings
                             are also retained correctly. Otherwise you most likely will get
                             runtime errors....
                           . You might set one of the instances as being a fixed master
                             (TTPClineBudgetSlave=No) so hardware is always guaranteed to be
                             correctly initialized. Always start with that instance and then 
                             start the others.
                           . Set 'DisplayDuringRecording' to 'No' or set 'DisplayOff' to 'Yes'
                         Note: Since the audio is shared when watching multiple programs you have
                               to mute the other programs to isolate the audio for a particular
                               program.
                         Note: If WinSTB crashes for some reason it might be that not all of the
                               driver is removed from memory. This means that at a restart the driver
                               detects another instance of the driver and switches to slave mode
                               (assuming 'TTPClineBudgetSlave=Yes'). This can be prevented by changing
                               this setting (momentarily) to 'No' which forces master mode. Note
                               that this only forces the master mode, the old driver data is not
                               removed by this; only memory used for buffering of data packets is
                               removed by this.

  [Debug]                               
  LogLevel=              Default is '0'.
                         The number (0-5) indicates what needs to be logged. The higher the number the
                         more is logged.
                         If this setting is not present (or 0) then no log file is used.
                         Note: Only supported for the local ini file. Placing this in the application
                               ini file has no impact.

  [Debug]                               
  LogClear=              Default is 'Yes'.
                         If set to Yes then the log file is always cleared, otherwise log data is appended.
                         Note: Only supported for the local ini file. Placing this in the application
                               ini file has no impact.


  [Interface]
  DisplayOff=            Default is 'No'.
                         Switches video/audio output off. Can be used for 'silent' recordings.
                         You will still have an OSD display but no actual video/audio.
                         This decreases the 'load' on a 2.4GHz system by about 30% (typical load
                         of the system is about 60%; without video/audio about 30%). Especially
                         suited when simultaneous recordings are being made from different programs
                         on the same transponder.
                         Note: Don't be fooled to think that just minimizing the WinSTB display screen
                               switches off the output (and thereby reducing the load on the system).
                               When minimized, all data is still being processed/send to the
                               video/output processoring parts (ActiveX) and therefore the load on
                               the system keeps the same.
                               On a typical 2.4GHz system two running instances of WinSTB can not
                               produce an uninterrupted visual display of both channels.

  [Interface]
  HandleMdApi=           Default is 'No'.
                         When set to 'Yes' the driver will handle some additional MDAPI calls
                         which are otherwise handled by the application:
                         . MDAPI_START_FILTER
                         . MDAPI_STOP_FILTER

                         By default the driver handles only one MDAPI command:
                         . DVB_COMMAND (when 'Cmd_laenge' is 7)

  [Interface]
  TSBufferSize=          Default is '400'.
                         Sets the size (in milliseconds) for the buffer to set aside for acquiring
                         the data as received from the satellite.
                         The smallest buffer size allowed is 40 ms and the largest one 5000 (5 seconds).
                         According to the value here the actual buffer size (memory size) is
                         calculated. It is assumed that a single buffer takes about 20 ms to be
                         filled so a setting of 400 ms will use 20 buffers in total (a single buffer
                         of 20 ms requires appr. 200 kB).
    
  [Interface]
  CSA=                   Default is ''.
                         Sets the external file for the common scrambling algorithm.
                         Example:
                           CSA=csa.dll
                         This file typically resides in the same directory as the WinSTB executable.
                         By default the internal mechanism is used.
                         

    
The following is a summary of all settings in <settings.ini> or <ttpclinebudget.ini>
which are used by the driver:
  [DiSEqC]
  DiSEqCType=
  LNB?Source=
  RepeatCommand=

  [LNB]
  LNB?Type=
  LNB?LOF1=9750
  LNB?LOF2=10600

  [Hardware]
  DVBType=TTPClineBudget          *** REQUIRED IN THE APPLICATION INI FILE
  ThreadPriority=
  Tuner=

  [Debug]
  TTPClineBudgetForm=
  TTPClineBudgetSlave=
  LogLevel=
  LogClear=

  [Interface]
  DisplayDuringRecording=
  DisplayOff=
  HandleMdApi=
  TSBufferSize=
  CSA=

  [Recording]
  RecordDirectory=
  IncludeInTSRecording=

  [Remote]
  Device=
  Key?=
  Key????=
