[linux-dvb] [PATCH] Correct 'unc' for CinergyT2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The CinergyT2 driver currently supplies the total 'unc' (uncorrected
block errors) rather than the difference since the last query. E.g:

root@MythTv:/usr/src/DVB/apps/szap # ./tzap -a 1 "TMF"
using '/dev/dvb/adapter1/frontend0' and '/dev/dvb/adapter1/demux0'
tuning to 842000000 Hz
video pid 0x00c9, audio pid 0x00ca
status 01 | signal ffff | snr 0000 | ber 00000000 | unc 00000000 |
status 1f | signal 700e | snr 5050 | ber 00000000 | unc 000022b6 | FE_HAS_LOCK
status 1f | signal 400e | snr 5050 | ber 00000000 | unc 00004ca6 | FE_HAS_LOCK
status 1f | signal a00e | snr 5656 | ber 00000000 | unc 0000798a | FE_HAS_LOCK
status 1f | signal c00e | snr 5050 | ber 00000000 | unc 0000a262 | FE_HAS_LOCK
status 1f | signal c00e | snr 5050 | ber 00000000 | unc 0000c762 | FE_HAS_LOCK
status 1f | signal a00e | snr 5656 | ber 00000000 | unc 0000dff0 | FE_HAS_LOCK
status 1f | signal 100e | snr 5656 | ber 00000000 | unc 0000f8a5 | FE_HAS_LOCK
status 1f | signal 700e | snr 5656 | ber 00000000 | unc 00011aa8 | FE_HAS_LOCK
status 1f | signal b00e | snr 5656 | ber 00000000 | unc 00013fa2 | FE_HAS_LOCK
status 1f | signal 900e | snr 5050 | ber 00000000 | unc 0001669e | FE_HAS_LOCK
status 1f | signal 500e | snr 5050 | ber 00000000 | unc 0001910b | FE_HAS_LOCK
status 1f | signal b00e | snr 5050 | ber 00000000 | unc 0001ac0d | FE_HAS_LOCK
status 1f | signal d00e | snr 5656 | ber 00000000 | unc 0001d6cc | FE_HAS_LOCK
status 1f | signal 600f | snr 5656 | ber 00000000 | unc 0001ff9d | FE_HAS_LOCK
status 1f | signal 100e | snr 5050 | ber 00000000 | unc 00022aeb | FE_HAS_LOCK

Note the constantly rising 'unc' value. The following patch to
cinergyt2.c corrects this output:

===================================================================
RCS file: /cvs/linuxtv/dvb-kernel/linux/drivers/media/dvb/cinergyT2/cinergyT2.c,v
retrieving revision 1.30
diff -u -r1.30 cinergyT2.c
--- cinergyT2.c 31 Oct 2005 17:01:06 -0000      1.30
+++ cinergyT2.c 9 Nov 2005 20:12:17 -0000
@@ -592,10 +600,15 @@
                                (__u16 __user *) arg);

        case FE_READ_UNCORRECTED_BLOCKS:
-               /* UNC are already converted to host byte order... */
-               return put_user(stat->uncorrected_block_count,
-                               (__u32 __user *) arg);
+       {
+               uint32_t unc_count;
+
+               unc_count = stat->uncorrected_block_count;
+               stat->uncorrected_block_count = 0;

+               /* UNC are already converted to host byte order... */
+               return put_user(unc_count,(__u32 __user *) arg);
+       }
        case FE_SET_FRONTEND:
        {
                struct dvbt_set_parameters_msg *param = &cinergyt2->param;
===================================================================


The results from tzap now look like:

root@MythTv:/usr/src/DVB/apps/szap # ./tzap -a 1 "TMF"
using '/dev/dvb/adapter1/frontend0' and '/dev/dvb/adapter1/demux0'
tuning to 842000000 Hz
video pid 0x00c9, audio pid 0x00ca
status 01 | signal ffff | snr 0000 | ber 00000000 | unc 00000000 |
status 1f | signal 200e | snr 5050 | ber 00000000 | unc 00002315 | FE_HAS_LOCK
status 1f | signal 600d | snr 5050 | ber 00000000 | unc 00002f9a | FE_HAS_LOCK
status 1e | signal 000e | snr 5050 | ber 00000000 | unc 00002fc0 | FE_HAS_LOCK
status 1f | signal a00d | snr 5050 | ber 00000000 | unc 00002fba | FE_HAS_LOCK
status 1e | signal 000e | snr 5050 | ber 00000000 | unc 00002fbe | FE_HAS_LOCK
status 1f | signal 900e | snr 5050 | ber 00000000 | unc 00002fc1 | FE_HAS_LOCK
status 1f | signal 700d | snr 5050 | ber 00000000 | unc 00002fc0 | FE_HAS_LOCK
status 1f | signal 900e | snr 5050 | ber 00000000 | unc 00002fc0 | FE_HAS_LOCK
status 1f | signal d00d | snr 5050 | ber 00000000 | unc 00002fc3 | FE_HAS_LOCK
status 1f | signal 300e | snr 5050 | ber 00000000 | unc 00002fbf | FE_HAS_LOCK
status 1f | signal 100e | snr 5050 | ber 00000000 | unc 00002fb5 | FE_HAS_LOCK
status 1f | signal 100f | snr 5050 | ber 00000000 | unc 00001fd6 | FE_HAS_LOCK
status 1f | signal e00d | snr 4848 | ber 00000000 | unc 00004f96 | FE_HAS_LOCK

Note the reasonably constant 'unc' value as expected.

Steve


[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux