[mythtv] [mythtv-commits] Ticket #1502: DVB API requires usleep after certain calls to get reliable tuning on certain drivers (esp Nova-T).
Marcus Metzler
mocm at mocm.de
Sat Mar 18 16:55:53 UTC 2006
>>>>> "Daniel" == Daniel Kristjansson <danielk at cuymedia.net> writes:
Daniel> On Thu, 2006-03-16 at 22:24 +0400, Manu Abraham wrote:
>> Daniel Kristjansson wrote: > I tried searching the archives and
>> didn't find anything for this. > I have applied patches from
>> him, so he's not a total unknown > around here...
>> >
>>
>> I have attached the old mail/patch sent by Marcus a while
>> back. It might not be now suitable as it is for your code now,
>> that sufficient time has passed by, but you can get the idea
>> out of it.
>>
>>
>> Manu
Daniel> Heh, this is exactly the what we use in the
Daniel> dvbsignalmonitor loop in 0.19, obviously it has
Daniel> problems... :)
There are several problems that have to be taken into account. First
of all, there really are some cards that take up to 4 seconds to tune
(mostly DVB-S which also have to switch diseqc). Some cards get
confused when you hit the i2c bus too often (i.e. check status) and
may not tune in that case.
So what I do is :
1) Set the diseqc and voltage and wait for 10000 usecs.
2) set the frontend
3) wait 300000 usecs check status
4) if you get a has_lock, everything is fine, otherwise repeat step 3
for a couple of times (3 times).
5) If there is still no lock (very rare) repeat 3)+4)
6) still no lock try resetting the diseqc (if there is one) and repeat
from 29.
I implemented that in my libdvb and also added a check for tuning
times and I got times from 0.2s to 4s for DVB-S cards, always
characteristic for the respective card.
I did not test many DVB-T cards, but they usually tune much faster.
For some cards the usleeps can be shorter, but I put in values that
fit all the cards I could test.
In any case you can forget about the FE_GET_EVENT, this was a relict
from the original Nokia API which was made for some specific Nokia
API.
Most drivers don't implement the events because you would have to
implement a polling loop in the driver which you can do just as well
with steps 3) and 4).
Marcus
More information about the mythtv-dev
mailing list