Project

General

Profile

Feature #3360

Support for extended CW API

Added by B C about 9 years ago. Updated over 6 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
Descrambling
Target version:
Start date:
2015-11-30
Due date:
% Done:

0%

Estimated time:

Description

like multiple CWs per channel needed for eg PowerVU support

Keep up the good work


Files

gdb.txt (2.79 KB) gdb.txt gdb crash log from tvh Petar Ivanov, 2017-05-26 18:22
tvh.log (1.01 MB) tvh.log --trace descrambler,capmt Petar Ivanov, 2017-06-07 04:09
tvh1.log (7.2 MB) tvh1.log --trace descrambler,capmt and ghlitches capmt: oscam: Invalid cipher mode 236 Petar Ivanov, 2017-06-08 04:11
tvh2.log (269 KB) tvh2.log this trace channels is also PowerVU - Science Poland HD not open Petar Ivanov, 2017-06-08 04:12
tvh.log (4.97 MB) tvh.log --trace descrambler,capmt Petar Ivanov, 2017-06-08 20:33
tvh.log (9.15 MB) tvh.log --trace descrambler,capmt Petar Ivanov, 2017-06-09 18:42
tvh.log (11.6 MB) tvh.log --trace descrambler,capmt with 2 PowerVU channesl same time Petar Ivanov, 2017-06-12 01:48
tvh1.log (28 MB) tvh1.log --trace descrambler,capmt with 1 PowerVu channel Petar Ivanov, 2017-06-12 01:49
tvh.log (755 KB) tvh.log --trace descrambler,capmt for this 3 channels where can't open Petar Ivanov, 2017-06-12 17:59
tvh.log (19.1 MB) tvh.log --trace descrambler,capmt Petar Ivanov, 2017-06-12 18:44
tvh.log (41.3 MB) tvh.log Petar Ivanov, 2017-06-12 19:31
TLC Poland HD.jpg (56.4 KB) TLC Poland HD.jpg Petar Ivanov, 2017-06-12 19:32
Animal Planet Poland HD.jpg (51.5 KB) Animal Planet Poland HD.jpg Petar Ivanov, 2017-06-12 19:32
Science Poland HD.jpg (56 KB) Science Poland HD.jpg Petar Ivanov, 2017-06-12 19:32
oscam.log (487 KB) oscam.log - level 128 Petar Ivanov, 2017-06-12 21:23
tvh-2.log (16 MB) tvh-2.log Petar Ivanov, 2017-06-12 21:24
gdb.txt (2.04 KB) gdb.txt Petar Ivanov, 2017-06-12 22:52
gdb.txt (686 Bytes) gdb.txt Petar Ivanov, 2017-06-13 08:41
tvh.log (762 KB) tvh.log --trace descrambler,capmt Petar Ivanov, 2017-06-13 08:57
oscam-emu.11384.patch (325 KB) oscam-emu.11384.patch Joe User, 2017-06-15 00:51
tvh.log (134 KB) tvh.log --trace descrambler,capmt p k, 2017-06-20 20:41
oscam.log (99.5 KB) oscam.log --debug 128 p k, 2017-06-20 20:41
oscam.log (5.91 MB) oscam.log debug 128 Petar Ivanov, 2017-06-22 17:18
tvh2.log (21.4 MB) tvh2.log --trace descrambler,capmt Petar Ivanov, 2017-06-22 17:18
tvh.log (13.5 MB) tvh.log --trace descrambler,capmt Petar Ivanov, 2017-07-04 19:27
tvh.log (11.4 MB) tvh.log --trace descrambler,capmt Petar Ivanov, 2017-07-05 03:02
oscam.log (14.4 MB) oscam.log debug 128 - same time Petar Ivanov, 2017-07-05 03:02
tvh.log (1.54 MB) tvh.log channel freeze --trace descrambler,capmt p k, 2017-07-06 20:44
oscam.log (2.5 MB) oscam.log channel freeze --debug 128 p k, 2017-07-06 20:44

History

#1

Updated by Jaroslav Kysela about 9 years ago

  • Target version set to 4.4
#3

Updated by Joe User over 8 years ago

I finally found some free time so I worked on adding extended_cw support to TVheadend. I also add DES decryption. I have it basically working, but only have done limited testing. Quite possibly it will break "normal" CSA decryption, (but at this time I do not have a way to test.) I have tested it with both CSA and DES powervu channels.

Things to do:
Find a way to set when to use the extended_cw (for now it is forced.)
Fix decrypting multiple channels on the same transponder ( now starting second channel stops first from working.)
Add more/better debug/trace messages.

Note: I used the latest oscam (11272) with the latest "offical" oscam-emu patch (they incorporated all my changes recently) But I sometimes had problems with oscam getting the PMT information. It would work the first time after oscam was started, but then not again. I am not sure if the problem is with oscam or tvheadend, but I added a line to oscam which enables it to work (almost) always: (line 3144 after oscam-emu patch is applied)

        if((cfg.dvbapi_boxtype == BOXTYPE_PC || cfg.dvbapi_boxtype == BOXTYPE_PC_NODMX || cfg.dvbapi_boxtype == BOXTYPE_SAMYGO)
                 && buffer[7] == 0x82 && buffer[8] == 0x02)
        {
                *demux_index = buffer[9]; // it is always 0 but you never know
                *adapter_index = buffer[10]; // adapter index can be 0,1,2
                *ca_mask = (1 << *adapter_index); // use adapter_index as ca_mask (used as index for ca_fd[] array)
+                if (buffer[21]==0x84 && buffer[22]==0x02) *pmtpid = b2i(2, buffer+23);
        }

Source code is available on my github account (https://github.com/joeusercz/tvheadend/tree/extended_cw) if anyone wants to try it.

I did not bother with a pull request because much more testing needs to be done!

#4

Updated by Joe User over 8 years ago

I finally found some free time so I worked on adding extended_cw support to TVheadend. I also add DES decryption. I have it basically working, but only have done limited testing. Quite possibly it will break "normal" CSA decryption, (but at this time I do not have a way to test.) I have tested it with both CSA and DES powervu channels.

Things to do:
Find a way to set when to use the extended_cw (for now it is forced.)
Fix decrypting multiple channels on the same transponder ( now starting second channel stops first from working.)
Possibly use openssl DES functions. (currently I added cscrypt from oscam-emu.)
Add more/better debug/trace messages.

Note: I used the latest oscam (11272) with the latest "offical" oscam-emu patch (they incorporated all my changes recently) But I sometimes had problems with oscam getting the PMT information. It would work the first time after oscam was started, but then not again. I am not sure if the problem is with oscam or tvheadend, but I added a line to oscam which enables it to work (almost) always: (line 3144 after oscam-emu patch is applied)

        if((cfg.dvbapi_boxtype == BOXTYPE_PC || cfg.dvbapi_boxtype == BOXTYPE_PC_NODMX || cfg.dvbapi_boxtype == BOXTYPE_SAMYGO)
                 && buffer[7] == 0x82 && buffer[8] == 0x02)
        {
                *demux_index = buffer[9]; // it is always 0 but you never know
                *adapter_index = buffer[10]; // adapter index can be 0,1,2
                *ca_mask = (1 << *adapter_index); // use adapter_index as ca_mask (used as index for ca_fd[] array)
+                if (buffer[21]==0x84 && buffer[22]==0x02) *pmtpid = b2i(2, buffer+23);
        }

Source code is available on my github account (https://github.com/joeusercz/tvheadend/tree/extended_cw) if anyone wants to try it.

I did not bother with a pull request because much more testing needs to be done!

#5

Updated by Joe User over 8 years ago

I finally found some free time so I worked on adding extended_cw support to TVheadend. I also add DES decryption. I have it basically working, but only have done limited testing. Quite possibly it will break "normal" CSA decryption, (but at this time I do not have a way to test.) I have tested it with both CSA and DES powervu channels.

Things to do:
Find a way to set when to use the extended_cw (for now it is forced.)
Fix decrypting multiple channels on the same transponder ( now starting second channel stops first from working.)
Possibly use openssl DES functions. (currently I added cscrypt from oscam-emu.)
Add extended_cw functionality to LIBDVBCSA. ( currently I only implemented it with ffdecsa.)
Add more/better debug/trace messages.

Note: I used the latest oscam (11272) with the latest "offical" oscam-emu patch (they incorporated all my changes recently) But I sometimes had problems with oscam getting the PMT information. It would work the first time after oscam was started, but then not again. I am not sure if the problem is with oscam or tvheadend, but I added a line to oscam which enables it to work (almost) always: (line 3144 after oscam-emu patch is applied)

        if((cfg.dvbapi_boxtype == BOXTYPE_PC || cfg.dvbapi_boxtype == BOXTYPE_PC_NODMX || cfg.dvbapi_boxtype == BOXTYPE_SAMYGO)
                 && buffer[7] == 0x82 && buffer[8] == 0x02)
        {
                *demux_index = buffer[9]; // it is always 0 but you never know
                *adapter_index = buffer[10]; // adapter index can be 0,1,2
                *ca_mask = (1 << *adapter_index); // use adapter_index as ca_mask (used as index for ca_fd[] array)
+                if (buffer[21]==0x84 && buffer[22]==0x02) *pmtpid = b2i(2, buffer+23);
        }

Source code is available on my github account (https://github.com/joeusercz/tvheadend/tree/extended_cw) if anyone wants to try it.

I did not bother with a pull request because much more testing needs to be done!

#6

Updated by Jaroslav Kysela over 7 years ago

Ok, I did a lot of work in current 4.3 tree. It's almost ready but untested. I choose a bit different implementation way than Joe User. So, if you look to v4.3-156-g85ea455, all pieces are in.

#7

Updated by Petar Ivanov over 7 years ago

Great work @Jaroslav Kysela,
i tested last 4.3-156-g85ea455, but you already have code for PowerVu channels ? , because i tested with PowerVu channels from 1W and not work.

I am tested also code of Joe Miller User from here https://github.com/joeusercz/tvheadend/tree/extended_cw and PowerVU channels work nice with his code.

I am readdy to provide logs and somethings else for PowerVu if you needs.

#8

Updated by Jaroslav Kysela over 7 years ago

More work in v4.3-161-gb8aae7b. If you use extended_cw_api = 1 in oscam, you should enable 'Extended' CW mode in tvh, too. The 'Extended DES' mode should be autodetected.

#9

Updated by Petar Ivanov over 7 years ago

I tested last v4.3-161-gb8aae7b with enable extended_cw_api = 1 in oscam and also enable 'Extended' mode in CAPMT in CW mode.

On PowerVu channels, TVH crash:

2017-05-26 18:43:34.936 [ ERROR] descrambler: cannot decode packets for service "Animal Planet HD"
2017-05-26 18:43:36.919 [ ALERT] CRASH: Signal: 11 in PRG: ./build.linux/tvheadend (4.3-161~gb8aae7bdd) [f1dfff650880d6b1a8b13cb8bda2984979894788] CWD: /home/user/tvheadend
2017-05-26 18:43:36.919 [ ALERT] CRASH: Fault address 0x28 (Address not mapped)
2017-05-26 18:43:36.919 [ ALERT] CRASH: Loaded libraries: linux-vdso.so.1 /usr/lib/libdvben50221.so /usr/lib/libdvbapi.so /usr/lib/libucsi.so /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /lib/x86_64-linux-gnu/libz.so.1 /lib/x86_64-linux-gnu/libpcre.so.3 /usr/lib/x86_64-linux-gnu/liburiparser.so.1 /lib/x86_64-linux-gnu/libdbus-1.so.3 /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/libm.so.6 /lib/x86_64-linux-gnu/librt.so.1 /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libsystemd.so.0 /lib64/ld-linux-x86-64.so.2 /lib/x86_64-linux-gnu/libselinux.so.1 /lib/x86_64-linux-gnu/liblzma.so.5 /usr/lib/x86_64-linux-gnu/liblz4.so.1 /lib/x86_64-linux-gnu/libgcrypt.so.20 /lib/x86_64-linux-gnu/libgpg-error.so.0
2017-05-26 18:43:36.919 [ ALERT] CRASH: Register dump [23]: 0000000000280a470000000000173ea40000000000000a280000000000000814000000000000017800007efea00063a0000000000000000000007efea0008a480000000000000020000055a442fb99a0000000000007f99000007efe8021604000007efe802160400000000000000178000000000000017800007efe997f9670000055a4411d74260000000000010206002b0000000000330000000000000004000000000000000efffffffe7ffbba110000000000000028
2017-05-26 18:43:36.919 [ ALERT] CRASH: STACKTRACE
2017-05-26 18:43:36.934 [ ALERT] CRASH: /home/user/tvheadend/src/trap.c:148 0x55a4411727ba 0x55a440fe8000
2017-05-26 18:43:36.949 [ ALERT] CRASH: ??:0 0x7efed22120c0 0x7efed2201000
2017-05-26 18:43:36.964 [ ALERT] CRASH: /home/user/tvheadend/src/descrambler/descrambler.c:849 0x55a4411d7426 0x55a440fe8000
2017-05-26 18:43:36.979 [ ALERT] CRASH: /home/user/tvheadend/src/input/mpegts/tsdemux.c:338 0x55a4411e0331 0x55a440fe8000
2017-05-26 18:43:36.993 [ ALERT] CRASH: /home/user/tvheadend/src/input/mpegts/mpegts_input.c:1412 0x55a4411dd855 0x55a440fe8000
2017-05-26 18:43:37.006 [ ALERT] CRASH: /home/user/tvheadend/src/wrappers.c:161 0x55a44113a871 0x55a440fe8000

#10

Updated by Petar Ivanov over 7 years ago

gdb crash log

#11

Updated by Jaroslav Kysela over 7 years ago

Retest with v4.3-174-gfdb364f .

#12

Updated by Jaroslav Kysela over 7 years ago

Note that there are two modes for OE 2.2 key algo/mode support. You should select the right one.

#13

Updated by saen acro over 7 years ago

git pull
remote: Counting objects: 12, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 12 (delta 9), reused 12 (delta 9), pack-reused 0
Разпакетиране на обектите: 100% (12/12), действието завърши.
От https://github.com/tvheadend/tvheadend
 + c4bba29...fdb364f master     -> origin/master  (принудително обновяване)
Автоматично сливане на „src/descrambler/algo/libdesdec.c“
КОНФЛИКТ (съдържание): Конфликт при сливане на „src/descrambler/algo/libdesdec.c“
Автоматично сливане на „src/descrambler/algo/libaesdec.c“
КОНФЛИКТ (съдържание): Конфликт при сливане на „src/descrambler/algo/libaesdec.c“
Неуспешно сливане — коригирайте конфликтите и подайте резултата.

there is some conflict on GIT
#14

Updated by saen acro over 7 years ago

CC              src/descrambler/algo/libaesdec.o
src/descrambler/algo/libaesdec.c: In function ‘aes_decrypt_packet’:
src/descrambler/algo/libaesdec.c:69:1: error: expected expression before ‘<<’ token
 <<<<<<< HEAD
 ^
src/descrambler/algo/libaesdec.c:86:1: error: expected expression before ‘==’ token
 =======
 ^
src/descrambler/algo/libaesdec.c:97:1: error: expected expression before ‘>>’ token
 >>>>>>> fdb364faba529af672c550d8bc2645bd50e6cc26
 ^
src/descrambler/algo/libaesdec.c:107:1: error: expected declaration or statement at end of input
 }
 ^
src/descrambler/algo/libaesdec.c:107:1: error: expected declaration or statement at end of input
Makefile:638: recipe for target '/opt/tvheadend/build.linux/src/descrambler/algo/libaesdec.o' failed
make[2]: *** [/opt/tvheadend/build.linux/src/descrambler/algo/libaesdec.o] Error 1
make[2]: Leaving directory '/opt/tvheadend'
debian/rules:11: recipe for target 'override_dh_auto_build' failed
make[1]: *** [override_dh_auto_build] Error 2
make[1]: Leaving directory '/opt/tvheadend'
debian/rules:5: recipe for target 'build' failed
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
#15

Updated by Jaroslav Kysela over 7 years ago

Sean Sean acro: git repo is fine. I pushed an old version of one commit, so you should remove it - you merged the old and new code in your local branch, so you're not on v4.3-174-gfdb364f. Do:

$ git reset --hard origin/master

or 

$ git reset --hard HEAD~10
$ git pull origin master
#16

Updated by saen acro over 7 years ago

Jaroslav Kysela wrote:

Sean Sean acro: git repo is fine. I pushed an old version of one commit, so you should remove it - you merged the old and new code in your local branch, so you're not on v4.3-174-gfdb364f. Do:

$ git reset --hard HEAD~10
$ git pull origin master

Last two commands solve problem. My last pull and build was 4.3-173~gc4bba29
on 3 systems same error debian x64, ubuntu x64 and x86

#17

Updated by Petar Ivanov over 7 years ago

v4.3-174-gfdb364f work good with Extended (OE 2.2), mode follows key for PowerVU channels on 1W and 9E work good, other mode only Extended (OE 2.2) not work for PowerVu i dont for what is.
Thanks, i will make more test ,but for now work good.

#18

Updated by Petar Ivanov over 7 years ago

In last 4.3-197~gf367aba get errors in descramble.

log with --trace descrambler,capmt

#19

Updated by Petar Ivanov over 7 years ago

v4.3-205~g9228 when try to play two PoreVU channesl and after time glitches
Also found channels where not open Science Poland HD also PowerVU

#20

Updated by Jaroslav Kysela over 7 years ago

Retest with v4.3-206-gb5ec51c .

#21

Updated by Petar Ivanov over 7 years ago

v4.3-208 - same problem after time glitches

#22

Updated by Pascale Ullrich over 7 years ago

I think I have the same problem

2017-06-08 22:20:33.534 capmt: OSCam: Starting CAPMT server for service "RTL HD" on adapter 0
2017-06-08 22:20:33.534 subscription: 0078: "192.168.30.38 [ htpc | Kodi Media Center ]" subscribing on channel "RTL HD", weight: 150, adapter: "SAT>IP DVB-C Tuner #3 (192.168.30.200)", network: "DVB-C Network", mux: "138MHz", provider: "Unitymedia", service: "RTL HD", profile="htsp", hostname="192.168.30.38", username="htpc", client="Kodi Media Center"
2017-06-08 22:20:33.613 TS: DVB-C Network/138MHz/RTL HD Transport error indicator (total 1)
2017-06-08 22:20:34.031 TS: DVB-C Network/138MHz/RTL HD: H264 #523: Invalid start code 8f:37:0c
2017-06-08 22:20:34.132 TS: DVB-C Network/138MHz/RTL HD: AC3
#524: Invalid start code f8:fa:33
2017-06-08 22:20:38.371 TS: DVB-C Network/138MHz/RTL HD: H264 #523 Continuity counter error (total 1)
2017-06-08 22:20:38.371 TS: DVB-C Network/138MHz/RTL HD: AC3
#524 Continuity counter error (total 1)
2017-06-08 22:20:38.371 TS: DVB-C Network/138MHz/RTL HD: TELETEXT #528 Continuity counter error (total 1)
2017-06-08 22:20:38.373 TS: DVB-C Network/138MHz/RTL HD: HBBTV
#1561 Continuity counter error (total 1)
2017-06-08 22:20:38.375 descrambler: cannot decode packets for service "RTL HD"
2017-06-08 22:20:48.331 TS: DVB-C Network/138MHz/RTL HD: H264 #523 Continuity counter error (total 2492)
2017-06-08 22:20:48.331 TS: DVB-C Network/138MHz/RTL HD: AC3
#524 Continuity counter error (total 2105)
2017-06-08 22:20:48.331 TS: DVB-C Network/138MHz/RTL HD: TELETEXT #528 Continuity counter error (total 1994)
2017-06-08 22:20:48.332 TS: DVB-C Network/138MHz/RTL HD: HBBTV
#1561 Continuity counter error (total 52)
2017-06-08 22:20:48.332 descrambler: cannot decode packets for service "RTL HD"
2017-06-08 22:20:48.334 TS: DVB-C Network/138MHz/RTL HD: H264 #523: Invalid start code 4b:28:30
2017-06-08 22:20:48.336 TS: DVB-C Network/138MHz/RTL HD: AC3
#524: Invalid start code b5:01:2d
2017-06-08 22:21:08.373 TS: DVB-C Network/138MHz/RTL HD: H264 #523 Continuity counter error (total 2525)
2017-06-08 22:21:08.373 TS: DVB-C Network/138MHz/RTL HD: AC3
#524 Continuity counter error (total 2133)
2017-06-08 22:21:08.373 TS: DVB-C Network/138MHz/RTL HD: TELETEXT #528 Continuity counter error (total 2021)
2017-06-08 22:21:08.374 TS: DVB-C Network/138MHz/RTL HD: HBBTV
#1561 Continuity counter error (total 53)

#23

Updated by Jaroslav Kysela over 7 years ago

v4.3-210-g7644886

#24

Updated by Petar Ivanov over 7 years ago

4.3-210~g764488 glitches continue

#25

Updated by Jaroslav Kysela over 7 years ago

Try v4.3-211-g1c1f52c . I think that I finally found the right fix.

#26

Updated by Petar Ivanov over 7 years ago

Unfortunately again freeze with v4.3-211-g1c1f52c with Extended (OE 2.2), mode follows key
Also give this:
[ ERROR] capmt: oscam: Invalid cipher mode 4
[ ERROR] capmt: oscam: Invalid cipher mode 233

tvh.log with 2 PowerVU channels same time

tvh1.log with one PowerVU channel and glitches more rarely, but again freeze

#27

Updated by Pablo R. over 7 years ago

I dont have problems here... With 4.3-211. Its true that I am using simple descrambling. But since last version is working very, very good.

Perexg has done a good job. :P

#28

Updated by Jaroslav Kysela over 7 years ago

v4.3-213-g54f2d47 , it should resolve both 'no key' and 'Invalid cipher' issues

#29

Updated by Petar Ivanov over 7 years ago

Nice v4.3-214~g9b56fce5c - work good without freeze and glitches on more PowerVU channels.

Next step is on 5E have 3 PowerVU channels with maybe differend kind on encryption, because only this channels can't decode, all other tested work nice.

provide log from this 3 channels where can't open, but in Oscam show "found" and send to TVH ,but TVH don't decode.

#30

Updated by Jaroslav Kysela over 7 years ago

Change '#if 0' to '#if 1' (DEBUG2) in src/descrambler/descrambler.c and create a new (more verbose) log with this.

#31

Updated by Petar Ivanov over 7 years ago

log with change '#if 1'

#32

Updated by Jaroslav Kysela over 7 years ago

Add this code, create a new log and show me the contents of the 'service info' dialog (i icon in the service grid).

diff --git a/src/descrambler/descrambler.c b/src/descrambler/descrambler.c
index 05492bf..52bd615 100644
--- a/src/descrambler/descrambler.c
+++ b/src/descrambler/descrambler.c
@@ -1014,7 +1014,10 @@ descrambler_descramble ( service_t *t,
         goto dd_destroy;
       if (dr->dr_key_multipid) {
         tk = key_find_struct(dr, tk, tsb2, t);
-        if (tk == NULL) goto next;
+        if (tk == NULL) {
+          debug2("%p: tk == NULL, pid = %d", dr, extractpid(tsb2));
+          goto next;
+        }
       }
       now = mclk();
 #ifdef DEBUG2
#33

Updated by Petar Ivanov over 7 years ago

log with change with new code added.

Service info from 3 channels where not open.

#34

Updated by Jaroslav Kysela over 7 years ago

Could you test this change?

diff --git a/src/descrambler/capmt.c b/src/descrambler/capmt.c
index 67d076f..290bad0 100644
--- a/src/descrambler/capmt.c
+++ b/src/descrambler/capmt.c
@@ -2008,6 +2008,7 @@ capmt_update_elementary_stream(capmt_service_t *ct, int *_i,
   case SCT_H264:       type = 0x1b; break;
   case SCT_HEVC:       type = 0x24; break;
   case SCT_DVBSUB:     type = 0x06; break;
+  case SCT_TELETEXT:   type = 0x06; break;
   default:
     if (SCT_ISVIDEO(st->es_type)) type = 0x02;
     else if (SCT_ISAUDIO(st->es_type)) type = 0x04;
#35

Updated by Petar Ivanov over 7 years ago

Nope, don't decode.

#36

Updated by Jaroslav Kysela over 7 years ago

Use 'Science Poland HD' and verify if oscam sends keys for PID 1811 (TELETEXT). I probably need logs from both tvh and oscam to see what's wrong.

#37

Updated by Petar Ivanov over 7 years ago

Channel Science Poland HD and log from both TVH and Oscam same timee

#38

Updated by Jaroslav Kysela over 7 years ago

Retest with v4.3-218-gea2d899, pls.

#39

Updated by Petar Ivanov over 7 years ago

crash on this channel

2017-06-12 23:16:49.456 [ ALERT] CRASH: Signal: 11 in PRG: ./build.linux/tvheadend (4.3-218~gea2d89950) [1d6f3d7974e1881036a045dac0e70daddd09bd03] CWD: /home/user/tvheadend
2017-06-12 23:16:49.456 [ ALERT] CRASH: Fault address 0x68 (Address not mapped)
2017-06-12 23:16:49.456 [ ALERT] CRASH: Loaded libraries: linux-vdso.so.1 /usr/lib/libdvben50221.so /usr/lib/libdvbapi.so /usr/lib/libucsi.so /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /lib/x86_64-linux-gnu/libz.so.1 /lib/x86_64-linux-gnu/libpcre.so.3 /usr/lib/x86_64-linux-gnu/liburiparser.so.1 /lib/x86_64-linux-gnu/libdbus-1.so.3 /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/libm.so.6 /lib/x86_64-linux-gnu/librt.so.1 /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libsystemd.so.0 /lib64/ld-linux-x86-64.so.2 /lib/x86_64-linux-gnu/libselinux.so.1 /lib/x86_64-linux-gnu/liblzma.so.5 /usr/lib/x86_64-linux-gnu/liblz4.so.1 /lib/x86_64-linux-gnu/libgcrypt.so.20 /lib/x86_64-linux-gnu/libgpg-error.so.0
2017-06-12 23:16:49.456 [ ALERT] CRASH: Register dump [23]: 00007fb70000551083781dc514080700c14c021223650e2cfdc532239e620431000000000000000000007fb70001e64000007fb70000555000007fb71c008fc800007fb71c006520000000000000071300007fb71c00656800000000000000bc00007fb71c008fc80000000000000040000000000000000000007fb72a1ef6700000560d89aa779f0000000000010246002b0000000000330000000000000004000000000000000efffffffe7ffbba110000000000000068
2017-06-12 23:16:49.456 [ ALERT] CRASH: STACKTRACE
2017-06-12 23:16:49.470 [ ALERT] CRASH: /home/user/tvheadend/src/trap.c:148 0x560d89a4201a 0x560d8989f000
2017-06-12 23:16:49.491 [ ALERT] CRASH: ??:0 0x7fb74c8d80c0 0x7fb74c8c7000
2017-06-12 23:16:49.510 [ ALERT] CRASH: /home/user/tvheadend/src/descrambler/descrambler.c:1170 0x560d89aa779f 0x560d8989f000
2017-06-12 23:16:49.524 [ ALERT] CRASH: /home/user/tvheadend/src/input/mpegts/tsdemux.c:338 0x560d89ab0441 0x560d8989f000
2017-06-12 23:16:49.540 [ ALERT] CRASH: /home/user/tvheadend/src/input/mpegts/mpegts_input.c:1332 0x560d89aad965 0x560d8989f000
2017-06-12 23:16:49.552 [ ALERT] CRASH: /home/user/tvheadend/src/wrappers.c:161 0x560d89a09ee1 0x560d8989f000
2017-06-12 23:16:49.567 [ ALERT] CRASH: ??:0 0x7fb74c8ce494 0x7fb74c8c7000
2017-06-12 23:16:49.567 [ ALERT] CRASH: clone+0x3f (/lib/x86_64-linux-gnu/libc.so.6)

#40

Updated by Joe User over 7 years ago

I am unable to test now, but a quick look at the oscam log show the initial pmt generated and sent by tvheadend and the real pmt sent later are not in the same order - this can cause index sync problems between oscam and tvheadend.

2017/06/12 22:16:18 36C3147D c   (dvbapi) Demuxer 0 found pmt type: 81 length: 8 (assuming enigma private descriptor: namespace 0000 tsid 01 onid 5e)
2017/06/12 22:16:18 36C3147D c   (dvbapi) Demuxer 0 ecmpid 0 CAID: 0E00 ECM_PID: 177F PROVID: 000000 
2017/06/12 22:16:18 36C3147D c   (dvbapi) Demuxer 0 stream Videostream (MPEG-4)(type: 1b pid: 0708 length: 0)
2017/06/12 22:16:18 36C3147D c   (dvbapi) Demuxer 0 stream Audiostream (Dolby Digital)(type: 81 pid: 070a length: 0)
2017/06/12 22:16:18 36C3147D c   (dvbapi) Demuxer 0 stream Audiostream (Dolby Digital)(type: 81 pid: 0709 length: 0)
2017/06/12 22:16:18 36C3147D c   (dvbapi) Demuxer 0 stream Audiostream (MPEG-2)(type: 04 pid: 070b length: 0)
2017/06/12 22:16:18 36C3147D c   (dvbapi) Demuxer 0 found 1 ECMpids and 4 STREAMpids in caPMT
2017/06/12 22:16:18 36C3147D c   (dvbapi) Demuxer 0 serving srvid 0708 (Science Poland HD) on adapter 0000 camask 0001 index 0000 pmtpid 0000

2017/06/12 22:16:19 36C3147D c   (dvbapi) pmt:
2017/06/12 22:16:19 36C3147D c   (dvbapi)   02 B0 78 07 08 CB 00 00 E7 08 F0 0C 09 04 0E 00 
2017/06/12 22:16:19 36C3147D c   (dvbapi)   F7 7F 0F 04 53 41 50 53 1B E7 08 F0 17 28 04 4D 
2017/06/12 22:16:19 36C3147D c   (dvbapi)   40 1E 3F 2A 0F FF 7F 00 00 00 01 00 00 01 C2 00 
2017/06/12 22:16:19 36C3147D c   (dvbapi)   00 03 E9 9F 06 E7 09 F0 11 81 05 08 20 03 FF 0F 
2017/06/12 22:16:19 36C3147D c   (dvbapi)   0A 04 70 6F 6C 00 6A 02 00 00 06 E7 0A F0 11 81 
2017/06/12 22:16:19 36C3147D c   (dvbapi)   05 08 20 03 FF 2F 0A 04 65 6E 67 00 6A 02 00 00 
2017/06/12 22:16:19 36C3147D c   (dvbapi)   04 E7 0B F0 06 0A 04 70 6F 6C 00 06 E7 13 F0 07 
2017/06/12 22:16:19 36C3147D c   (dvbapi)   56 05 70 6F 6C 28 58 4A 55 E1 A7 
2017/06/12 22:16:19 36C3147D c   (dvbapi) Demuxer 0 stream Videostream (MPEG-4)(type: 1b pid: 0708 length: 23)
2017/06/12 22:16:19 36C3147D c   (dvbapi) Demuxer 0 stream Data-/Audiostream (Subtitles/VBI and AC-3)(type: 06 pid: 0709 length: 17)
2017/06/12 22:16:19 36C3147D c   (dvbapi) Demuxer 0 stream Data-/Audiostream (Subtitles/VBI and AC-3)(type: 06 pid: 070a length: 17)
2017/06/12 22:16:19 36C3147D c   (dvbapi) Demuxer 0 stream Audiostream (MPEG-2)(type: 04 pid: 070b length: 6)
2017/06/12 22:16:19 36C3147D c   (dvbapi) Demuxer 0 stream Data-/Audiostream (Subtitles/VBI and AC-3)(type: 06 pid: 0713 length: 7)
2017/06/12 22:16:19 36C3147D c   (dvbapi) Demuxer 0 found 1 ECMpids and 5 STREAMpids in PMT
2017/06/12 22:16:19 36C3147D c   (dvbapi) Demuxer 0 serving srvid 0708 (Science Poland HD) on adapter 0000 camask 0001 index 0000 pmtpid 0000

In my code I solved this by never sending the real pmt to oscam.

This also becomes a problem when one uses stream filters to use only certain audio pids...

#41

Updated by Jaroslav Kysela over 7 years ago

Could you compile tvh with '--enable-ccdebug' ? I don't see probably the exact crash line with the optimized binary. Provide the crash lines again.

#42

Updated by Jaroslav Kysela over 7 years ago

Joe User wrote:

In my code I solved this by never sending the real pmt to oscam.

This also becomes a problem when one uses stream filters to use only certain audio pids...

The new code works only with PID numbers, so the unknown PID (filtered or so) is just ignored. The teletext PID was missing in the first (non-real) PMT sent by tvh, but it's fixed now.

#43

Updated by Petar Ivanov over 7 years ago

same line with '--enable-ccdebug'

i upload gdb

#44

Updated by Petar Ivanov over 7 years ago

2017-06-12 23:57:53.453 [ ALERT]:CRASH: Signal: 11 in PRG: ./build.linux/tvheadend (4.3-218~gea2d89950) [28d7241e214ff74166da640161d6ad9546c7081f] CWD: /home/home/user/tvheadend
2017-06-12 23:57:53.453 [ ALERT]:CRASH: Fault address 0x68 (Address not mapped)
2017-06-12 23:57:53.453 [ ALERT]:CRASH: Loaded libraries: linux-vdso.so.1 /usr/lib/libdvben50221.so /usr/lib/libdvbapi.so /usr/lib/libucsi.so /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /lib/x86_64-linux-gnu/libz.so.1 /lib/x86_64-linux-gnu/libpcre.so.3 /usr/lib/x86_64-linux-gnu/liburiparser.so.1 /lib/x86_64-linux-gnu/libdbus-1.so.3 /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/libm.so.6 /lib/x86_64-linux-gnu/librt.so.1 /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libsystemd.so.0 /lib64/ld-linux-x86-64.so.2 /lib/x86_64-linux-gnu/libselinux.so.1 /lib/x86_64-linux-gnu/liblzma.so.5 /usr/lib/x86_64-linux-gnu/liblz4.so.1 /lib/x86_64-linux-gnu/libgcrypt.so.20 /lib/x86_64-linux-gnu/libgpg-error.so.0
2017-06-12 23:57:53.453 [ ALERT]:CRASH: Register dump [23]: 00007f4d7803d6f0031e06007ce05b00105c11ad56d5e964d471443cb3d20068000000000000000000007f4dc838988f000000000000000000007f4dceb4604000007f4d7803e72000007f4da0006bb800007f4daa7f269000000000000000000000005abc9e3736000000000000000000005634c0c5183000007f4daa7f261000005634bf29a5f90000000000010246002b0000000000330000000000000004000000000000000efffffffe7ffbba110000000000000068
2017-06-12 23:57:53.453 [ ALERT]:CRASH: STACKTRACE
2017-06-12 23:57:53.467 [ ALERT]:CRASH: /home/home/user/tvheadend/src/trap.c:148 0x5634bf209354 0x5634bf049000
2017-06-12 23:57:53.481 [ ALERT]:CRASH: ??:0 0x7f4dccf8f0c0 0x7f4dccf7e000
2017-06-12 23:57:53.494 [ ALERT]:CRASH: /home/home/user/tvheadend/src/descrambler/descrambler.c:1018 0x5634bf29a5f9 0x5634bf049000
2017-06-12 23:57:53.508 [ ALERT]:CRASH: /home/home/user/tvheadend/src/input/mpegts/tsdemux.c:338 0x5634bf2a8720 0x5634bf049000
2017-06-12 23:57:53.525 [ ALERT]:CRASH: /home/home/user/tvheadend/src/input/mpegts/mpegts_input.c:1332 (discriminator 2) 0x5634bf2a538c 0x5634bf049000
2017-06-12 23:57:53.541 [ ALERT]:CRASH: /home/home/user/tvheadend/src/input/mpegts/mpegts_input.c:1475 0x5634bf2a59bf 0x5634bf049000
2017-06-12 23:57:53.552 [ ALERT]:CRASH: /home/home/user/tvheadend/src/wrappers.c:161 0x5634bf1bcd24 0x5634bf049000
2017-06-12 23:57:53.566 [ ALERT]:CRASH: ??:0 0x7f4dccf85494 0x7f4dccf7e000
2017-06-12 23:57:53.566 [ ALERT]:CRASH: clone+0x3f (/lib/x86_64-linux-gnu/libc.so.6)

#45

Updated by Jaroslav Kysela over 7 years ago

v4.3-219-g11b2611

#46

Updated by Petar Ivanov over 7 years ago

Again crash

#47

Updated by Jaroslav Kysela over 7 years ago

Sorry, I'm just blind for those bugs. v4.3-222-g429679e

#48

Updated by Petar Ivanov over 7 years ago

Not crash, but and not decode again.

2017-06-13 09:54:24.565 [WARNING] descrambler: Overwrite key1800 type from DES to CSA for service "Science Poland HD"
2017-06-13 09:54:24.565 [WARNING] descrambler: Overwrite key1803 type from DES to CSA for service "Science Poland HD"
2017-06-13 09:54:25.478 [ ERROR] descrambler: cannot decode packets for service "Science Poland HD"
2017-06-13 09:54:25.930 [WARNING] descrambler: Science Poland HD stream key1811 is not available
2017-06-13 09:54:35.646 [ ERROR] descrambler: cannot decode packets for service "Science Poland HD"
2017-06-13 09:54:35.940 [WARNING] descrambler: Science Poland HD stream key1811 is not available
2017-06-13 09:54:45.837 [ ERROR] descrambler: cannot decode packets for service "Science Poland HD"

#49

Updated by Petar Ivanov over 7 years ago

v4.3-222-g429679e
Now and other PowerVu channels where, before decode now not decode.

#50

Updated by Jaroslav Kysela over 7 years ago

The oscam replies are not perfect. There's mix for DES/CSA key algorithms. If you see 'CSA' key, then something is wrong. Try v4.3-224-g9432ddd - I added another workaround.

#51

Updated by Joe User over 7 years ago

Jaroslav Kysela wrote:

Joe User wrote:

In my code I solved this by never sending the real pmt to oscam.

This also becomes a problem when one uses stream filters to use only certain audio pids...

The new code works only with PID numbers, so the unknown PID (filtered or so) is just ignored. The teletext PID was missing in the first (non-real) PMT sent by tvh, but it's fixed now.

I was away for a few weeks and I am quite busy catching up, so I do not have time now to test or look at the new code. But, CA_SET_DESCR and CA_SET_DESCR_MODE messages both only include an index value and not a pid, so I am not sure how you use only pid numbers?? Also, I vaguely remember there was also a possible issue (bug??) internal to oscam affecting the indexes when the pmt changed. Sorry can't remember exact details as it was over a year ago and blocking the real PMT from being sent fixed the problem for me.

Also, I do not recall ever seeing oscam sending conflicting modes and I quick check of my STB shows the IOCTL calls from oscam-emu are consistent for these channels. Although there certainly couls be a difference between the IOCTL calls and the messages sent via network. Again. sorry I do not have time now to review the oscam-emu DVBAPI module.

Last thing, a recent change to oscam switched the order of sending CA_SET_DESCR and CA_SET_DESR_MODE which caused problems for me. I wrote a bug report, but it has been ignored. ([[http://www.streamboard.tv/oscam/ticket/4586]] So, I reverted the change in oscam-emu. The source code for the latest oscam patched with oscam-emu is available on my github account: [[https://github.com/joeusercz/OSCam-with-emu-branch/tree/oscam-emu-merged]] More info here: [[http://www.streamboard.tv/wbb2/thread.php?threadid=45236&hilightuser=142703]]

#52

Updated by Petar Ivanov over 7 years ago

Now finaly with v4.3-224-g9432ddd three PowerVu channels with teletext 'TLC' 'Animal' 'Science' Poland now decode and work.

With oscam from svn and patched with oscam-emu is many unstable oscam send/replies every time with mix DES/CSA and with more then 2 channels 3rd and more or not decode or must stat stop several time to start work good.

Now i make test with oscam-emu with change from Joe Miller User and all work perfect for now.

Now i make different test with start stop different channels to see all stable and no more freeze , will make more test ,but for now work good.

#53

Updated by Jaroslav Kysela over 7 years ago

Joe User wrote:

I was away for a few weeks and I am quite busy catching up, so I do not have time now to test or look at the new code. But, CA_SET_DESCR and CA_SET_DESCR_MODE messages both only include an index value and not a pid, so I am not sure how you use only pid numbers?? Also, I vaguely remember there was also a possible issue (bug??) internal to oscam affecting the indexes when the pmt changed. Sorry can't remember exact details as it was over a year ago and blocking the real PMT from being sent fixed the problem for me.

You know, there are three commands which controls the descrambling, SET_PID, SET_DESCR_MODE, SET_DESCR. The decoder must know the PID and the associated key. All other things (like indexes for PID/DESCR_MODE/DESCR) are just implementation details which should (and they are) handled only in the dvbapi client. So the current descrambler code receives 'key type', 'key pid', 'odd/oven keys' from the client. No indexes.

Also, I do not recall ever seeing oscam sending conflicting modes and I quick check of my STB shows the IOCTL calls from oscam-emu are consistent for these channels. Although there certainly couls be a difference between the IOCTL calls and the messages sent via network. Again. sorry I do not have time now to review the oscam-emu DVBAPI module.

With your version of oscam-emu, I can see CSA keys instead DSA keys at the stream start - wrong DESCR_MODE (it's rare, but it can be quite easily reproduced with tvh - just do quick wget test multiple times and tvh will print warning that CSA descrambling was changed to DES - first keys were CSA and the later marked as DES).

Last thing, a recent change to oscam switched the order of sending CA_SET_DESCR and CA_SET_DESR_MODE which caused problems for me. I wrote a bug report, but it has been ignored. ([[http://www.streamboard.tv/oscam/ticket/4586]]

The order is really problematic. It's true that DESCR_MODE is static when initially set. So it works with hardware descramblers, but when you add more logic into it, it's really necessary to know, when you have all parameters/info gathered. I just added 'CW Mode' field to the configuration of capmt/dvbapi client in tvh where you can select the incoming order:

   { N_("Standard / auto"),                     CAPMT_CWMODE_AUTO },
   { N_("Extended (OE 2.2)"),                   CAPMT_CWMODE_OE22 },
   { N_("Extended (OE 2.2), mode follows key"), CAPMT_CWMODE_OE22SW },
   { N_("Extended DES (OE 2.0)"),               CAPMT_CWMODE_OE20 },

Most of modes are detected automatically except the 'mode follows key' (which is unfortunately used in the current official oscam repo). I suggested this [[http://www.streamboard.tv/oscam/ticket/4615]] , but the maintainers are not very responsible, indeed.

#54

Updated by Jaroslav Kysela over 7 years ago

  • Status changed from New to Fixed
#55

Updated by Hanspeter Müller over 7 years ago

Hi,

just to clarify, are the two mentioned oscam-branches required, or would they just allow the automatic "mode follows key"-mode detection?

#56

Updated by Joe User over 7 years ago

Jaroslav Kysela wrote:

You know, there are three commands which controls the descrambling, SET_PID, SET_DESCR_MODE, SET_DESCR. The decoder must know the PID and the associated key. All other things (like indexes for PID/DESCR_MODE/DESCR) are just implementation details which should (and they are) handled only in the dvbapi client. So the current descrambler code receives 'key type', 'key pid', 'odd/oven keys' from the client. No indexes.

I just found it much simpler and easier to use the index as an index for the array of keys - this is what is done with the oscam-emu stream-relay descrambling. Also I wanted to change as little as possible the existing tvheadend code to make future merges easier.

With your version of oscam-emu, I can see CSA keys instead DSA keys at the stream start - wrong DESCR_MODE (it's rare, but it can be quite easily reproduced with tvh - just do quick wget test multiple times and tvh will print warning that CSA descrambling was changed to DES - first keys were CSA and the later marked as DES).

I just assume CSA until/unless I received a CA_SET_DESCR_MODE telling me otherwise since it is the most commonly used. I can't test now because I gave my only dvb-s2 tuner card to a friend to use...

The order is really problematic. It's true that DESCR_MODE is static when initially set. So it works with hardware descramblers, but when you add more logic into it, it's really necessary to know, when you have all parameters/info gathered. I just added 'CW Mode' field to the configuration of capmt/dvbapi client in tvh where you can select the incoming order:

[...]

Most of modes are detected automatically except the 'mode follows key' (which is unfortunately used in the current official oscam repo). I suggested this [[http://www.streamboard.tv/oscam/ticket/4615]] , but the maintainers are not very responsible, indeed.

I really do not see the point of selecting the extended_cw mode in tvheadend. The extended_cw mode MUST be set in oscam to match the firmware (in this case software) being used. The main difference being that the OE 2.2 firmware supports the sending of the CA_SET_DESCR_MODE messages. The older firmware did not, it used different indexes for the DES keys. (Talking about Dreambox firmware..) So for tvheadend, I chose to implement the OE 2.2 method (much easier) to emulate in tvheadend. (I did the same for the spark7162/7111 firmware changes I made.) There is no need to implement both, let alone have to try to figure out which mode oscam is using. I think it just makes it more confusing for the users. It seems much more simple and straight forward to implement just the OE 2.2 mode and tell the user they MUST set the oscam dvbapi extended_cw mode to 1 (OE 2.2).

#57

Updated by Joe User over 7 years ago

In case somebody wants to test, here is an oscam-emu patch which reverts the oscam change referred to above.
With this version of the oscam-eum patch, CA_SET_DESCR_MODE is sent before CA_SET_DESCR.
I will see about getting it pushed to the "official" repo...

#58

Updated by saen acro over 7 years ago

Joe User wrote:

In case somebody wants to test, here is an oscam-emu patch which reverts the oscam change referred to above.
With this version of the oscam-eum patch, CA_SET_DESCR_MODE is sent before CA_SET_DESCR.
I will see about getting it pushed to the "official" repo...

In this patch there is something with missing in
module-dvbapi.h

#define MAX_DEMUX 16

16 represent count of maximum decoded streams,
isn't better to set bigger value?

#59

Updated by Joe User over 7 years ago

#define MAX_DEMUX 16

Is not part of the patch, it is from the original oscam code.

The code was written primarily to be used with STBs and 15 is far, far more than most people will ever need. Also most STBs have very limited memory, so memory usage of oscam is a concern. In your case, I can see where you would want to increase the value. Just be aware that it is used for a number of things in the code, so there is a chance of something breaking if you increase it and exceed 15 channels. But you should be able to use valgrind to find any problems.

#60

Updated by p k over 7 years ago

Tested latest oscam (r11385, this includes "DVBAPI: - Revert r11285 as suggested in #4586 by joeuser and tested by pr2") with latest oscam-emu.patch (git rev fb79f6c). oscam seems to work fine, it finds keys, but tvheadend (4.3-262~g8011a8c-dirty) fails to decode channels.
Mode="OSCam net protocol (rev >= 10389)" and CW mode="Extended (OE 2.2)" in tvheadend.

Logs attached.

#61

Updated by Jaroslav Kysela over 7 years ago

nemal nemal k: do you have enabled 'extended_cw_api = 1' in oscam? oscam does not send keys to tvh..

#62

Updated by p k over 7 years ago

dvbapi section is following in oscam.conf file

[dvbapi]
enabled                       = 1
pmt_mode                      = 4
listen_port                   = 9000
delayer                       = 80
user                          = tvheadend
extended_cw_api               = 1
boxtype                       = pc
#63

Updated by p k over 7 years ago

I think it is somehow related to aarch64 hardware.
The problem with aarch64 is that oscam with oscam-emu.patch doesn't compile for aarch64 (https://github.com/oscam-emu/OSEmu/issues/146) so I had to compile oscam+oscam-emu for armhf.

Now I switched my setup to oscam (without oscam-emu.patch, aarch64) + OSEmu (armhf) setup, decoding itself started working, I can see following lines in tvh log:

2017-06-21 10:13:00.194 [  TRACE]:descrambler: Obtained CSA keys[3200] 70F8268E98921C46:0000000000000000 pid 0C80 from capmt-127.0.0.1-9000 for service

but now I see

Jun 21 10:12:57 tvheadend tvheadend[13433]: TS: thor 1.0W/12303V/Science Europe HD: AC3 @ #3201: Invalid start code 4b:a3:08
Jun 21 10:12:57 tvheadend tvheadend[13433]: TS: thor 1.0W/12303V/Science Europe HD: AC3 @ #3204: Invalid start code 4b:a3:08
Jun 21 10:12:57 tvheadend tvheadend[13433]: TS: thor 1.0W/12303V/Science Europe HD: AC3 @ #3202: Invalid start code 0c:a8:a3
Jun 21 10:12:57 tvheadend tvheadend[13433]: TS: thor 1.0W/12303V/Science Europe HD: AC3 @ #3203: Invalid start code 80:db:8d

Will try on different architecture.

#64

Updated by Joe User over 7 years ago

Make sure stream relay is disabled in oscam.conf.

[streamrelay]
stream_relay_enabled          = 0

#65

Updated by p k over 7 years ago

Joe User wrote:

Make sure stream relay is disabled in oscam.conf.
[...]

Thanks, that did the trick.

#66

Updated by Petar Ivanov over 7 years ago

@Jaroslav can you look another bug.

When play multiple PowerVU channels from same mux and when unsubscribing(stop) channel, another one ffrom same mux stop decode and fail.

First channels who stop is 'ID Xtra Europe HD' and after that fail 'Discovery HD Czech/Hun'

provide log on fail from both oscam and tvh

#67

Updated by p k over 7 years ago

I can confirm that issue.

#68

Updated by Jaroslav Kysela over 7 years ago

I cannot reproduce here and the logs are not commented, so I'm lost with them. Please, provide commented logs (detailed time where the problem occurs).

#69

Updated by Petar Ivanov over 7 years ago

I now make more test.

start 6 PowerVU channels, next start 7 channel first start DTX who is with 'SID - 3002' next start 8 channels 'DTX' with 'SID - 3000' after unsibscribe(stop) channel with 'SID - 3002' channel with 'SID - 3000' stop descramble(fail) decode..

1. 2017-07-04 20:00:11.663 subscription: 077B: "HTTP" subscribing on channel "DTX", - 'SID - 3002'
2. 2017-07-04 20:00:19.246 subscription: 077C: "HTTP" subscribing on channel "DTX RUS", - 'SID - 3000'
3. 2017-07-04 20:00:37.657 subscription: 077B: "HTTP" unsubscribing from "DTX" - 'SID - 3002'
4. 2017-07-04 20:00:45.419 descrambler: DTX even stream key3000 is not valid - fail - 'SID - 3000'

Fail happend on channels with same PCR,VPID

"DTX", - 'SID - 3002'

Index    PID    Type    Language    Details
     0x0bb8 /  3000    PCR          
     0x0c14 /  3092    PMT          
1    0x0bb8 /  3000    H264          
2    0x0bb9 /  3001    AC3    eng     
3    0x0bbb /  3003    AC3    rus     
4    0x0bbf /  3007    MPEG2AUDIO    eng     
5    0x0bc0 /  3008    MPEG2AUDIO    rus     
6    0x0bd7 /  3031    DVBSUB    rus     
7    0x1799 /  6041    CA         CAIDS: 0e00:000000
After filtering and reordering (without PCR and PMT)

Index    PID    Type    Language    Details
1    0x0bb8 /  3000    H264          
2    0x0bb9 /  3001    AC3    eng     
4    0x0bbf /  3007    MPEG2AUDIO    eng     
3    0x0bbb /  3003    AC3    rus     
5    0x0bc0 /  3008    MPEG2AUDIO    rus     
6    0x0bd7 /  3031    DVBSUB    rus     
7    0x1799 /  6041    CA         CAIDS: 0e00:000000

"DTX RUS" - 'SID - 3000'

Index    PID    Type    Language    Details
     0x0bb8 /  3000    PCR          
     0x0c12 /  3090    PMT          
1    0x0bb8 /  3000    H264          
2    0x0bb9 /  3001    AC3    eng     
3    0x0bba /  3002    AC3    tur     
4    0x0bbb /  3003    AC3    rus     
5    0x0bd2 /  3026    DVBSUB    ara     
6    0x0bd4 /  3028    DVBSUB    rum     
7    0x0bd5 /  3029    DVBSUB    alb     
8    0x0bd6 /  3030    DVBSUB    gre     
9    0x0bd7 /  3031    DVBSUB    rus     
10    0x0bdb /  3035    DVBSUB    und     
11    0x0bdc /  3036    DVBSUB    slv     
12    0x0bde /  3038    DVBSUB    und     
13    0x1797 /  6039    CA         CAIDS: 0e00:000000
After filtering and reordering (without PCR and PMT)

Index    PID    Type    Language    Details
1    0x0bb8 /  3000    H264          
2    0x0bb9 /  3001    AC3    eng     
3    0x0bba /  3002    AC3    tur     
4    0x0bbb /  3003    AC3    rus     
10    0x0bdb /  3035    DVBSUB    und     
12    0x0bde /  3038    DVBSUB    und     
5    0x0bd2 /  3026    DVBSUB    ara     
6    0x0bd4 /  3028    DVBSUB    rum     
7    0x0bd5 /  3029    DVBSUB    alb     
8    0x0bd6 /  3030    DVBSUB    gre     
9    0x0bd7 /  3031    DVBSUB    rus     
11    0x0bdc /  3036    DVBSUB    slv     
13    0x1797 /  6039    CA         CAIDS: 0e00:000000

#70

Updated by Petar Ivanov over 7 years ago

Another round...

This may happend on 7+ channels same time from same muxx

  1. 2017-07-05 03:44:03.824 [ INFO]:subscription: 0001: "HTTP" unsubscribing from "Science Europe HD Russian" - no fail any channels
  2. 2017-07-05 03:44:14.902 [ INFO]:subscription: 0003: "HTTP" unsubscribing from "Discovery HD Showcase Europe MAK" - no fail any channels
  3. 2017-07-05 03:44:25.250 [ INFO]:subscription: 0004: "HTTP" unsubscribing from "Animal Planet HD BG" - after unsubscribe Animal Planet HD BG, fail Animal Planet HD Russian
  4. 2017-07-05 03:44:26.357 [ DEBUG]:descrambler: no key for service='Animal Planet HD Russian'
    2017-07-05 03:44:26.357 [ TRACE]:descrambler: capmt-127.0.0.1-9000: key state changed from RESOLVED to READY for "1W/12303V/Animal Planet HD Russian"
    2017-07-05 03:44:26.357 [ TRACE]:descrambler: service "1W/12303V/Animal Planet HD Russian": 1 descramblers (0 ok 0 failed)

Animal Planet HD BG - 'Service details'


 Service details for 1W/12303V/Animal Planet HD
Index    PID    Type    Language    Details
     0x0a28 /  2600    PCR          
     0x0a82 /  2690    PMT          
1    0x0a28 /  2600    H264          
2    0x0a29 /  2601    AC3    eng     
3    0x0a2a /  2602    AC3    pol     
4    0x0a2b /  2603    AC3    rus     
5    0x0a2d /  2605    AC3    tur     
6    0x0a3d /  2621    DVBSUB    swe     
7    0x0a3e /  2622    DVBSUB    dan     
8    0x0a3f /  2623    DVBSUB    nor     
9    0x0a40 /  2624    DVBSUB    dut     
10    0x0a41 /  2625    DVBSUB    fin     
11    0x0a44 /  2628    DVBSUB    rum     
12    0x0a47 /  2631    DVBSUB    rus     
13    0x0a48 /  2632    DVBSUB    bul     
14    0x0a4b /  2635    DVBSUB    und     
15    0x0a4c /  2636    DVBSUB    slv     
16    0x0a4d /  2637    DVBSUB    mac     
17    0x0a4e /  2638    DVBSUB    und     
18    0x178a /  6026    CA         CAIDS: 0e00:000000
After filtering and reordering (without PCR and PMT)

Index    PID    Type    Language    Details
1    0x0a28 /  2600    H264          
2    0x0a29 /  2601    AC3    eng     
3    0x0a2a /  2602    AC3    pol     
4    0x0a2b /  2603    AC3    rus     
5    0x0a2d /  2605    AC3    tur     
13    0x0a48 /  2632    DVBSUB    bul     
18    0x178a /  6026    CA         CAIDS: 0e00:000000

Animal Planet HD Russian - 'Service details'

Service details for 1W/12303V/Animal Planet HD Russian
Index    PID    Type    Language    Details
     0x0a28 /  2600    PCR          
     0x0a84 /  2692    PMT          
1    0x0a28 /  2600    H264          
2    0x0a29 /  2601    AC3    eng     
3    0x0a2b /  2603    AC3    rus     
4    0x0a47 /  2631    DVBSUB    rus     
5    0x178c /  6028    CA         CAIDS: 0e00:000000
After filtering and reordering (without PCR and PMT)

Index    PID    Type    Language    Details
1    0x0a28 /  2600    H264          
2    0x0a29 /  2601    AC3    eng     
3    0x0a2b /  2603    AC3    rus     
4    0x0a47 /  2631    DVBSUB    rus     
5    0x178c /  6028    CA         CAIDS: 0e00:000000

#71

Updated by Joe User over 7 years ago

I cannot test Jaroslav's version right now, but most likely the problem is that those channels share the same video pid.
For extended_cw there is a limit of 4 audio tracks, so when a feed has more than 4 audio tracks they create another channel with the same video pid but different audio pids. Sometimes audio pids are also used for multiple channels (especially English...)

"Animal Planet HD Russian" just uses a subset of the pids used for "Animal Planet HD"

#72

Updated by p k over 7 years ago

IIRC I tried with different channels, e.g "Discovery Science HD" and "Discovery Showcase HD".

#73

Updated by Jaroslav Kysela over 7 years ago

@Petar : It seems that Joe Miller User is right. The problem is shared VPID (video PID) - oscam does not handle the ecm filter correctly in this case (it closes the ecmpid when one of the shared service is closed). But it should not be a problem for the standard usage (just use only one from channels with the shared VPID).

#74

Updated by Petar Ivanov over 7 years ago

nemal nemal k say say same problem with differend channels, at see same problem.

nemal nemal k can you share log from tvh and oscam from your situation to seem bug.

#75

Updated by p k over 7 years ago

I was able to reproduce this with different channels (DTX and Discovery Science). Log files are attached, added comments to tvh.log file.
Also I noticed it happens only if the order is following: First client subscribes to a channel, second client subscribes to different channel, click stop in first client.
If stopping stream in second client first then first client continues without issues.

#76

Updated by matias segurola over 6 years ago

hello dear good afternoon I'm trying to configure oscam and tvheadend someone to help me in my last configuration oscam emu and tvheadend 4.3 greetings

Also available in: Atom PDF