[linux-dvb] Problems with ca_zap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Allan Stirling wrote:

> Allan Stirling wrote:
>
>> dvbsnoop gives me the following:
>> ------------------------------------------------------------
>> SECT-Packet: 00000001   PID: 0 (0x0000), Length: 44 (0x002c)
>> Time received: Thu 2005-06-23  22:20:09.035
>> ------------------------------------------------------------
>>  0000:  00 b0 29 07 ee e3 00 00  00 00 e0 10 11 39 e1 01   
>> ..)..........9..
>>  0010:  11 fa e1 07 11 fb e1 09  12 5f e1 04 12 c2 e1 0c   
>> ........._......
>>  0020:  12 c9 e1 0b 13 2a e1 0a  24 a9 24 84               .....*..$.$.
>>
>> PID:  0 (0x0000)  [= assigned for: ISO 13818-1 Program Association 
>> Table (PAT)]
>> Guess table from table id...
>> PAT-decoding....
>> Table_ID: 0 (0x00)  [= Program Association Table (PAT)]
>> section_syntax_indicator: 1 (0x01)
>> (fixed): 0 (0x00)
>> reserved_1: 3 (0x03)
>> Section_length: 41 (0x0029)
>> Transport_Stream_ID: 2030 (0x07ee)
>> reserved_2: 3 (0x03)
>> Version_number: 17 (0x11)
>> current_next_indicator: 1 (0x01)  [= valid now]
>> Section_number: 0 (0x00)
>> Last_Section_number: 0 (0x00)
>>
>>    Program_number: 0 (0x0000)
>>    reserved: 7 (0x07)
>>    Network_PID: 16 (0x0010)
>>
>>    Program_number: 4409 (0x1139)
>>    reserved: 7 (0x07)
>>    Program_map_PID: 257 (0x0101)
>>
>>    Program_number: 4602 (0x11fa)
>>    reserved: 7 (0x07)
>>    Program_map_PID: 263 (0x0107)
>>
>>    Program_number: 4603 (0x11fb)
>>    reserved: 7 (0x07)
>>    Program_map_PID: 265 (0x0109)
>>
>>    Program_number: 4703 (0x125f)
>>    reserved: 7 (0x07)
>>    Program_map_PID: 260 (0x0104)
>>
>>    Program_number: 4802 (0x12c2)
>>    reserved: 7 (0x07)
>>    Program_map_PID: 268 (0x010c)
>>
>>    Program_number: 4809 (0x12c9)
>>    reserved: 7 (0x07)
>>    Program_map_PID: 267 (0x010b)
>>
>>    Program_number: 4906 (0x132a)
>>    reserved: 7 (0x07)
>>    Program_map_PID: 266 (0x010a)
>>
>> Where you can clearly see that 4703 is listed, with a PID of 260. I 
>> think there must be something wrong in the PAT parsing, since I get 
>> the following with a slightly modified ca_zap:
>>
>> parse_pat: PAT => Section Length=[41], TS ID=[12270]
>> service_id: 4703
>> program_number: 176    PID: 2311
>> program_number: 61155  PID: 0
>> program_number: 12288  PID: 16
>> program_number: 65337  PID: 7937
>> program_number: 65530  PID: 7943
>> program_number: 4603   PID: 265
>> program_number: 15967  PID: 260
>> program_number: 65474  PID: 7948
>> program_number: 4809   PID: 267
>> program_number: 4906   PID: 266
>>
>> As you can see, some of the program_numbers as well as some of the 
>> PIDs are correct, but some are not. This is repeatable between runs.
>>
>> The TS ID is also different. I'm just about to try hardcoding the PID 
>> as Manu originally suggested.
>>
> Okay. That gets me more output, but I don't think it's good.
>
> parse_sat_channel_list: Channel=[Sky One], Frequency=[12285], 
> Satellite=[0], Symbol Rate=[27500], Video=[513], Audio=[641], 
> Service=[4703]
> Service ID=[4703]
> parse_pat: ----------------->parse PAT section
> parse_pat: PAT => Section Length=[41], TS ID=[12270]
> service_id: 4703
> program_number: 176    PID: 2311
> program_number: 61155  PID: 0
> program_number: 12288  PID: 16
> program_number: 65337  PID: 7937
> program_number: 65530  PID: 7943
> program_number: 4603   PID: 265
> program_number: 15967  PID: 260
> parse_si: PMT PID = [260]
> program_number: 65474  PID: 7948
> program_number: 4809   PID: 267
> program_number: 4906   PID: 266
> parse_si: PAT: Close Demux /dev/dvb/adapter3/demux0
> parse_pmt: PMT Words=[ 02 b2 f5 12 5f c9 00 00 ff fe f0 13 0c 04 80 b4 
> 81 68 0e 03 c5 df bb 10 06 c5 df bb c0 08 00 02 e2 01 f0 1c 02 03 1a 
> 48 5f 09 04 09 60 e5 00 09 04 09 61 e5 00 52 01 01 0e 03 c0 4f f0 06 
> 01 02 04 e2 81 f0 1d 03 01 67 09 04 09 60 e5 00 09 04 09 61 e5 00 0a 
> 04 65 6e 67 00 52 01 81 0e 03 c0 02 0a 04 e2 95 f0 1d 03 01 67 09 04 
> 09 60 e5 00 09 04 09 61 e5 00 0a 04 4e 41 52 00 52 01 95 0e 03 c0 02 
> 0a 06 e2 40 f0 0f 56 05 65 6e 67 09 00 52 01 40 0e 03 c0 01 78 06 e2 
> 41 f0 0f 56 05 65 6e 67 10 88 52 01 41 0e 03 c0 00 bc 05 e9 80 f0 17 
> 0e 03 c0 46 d8 0f 04 4f 54 56 00 90 01 90 fe 04 45 54 30 31 52 01 5a 
> 05 e9 81 f0 17 0e 03 c0 46 d8 0f 04 4f 54 56 00 90 01 90 fe 04 45 54 
> 30 32 52 01 5b 05 e9 82 f0 17 0e 03 c0 46 d8 0f 04 4f 54 56 00 90 01 
> 90 fe 04 45 54 30 33 52 01 5c 05 e9 83 f0 17 0e 03 c0 46 d8 0f 04 4f 
> 54 56 00 90 01 90 fe 04 57 54 53 33 52 01 0f 05 e9 84 f0 17 0e 03 c0 
> 46 d8 0f 04 4f 54 56 00 90 01 90 fe 04 45 54 30 34 52 01 5d 05 e9 85 
> f0 17 0e 03 c0 46 d8 0f 04 4f 54 56 00 90 01 90 fe 04 45 54 30 35 52 
> 01 5e 05 e9 86 f0 17 0e 03 c0 46 d8 0f 04 4f 54 56 00 90 01 90 fe 04 
> 45 54 30 36 52 01 5f 05 e9 87 f0 17 0e 03 c0 46 d8 0f 04 4f 54 56 00 
> 90 01 90 fe 04 45 54 30 37 52 01 60 05 e9 88 f0 17 0e 03 c0 46 d8 0f 
> 04 4f 54 56 00 90 01 90 fe 04 45 54 30 38 52 01 61 05 e9 89 f0 17 0e 
> 03 c0 46 d8 0f 04 4f 54 56 00 90 01 90 fe 04 45 54 30 39 52 01 62 05 
> e9 8a f0 17 0e 03 c0 46 d8 0f 04 4f 54 56 00 90 01 90 fe 04 57 49 41 
> 31 52 01 7e 05 e9 8b f0 17 0e 03 c0 46 d8 0f 04 4f 54 56 00 90 01 90 
> fe 04 57 49 41 32 52 01 7f 05 e9 8c f0 17 0e 03 c0 46 d8 0f 04 4f 54 
> 56 00 90 01 90 fe 04 57 49 41 33 52 01 80 05 e9 8d f0 17 0e 03 c0 46 
> d8 0f 04 4f 54 56 00 90 01 90 fe 04 57 54 56 43 52 01 c9 05 e9 8e f0 
> 17 0e 03 c0 46 d8 0f 04 4f 54 56 00 90 01 90 fe 04 57 54 56 30 52 01 
> ca 05 ec 01 f0 17 0e 03 c0 46 d8 0f 04 4f 54 56 00 90 01 90 fe 04 54 
> 58 54 00 52 01 3a 05 ec 02 f0 17 0e 03 c0 46 d8 0f 04 4f 54 56 00 90 
> 01 90 fe 04 54 58 54 01 52 01 3b 05 ec 03 f0 17 0e 03 c0 46 d8 0f 04 
> 4f 54 56 00 90 01 90 fe 04 54 58 54 02 52 01 3c 05 ec 04 f0 17 0e 03 
> c0 46 d8 0f 04 4f 54 56 00 90 01 90 fe 04 54 58 54 03 52 01 3d 05 e9 
> 93 f0 17 0e 03 c0 46 d8 0f 04 4f 54 56 00 90 01 90 fe 04 49 53 4d 00 
> 52 01 f7 05 e4 06 f0 13 5f 04 4f 54 56 00 90 01 9d fe 04 54 47 54 00 
> 66 02 01 07 5c fc 4f 1d ]
>
> parse_pmt: ----------->parse PMT section, PMT PID=[260], bytes=[760]
> parse_pmt_header: Table ID=[2], Section Length=[757], Program 
> Number=[4703], Section Number=[0], PCR PID=[8190], Program info 
> length=[19]
> parse_pmt: Program info length=[19]
> parse_pmt: Count=[16], Position=[16], Program descriptor count=[19]
> parse_pmt: Count=[137], Position=[120], Program descriptor count=[19]
>
>        parse_streams: Elements=[ 4e 41 52 00 52 01 95 0e 03 c0 02 0a 
> 06 e2 40 f0 0f 56 05 65 6e 67 09 00 52 01 40 0e 03 c0 01 78 06 e2 41 
> f0 0f 56 05 65 6e 67 10 88 52 01 41 0e 03 c0 00 bc 05 e9 80 f0 17 0e 
> 03 c0 46 d8 0f 04 4f 54 56 00 90 01 90 fe 04 45 54 30 31 52 01 5a 05 
> e9 81 f0 17 0e 03]
>        parse_streams: Stream=[0], Stream Type=[78], Elementary 
> PID=[338], ES info length=[82]
>
> Cheers,
>
> Allan.

 From pat.c:

static uint16_t parse_descriptor(struct program_descriptor 
*p_program_descriptor,
                                                                uint8_t 
*buf, uint16_t pos)
{
        p_program_descriptor->program_number =
                ((p_program_descriptor->program_number | buf[pos + 0]) 
<< 8) | buf[pos + 1];

Doesn't look quite right. Why do we care what the program_number is 
before it's been parsed?

If I change this to

        p_program_descriptor->program_number =
                ( buf[pos + 0] << 8) | buf[pos + 1];

Then the table comes out mostly fine. There's a couple of 
program_numbers at the beginning that look like 'noise' however... I 
think the offset of the start of the programs in the PAT may somehow be 
wrong.

parse_pat: PAT => Section Length=[41], TS ID=[12270]
service_id: 4703
program_number: 176    PID: 2311
program_number: 61155  PID: 0
program_number: 0      PID: 16
program_number: 4409   PID: 7937
program_number: 4602   PID: 7943
program_number: 4603   PID: 265
program_number: 4703   PID: 260
parse_si: PMT PID = [260]
program_number: 4802   PID: 7948
program_number: 4809   PID: 267
program_number: 4906   PID: 266

Cheers,

Allan.



[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux