[linux-dvb] DVB-S streams with TT3200

laasa laasa at gmx.de
Sat May 5 02:56:52 CEST 2007


with some adaptions in manus snapshot at 
http://jusst.de/manu/stb0899-v4l-dvb.tar.bz and the szap-sources from 
/http://dev.kewl.org/tmp/hvr4000/szap2.tgz /I can get  (sometimes) 
DVB-S-streams *(not DVB-S2)* on my TT3200 board.

*Envoirenment:*

    * TT3200 (SAA7146AH, STB0899 C2L, STB6100, LNBP21 PD, 27000 MHz,
      board B2S3000 Rev 1.0 TT2006.1)
    * Tested with Linux-Kernel 2.6.16-45 (from kernel.org)  and
      2.6.17-chw-8 (MythTV R5D1): must be <= 2.6.17

*Patches:*
*linux/drivers/media/dvb/ttpci/budget.c*

    ...
    #include "stb0899_reg.h"
    *#include "stb6100.h"*
    #include "dvb_frontend.h"

    *struct stb6100_config tuner_stb6100_config = {
        .tuner_address = 0x60,
        .refclock      = 27000000,
    };*

    /* KNC1 DVB-S (STB0899) Inittab    */
    static const struct stb0899_s1_reg knc1_stb0899_s1_init_1[] = {
    ... /* aus budget-av.c kopiert */
    };

    *static int tt3200_pll_set_frequency(struct dvb_frontend *fe, u32
    frequency)*
    *{*
    *    struct budget* budget = (struct budget*) fe->dvb->priv;*
    *    struct tuner_state stb6100_tuner_state;*
    *    if ( budget->dvb_frontend->ops.tuner_ops.set_state ) {*

    *        stb6100_tuner_state.frequency = frequency;*

    *//        printk("%s frequency=%d\n",__func__,frequency);*

    *        budget->dvb_frontend->ops.tuner_ops.set_state(*
    *            fe,DVBFE_TUNER_FREQUENCY,*
    *            &stb6100_tuner_state);*

    *        /* FIXME !*
    *         * This is just a hack because dvb-pll is too rigid*
    *         * will need to adjust dvb-pll to avoid unpleasant*
    *         * issues like this !*
    *         */*
    *        msleep(200);*
    *    }*

    *    return 0;*
    *}*

    *static int tt3200_pll_get_frequency(struct dvb_frontend *fe, u32
    *frequency)*
    *{*
    *    struct budget* budget = (struct budget*) fe->dvb->priv;*
    *    struct tuner_state stb6100_tuner_state;*
    *    *frequency = 0;*
    *    if ( budget->dvb_frontend->ops.tuner_ops.get_state ) {*

    *        budget->dvb_frontend->ops.tuner_ops.get_state(*
    *            fe,DVBFE_TUNER_FREQUENCY,*
    *            &stb6100_tuner_state);*

    *        *frequency = stb6100_tuner_state.frequency;*
    *    }*

    *    return 0;*
    *}*

    *static int tt3200_pll_set_bandwidth(struct dvb_frontend *fe, u32
    bandwidth)*
    *{*
    *    struct budget* budget = (struct budget*) fe->dvb->priv;*
    *    struct tuner_state stb6100_tuner_state;*
    *    if ( budget->dvb_frontend->ops.tuner_ops.set_state ) {*

    *        stb6100_tuner_state.bandwidth = bandwidth;*

    *//        printk("%s bandwidth=%d\n",__func__,bandwidth);*

    *        budget->dvb_frontend->ops.tuner_ops.set_state(*
    *            fe,DVBFE_TUNER_BANDWIDTH,*
    *            &stb6100_tuner_state);*

    *        /* FIXME !*
    *         * This is just a hack because dvb-pll is too rigid*
    *         * will need to adjust dvb-pll to avoid unpleasant*
    *         * issues like this !*
    *         */*
    *        msleep(200);*
    *    }*

    *    return 0;*
    *}*

    *static int tt3200_pll_get_bandwidth(struct dvb_frontend *fe, u32
    *bandwidth)*
    *{*
    *    struct budget* budget = (struct budget*) fe->dvb->priv;*
    *    struct tuner_state stb6100_tuner_state;*

    *    *bandwidth = 0;*
    *    if ( budget->dvb_frontend->ops.tuner_ops.get_state ) {*

    *        budget->dvb_frontend->ops.tuner_ops.get_state(*
    *            fe,DVBFE_TUNER_BANDWIDTH,*
    *            &stb6100_tuner_state);*

    *        *bandwidth = stb6100_tuner_state.bandwidth;*

    *//        printk("%s bandwidth=%d\n",__func__,*bandwidth);*
    *    *
    *    }*

    *    return 0;*
    *}*

    #define KNC1_DVBS2_ESNO_AVE            3
    ...
    #define KNC1_DVBS2_LDPC_MAX_ITER        70

    *static struct stb0899_config tt3200_config = {*
    *    .init_dev        = knc1_stb0899_s1_init_1,*
    *    .init_s2_demod        = knc1_stb0899_s2_init_2,*
    *    .init_s1_demod        = knc1_stb0899_s1_init_3,*
    *    .init_s2_fec        = knc1_stb0899_s2_init_4,*
    *    .init_tst        = knc1_stb0899_s1_init_5,*

    *    .demod_address        = 0x68,*
    *//    .ts_output_mode        = STB0899_OUT_PARALLEL,    /* types =
    SERIAL/PARALLEL    */*
    *    .block_sync_mode    = STB0899_SYNC_FORCED,    /* DSS,
    SYNC_FORCED/UNSYNCED    */*
    *//    .ts_pfbit_toggle    = STB0899_MPEG_NORMAL,    /* DirecTV,
    MPEG toggling seq    */*

    *    .xtal_freq        = 27000000,*
    *    .inversion        = 1,*

    *    .esno_ave        = KNC1_DVBS2_ESNO_AVE,*
    *    .esno_quant        = KNC1_DVBS2_ESNO_QUANT,*
    *    .avframes_coarse    = KNC1_DVBS2_AVFRAMES_COARSE,*
    *    .avframes_fine        = KNC1_DVBS2_AVFRAMES_FINE,*
    *    .miss_threshold        = KNC1_DVBS2_MISS_THRESHOLD,*
    *    .uwp_threshold_acq    = KNC1_DVBS2_UWP_THRESHOLD_ACQ,*
    *    .uwp_threshold_track    = KNC1_DVBS2_UWP_THRESHOLD_TRACK,*
    *    .uwp_threshold_sof    = KNC1_DVBS2_UWP_THRESHOLD_SOF,*
    *    .sof_search_timeout    = KNC1_DVBS2_SOF_SEARCH_TIMEOUT,*

    *    .btr_nco_bits        = KNC1_DVBS2_BTR_NCO_BITS,*
    *    .btr_gain_shift_offset    = KNC1_DVBS2_BTR_GAIN_SHIFT_OFFSET,*
    *    .crl_nco_bits        = KNC1_DVBS2_CRL_NCO_BITS,*
    *    .ldpc_max_iter        = KNC1_DVBS2_LDPC_MAX_ITER,*

    *    .tuner_get_frequency    = tt3200_pll_get_frequency,*
    *    .tuner_set_frequency    = tt3200_pll_set_frequency,*
    *    .tuner_set_bandwidth    = tt3200_pll_set_bandwidth,*
    *    .tuner_get_bandwidth    = tt3200_pll_get_bandwidth,*
    *};*
    *...*
    static void frontend_init(struct budget *budget)
    {
    ...
    *    case 0x1019: // Hauppauge/TT 3200*
    *        // gpio2 is connected to CLB - reset it + leave it high*
    *        saa7146_setgpio(budget->dev, 2, SAA7146_GPIO_OUTLO);*
    *        msleep(1);*
    *        saa7146_setgpio(budget->dev, 2, SAA7146_GPIO_OUTHI);*
    *        msleep(1);*

    *        budget->dvb_frontend = dvb_attach(stb0899_attach,
    &tt3200_config, &budget->i2c_adap);*
    *        if (budget->dvb_frontend) {*
    *            if (dvb_attach(stb6100_attach, budget->dvb_frontend,
    &tuner_stb6100_config, &budget->i2c_adap) == NULL)*
    *                printk("%s: No STB6100 found!\n", __FUNCTION__);*
    *            if (dvb_attach(lnbp21_attach, budget->dvb_frontend,
    &budget->i2c_adap, 0, 0) == NULL) {*
    *                printk("%s: No LNBP21 found!\n", __FUNCTION__);*
    *                goto error_out;*
    *            }*
    *            break;*
    *        }*

        }
    ...
    MAKE_BUDGET_INFO(fsacs1, "Fujitsu Siemens Activy Budget-S PCI (rev
    AL/alps frontend)", BUDGET_FS_ACTIVY);
    *MAKE_BUDGET_INFO(tts23200,"TT-Budget-S2-3200 PCI", BUDGET_TT3200);*

    static struct pci_device_id pci_tbl[] = {
        MAKE_EXTENSION_PCI(ttbs,  0x13c2, 0x1003),
        MAKE_EXTENSION_PCI(ttbc,  0x13c2, 0x1004),
        MAKE_EXTENSION_PCI(ttbt,  0x13c2, 0x1005),
        MAKE_EXTENSION_PCI(satel, 0x13c2, 0x1013),
        MAKE_EXTENSION_PCI(ttbs,  0x13c2, 0x1016),
        MAKE_EXTENSION_PCI(ttbs1401, 0x13c2, 0x1018),
        MAKE_EXTENSION_PCI(fsacs1,0x1131, 0x4f60),
        MAKE_EXTENSION_PCI(fsacs0,0x1131, 0x4f61),
    *    MAKE_EXTENSION_PCI(tts23200, 0x13c2, 0x1019),*
        {
            .vendor    = 0,
        }
    };
    ...

*linux/drivers/media/dvb/ttpci/budget.h*

    ...
    #define BUDGET_KNC1S2           15
    *#define BUDGET_TT3200           16*

    #define BUDGET_VIDEO_PORTA         0
    ...

*linux/drivers/media/dvb/dvb-core/dvb_frontend.c => bugfix against 
crashes in rmmod*

    ...
    #ifdef CONFIG_DVB_CORE_ATTACH
    void dvb_frontend_detach(struct dvb_frontend* fe)
    {
        void *ptr;

        if (fe->ops.release_sec) {
    *        ptr = (void*)fe->ops.release_sec;
        *    fe->ops.release_sec(fe);*
            symbol_put_addr(ptr);*
        }
        if (fe->ops.tuner_ops.release) {
          *  ptr = (void*)fe->ops.tuner_ops.release;*
            fe->ops.tuner_ops.release(fe);
       *     symbol_put_addr(ptr);*
        }
        ptr = (void*)fe->ops.release;
        if (ptr) {
            fe->ops.release(fe);
            symbol_put_addr(ptr);
        }
    }
    #else
    void dvb_frontend_detach(struct dvb_frontend* fe)
    ...

*Procedure for compiling and loading of drivers*

    * unpack kernel-sources (to /usr/src/linux) if necessary
    * unpack v4l-dvb-sources (to /usr/src/v4l-dvb)
    * unpack szap2-sources (to /usr/src/szap)
    * change to /usr/src/szap
    * make
    * make install => check if szap2 now is installed
    * change to /usr/src/v4l-dvb
    * v4l-scripts-make_myconfig.pl
    * make
    * unload all dvb-driver (e.g. make rmmod)
    * make install
    * modprobe budget
    * szap -r ...
    * xine

*Problems*

    * sometimes the PLL lock after some trys on different DVB-S-channels
    * on some DVB-S-channels the Pll never locked
    * on DVB-S2-channels the Pll never locked
    * some other changes necassary to work with old DVB-programs (like
      mythTV)

*Questions*

    * Is the tuning with KNC1 DVB-S2 boards also critical? If no then
      the main problem must be in STB6100-module.
    * It is really able to tune to DVB-S2-channels with KNC1 DVB-S2 board?
    * Have anyone the correct entries in channels.conf for Pro7 HD,
      Sat.1 HD, ASTRA HD, Anixe HD?
    * Do I need any newer tools (like szap)?


Sorry for long text without patch-file.




More information about the linux-dvb mailing list