Skip to content
oscam-emu edited this page Apr 14, 2024 · 1 revision

November 2018 update - Attention!

From Emu version r775 and on, you need to tell OSCam to skip the checksum test for CWs.
This can be done by either of the following ways:

A. Edit the Emu reader with one of these ways:

  1. Delete you current Emu reader and let OSCam-Emu create a new one for you, with all necessary settings.
  2. Add the 0E00:000000 string in the Skip CWs checksum test only for option under the general reader settings.
  3. Add the disablecrccws_only_for = 0E00:000000 directive in the oscam.server file under the Emu reader section.

B. Edit the global OSCam configuration with one of these ways:

  1. Add the 0E00:000000 string in the Skip CWs checksum test only for option under the global config settings.
  2. Add the disablecrccws_only_for = 0E00:000000 directive in the oscam.conf file under the global section.

Syntax for ECM Keys in SoftCam.Key

P <groupid><srvid> <key number> <key>

Where:

groupid   (2 bytes) :  Any 4 hex digits of your choice. Groups must be unique. Leading zeros are optional.
srvid     (2 bytes) :  Service id of channel in hex with leading zeros to make 4 hex digits.
key number (string) :  '00' for even or '01' for odd key.
key       (7 bytes) :  The ECM key.

Example:

groupid    :  1
srvid      :  25CA
key number :  00 and 01
key        :  11223344556677 and 8899AABBCCDDEE

P 0125CA 00 11223344556677
P 000125CA 01 8899AABBCCDDEE

Example:

groupid    :  2
srvid      :  0034
key number :  00 and 01
key        :  00112233445566 and FF22334455AADD

P 00020034 00 00112233445566
P 0020034 01 FF22334455AADD

Syntax for EMM keys in SoftCam.Key

P <groupid> <UA> <key>

Where:

groupid (2 bytes) :  Any 4 hex digits of your choice. Groups must be unique. Leading zeros are optional.
UA      (4 bytes) :  The Unique Address of the EMM key.
key     (7 bytes) :  The EMM key.

Example:

P 009E 11223344 11223344556677
P 009E 44332211 22334455667788
P 0004 22334455 33445566778899
P 013E 00112233 00112233445566

Matching ECM and EMM keys based on transponder (new method - May 2019)

The traditional method of getting ECM keys is based on matching the srvid of the channel only. This means the ECM algorithm does not match the group id at all when searching for the ECM key. If many ECM keys with the same srvid (see Note 1 below) are present in the SoftCam.Key, they are all tried until the correct one is found.

In addition, the EMM algorithm does not match the group id as well. The EMM keys used for auto updating can be chosen from various groups (see Note 3) and as a result wrong EMM keys can be used.

The new approach is to utilize the group id of the channel when the ECM and EMM algorithms run. In order OSCam-Emu to know what is the correct group id to use, it calculates a hash based on tsid, onid and enigma namespace of the transponder. The user then needs to enter a new line in the SoftCam.key telling OSCam-Emu which group id to use for each transponder (hash).

The syntax for this line is the following:

P <hash> GROUP <groupid>

Where:

hash    (4 bytes) :  Transponder hash calculated automatically by OSCam-Emu. Use debug level 2 to display it.
groupid (2 bytes) :  The group id that is used for the ECM and EMM keys.

Example:

P BF175115 GROUP 0080 ; 12303 V, 0.8°W
P ACE05CA0 GROUP 0080 ; 12360 V, 4.8°E

P 9798A8F2 GROUP 0900 ; 11804 V, 9.0°E

Transponders using the same ECM and EMM keys should use the same group (this should be the case for the traditional method as well) and thus multiple "GROUP" entries should exist for that group id.

After adding the GROUP instruction for a group, the next step is to remove all ECM keys for that group and enter a new one with the dummy srvid 0xFFFF. For example:

P 0900FFFF 00 00000000000000 ; ECM Key
P 0900FFFF 01 00000000000000 ; ECM Key

The EMM keys should remain untouched. After restarting the Emu reader, the new method should take over for both the ECM algorithm and the EMM (AU) aglorithm.

The advantages of this new method are many:

  • One ECM key is used for all channels in a transponder, so the SoftCam.Key has smaller size and it's easier to maintain and update.
  • Memory consumption is lower and getting the correct key is faster.
  • All problems described in Note 3 are disappeared, which makes creating a proper, trouble-free SoftCam.Key easier for all.

On the other hand there is one drawback: The application of this new method is limited to STBs utilizing the enigma namespace, like enigma2 boxes and TVheadend, VDR, etc.


Note 1

For channels with the same service id, the correct ECM key will be detected automatically, but each key needs a unique groupid. If you need different ECM keys for channels with the same service id, make sure they belong to different groups, like in the example:

P 009E0234 01 11223344556677
P 00040234 01 22334455667788
P 013E0234 01 33445566778899

Duplicate keys (same groupid and same srvid) are not allowed. If there are any duplicates, only the last one in the SoftCam.Key file will be used. This also means that as new ECM keys are found and appended to the file, they will automatically replace earlier keys.

Note 2

In order the auto update feature to work, the ECM keys must be seeded. This is done by entering a dummy ECM key and a corresponding (i.e. with the same group id) EMM key, for example:

P 00010004 00 00000000000000
P 00010004 01 00000000000000

P 0001 AABBCCDD 11223344556677

When you tune into the channel with the service id '0004', the auto update function will run. After a while, a new ECM key will be written at the bottom of the SoftCam.Key file. This new ECM key will be used instead of the dummy one when opening the channel. For each service id, a dummy ECM key has to be added. Each EMM key will update all ECM keys in the same group.

Note 3

Multiple EMM keys are allowed for each group, but there is a maximum number of 32 EMM keys that will be used when auto updating. When the auto update function runs, the algorithm does not match the group id. This means that these 32 EMM keys are chosen among all groups that have an ECM key with the current channel's service id, and not necessarily from the 'correct' group. The effective number of EMM keys for auto updating is thus 32 per service id (channel). This design has two side effects:

  • If there are many EMM keys for each group, there is a chance all 32 EMM keys are chosen from the 'wrong' group. Then the auto update function will never update the ECM keys.
  • Since no group id is matched, there is a chance the newly found ECM keys to be written to the 'wrong' group.

For best results, it is recommended to have no more than 10 EMM keys in each group, especially if you have many groups in your SoftCam.Key file, and make sure there are no EMM keys with the same UA belonging to different groups.

When using the new method for matching ECM and EMM keys based on transponder, all considerations described above are gone. Only limitation is the maximum number of EMM keys that can be used per group are 32.


Configuring DVB-Api (on compatible devices)

Some receivers support PowerVu through direct DVB-Api decryption. If your device supports it, configure OSCam-Emu as follows:

  1. Disable Stream Relay (on by default) through the WebIf:

     WebIf -> Config -> Stream Relay -> Mode
     0 - disabled (use direct DVB-Api decryption)
    

    or by editing the oscam.conf file:

     [streamrelay]
     stream_relay_enabled = 0
    
  2. Select the correct extended CW API:

     Webif -> Config -> DVB-Api -> API for extended CWs
     1 - OE 2.2
     2 - OE 2.0
    

    or by editing the oscam.conf file:

     [dvbapi]
     extended_cw_api = 1
    

Configuring the Stream Relay

Some older receivers support PowerVu only through the Stream Relay (internal streaming). This setup needs a fast CPU though and not every STB is fast enough. If you cannot fix stuttering with the following guide, likely your CPU is too slow.

For best performance, the "Include ECM in http streams" setting must be enabled. If your image supports it (openpli, openatv), you can find it in OpenWebif -> Settings -> Customize. If this setting is not available, you may need to adjust the "ECM fix delay" setting in OSCam webIf (Config -> Stream Relay). Increase/Lower it until there is no stuttering.

To learn how to enable the Stream Relay and configure it for use with PowerVu channels, jump to the Stream Relay configuration page.