[dvblast-devel] [Patch] Add ioctl to read the uncorrected blocks from the frontend.

Philip Downer pdowner at prospero-tech.com
Tue May 26 17:55:50 CEST 2015


Hi,

This adds an ioctl call to get the Uncorrected blocks value from a dvb frontend and present it via dvblastctl. This is useful for seeing how many errors make it past the protocols error correction. Whilst reporting the Bit Error Rate alone is useful it can cause confusion as some or all of the reported errors could have been corrected automatically.

Kind Regards,

Philip Downer

---
 comm.h       | 1 +
 dvb.c        | 3 +++
 dvblastctl.c | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/comm.h b/comm.h
index fe58e3e..a92c1e9 100644
--- a/comm.h
+++ b/comm.h
@@ -75,6 +75,7 @@ struct ret_frontend_status
     fe_status_t i_status;
     uint32_t i_ber;
     uint16_t i_strength, i_snr;
+    uint32_t i_unc;
 };
 
 struct ret_mmi_status
diff --git a/dvb.c b/dvb.c
index c6b32c1..c1f57e1 100644
--- a/dvb.c
+++ b/dvb.c
@@ -1372,6 +1372,9 @@ uint8_t dvb_FrontendStatus( uint8_t *p_answer, ssize_t *pi_size )
 
         if ( ioctl( i_frontend, FE_READ_SNR, &p_ret->i_snr ) < 0 )
             msg_Err( NULL, "ioctl FE_READ_SNR failed (%s)", strerror(errno) );
+
+	if ( ioctl( i_frontend, FE_READ_UNCORRECTED_BLOCKS, &p_ret->i_unc ) < 0 )
+            msg_Err( NULL, "ioctl FE_READ_UNCORRECTED_BLOCKS failed (%s)", strerror(errno) );
     }
 
     *pi_size = sizeof(struct ret_frontend_status);
diff --git a/dvblastctl.c b/dvblastctl.c
index 378cb47..71b91f2 100644
--- a/dvblastctl.c
+++ b/dvblastctl.c
@@ -721,10 +721,12 @@ int main( int i_argc, char **ppsz_argv )
                 printf(" <VALUE bit_error_rate=\"%u\"/>\n", p_ret->i_ber);
                 printf(" <VALUE signal_strength=\"%u\"/>\n", p_ret->i_strength);
                 printf(" <VALUE SNR=\"%u\"/>\n", p_ret->i_snr);
+		printf(" <VALUE uncorrected_blocks=\"%u\"/>\n", p_ret->i_unc);
             } else {
                 printf("\nBit error rate: %u\n", p_ret->i_ber);
                 printf("Signal strength: %u\n", p_ret->i_strength);
                 printf("SNR: %u\n", p_ret->i_snr);
+		printf("Uncorrected blocks: %u\n", p_ret->i_unc);
             }
             ret = 0;
         }
-- 
2.1.4



More information about the dvblast-devel mailing list