18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ci.. _frontend-stat-properties:
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci******************************
68c2ecf20Sopenharmony_ciFrontend statistics indicators
78c2ecf20Sopenharmony_ci******************************
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciThe values are returned via ``dtv_property.stat``. If the property is
108c2ecf20Sopenharmony_cisupported, ``dtv_property.stat.len`` is bigger than zero.
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ciFor most delivery systems, ``dtv_property.stat.len`` will be 1 if the
138c2ecf20Sopenharmony_cistats is supported, and the properties will return a single value for
148c2ecf20Sopenharmony_cieach parameter.
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ciIt should be noted, however, that new OFDM delivery systems like ISDB
178c2ecf20Sopenharmony_cican use different modulation types for each group of carriers. On such
188c2ecf20Sopenharmony_cistandards, up to 3 groups of statistics can be provided, and
198c2ecf20Sopenharmony_ci``dtv_property.stat.len`` is updated to reflect the "global" metrics,
208c2ecf20Sopenharmony_ciplus one metric per each carrier group (called "layer" on ISDB).
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciSo, in order to be consistent with other delivery systems, the first
238c2ecf20Sopenharmony_civalue at :c:type:`dtv_property.stat.dtv_stats <dtv_stats>` array refers
248c2ecf20Sopenharmony_cito the global metric. The other elements of the array represent each
258c2ecf20Sopenharmony_cilayer, starting from layer A(index 1), layer B (index 2) and so on.
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ciThe number of filled elements are stored at ``dtv_property.stat.len``.
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ciEach element of the ``dtv_property.stat.dtv_stats`` array consists on
308c2ecf20Sopenharmony_citwo elements:
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci-  ``svalue`` or ``uvalue``, where ``svalue`` is for signed values of
338c2ecf20Sopenharmony_ci   the measure (dB measures) and ``uvalue`` is for unsigned values
348c2ecf20Sopenharmony_ci   (counters, relative scale)
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci-  ``scale`` - Scale for the value. It can be:
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci   -  ``FE_SCALE_NOT_AVAILABLE`` - The parameter is supported by the
398c2ecf20Sopenharmony_ci      frontend, but it was not possible to collect it (could be a
408c2ecf20Sopenharmony_ci      transitory or permanent condition)
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci   -  ``FE_SCALE_DECIBEL`` - parameter is a signed value, measured in
438c2ecf20Sopenharmony_ci      1/1000 dB
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci   -  ``FE_SCALE_RELATIVE`` - parameter is a unsigned value, where 0
468c2ecf20Sopenharmony_ci      means 0% and 65535 means 100%.
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci   -  ``FE_SCALE_COUNTER`` - parameter is a unsigned value that counts
498c2ecf20Sopenharmony_ci      the occurrence of an event, like bit error, block error, or lapsed
508c2ecf20Sopenharmony_ci      time.
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci.. _DTV-STAT-SIGNAL-STRENGTH:
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ciDTV_STAT_SIGNAL_STRENGTH
568c2ecf20Sopenharmony_ci========================
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ciIndicates the signal strength level at the analog part of the tuner or
598c2ecf20Sopenharmony_ciof the demod.
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ciPossible scales for this metric are:
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci-  ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
648c2ecf20Sopenharmony_ci   measurement was not complete yet.
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci-  ``FE_SCALE_DECIBEL`` - signal strength is in 0.001 dBm units, power
678c2ecf20Sopenharmony_ci   measured in miliwatts. This value is generally negative.
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci-  ``FE_SCALE_RELATIVE`` - The frontend provides a 0% to 100%
708c2ecf20Sopenharmony_ci   measurement for power (actually, 0 to 65535).
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci.. _DTV-STAT-CNR:
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ciDTV_STAT_CNR
768c2ecf20Sopenharmony_ci============
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ciIndicates the Signal to Noise ratio for the main carrier.
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ciPossible scales for this metric are:
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci-  ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
838c2ecf20Sopenharmony_ci   measurement was not complete yet.
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci-  ``FE_SCALE_DECIBEL`` - Signal/Noise ratio is in 0.001 dB units.
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci-  ``FE_SCALE_RELATIVE`` - The frontend provides a 0% to 100%
888c2ecf20Sopenharmony_ci   measurement for Signal/Noise (actually, 0 to 65535).
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci.. _DTV-STAT-PRE-ERROR-BIT-COUNT:
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ciDTV_STAT_PRE_ERROR_BIT_COUNT
948c2ecf20Sopenharmony_ci============================
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ciMeasures the number of bit errors before the forward error correction
978c2ecf20Sopenharmony_ci(FEC) on the inner coding block (before Viterbi, LDPC or other inner
988c2ecf20Sopenharmony_cicode).
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ciThis measure is taken during the same interval as
1018c2ecf20Sopenharmony_ci``DTV_STAT_PRE_TOTAL_BIT_COUNT``.
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ciIn order to get the BER (Bit Error Rate) measurement, it should be
1048c2ecf20Sopenharmony_cidivided by
1058c2ecf20Sopenharmony_ci:ref:`DTV_STAT_PRE_TOTAL_BIT_COUNT <DTV-STAT-PRE-TOTAL-BIT-COUNT>`.
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ciThis measurement is monotonically increased, as the frontend gets more
1088c2ecf20Sopenharmony_cibit count measurements. The frontend may reset it when a
1098c2ecf20Sopenharmony_cichannel/transponder is tuned.
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ciPossible scales for this metric are:
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci-  ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
1148c2ecf20Sopenharmony_ci   measurement was not complete yet.
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci-  ``FE_SCALE_COUNTER`` - Number of error bits counted before the inner
1178c2ecf20Sopenharmony_ci   coding.
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci.. _DTV-STAT-PRE-TOTAL-BIT-COUNT:
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ciDTV_STAT_PRE_TOTAL_BIT_COUNT
1238c2ecf20Sopenharmony_ci============================
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ciMeasures the amount of bits received before the inner code block, during
1268c2ecf20Sopenharmony_cithe same period as
1278c2ecf20Sopenharmony_ci:ref:`DTV_STAT_PRE_ERROR_BIT_COUNT <DTV-STAT-PRE-ERROR-BIT-COUNT>`
1288c2ecf20Sopenharmony_cimeasurement was taken.
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_ciIt should be noted that this measurement can be smaller than the total
1318c2ecf20Sopenharmony_ciamount of bits on the transport stream, as the frontend may need to
1328c2ecf20Sopenharmony_cimanually restart the measurement, losing some data between each
1338c2ecf20Sopenharmony_cimeasurement interval.
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_ciThis measurement is monotonically increased, as the frontend gets more
1368c2ecf20Sopenharmony_cibit count measurements. The frontend may reset it when a
1378c2ecf20Sopenharmony_cichannel/transponder is tuned.
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ciPossible scales for this metric are:
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci-  ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
1428c2ecf20Sopenharmony_ci   measurement was not complete yet.
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ci-  ``FE_SCALE_COUNTER`` - Number of bits counted while measuring
1458c2ecf20Sopenharmony_ci   :ref:`DTV_STAT_PRE_ERROR_BIT_COUNT <DTV-STAT-PRE-ERROR-BIT-COUNT>`.
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci
1488c2ecf20Sopenharmony_ci.. _DTV-STAT-POST-ERROR-BIT-COUNT:
1498c2ecf20Sopenharmony_ci
1508c2ecf20Sopenharmony_ciDTV_STAT_POST_ERROR_BIT_COUNT
1518c2ecf20Sopenharmony_ci=============================
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ciMeasures the number of bit errors after the forward error correction
1548c2ecf20Sopenharmony_ci(FEC) done by inner code block (after Viterbi, LDPC or other inner
1558c2ecf20Sopenharmony_cicode).
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ciThis measure is taken during the same interval as
1588c2ecf20Sopenharmony_ci``DTV_STAT_POST_TOTAL_BIT_COUNT``.
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ciIn order to get the BER (Bit Error Rate) measurement, it should be
1618c2ecf20Sopenharmony_cidivided by
1628c2ecf20Sopenharmony_ci:ref:`DTV_STAT_POST_TOTAL_BIT_COUNT <DTV-STAT-POST-TOTAL-BIT-COUNT>`.
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ciThis measurement is monotonically increased, as the frontend gets more
1658c2ecf20Sopenharmony_cibit count measurements. The frontend may reset it when a
1668c2ecf20Sopenharmony_cichannel/transponder is tuned.
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ciPossible scales for this metric are:
1698c2ecf20Sopenharmony_ci
1708c2ecf20Sopenharmony_ci-  ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
1718c2ecf20Sopenharmony_ci   measurement was not complete yet.
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci-  ``FE_SCALE_COUNTER`` - Number of error bits counted after the inner
1748c2ecf20Sopenharmony_ci   coding.
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci.. _DTV-STAT-POST-TOTAL-BIT-COUNT:
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_ciDTV_STAT_POST_TOTAL_BIT_COUNT
1808c2ecf20Sopenharmony_ci=============================
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ciMeasures the amount of bits received after the inner coding, during the
1838c2ecf20Sopenharmony_cisame period as
1848c2ecf20Sopenharmony_ci:ref:`DTV_STAT_POST_ERROR_BIT_COUNT <DTV-STAT-POST-ERROR-BIT-COUNT>`
1858c2ecf20Sopenharmony_cimeasurement was taken.
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ciIt should be noted that this measurement can be smaller than the total
1888c2ecf20Sopenharmony_ciamount of bits on the transport stream, as the frontend may need to
1898c2ecf20Sopenharmony_cimanually restart the measurement, losing some data between each
1908c2ecf20Sopenharmony_cimeasurement interval.
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_ciThis measurement is monotonically increased, as the frontend gets more
1938c2ecf20Sopenharmony_cibit count measurements. The frontend may reset it when a
1948c2ecf20Sopenharmony_cichannel/transponder is tuned.
1958c2ecf20Sopenharmony_ci
1968c2ecf20Sopenharmony_ciPossible scales for this metric are:
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ci-  ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
1998c2ecf20Sopenharmony_ci   measurement was not complete yet.
2008c2ecf20Sopenharmony_ci
2018c2ecf20Sopenharmony_ci-  ``FE_SCALE_COUNTER`` - Number of bits counted while measuring
2028c2ecf20Sopenharmony_ci   :ref:`DTV_STAT_POST_ERROR_BIT_COUNT <DTV-STAT-POST-ERROR-BIT-COUNT>`.
2038c2ecf20Sopenharmony_ci
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ci.. _DTV-STAT-ERROR-BLOCK-COUNT:
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ciDTV_STAT_ERROR_BLOCK_COUNT
2088c2ecf20Sopenharmony_ci==========================
2098c2ecf20Sopenharmony_ci
2108c2ecf20Sopenharmony_ciMeasures the number of block errors after the outer forward error
2118c2ecf20Sopenharmony_cicorrection coding (after Reed-Solomon or other outer code).
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ciThis measurement is monotonically increased, as the frontend gets more
2148c2ecf20Sopenharmony_cibit count measurements. The frontend may reset it when a
2158c2ecf20Sopenharmony_cichannel/transponder is tuned.
2168c2ecf20Sopenharmony_ci
2178c2ecf20Sopenharmony_ciPossible scales for this metric are:
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ci-  ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
2208c2ecf20Sopenharmony_ci   measurement was not complete yet.
2218c2ecf20Sopenharmony_ci
2228c2ecf20Sopenharmony_ci-  ``FE_SCALE_COUNTER`` - Number of error blocks counted after the outer
2238c2ecf20Sopenharmony_ci   coding.
2248c2ecf20Sopenharmony_ci
2258c2ecf20Sopenharmony_ci
2268c2ecf20Sopenharmony_ci.. _DTV-STAT-TOTAL-BLOCK-COUNT:
2278c2ecf20Sopenharmony_ci
2288c2ecf20Sopenharmony_ciDTV-STAT_TOTAL_BLOCK_COUNT
2298c2ecf20Sopenharmony_ci==========================
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_ciMeasures the total number of blocks received during the same period as
2328c2ecf20Sopenharmony_ci:ref:`DTV_STAT_ERROR_BLOCK_COUNT <DTV-STAT-ERROR-BLOCK-COUNT>`
2338c2ecf20Sopenharmony_cimeasurement was taken.
2348c2ecf20Sopenharmony_ci
2358c2ecf20Sopenharmony_ciIt can be used to calculate the PER indicator, by dividing
2368c2ecf20Sopenharmony_ci:ref:`DTV_STAT_ERROR_BLOCK_COUNT <DTV-STAT-ERROR-BLOCK-COUNT>` by
2378c2ecf20Sopenharmony_ci:ref:`DTV-STAT-TOTAL-BLOCK-COUNT`.
2388c2ecf20Sopenharmony_ci
2398c2ecf20Sopenharmony_ciPossible scales for this metric are:
2408c2ecf20Sopenharmony_ci
2418c2ecf20Sopenharmony_ci-  ``FE_SCALE_NOT_AVAILABLE`` - it failed to measure it, or the
2428c2ecf20Sopenharmony_ci   measurement was not complete yet.
2438c2ecf20Sopenharmony_ci
2448c2ecf20Sopenharmony_ci-  ``FE_SCALE_COUNTER`` - Number of blocks counted while measuring
2458c2ecf20Sopenharmony_ci   :ref:`DTV_STAT_ERROR_BLOCK_COUNT <DTV-STAT-ERROR-BLOCK-COUNT>`.
246