Project

General

Profile

Bug #4799

After the patch "replace liben50221 (dvb-apps dependency)" "Bug #4738" where applied my decrypting stop working

Added by Emil Silverarn almost 7 years ago. Updated almost 7 years ago.

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

100%

Estimated time:
Found in version:
4.3-792~gc1a5e434b
Affected Versions:

Description

Jaroslav Kysela wrote:

Applied in changeset tvheadend|fab0a6c59ceb322c44722f7576e743de176f81a9.

Hi

After this patch, my decrypting stopped working :( I just get (did attach a log with --trace en50221)

2017-12-15 07:20:15.641 mpegts: 642MHz in Boxer - tuning on Silicon Labs Si2168 : DVB-T #0
2017-12-15 07:20:15.669 subscription: 0009: "HTTP" subscribing on channel "Kanal 9", weight: 100, adapter: "Silicon Labs Si2168 : DVB-T #0", network: "Boxer", mux: "642MHz", provider: "SBS Broadcasting Networks Ltd", service: "Kanal 9", profile="pass", hostname="192.168.178.135", client="VLC/2.2.4 LibVLC/2.2.4"
2017-12-15 07:20:16.596 en50221: dvbca0-slot0: communication stalled for more than 500ms
2017-12-15 07:20:20.652 linuxdvb: dvbca0-0: CAM slot 0 status changed to module init
2017-12-15 07:20:21.172 linuxdvb: dvbca0-0: CAM slot 0 status changed to module connected
2017-12-15 07:20:22.628 en50221: dvbca0-slot0-app00020041/0002: CAM INFO: Viaccess Access, 01, CAFE, BABE
2017-12-15 07:20:22.725 TS: Boxer/642MHz/Kanal 9: TELETEXT #486 Continuity counter error (total 1)
2017-12-15 07:20:28.764 en50221: dvbca0-slot0-app00030041/0004: CAM supported CAIDs: 0500 (Viaccess) 0500 (Viaccess)
2017-12-15 07:20:28.984 linuxdvb: dvbca0-0: CAM slot 0 status changed to module ready
...
2017-12-15 07:21:33.810 mpegts: 666MHz in Boxer - tuning on Silicon Labs Si2168 : DVB-T #0
2017-12-15 07:21:33.840 subscription: 000B: "HTTP" subscribing on channel "TV3 HD STOCKHOLM", weight: 100, adapter: "Silicon Labs Si2168 : DVB-T #0", network: "Boxer", mux: "666MHz", provider: "Viasat AB", service: "TV3 HD STOCKHOLM", profile="pass", hostname="192.168.178.135", client="VLC/2.2.4 LibVLC/2.2.4"
2017-12-15 07:21:34.908 en50221: dvbca0-slot0: communication stalled for more than 500ms
2017-12-15 07:21:38.860 linuxdvb: dvbca0-0: CAM slot 0 status changed to module init
2017-12-15 07:21:39.484 linuxdvb: dvbca0-0: CAM slot 0 status changed to module connected
2017-12-15 07:21:40.940 en50221: dvbca0-slot0-app00020041/0002: CAM INFO: Viaccess Access, 01, CAFE, BABE
2017-12-15 07:21:40.966 TS: Boxer/666MHz/TV3 HD STOCKHOLM: TELETEXT #3006 Continuity counter error (total 1)
2017-12-15 07:21:40.981 tbl-eit: eit: 666MHz in Boxer: invalid checksum (len 539, errors 1)
2017-12-15 07:21:41.153 tbl-pass: pass-eit: -: invalid checksum (len 539, errors 1)
2017-12-15 07:21:47.080 en50221: dvbca0-slot0-app00030041/0004: CAM supported CAIDs: 0500 (Viaccess) 0500 (Viaccess)
2017-12-15 07:21:47.180 linuxdvb: dvbca0-0: CAM slot 0 status changed to module ready

If I switch to the version before this patch everything works.

can I provide some logs or do I need to configure something in thvheaden to make it work after this patch?

/Emil


Files

tvheadend.log (197 KB) tvheadend.log Emil Silverarn, 2017-12-16 15:38
tvheadend_1min.log (483 KB) tvheadend_1min.log Emil Silverarn, 2017-12-17 07:17
tvheadend171217_1.log (904 KB) tvheadend171217_1.log Emil Silverarn, 2017-12-17 17:02
straceST.txt (252 KB) straceST.txt SDTV Emil Silverarn, 2017-12-18 07:44
straceHD.txt (267 KB) straceHD.txt HDTV Emil Silverarn, 2017-12-18 07:44
strace.txt (617 KB) strace.txt Emil Silverarn, 2017-12-18 10:24
tvheadend.log (1.8 MB) tvheadend.log Emil Silverarn, 2017-12-18 10:24
tvheadend.log (360 KB) tvheadend.log Emil Silverarn, 2017-12-18 16:21
strace.txt (328 KB) strace.txt Emil Silverarn, 2017-12-18 16:21
trace-bad.txt (534 KB) trace-bad.txt Emil Silverarn, 2017-12-19 14:19
trace-working.txt (1.84 MB) trace-working.txt Emil Silverarn, 2017-12-19 14:19
trace-working.txt (1.76 MB) trace-working.txt Emil Silverarn, 2017-12-20 06:15
tvheadend20171220.log (1.17 MB) tvheadend20171220.log Emil Silverarn, 2017-12-20 12:25

History

#1

Updated by Jaroslav Kysela almost 7 years ago

The log is incomplete. Please, subscribe for one channel for 60 seconds when the CAM becomes ready.

#2

Updated by Emil Silverarn almost 7 years ago

Jaroslav Kysela wrote:

The log is incomplete. Please, subscribe for one channel for 60 seconds when the CAM becomes ready.

Ok here i did tune for 1+ min.
(I also deactivated 2 of the 3 cards so they would not interfere)

#3

Updated by Jaroslav Kysela almost 7 years ago

Could you retest with this change?

diff --git a/src/input/mpegts/en50221/en50221.c b/src/input/mpegts/en50221/en50221.c
index 295b3b7ee..80625d41a 100644
--- a/src/input/mpegts/en50221/en50221.c
+++ b/src/input/mpegts/en50221/en50221.c
@@ -691,7 +691,7 @@ en50221_slot_monitor(en50221_slot_t *cil, int64_t clock)
   int r;

   LIST_FOREACH(cia, &cil->cil_apps, cia_link) {
-    if (cil->cil_monitor_read + ms2mono(500) < mclk()) {
+    if (cil->cil_monitor_read + ms2mono(1500) < mclk()) {
       tvherror(LS_EN50221, "%s: communication stalled for more than 500ms",
                cil->cil_name);
       return -ENXIO;
#4

Updated by Emil Silverarn almost 7 years ago

Jaroslav Kysela wrote:

Could you retest with this change?

[...]

Done.(but no change)

#5

Updated by Jaroslav Kysela almost 7 years ago

I pushed some minor changes to the master repository, but I don't think that it will fix the dead-after-capmt problem.

I need to look what the previous code does for your hw. Please, do this for working version of tvh:

Obtain PID of freshly started tvheadend:

$ ps ax | grep tvheadend
19583 pts/0    Rl+    0:04 ./build.linux/tvheadend ....

Obtain file descriptor number for /dev/dvb/adapter0/ca0 using tvh's PID 19583:

$ ls -la /proc/19583/fd | grep /ca0
lrwx------. 1 perex perex 64 17. pro 18.22 27 -> /dev/dvb/adapter0/ca0
                                           ^^

So main PID for tvheadend is 19583 and file descriptor number for /dev/dvb/adapter0/ca0 is 27. Run strace (replace appropriate values with yours):

strace -f -tt -P /dev/dvb/adapter0/ca0 -e trace=write,read -e write=27 -e read=27 -p 19583 2> strace.txt

If CAM is ready, run streaming for one channel for 60 seconds (it must work). Then break strace (after 10 seconds after streaming).

Upload strace.txt, if it contains something like:

[pid 19056] read(26, "\0\1\200\2\1\0", 8192) = 6
 | 00000  00 01 80 02 01 00                                 ......           |
[pid 19056] write(26, "\0\1\240\1\1", 5) = 5
 | 00000  00 01 a0 01 01                                    .....            |
[pid 19056] read(26, 0x7ff1562ca810, 8192) = -1 EAGAIN (Resource temporarily unavailable)
[pid 19056] read(26, "\0\1\200\2\1\0", 8192) = 6
 | 00000  00 01 80 02 01 00                                 ......           |
[pid 19056] write(26, "\0\1\240\1\1", 5) = 5
 | 00000  00 01 a0 01 01                                    .....            |
#6

Updated by Emil Silverarn almost 7 years ago

Jaroslav Kysela wrote:

I pushed some minor changes to the master repository, but I don't think that it will fix the dead-after-capmt problem.

I need to look what the previous code does for your hw. Please, do this for working version of tvh:

Obtain PID of freshly started tvheadend:

[...]

Obtain file descriptor number for /dev/dvb/adapter0/ca0 using tvh's PID 19583:

[...]

So main PID for tvheadend is 19583 and file descriptor number for /dev/dvb/adapter0/ca0 is 27. Run strace (replace appropriate values with yours):

[...]

If CAM is ready, run streaming for one channel for 60 seconds (it must work). Then break strace (after 10 seconds after streaming).

Upload strace.txt, if it contains something like:

[...]

Done did do one for HDTV and one for SDTV (Hope I did right)

/Emil

#7

Updated by Jaroslav Kysela almost 7 years ago

Pls, retest with v4.3-811-ge06ffd87b (latest).

#8

Updated by Emil Silverarn almost 7 years ago

Jaroslav Kysela wrote:

Pls, retest with v4.3-811-ge06ffd87b (latest).

Did not work:(

i did a new trace and debug for you

#9

Updated by Jaroslav Kysela almost 7 years ago

The last strace does not contains full hexadecimal dumps for read/write - update '-e write=' and '-e read=' numbers correctly. Please, tune same channel as in tvheadend.log (Animal Planet HD) - only this channel.

#10

Updated by Emil Silverarn almost 7 years ago

Jaroslav Kysela wrote:

The last strace does not contains full hexadecimal dumps for read/write - update '-e write=' and '-e read=' numbers correctly. Please, tune same channel as in tvheadend.log (Animal Planet HD) - only this channel.

My father-in-law used kode when I did make the trace, Sorry

Did a new try, (hope it looks better i can see any difference)

Did use this commands:

sudo ps ax | grep tvheadend
1203 ? Ssl 0:02 /usr/bin/tvheadend -f -p /var/run/tvheadend.pid -u hts -g video
1724 pts/0 R+ 0:00 grep --color=auto tvheadend

ls la /proc/1203/fd | grep /ca0
lrwx-----
1 root root 64 dec 18 16:13 28 -> /dev/dvb/adapter0/ca0

strace -f -tt -P /dev/dvb/adapter0/ca0 -e trace=write,read -e write=28 -e read=28 -p 1203 2> /tmp/strace.txt

#11

Updated by Pablo R. almost 7 years ago

As I said on IRC, since last version I cant open more than 16 different channels using oscam (with oscam patched). Is now needed to increase DEMUX limit on tvheadend config? I'm not sure from which version this happens. Previously tvheadend when filling 16 channels by demux opened another demux of 16, etc.

#12

Updated by Emil Silverarn almost 7 years ago

Pablo Rodríguez wrote:

As I said on IRC, since last version I cant open more than 16 different channels using oscam (with oscam patched). Is now needed to increase DEMUX limit on tvheadend config? I'm not sure from which version this happens. Previously tvheadend when filling 16 channels by demux opened another demux of 16, etc.

Hi Pablo

Think you have commented wrong post, this is about hardware CAM

#13

Updated by Jaroslav Kysela almost 7 years ago

I checked capmt from dvb-apps (liben50221) and the new code, and it's identical now:

00 01 a0 81 81 01 90 02  00 04 9f 80 32 78 03 18
00 01 A0 81 81 01 90 02  00 04 9F 80 32 78 03 18 

d8 d7 f0 00 09 0f 05 f0  34 01 09 0f 05 00 e0 9a
D8 D7 F0 00 09 0F 05 F0  34 01 09 0F 05 00 E0 9A

10 01 00 13 01 20 14 03  02 05 08 09 0f 05 00 e0
10 01 00 13 01 20 14 03  02 05 08 09 0F 05 00 E0

9b 10 01 00 13 01 20 14  03 02 32 08 09 0f 05 00
9B 10 01 00 13 01 20 14  03 02 32 08 09 0F 05 00

e0 9c 10 01 00 13 01 20  14 03 04 0d 08 0a 04 73
E0 9C 10 01 00 13 01 20  14 03 04 0D 08 0A 04 73

f0 34 01 09 0f 05 00 e0  9a 10 01 00 13 01 20 14
F0 34 01 09 0F 05 00 E0  9A 10 01 00 13 01 20 14

03 02 05 08 09 0f 05 00  e0 9b 10 01 00 13 01 20
03 02 05 08 09 0F 05 00  E0 9B 10 01 00 13 01 20

14 03 02 32 08 09 0f 05  00 e0 9c 10 01 00 13 01
14 03 02 32 08 09 0F 05  00 E0 9C 10 01 00 13 01

20 14 03 04 0d 08
20 14 03 04 0D 08

(first line is from dvb-apps, the second - upper hexa - from new tvh code).

I know that it's not big fun, but could you do new whole trace (working tvh) + tvh logs (new tvh) like:

for working tvh:

1) disable CAM - shutdown tvh
2) start tvh
3) run strace
4) enable CAM
5) play a channel (Animal Planet HD)
6) stop strace

for non-working tvh (same as you did before):

1) start tvh (enable CAM if it's not enabled)
2) play a channel (Animal Planet HD)
3) upload the log with traces
4) shutdown tvh
5) upload log

#14

Updated by Jaroslav Kysela almost 7 years ago

Pls, wait the instructions are not perfect.. It won't work.

#15

Updated by Jaroslav Kysela almost 7 years ago

Ok, here are much more simpler instructions, run this for both (working/non-working) tvh - immediately after tvh start:

strace -tt -f -P /dev/dvb/adapter0/ca0 -s 4096 -xx -p $(ps ax | grep tvheadend | grep -v grep | cut -d ' ' -f 1) 2> trace-working.txt

Try to watch 'Animal Planet HD'. Stop tvh and strace.

Upload both files here.

#16

Updated by Emil Silverarn almost 7 years ago

Jaroslav Kysela wrote:

Ok, here are much more simpler instructions, run this for both (working/non-working) tvh - immediately after tvh start:

[...]

Try to watch 'Animal Planet HD'. Stop tvh and strace.

Upload both files here.

Done

#17

Updated by Jaroslav Kysela almost 7 years ago

The traces in 'trace-working.txt' are a bit late. The -bad version is ok. Could you restart tvh and do strace on the one line? I need only updated 'trace-working.txt'.

#18

Updated by Emil Silverarn almost 7 years ago

Jaroslav Kysela wrote:

The traces in 'trace-working.txt' are a bit late. The -bad version is ok. Could you restart tvh and do strace on the one line? I need only updated 'trace-working.txt'.

Here we go :) Sorry, it took a while

#19

Updated by Jaroslav Kysela almost 7 years ago

Please, retest with the master. If it does not work, upload '--trace en50221' log for the 'bad' tvh, again.

#20

Updated by Emil Silverarn almost 7 years ago

Jaroslav Kysela wrote:

Please, retest with the master. If it does not work, upload '--trace en50221' log for the 'bad' tvh, again.

Much better :) HD lock fine, but alot of "SDTV" do not work

I did a trace where i tune Animal HD (now working) then a lot of other channels that do not work

#21

Updated by Jaroslav Kysela almost 7 years ago

Could you try to add CAID 5601 to the configuration / stream / CA stream filters with the action 'IGNORE' ?

#22

Updated by Emil Silverarn almost 7 years ago

Jaroslav Kysela wrote:

Could you try to add CAID 5601 to the configuration / stream / CA stream filters with the action 'IGNORE' ?

Unfortunately no difference

#23

Updated by Emil Silverarn almost 7 years ago

Jaroslav Kysela wrote:

Could you try to add CAID 5601 to the configuration / stream / CA stream filters with the action 'IGNORE' ?

Sorry, it works, thanks for all your help!

#24

Updated by Jaroslav Kysela almost 7 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset commit:tvheadend|aa36c1448f0faa838f000c18f7ecc82273752e69.

#25

Updated by Jaroslav Kysela almost 7 years ago

I fixed the CAID issue (you may remove the explicit filter now). I believe that your problem is completely fixed now.

#26

Updated by Emil Silverarn almost 7 years ago

Jaroslav Kysela wrote:

I fixed the CAID issue (you may remove the explicit filter now). I believe that your problem is completely fixed now.

Did update to the new version and did remove the filter and everything works! :D

Thank you for all your help and hope you have a good weekend / Christmas and a happy new year

Also available in: Atom PDF