[linux-dvb] CI problems with Twinhan VP-3040 (DTT-CI)

Henrik Sjoberg henke at epact.se
Mon Oct 10 16:06:24 CEST 2005


Hi,

I am struggling with my Twinhan VP-3040 to get the CI working. Everything
looks fine up to the point where I actually want to tell the CAM to
decrypt a channel.
I'm no EN50221-master, but I believe that the problem is that in the
ca_pmt, both program_info_length and ES_info_length fields are zero,
meaning that there is no ca_pmt_cmd_id in the message. Hence, there is
nothing telling the CAM to start decripting.

Could someone with a bit more insight in EN50221 look at my logs and tell
me if I'm on the right track and a bit more on how my ca_pmt mesage should
look.

Ok, let's move on to some logs


First, we start out with ca_zap:

[root at evermeet ~]# /usr/src/dvb-apps//util/ca_zap/ca_zap -c
~/.tzap/channels.conf -n TV3 -t ter
Using Adpater=[/dev/dvb/adapter0]
 Frontend=[/dev/dvb/adapter0/frontend0]
 Demux=[/dev/dvb/adapter0/demux0]
 Slot=[/dev/dvb/adapter0/ca0]
Parsing /root/.tzap/channels.conf
Terrestrial frontend
Channel TV3
parse_ter_channel_list: Channel=[TV3], Frequency=[786000000],
Video=[1039], Audio=[1038], Service=[1030]
Service ID=[1030]
parse_pat: ----------------->parse PAT section
parse_pat: PAT => Section Length=[73], TS ID=[1110]
parse_si: PMT PID = [1030]
parse_si: PAT: Close Demux /dev/dvb/adapter0/demux0
parse_pmt: PMT Words=[ 02 b0 73 04 06 c9 00 00 e4 0f f0 00 05 ef a4 f0 12
0f 04 4f 54 56 00 90 01 86 fe 04 45 50 47 32 fd 01 20 02
e4 0f f0 11 09 0f 05 00 e0 32 10 01 01 13 01 20 14 03 02 05 08 03 e4 0e f0
11 09 0f 05 00 e0 32 10 01 01 13 01 20 14 03 02 05 08 06
 e4 0c f0 07 56 05 73 77 65 09 00 05 e4 08 f0 12 0f 04 4f 54 56 00 90 01
86 fe 04 31 30 33 32 fd 01 80 e1 df dc cc ]

parse_pmt: ----------->parse PMT section, PMT PID=[1030], bytes=[118]
parse_pmt_header: Table ID=[2], Section Length=[115], Program
Number=[1030], Section Number=[0], PCR PID=[1039], Program info lengt
h=[0]
parse_pmt: Program info length=[0]

        parse_streams: Elements=[ 05 ef a4 f0 12 0f 04 4f 54 56 00 90 01
86 fe 04 45 50 47 32 fd 01 20]
        parse_streams: Stream=[0], Stream Type=[5], Elementary PID=[4004],
ES info length=[18]

copy_en50221_pmt_object: Copying EN50221 Header
copy_en50221_pmt_object: Program Number=[1030], Program info length=[0]
copy_en50221_pmt_object: Program level descriptor count=[0]
copy_en50221_stream_object: Stream Type=[5], Elementary PID=[4004], ES
length=[18], Number of descriptors=[0]
do_en50221_pmt_object: CA PMT List Management=[03]
set_pmt_command: Setting PMT Command
do_en50221_pmt_object: Object length=[88], Total length=[11]
asn_1_encode: Length=[11]
asn_1_encode: length indicator=[0b]
do_en50221_pmt_object: ASN.1 words=[1], Length Array=[  11 ]
en50221_encode_header: CA PMT List Mgmt=[3], Program Number=[1030],
Program info length=[0]
write_en50221_pmt_object: EN50221 header encoded
en50221_encode_streams: Stream type=[05], ES PID=[fa4], ES Info length=[12]
debug_message: CA MESSAGE=[ 9f 80 32 0b 03 04 06 d1 10 00 05 ef a4 f0 00  ]


decoding the message gives:
9f 80 32 - ca_pmt
0b - length
03 - select 'only'
04 06 - Program # (1030)
d1 - Reserved+Version=8,current_next_ind=1
10 00 - reserved+program_info_length=0
05 - stream_type=5
ef a4 - Reserved+Elementary PID=4004
f0 00 - Reserved+ES_info_length=0

>From what I can tell from ca_zap, the program_info_length is actually
zero, while the ES_info_length is not. However, since the number of
descriptors is zero, ES_info_length is set to zero too. From the dvbsnoop
log (see below) it seems that there ARE ca descriptors in the ES_info.

Could someone please help me understand this. Am I right when I believe
that the problem is that there is no ca_pmt_cmd_id in the message? If so,
why is there not? Is it a problem in en50221_encode.c?


Regards,
Henrik



ps If more logs are needed:

dvbsnoop on the pid:
[root at evermeet src]# dvbsnoop -nohexdumpbuffer -n 1 1030 | less
dvbsnoop V1.4.00 -- http://dvbsnoop.sourceforge.net/

------------------------------------------------------------
SECT-Packet: 00000001   PID: 1030 (0x0406), Length: 118 (0x0076)
Time received: Mon 2005-10-10  15:59:49.695
------------------------------------------------------------
PID:  1030 (0x0406)
Guess table from table id...
PMT-decoding....
Table_ID: 2 (0x02)  [= Program Map Table (PMT)]
section_syntax_indicator: 1 (0x01)
(fixed '0'): 0 (0x00)
reserved_1: 3 (0x03)
Section_length: 115 (0x0073)
Program_number: 1030 (0x0406)
reserved_2: 3 (0x03)
Version_number: 4 (0x04)
current_next_indicator: 1 (0x01)  [= valid now]
Section_number: 0 (0x00)
Last_Section_number: 0 (0x00)
reserved_3: 7 (0x07)
PCR PID: 1039 (0x040f)
reserved_4: 15 (0x0f)
Program_info_length: 0 (0x0000)

Stream_type loop:

    Stream_type: 5 (0x05)  [= ITU-T Rec. H.222.0 | ISO/IEC 13818-1 private
sections]
    reserved_1: 7 (0x07)
    Elementary_PID: 4004 (0x0fa4)
    reserved_2: 15 (0x0f)
    ES_info_length: 18 (0x0012)

            MPEG-DescriptorTag: 15 (0x0f)  [=
private_data_indicator_descriptor]
            Descriptor_length: 4 (0x04)
            Descriptor-data:
                 0000:  4f 54 56 00                                       
OTV.

            DVB-DescriptorTag: 144 (0x90)  [= User defined/ATSC reserved]
            Descriptor_length: 1 (0x01)
            Descriptor-data:
                 0000:  86                                                 .

            DVB-DescriptorTag: 254 (0xfe)  [= User defined]
            Descriptor_length: 4 (0x04)
            Descriptor-data:
                 0000:  45 50 47 32                                       
EPG2

            DVB-DescriptorTag: 253 (0xfd)  [= User defined]
            Descriptor_length: 1 (0x01)
            Descriptor-data:
                 0000:  20


    Stream_type: 2 (0x02)  [= ITU-T Rec. H.262 | ISO/IEC 13818-2 Video |
ISO/IEC 11172-2 constr. parameter video stream]
    reserved_1: 7 (0x07)
    Elementary_PID: 1039 (0x040f)
    reserved_2: 15 (0x0f)
    ES_info_length: 17 (0x0011)

            MPEG-DescriptorTag: 9 (0x09)  [= CA_descriptor]
            Descriptor_length: 15 (0x0f)
            CA_system_ID: 1280 (0x0500)  [= France Telecom (Viaccess)]
            reserved: 7 (0x07)
            CA_PID: 50 (0x0032)
            Private Data:
                 0000:  10 01 01 13 01 20 14 03  02 05 08                 
..... .....


    Stream_type: 3 (0x03)  [= ISO/IEC 11172 Audio]
    reserved_1: 7 (0x07)
    Elementary_PID: 1038 (0x040e)
    reserved_2: 15 (0x0f)
    ES_info_length: 17 (0x0011)

            MPEG-DescriptorTag: 9 (0x09)  [= CA_descriptor]
            Descriptor_length: 15 (0x0f)
            CA_system_ID: 1280 (0x0500)  [= France Telecom (Viaccess)]
            reserved: 7 (0x07)
            CA_PID: 50 (0x0032)
            Private Data:
                 0000:  10 01 01 13 01 20 14 03  02 05 08                 
..... .....


    Stream_type: 6 (0x06)  [= ITU-T Rec. H.222.0 | ISO/IEC 13818-1 PES
packets containing private data]
    reserved_1: 7 (0x07)
    Elementary_PID: 1036 (0x040c)
    reserved_2: 15 (0x0f)
    ES_info_length: 7 (0x0007)

            DVB-DescriptorTag: 86 (0x56)  [= teletext_descriptor]
            Descriptor_length: 5 (0x05)
               ISO639_language_code:  swe
               Teletext_type: 1 (0x01)  [= initial teletext page]
               Teletext_magazine_number: 1 (0x01)
               Teletext_page_number: 0 (0x00)



    Stream_type: 5 (0x05)  [= ITU-T Rec. H.222.0 | ISO/IEC 13818-1 private
sections]
    reserved_1: 7 (0x07)
    Elementary_PID: 1032 (0x0408)
    reserved_2: 15 (0x0f)
    ES_info_length: 18 (0x0012)

            MPEG-DescriptorTag: 15 (0x0f)  [=
private_data_indicator_descriptor]
            Descriptor_length: 4 (0x04)
            Descriptor-data:
                 0000:  4f 54 56 00                                       
OTV.

            DVB-DescriptorTag: 144 (0x90)  [= User defined/ATSC reserved]
            Descriptor_length: 1 (0x01)
            Descriptor-data:
                 0000:  86                                                 .

            DVB-DescriptorTag: 254 (0xfe)  [= User defined]
            Descriptor_length: 4 (0x04)
            Descriptor-data:
                 0000:  31 30 33 32                                       
1032

            DVB-DescriptorTag: 253 (0xfd)  [= User defined]
            Descriptor_length: 1 (0x01)
            Descriptor-data:
                 0000:  80                                                 .

CRC: 3789544652 (0xe1dfdccc)
==========================================================


dmesg while ca_zap:ing:
Oct  6 08:35:48 evermeet kernel: dst_ca_open:  Device opened [c0606f60]
Oct  6 08:35:48 evermeet kernel: dst_ca_ioctl:  Sending message
Oct  6 08:35:48 evermeet kernel: ca_send_message:
Oct  6 08:35:48 evermeet kernel: ca_send_message:  Command=[0x9f8032]
Oct  6 08:35:48 evermeet kernel:
Oct  6 08:35:48 evermeet kernel: ca_send_message: Command = SEND_CA_PMT
Oct  6 08:35:48 evermeet kernel: asn_1_decode:  Length field=[0b]
Oct  6 08:35:48 evermeet kernel: asn_1_decode:  Length=[0b]
Oct  6 08:35:48 evermeet kernel:
Oct  6 08:35:48 evermeet kernel: ca_set_pmt:  CA Message length=[11]
Oct  6 08:35:48 evermeet kernel:  String=[ 03 04 06 d1 10 00 05 ef a4 f0 00 ]
Oct  6 08:35:48 evermeet kernel: put_checksum:  =========================
Checksum calculation ===========================
Oct  6 08:35:48 evermeet kernel: put_checksum:  String Length=[0x12]
Oct  6 08:35:48 evermeet kernel: put_checksum:  String=[
Oct  6 08:35:48 evermeet kernel:  12 40 03 00 03 0b 00 03 04 06 d1 10 00
05 ef a4 f0 00 ]
Oct  6 08:35:48 evermeet kernel: put_checksum: Sum=[d9]
Oct  6 08:35:48 evermeet kernel:
Oct  6 08:35:48 evermeet kernel: put_checksum:  Checksum=[27]
Oct  6 08:35:48 evermeet kernel: put_checksum: 
==========================================================================
Oct  6 08:35:48 evermeet kernel:  String=[ 12 40 03 00 03 0b 00 03 04 06
d1 10 00 05 ef a4 f0 00 27 ]
Oct  6 08:35:48 evermeet kernel: dst_put_ci:  Put Command
Oct  6 08:35:48 evermeet kernel: write_to_8820:  DST-CI Command succes.
Oct  6 08:35:48 evermeet kernel: ca_send_message:  -->CA_PMT Success !
Oct  6 08:35:48 evermeet kernel: dst_ca_release:  Device closed.

ds





More information about the linux-dvb mailing list