|Assignee:||Andreas Öman||% Done:|
|Found in version:||Affected Versions:|
Hi, I've been wondering why the "quality" on my DVB-T cards always tends to zero (even though they actually work fine!) in tvheadend, and I've identified the cause. Specifically, it is the code in
https://github.com/andoma/tvheadend/blob/master/src/dvb/dvb_fe.c dealing with reading the uncorrected blocks count. It is assuming the UCBLOCKS count is reset on each call, e.g.:
/* Reset FEC counter */
ioctl(tda->tda_fe_fd, FE_READ_UNCORRECTED_BLOCKS, &fec);
However, according to the DVB API, this is incorrect, the UCBLOCKS count is the total uncorrected blocks since the adapter was created. See
"This ioctl call returns the number of uncorrected blocks detected by the device driver during its lifetime."
However, the other issue is while some that DVB frontends implement this correctly (e.g. the af9013 DVBT demod is an accumulative counter), others don't. The ones that are incorrectly implemented do in fact reset the count every call.