From: "P. van Gaans" <w3ird_n3rd@gmx.net>
To: linux-dvb@linuxtv.org
Subject: Re: [linux-dvb] [PATCH] Fix the unc for the frontends tda10021 and stv0297
Date: Mon, 12 May 2008 15:47:23 +0200 [thread overview]
Message-ID: <48284A6B.2020602@gmx.net> (raw)
In-Reply-To: <200805121516.48002@orion.escape-edv.de>
On 05/12/2008 03:16 PM, Oliver Endriss wrote:
> Andy Walls wrote:
>> On Sun, 2008-05-11 at 23:33 +0400, Manu Abraham wrote:
>>
>>> I am talking about standard DVB demods:
>>> Every demodulator provides a standard interface, whether you know it or not.
>>>
>>> BER, Bit Error Rate (symbols per unit time)
>>> Strength, usually a RMS value (Absolute)
>>> SNR, Signal To Noise Ratio (Relative)
>>> UNC, Uncorrectable symbols (Absolute)
>>>
>>> These parameters have meanings for the users, not just Linux users but
>>> general users on the whole. Most DVB stuff is quite standardized, most
>>> of which you can find in ETSI specifications and or old DVB.org whitepapers.
>>>
>>> All the resultant parameters that which an API provides, should be that
>>> which is a standard definition, rather than defining something which is
>>> bogus. You take anything standardized, you won't find any other
>>> difference from the above, almost all demodulators follow the
>>> specifications involved therein.
>> Manu,
>>
>> I will agree with you then, drivers shouldn't compute a UNC block rate.
>>
>>
>> Oliver,
>>
>> However, the original spec that was quoted, implied that *applications*
>> would/could do just that: compute a rate from UNC block counts:
>
> Applications may do whatever they wish with the UNC counter:
> - provide the raw error count
> - present the number of UNC blocks over a sliding window (last minute,
> last hour, whatever)
> - calculate an UNC rate [1]
>
> [1] Imho not very useful. UNC should remain constant or increment very
> slowly. Otherwise the ts stream will be unusable.
>
>>> Argh, I just checked the API 1.0.0. spec:
>>> | FE READ UNCORRECTED BLOCKS
>>> | This ioctl call returns the number of uncorrected blocks detected by the device
>>> | driver during its lifetime. For meaningful measurements, the increment
>>> | in block count during a speci c time interval should be calculated. For this
>>> | command, read-only access to the device is suf cient.
>>> | Note that the counter will wrap to zero after its maximum count has been
>>> | reached
>> Putting aside whether such UNC block rates are useful or not, the
>> specification as quoted facilitates the following use case:
>>
>> Multiple applications, can compute UNC block rates over different,
>> possibly overlapping intervals of different lengths, with the
>> applications required to handle rollover gracefully.
>
> This a a very important point: The frontend may be opened by multiple
> readers, so a driver _must_ _not_ reset the UNC counter after reading.
> I guess that's why UNC was defined this way.
>
> Btw, this is a common concept: SNMP (Simple Network Management Protocol)
> counters behave the same way.
>
>> The specification as is, appears to be the easiest way to support this
>> use case, and it works provided the hardware automatically performs
>> rollover of the UNC block counter.
>>
>> If this is a use case that needs to be supported, then to handle the
>> case of hardware that doesn't automatically roll the UNC counter over to
>> zero, the last sentence of the specification might be changed to
>> something like this:
>>
>> "Note that the counter will wrap to zero after its maximum count has
>> been reached. For devices where the hardware does not automatically
>> roll over to zero, when the ioctl would return the maximum supported
>> value, the driver will reset the hardware counter to zero."
>>
>>
>> This isn't perfect as some UNC counts will be lost after the counter
>> saturates, but aside from this exceptional circumstance, the use case
>> would be correctly supported.
>
> The driver should do its best to implement the API spec. It might:
> - return the value of a counter provided by the hardware if it matches
> the API spec
> - implement a counter in software (see proposed patch for an example)
> - return -ENOSYS if it cannot support the UNC counter [2]
>
> Btw, the spec refers to an error code ENOSIGNAL, which does not exist.
> :-(
>
> [2] Unfortunately some drivers return a bogus value if they cannot
> provide UNC. This is a bug and should be fixed!
> Returning 0 is wrong. I'll fix the stv0299.
>
> It is unlikely that the 32 bit UNC error count wraps. If it does, the
> 'UNC rate' is very high, and it does not matter whether a few errors
> are lost...
>
> Anyway the application should handle the wrapping of the UNC counter
> properly.
>
>
> @all:
> 1. If nobody objects I will commit the patches.
> 2. Please check and fix the other frontend drivers to follow the spec.
>
> CU
> Oliver
>
Will the behaviour of femon change, and if so, in what way? I use it now
to see at what points in time I've had hickups by writing femon's output
to a file and grep -nv "unc 0". This way I can see for example I've had
errors at 16:35 and 17:48. If this will still work after the patch, I'm
fine with it. If it won't work, will there be an alternative?
P.
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
next prev parent reply other threads:[~2008-05-12 13:48 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-10 8:46 [linux-dvb] [PATCH] Fix the unc for the frontends tda10021 and stv0297 e9hack
2008-05-10 15:17 ` Oliver Endriss
2008-05-10 15:27 ` Oliver Endriss
2008-05-10 15:48 ` Michael Krufky
2008-05-12 13:29 ` Oliver Endriss
2008-05-10 16:02 ` e9hack
2008-05-10 16:39 ` Oliver Endriss
2008-05-10 21:53 ` Andy Walls
2008-05-10 22:16 ` Manu Abraham
2008-05-10 23:44 ` Andy Walls
2008-05-11 6:14 ` Manu Abraham
2008-05-11 18:35 ` Andy Walls
2008-05-11 19:33 ` Manu Abraham
2008-05-11 21:32 ` Andy Walls
2008-05-12 13:16 ` Oliver Endriss
2008-05-12 13:47 ` P. van Gaans [this message]
2008-05-12 16:02 ` Oliver Endriss
2008-05-12 17:03 ` P. van Gaans
2008-05-12 22:42 ` Andy Walls
2008-05-11 23:45 ` P. van Gaans
2008-05-12 6:47 ` e9hack
2008-05-12 14:26 ` Luca Olivetti
2008-05-10 16:12 ` e9hack
2008-05-30 23:46 ` Oliver Endriss
2008-05-31 0:01 ` Manu Abraham
2008-05-31 7:19 ` e9hack
2008-05-31 12:45 ` Oliver Endriss
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48284A6B.2020602@gmx.net \
--to=w3ird_n3rd@gmx.net \
--cc=linux-dvb@linuxtv.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox