Oivind wrote: > Hi, > > Is ca_set_pmt() from section 8.4.3.4 of EN50221 spec? > > It looks like the offset is wrong for fetching ES length. I did some > modifications do dst_ca.c aswell. Aslo, the offset for fetching CA > descriptor (checking for 0x09) looks like wrong offset to me. The > relevant code for the additional debug info below is; > There is a high chance that the offset is wrong, yesterday i just made the patch a bit too fast .. ! > buf_offset += 1;// hw_offset += 1; > for (i = buf_offset; i < length; i++) { > // dprintk("%s: Stream Header ", __FUNCTION__); > count = copy_string(hw_buffer->msg, p_ca_message->msg, > hw_offset, buf_offset, 5); > modify_4_bits(hw_buffer->msg, (hw_offset + 3)); > > hw_offset += 5, buf_offset += 5, i += 4; > debug_string(hw_buffer->msg, hw_offset, (hw_offset - 5)); > dprintk("%s: buf_offset-2 > [p_ca_message->msg[buf_offset-2]]=%02x > [%02x]\n",__FUNCTION__,buf_offset-2, p_ca_message->msg[buf_offset-2]); > dprintk("%s: buf_offset-1 > [p_ca_message->msg[buf_offset-1]]=%02x > [%02x]\n",__FUNCTION__,buf_offset-1, p_ca_message->msg[buf_offset-1]); > dprintk("%s: ES Info length bytes = [%02x %02x]\n", > __FUNCTION__, p_ca_message->msg[buf_offset - 1], > p_ca_message->msg[buf_offset]); > es_info_length = 0; > es_info_length = p_ca_message->msg[buf_offset-2] & 0x0f; > es_info_length <<= 8; > es_info_length |= p_ca_message->msg[buf_offset-1]; > // es_info_length = ((es_info_length | > (p_ca_message->msg[buf_offset - 1] & 0x0f)) << 8) | > p_ca_message->msg[buf_offset]; > dprintk("%s: ES info length=[%02x]\n", __FUNCTION__, > es_info_length); > if (es_info_length) { > dprintk("%s: buf_offset+1 > [p_ca_message->msg[buf_offset+1]]=%02x > [%02x]\n",__FUNCTION__,buf_offset+1,p_ca_message->msg[buf_offset+1]); > dprintk("%s: buf_offset+2 > [p_ca_message->msg[buf_offset+2]]=%02x > [%02x]\n",__FUNCTION__,buf_offset+2,p_ca_message->msg[buf_offset+2]); > dprintk("%s: buf_offset+2 > [p_ca_message->msg[buf_offset+3]]=%02x > [%02x]\n",__FUNCTION__,buf_offset+3,p_ca_message->msg[buf_offset+3]); > // copy descriptors @ STREAM level > if (p_ca_message->msg[buf_offset + 2] == 0x09) > { // Copy CA descriptor only > copy_string(hw_buffer->msg, > p_ca_message->msg, hw_offset, buf_offset, (es_info_length - 1)); > dprintk("%s: Descriptors @ STREAM > level...!!! \n", __FUNCTION__); > } > } > > } > > > > > >>From dmesg with your patch > ----------------------------- > dst_ca_open:Device opened [ffff81003cc1ea80] > dst_ca_ioctl: Sending message > ca_send_message > ca_send_message:Command=[0x9f8032] > Command = SEND_CA_PMT > asn_1_decode: Length field=[12] > asn_1_decode: Length=[12] > ca_set_pmt: CA Message length=[18] > ca_set_pmt: ASN.1 String=[ 03 05 e4 01 10 06 01 09 04 0b 00 e5 05 02 > e2 02 f0 05 ] > copy_string: Copying [ 03 05 e4 01 10 06] > ca_set_pmt: Probably an ASIC bug !!! > String=[ 19 40 03 00 03 12 00 03 05 e4 01 00 06 00 00 00 00 00 00 ] > ca_set_pmt: Program info length=[06] > copy_string: Copying [ 01 09 04 0b 00 e5 05] > copy_string: Copying [ 02 e2 02 f0 05] > ca_set_pmt: ES Info length bytes = [05 00] Yep, offset is wrong .. 0xf0 and 0x05 contain es_info_length bytes inside the EN50221 message.. > ca_set_pmt: ES info length=[500] And ES info length is wrong .. > String=[ 19 40 03 00 03 12 00 03 05 e4 01 00 07 01 09 04 0b 00 e5 05 > 02 e2 02 00 05 ad ] > dst_put_ci: Put Command > write_to_8820: DST-CI Command succes. > ca_send_message: -->CA_PMT Success ! > dst_ca_release:Device closed. > > >>From dmesg with some additional debug info > ------------------------------------------ > dst_ca_open:Device opened [ffff81003d1687c0] > dst_ca_ioctl: Sending message > ca_send_message > ca_send_message:Command=[0x9f8032] > Command = SEND_CA_PMT > asn_1_decode: Length field=[12] > asn_1_decode: Length=[12] > ca_set_pmt: CA Message length=[18] > ca_set_pmt: ASN.1 String=[ 03 05 e4 01 10 06 01 09 04 0b 00 e5 05 02 > e2 02 f0 05 ] > copy_string: Copying [ 03 05 e4 01 10 06] > ca_set_pmt: Probably an ASIC bug !!! > String=[ 19 40 03 00 03 12 00 03 05 e4 01 00 06 00 00 00 00 00 00 ] > ca_set_pmt: Program info length=[06] > copy_string: Copying [ 01 09 04 0b 00 e5 05] > copy_string: Copying [ 02 e2 02 f0 05] > String=[ 02 e2 02 00 05 ] > ca_set_pmt: buf_offset-2 [p_ca_message->msg[buf_offset-2]]=14 [f0] > ca_set_pmt: buf_offset-1 [p_ca_message->msg[buf_offset-1]]=15 [05] > ca_set_pmt: ES Info length bytes = [05 00] (offsets 15,16) > ca_set_pmt: ES info length=[05] ES info length eventhough correct, uses the wrong words, ie offset is wrong .. ? ie it should have been using 0xf0 and 0x05, offsets 15 and 16.. The offset is important since for some cards, the reserved 4 bits needs to be set to 0 for some cards.. > ca_set_pmt: buf_offset+1 [p_ca_message->msg[buf_offset+1]]=17 [00] > ca_set_pmt: buf_offset+2 [p_ca_message->msg[buf_offset+2]]=18 [00] > ca_set_pmt: buf_offset+2 [p_ca_message->msg[buf_offset+3]]=19 [00] > String=[ 19 40 03 00 03 12 00, 03 05 e4 01 00 07 01 09 04 0b 00 e5 05 > 02 e2 02 00 05 ad ] The string looks somewhat okay, but program_info_length is just after 0x03 just after the comma that i placed in your log to show it out .. In this case the program_info_length becomes 0x05 0xe4 which is wrong .. And the entire message seems to be shifted to the left by 1 word, due to a wrong offset Get the correct offset, other than that everything looks moreor less okay .. Manu