Opened 12 years ago

Closed 12 years ago

#2882 closed enhancement (fixed)

Poll CAM module at consistent intervals

Reported by: david@… Owned by: danielk
Priority: minor Milestone: 0.21
Component: dvb Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

Currently the DVB CAM code polls the CAM module with a more or less random frequency. A test run with some debugging output gives:

poll interval 3ms poll interval 22ms poll interval 24ms poll interval 26ms poll interval 27ms poll interval 28ms poll interval 29ms poll interval 30ms poll interval 31ms poll interval 32ms poll interval 34ms poll interval 44ms poll interval 54ms poll interval 64ms poll interval 74ms poll interval 91ms poll interval 101ms poll interval 4ms

The attached patch changes the polling to only go off at a prespecified interval (100ms, which corresponds with the standard), thus reducing the stress on the CAM module (which improves stability for me at least). Debugging output with patch applied:

poll interval 100ms poll interval 100ms poll interval 100ms poll interval 100ms poll interval 101ms poll interval 100ms poll interval 100ms

This is against the 0.20-fixes branch but should be trivial to apply to trunk.

Attachments (1)

poll-cam-100ms-interval.patch (1.6 KB) - added by david@… 12 years ago.
Version 1 of poll interval patch

Download all attachments as: .zip

Change History (4)

Changed 12 years ago by david@…

Version 1 of poll interval patch

comment:1 Changed 12 years ago by danielk

David, is there any reason this can't be done in DVBCam::CiHandlerLoop?()?

I'd prefer to do it there both for efficiency and so our dvbci.cpp doesn't depart as far from the vdr code.

comment:2 Changed 12 years ago by david@…

The reason that I didn't want to do it in CiHandlerLoop? is that it calls ciHandler->Process() which in turn also perform the other processing steps (such as sending DateTime? to the CAM module, etc), and delaying those steps by up to 100ms might be a bad idea (I'm not sure whether it is).

Perhaps it would be an idea to try to get the patch applied to the vdr sources?

Talking about the CiHandlerLoop?: currently there is a usleep(250) in there, with some debugging code I found that the loop is executed approx. 950 times/sec on my machine, which seems a bit excessive.

I've tried bumping the usleep to 2500, 10000 and 90000 (so 2.5, 10 and 90 ms precision), and there seems to be no ill effects. Do you know why the current value is so low? Perhaps the usleep should be changed?

See http://www.linuxtv.org/pipermail/linux-dvb/2006-October/013946.html for an example of one user who improved stability on his system by bumping it to 90000 (which is probably a bit too much).

comment:3 Changed 12 years ago by danielk

Resolution: fixed
Status: newclosed

(In [12441]) Fixes #2882. Polls CAM module every 100 ms to be within DVB specs for CAM polling.

Note: See TracTickets for help on using tickets.