Project

General

Profile

Feature #5393

Maximize use of libdvbcsa's batch processing.

Added by Joe User 13 days ago. Updated 12 days ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
Descrambling
Target version:
-
Start date:
2018-12-05
Due date:
% Done:

0%

Estimated time:

Description

The batch mode processing of libdvbcsa has a maximum number of packets it can descramble in one pass and according to the documentation:

Arrays with less entries  than the maximum batch size will take
the _same_ time to process as a full batch array.

So, for best performance, the array should be filled with the maximum number of packets. The csa_tbscluster is created with the maximum size, but, since unscrambled packets are also sent through the descrambler, the csa_tsbcluster ends up containing less then the maximum number of scrambled packets. I was seeing as much as 20% of the csa_tsbcluster filled with unscrambled packets for regular channels and as much as 60% unscrambled packets for radio only channels. So, I increased the size of the csa_tsbcluster (3X) and individually track how many even and odd scrambled packets are put in the buffer and only call the flush when either the even or odd count reaches the maximum, or the (enlarged) csa_tsbcluster is full.

I also renamed the unused "csa" subsystem to "tvhcsa" (since it does more than just csa now) and added some traces to show the fill levels.

Example:

[  TRACE] tvhcsa: 0x7f3a70004dc0: service "SERVICE" using CSA batch size = 128 for decryption

[  TRACE] tvhcsa: 0x7f3a70004dc0: CSA flush - descramble packets for service "SERVICE"  MAX=128  even=128  odd=0   fill=152

[  TRACE] tvhcsa: 0x7f3a70005280: service "RADIO SERVICE" using CSA batch size = 128 for decryption

[  TRACE] tvhcsa: 0x7f3a70005280: CSA flush - descramble packets for service "RADIO SERVICE"  MAX=128  even=128  odd=0   fill=265

The pull request is here:

[[https://github.com/tvheadend/tvheadend/pull/1231]]

History

#1 Updated by Jaroslav Kysela 12 days ago

Added in latest.

#2 Updated by Jaroslav Kysela 12 days ago

  • Status changed from New to Fixed

Also available in: Atom PDF