Ticket #1502: myth.diff

File myth.diff, 2.4 KB (added by dscoular@…, 18 years ago)

Patch to add usleep delay for reliable tuning on Nova-T DVB cards.

  • libs/libmythtv/dvbsignalmonitor.h

     
    4848    int GetDVBCardNum(void) const;
    4949
    5050    bool SupportsTSMonitoring(void);
     51
     52    DVBChannel *GetDVBChannel(void) const { return(channel); };
     53    void SetDVBChannel(DVBChannel *_channel) { channel = _channel; };
     54
    5155  protected:
    5256    SignalMonitorValue signalToNoise;
    5357    SignalMonitorValue bitErrorRate;
     
    5862    pthread_t          table_monitor_thread;
    5963
    6064    FilterMap          filters; ///< PID filters for table monitoring
     65    DVBChannel         *channel;
    6166};
    6267
    6368#endif // DVBSIGNALMONITOR_H
  • libs/libmythtv/dvbchannel.cpp

     
    633633                  "Setting Frontend tuning parameters failed.");
    634634            return false;
    635635        }
     636
     637        // Special case for Nova-T. Should use configurable timeout.
     638        if (GetFrontendName() == "DiBcom 3000P/M-C DVB-T") {
     639          usleep(2000000);
     640        }
    636641        wait_for_backend(fd_frontend, 5 /* msec */);
    637642
    638643        prev_tuning.params = params;
  • libs/libmythtv/dvbsignalmonitor.cpp

     
    8383    QString msg = QString("DVBSignalMonitor(%1)::constructor(%2,%3): %4")
    8484        .arg(channel->GetDevice()).arg(capturecardnum);
    8585
     86    SetDVBChannel(_channel);
     87
    8688#define DVB_IO(WHAT,WHERE,ERRMSG,FLAG) \
    8789    if (ioctl(_channel->GetFd(), WHAT, WHERE)) \
    8890        VERBOSE(VB_IMPORTANT, msg.arg(ERRMSG).arg(strerror(errno))); \
     
    542544    uint32_t ber = 0, ublocks = 0;
    543545    fe_status_t  status;
    544546    bzero(&status, sizeof(status));
     547    DVBChannel *channel = GetDVBChannel();
    545548
    546549    // Get info from card
    547550    int fd_frontend = channel->GetFd();
    548551    ioctl(fd_frontend, FE_READ_STATUS, &status);
     552    // Special case for Nova-T. Should use configurable timeout.
     553    if (channel->GetFrontendName() == "DiBcom 3000P/M-C DVB-T") {
     554      usleep(2000000);
     555    }
     556
    549557    if (HasFlags(kDTVSigMon_WaitForSig))
    550558        ioctl(fd_frontend, FE_READ_SIGNAL_STRENGTH, &sig);
    551559    if (HasFlags(kDVBSigMon_WaitForSNR))