Opened 15 years ago

Closed 15 years ago

Last modified 11 years ago

#1552 closed task (fixed)

Backport DVB Tuning fixes to 0.19-fixes

Reported by: danielk Owned by: danielk
Priority: minor Milestone: 0.20
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no


I'd like to take Marcus' comments into account in the tuning. I don't want to use a 300 ms delay for the DVB-T and ATSC cards, since it would slow down tuning quite a bit and make the antenna adjust very slow; but that delay should be fine for DVB-S. I'd also like to incorporate the retuning and the DiSEqC delays. -- dtk

Marcus (March 18th, 2006): 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).

Change History (11)

comment:1 Changed 15 years ago by danielk

(In [9462]) References #1552. Implements steps 1-4 of Marcus Metzler's DVB tuning suggestions.

comment:2 Changed 15 years ago by danielk

(In [9564]) Refs #927, Refs #1552. Adds Retune() call to dvbchannel.

comment:3 Changed 15 years ago by danielk

(In [9565]) Fixes #927, refs #1049, refs #1552. Retunes when we fail to see video after a while (for DVB-S).

This is mainly intended to help DVB-S, where sometimes tuning fails due to DiSEqC and other hardware and driver issues.

This should be backed out and moved to DVBSignalMonitor once #1049 is addressed. At the moment we never know if we are on the right transport, which is especially problematic when there is a rotor involved. Once #1049 is implemented we will know, and then we can safely move this code to the signal monitor which also means the UI won't freeze up while tuning DVB-S channels.

comment:4 Changed 15 years ago by danielk

Summary: Revisit DVB TuningBackport DVB Tuning fixes to 0.19-fixes

comment:5 Changed 15 years ago by danielk

(In [10127]) Refs #1502. Refs #1552. Backport DVB tuning delay for broken DVB drivers.

This slows down tuning when you use the Nova-T or TerraTech? USB 2.0 DVB-T devices.

A more flexible version of this is in SVN head, but it requires a DB schema change. This instead hardcodes the two devices with known broken drivers.

The DVB folks do not intend to fix these bugs anytime soon, so we have to work around the bugs.

comment:6 Changed 15 years ago by danielk

(In [10128]) Refs #1552. Backports various tuning delays to 0.19-fixes.

This backports some tuning delays recommended by Marcus Metzler.

In particular we 10 ms sleep after every frontend set, and if we are dealing with any DVB-S device or the Nova-T DVB-T device we sleep for 300 ms or 100 ms, resp between status querying ioctl calls.

This delays are needed due to numerous bugs in the i2c bus handling in many DVB-S drivers and the Nova-T DVB-T driver.

Again, these are bugs that the DVB driver folks do not intend to fix anytime soon so we need to work around them.

comment:7 Changed 15 years ago by danielk

Resolution: fixed
Status: newclosed

(In [10129]) Closes #1552. Backports DVB-S retune code to 0.19-fixes.

This repeatedly retunes a DVB channel up to three times. This is to work around the problem of not knowing the SDT of the current channel and so accidentally tuning to the wrong channel when using a rotor.

comment:8 Changed 15 years ago by danielk

(In [10132]) Refs #1552. Refs #1049. Removes DVB retuning hack from SVN head.

This should no longer be needed now that #1049 has been fixed.

comment:9 Changed 15 years ago by dscoular@…

Hi Daniel,

I have to confess that tuning seems slightly more iffy with this most recent change. On both my Nova-T (tda1004x) and AverMedia? AverTV a800 USB 2.0 DVB-T tuners. Still at least it seems to make a more determined effort to continue tuning and allowing selection of other channels.

Just my 2 cents...



comment:10 Changed 15 years ago by (none)

Milestone: 0.19.1

Milestone 0.19.1 deleted

comment:11 Changed 11 years ago by stuartm

Milestone: 0.250.20
Note: See TracTickets for help on using tickets.