Jump to content


sundtek

Member Since 10 Aug 2011
Offline Last Active 31 Mar 2024 07:43
-----

Posts I've Made

In Topic: Cable scan executable utility not found '/usr/bin/tda1002x'!

31 March 2024 - 06:56

Someone just asked about blindscan support for Sundtek Tuners, I haven't tested this for a long time with settopbox images, so if nothing changed within the last years it should still work as it is.

The blobs from the other vendors directly interfaced i2c in userspace back then we just emulated the same style with our mediaclient command, however we have extended the DVB API for supporting blindscan with our tuners.

 

Basically setting up the Blindscan request first and iterate through the band, the drivers and hardware do the magic in the background. While this is for DVB, we are even using similar approaches for FM and DAB Radio.

 

some pseudo code/snippets :

sundtek frontend.h
 
#define FE_SCAN_SETUP 95
struct dvb_scan_setup {
        uint32_t seekBWHz;
        /* this can be used to finetune DVB-T/T2 stepping frequency */
        uint32_t seekStepHz; /* <- this is unused at the moment */
        uint32_t minSRbps;
        uint32_t maxSRbps;
        uint32_t minRSSIdBm;
        uint32_t maxRSSIdBm;
        uint32_t minSNRHalfdB;
        uint32_t maxSNRHalfdB;
        uint32_t rangeMin;
        uint32_t rangeMax;
        uint32_t bandwidth;
        uint8_t countrycode_set;
        uint8_t countrycode[2];
        uint8_t default_setup; /* use default setup stored in the driver,
                                  overwrite all other values */
} __attribute__((packed));
 
#define FE_SCAN_NEXT_FREQUENCY 96
struct dvb_scan_parameters {
        uint32_t frequency;
        uint32_t symbol_rate_bps;
        uint32_t bandwidth_Hz;
        uint16_t dvb_t2_num_plp;
        uint32_t modulation;
        uint16_t stream;
        uint32_t delivery_system;
 
        uint32_t timeout;
        uint8_t status; /* do not clear the lock status when running
                           the scan loop, you're allowed to clear the struct
                           before running SCAN_NEXT_FREQUENCY the first time */
#define FE_SCAN_LOCKED    1
#define FE_SCAN_SEARCHING 2
#define FE_SCAN_ERROR     4
#define FE_SCAN_COMPLETE  8
} __attribute__((packed));
 
 
----
 
                struct dvb_scan_setup sp;
                memset(&sp, 0x0, sizeof(struct dvb_scan_setup));
                sp.minSRbps = 6800000;
                sp.maxSRbps = 7000000;
                sp.rangeMin = 114000000;
                sp.rangeMax = 874000000;
                rv = net_ioctl(fd, FE_SCAN_SETUP, &sp);
----

                struct dvb_scan_parameters scan_params;
                net_ioctl(fd, FE_SCAN_NEXT_FREQUENCY, &scan_params);
                while(1) {
                      net_ioctl(fd, FE_SCAN_NEXT_FREQUENCY, &scan_params);
                      switch(scan_params.status) {
                      case FE_SCAN_LOCKED:
                           .... take parameters from scan_params.
                      case FE_SCAN_SEARCHING:
                           .... still searching
                      case FE_SCAN_COMPLETE:
                           .... entire band scanned
                           .... end loop
                      case FE_SCAN_ERROR: 
                           ... error handling
                      }
             }