Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] Re: Drivers not reporting TIMEDOUT
Nico Sabbi wrote:
Holger Waechtler wrote:
Nico Sabbi wrote:
Hi,
it seems that not all drivers set TIMEDOUT when tuning on a "wrong"
frequency, in my case Airstar2 does not.
It would be nice if all frontends implemented this mechanism :)
There is no objective criteria for a timeout on DVB, especially for
DVB-T the signal cn disappear and reappear at any time, not?
It's a matter of clarity: why some frontends set the flag and others
don't ?
those ones which enable the zigzag-scan if I remember correctly.
If a timeout flag exists I should have a way to determine if I can use
or not, correct?
The flag is a left-over like GET_EVENT, it turned out in the past that
it doesn't really makes sense: for one demod 1-2seconds may be perfectly
sufficient to aquire a lock, for another one under bad receiption
conditions you may have to wait much longer (or get a flockering lock
bit at all -- but the incoming stream may still be sufficient to parse
some redundant section data...).
Additionally, why can't I specify the timeout threshold?
you can, for poll() and select(). Please see the manpages for details.
At the current state of things I have to set 2 timeouts:
tm1 = tm2 = time(NULL);
while (((festatus & FE_TIMEDOUT)==0) && ((festatus & FE_HAS_LOCK)==0)
&& (tm2 - tm1 < 3) && (locks < 2))
{
...
tm2 = time(NULL);
}
what about:
tune(frontend_fd, params);
once_locked = 0;
while (!cancel) {
select(frontend_fd, ... /* with user-defined OSD refresh timeout */);
if (ioctl(frontend_fd, FE_READ_STATUS, &s) == 0) {
if (s & FE_HAS_LOCK)
once_locked = 1;
if (!once_locked && time_since_tuning() > timeout) {
display_osd_message("failed to aquire lock (weak or no
signal?)!");
}
/* display status bits as LED-alike widgets in OSD */
}
if (ioctl(frontend_fd, FE_READ_BER, &s) == 0) {
/* display BER in OSD */
}
if (ioctl(frontend_fd, FE_READ_UNC, &s) == 0) {
/* display unc in OSD */
}
}
?
Why would you want something like this, can you please try to
elaborate your needs a little more in detail? A simple "tuning
failed/no or bad signal" message can easily get implemented in
userspace, just set the poll()/select() timeout to your user-defined
limit and then check whether the READ_STATUS ioctl reports a lock
within this time.
Holger
done as above.
There's another problem: ghost locking. If you 1) tune to a "good"
frequency, then 2) tune to a wrong one,
often the FE_READ_STATUS on the wrong one (2) reports FE_HAS_LOCK,
even though the frontend
didn't lock at all, so it seems it's reporting the FE_HAS_LOCK related
to 1).
This happens both on my Nova-S and on my Airstar2 with yesterday's
dvb-kernel and all previous versions
that I used.
That's why I added && (locks < 2) in the while loop.
sounds like a bug in the dvb_frontend.c code...
Holger
Home |
Main Index |
Thread Index