← Back to team overview

rohc team mailing list archive

Re: RTP compare port python binding

 

Hi Didier,

I appreciate your past answer, I haven't tested the patch since I remove temporarily the check in rohc_comp.c, specifically I did on line 2225

check_profile = true;

commenting the previous assignment, then recompiled rohc.

I have an issue I would like your comments, my program start one compressor and one decompressor instance, the same program runs on another host, compressor on one program send to decompressor on the other host and vice versa, when I tested with RTP audio in one way at a given time it works perfectly, but when I tested with rtp packets feeding the compresors on both programs at the same time, the decompressor of the starter RTP flow (the one that receives RTP packets last but send first) just fails to decompress the first packet and of course further packets. 
Not sure if it might be something I am missing or something on the python binding since a couple of times during my tests when I change rohc library it didn't fail.

I am using Unidirectional Rohc, here is the log of a right decompressed packet 

[DEBUG] [rohc_decomp.c:780 rohc_decompress3()] decompress the 164-byte packet #75
[DEBUG] [rohc_decomp.c:3645 rohc_decomp_parse_padding()] skip 0 byte(s) of padding
[DEBUG] [rohc_decomp.c:1024 d_decode_header()] decompressor received 0 bytes of feedback for the same-side associated compressor
[DEBUG] [rohc_decomp.c:3582 rohc_decomp_decode_cid()] no add-CID found, CID defaults to 0
[DEBUG] [rohc_decomp.c:3762 rohc_decomp_find_context()] context with CID 0 found
[DEBUG] [rohc_decomp.c:1180 d_decode_header()] 6 bits required for SN in feedback (6 bits required for RTT, 16 max)
[DEBUG] [d_rtp.c:460 rtp_choose_uo1_variant()] UO-1* packet disambiguation: at least one IP header is IPv4 with context(RND) = 0, so parse as UO-1-ID or UO-1-TS
[DEBUG] [d_rtp.c:474 rtp_choose_uo1_variant()] UO-1* packet disambiguation: T = 0, so parse as UO-1-ID
[DEBUG] [rohc_decomp.c:1199 d_decode_header()] decode packet as 'RTP/UO-1-ID'
[DEBUG] [rohc_decomp.c:1370 rohc_decomp_decode_pkt()] parse packet type 'RTP/UO-1-ID' (4)
[DEBUG] [rohc_decomp_rfc3095.c:2109 parse_uo1id()] 5 IP-ID bits for IP header #1 = 0x19
[DEBUG] [rohc_decomp_rfc3095.c:2121 parse_uo1id()] 5 outer IP-ID bits = 0x19
[DEBUG] [rohc_decomp_rfc3095.c:2133 parse_uo1id()] 1-bit extension (X) = 0
[DEBUG] [rohc_decomp_rfc3095.c:2137 parse_uo1id()] 4 SN bits = 0xf
[DEBUG] [rohc_decomp_rfc3095.c:2142 parse_uo1id()] CRC-3 found in packet = 0x05
[DEBUG] [rohc_decomp_rfc3095.c:2151 parse_uo1id()] no extension in UO-1-ID packet
[DEBUG] [d_rtp.c:1518 rtp_parse_uo_remainder()] UDP checksum = 0x7fd2
[DEBUG] [rohc_decomp.c:1388 rohc_decomp_decode_pkt()] ROHC payload (length = 160 bytes) starts at offset 4
[DEBUG] [rohc_decomp_rfc3095.c:5630 rfc3095_decomp_decode_bits()] decoded SN = 42975 / 0xa7df (nr bits = 4, bits = 15 / 0xf)
[DEBUG] [rohc_decomp_rfc3095.c:5722 decode_ip_values_from_bits()] decoded outer TOS/TC = 184
[DEBUG] [rohc_decomp_rfc3095.c:5735 decode_ip_values_from_bits()] decoded outer TTL/HL = 63
[DEBUG] [rohc_decomp_rfc3095.c:5749 decode_ip_values_from_bits()] decoded outer protocol/NH = 17
[DEBUG] [rohc_decomp_rfc3095.c:5765 decode_ip_values_from_bits()] decoded outer NBO = 1
[DEBUG] [rohc_decomp_rfc3095.c:5778 decode_ip_values_from_bits()] decoded outer RND = 0
[DEBUG] [rohc_decomp_rfc3095.c:5791 decode_ip_values_from_bits()] decoded outer SID = 0
[DEBUG] [rohc_decomp_rfc3095.c:5850 decode_ip_values_from_bits()] decoded outer IP-ID = 0x3478 (rnd = 0, nbo = 1, sid = 0, nr bits = 5, bits = 0x19)
[DEBUG] [rohc_decomp_rfc3095.c:5863 decode_ip_values_from_bits()] decoded outer DF = 1
[DEBUG] [rohc_decomp_rfc3095.c:5879 decode_ip_values_from_bits()] decoded outer src address = c0a80204 (192.168.2.4)
[DEBUG] [rohc_decomp_rfc3095.c:5895 decode_ip_values_from_bits()] decoded outer dst address = c0a80304 (192.168.3.4)
[DEBUG] [d_rtp.c:1577 rtp_decode_values_from_bits()] decoded UDP source port = 0x2770
[DEBUG] [d_rtp.c:1592 rtp_decode_values_from_bits()] decoded UDP destination port = 0x271a
[DEBUG] [d_rtp.c:1627 rtp_decode_values_from_bits()] decoded UDP checksum = 0x7fd2 (checksum present = 1)
[DEBUG] [d_rtp.c:1641 rtp_decode_values_from_bits()] decoded RTP version = 2
[DEBUG] [d_rtp.c:1655 rtp_decode_values_from_bits()] decoded R-P flag = 0
[DEBUG] [d_rtp.c:1669 rtp_decode_values_from_bits()] decoded R-X flag = 0
[DEBUG] [d_rtp.c:1683 rtp_decode_values_from_bits()] decoded CC = 0
[DEBUG] [d_rtp.c:1699 rtp_decode_values_from_bits()] decoded RTP M flag = 0
[DEBUG] [d_rtp.c:1713 rtp_decode_values_from_bits()] decoded R-PT = 0
[DEBUG] [d_rtp.c:1716 rtp_decode_values_from_bits()] 0-bit TS delta = 0x0
[DEBUG] [d_rtp.c:1753 rtp_decode_values_from_bits()] TS is deducted from SN
[DEBUG] [decomp_scaled_rtp_ts.c:444 ts_deduce_from_sn()] new TS_SCALED = 8980032 (ref TS_SCALED = 8980031, new SN = 42975, ref SN = 42974)
[DEBUG] [decomp_scaled_rtp_ts.c:450 ts_deduce_from_sn()] new TS = 1436805152 (TS_SCALED = 8980032, TS_STRIDE = 160, TS_OFFSET = 32)
[DEBUG] [d_rtp.c:1776 rtp_decode_values_from_bits()] decoded timestamp = 1436805152 / 0x55a3e820 (nr bits = 0, bits = 0 / 0x0)
[DEBUG] [d_rtp.c:1790 rtp_decode_values_from_bits()] decoded SSRC = 847996751
[DEBUG] [rohc_decomp_rfc3095.c:5046 rfc3095_decomp_build_hdrs()] length of transport header = 20 bytes
[DEBUG] [rohc_decomp_rfc3095.c:5208 build_uncomp_ipv4()] Total Length = 0x00c8 (IHL * 4 + 180)
[DEBUG] [rohc_decomp_rfc3095.c:5212 build_uncomp_ipv4()] IP checksum = 0x7f9c
[DEBUG] [d_rtp.c:1833 rtp_build_uncomp_rtp()] UDP + RTP length = 0x00b4
[DEBUG] [rohc_decomp_rfc3095.c:5366 check_uncomp_crc()] CRC-3 on uncompressed header = 0x5
[DEBUG] [rohc_decomp.c:1472 rohc_decomp_decode_pkt()] CRC is correct
[DEBUG] [rohc_decomp.c:1604 rohc_decomp_decode_pkt()] uncompressed packet length = 200 bytes
[DEBUG] [decomp_scaled_rtp_ts.c:187 ts_update_context()] old SN 42974 replaced by new SN 42975
[DEBUG] [decomp_scaled_rtp_ts.c:188 ts_update_context()] old TS 1436804992 replaced by new TS 1436805152
[DEBUG] [decomp_scaled_rtp_ts.c:195 ts_update_context()] old TS_SCALED 8980031 replaced by new TS_SCALED 8980032
[DEBUG] [decomp_scaled_rtp_ts.c:210 ts_update_context()] old TS_STRIDE 160 kept unchanged
[DEBUG] [decomp_scaled_rtp_ts.c:220 ts_update_context()] old TS_OFFSET 32 kept unchanged
[DEBUG] [rohc_decomp.c:1278 d_decode_header()] 6 bits required for SN in feedback (6 bits required for RTT, 16 max)
[DEBUG] [rohc_decomp.c:802 rohc_decompress3()] stay in U-mode as requested by user
[DEBUG] [rohc_decomp.c:855 rohc_decompress3()] packet decompression succeeded
[DEBUG] [rohc_decomp.c:863 rohc_decompress3()] update decompressor and context statistics
[DEBUG] [rohc_decomp.c:1775 rohc_decomp_feedback_ack()] CID 0: U-mode: Full Context state: RTP/UO-1-ID packet successfully decompressed
[DEBUG] [rohc_decomp.c:1860 rohc_decomp_feedback_ack()] do not send a positive ACK because of rate-limiting (100 of 3200 with threshold 64)

and here is the log of a failed decompressor

[DEBUG] [rohc_decomp.c:780 rohc_decompress3()] decompress the 164-byte packet #1
[DEBUG] [rohc_decomp.c:3645 rohc_decomp_parse_padding()] skip 0 byte(s) of padding
[DEBUG] [rohc_decomp.c:1024 d_decode_header()] decompressor received 0 bytes of feedback for the same-side associated compressor
[DEBUG] [rohc_decomp.c:3582 rohc_decomp_decode_cid()] no add-CID found, CID defaults to 0
[DEBUG] [rohc_decomp.c:3745 rohc_decomp_find_context()] context with CID 0 not found
[WARNING] [rohc_decomp.c:3751 rohc_decomp_find_context()] non-IR packet cannot create a new context with CID 0
[WARNING] [rohc_decomp.c:889 rohc_decompress3()] packet decompression failed: no matching context and creation was impossible or failed (3)
[DEBUG] [rohc_decomp.c:2038 rohc_decomp_feedback_nack()] CID 0: packet failed to be parsed
[DEBUG] [rohc_decomp.c:2121 rohc_decomp_feedback_nack()] no need to perform a downward state transition nor send a negative ACK
ERROR:failed to decompress packet: no matching context and creation was impossible or failed (3)

I really will appreciate your comments,

Best,


Manuel Iglesias


________________________________________
From: Rohc [rohc-bounces+manuel.iglesias=plcpower.com@xxxxxxxxxxxxxxxxxxx] on behalf of Didier Barvaux [didier@xxxxxxxxxxx]
Sent: Thursday, May 12, 2016 3:10 PM
To: ROHC Library
Subject: Re: [Rohc] RTP compare port python binding

Hi,

> Yes I follow it but when I try to include/modify the code in function
> "rohc_comp_rtp_cb" at file rohc_helpers.h to include additional ports
> it seems it doesn't works since rohc give me a bad profile error at
> run time. My setup works for the list of 6 ports you have there, that
> is,
>
> default_rtp_ports[] = { 1234, 36780, 33238, 5020, 5002, 5006 }
>
> but if I tried add or even try to modify the array and it doesn't
> work afetr build/install of python binding. (I already modify the
> index value). I also try to recompile rohc before the python binding.
>
> The modification I did for this is
>
> default_rtp_ports[] = { 10050, 36780, 33238, 5020, 5002, 5006 } with
> same index
>
> or
>
> default_rtp_ports[] = { 1234, 36780, 33238, 5020, 5002, 5006, 10050}
> with index=7

Looks ok. Did you re-build the Python module? To be sure that
everything is re-built, you may remove entirely the build subdir.

$ cd contrib/python/
$ rm -rf build
$ python setup.py build

Then run your test.


> I endup trying this because what I try initially didn't work, I
> actually wanted to add a function that modify the array of udp ports,
> a function that I could call from python, I saw a similar function in
> older version of rohc but it's now deprecated and actually it was a c
> function.  If my function prototype is
>
> bool rohc_comp_add_rtp_port(const unsigned int port);
>
> I understand I need to add a line like the following to rohc.i file
>
> %constant bool rohc_comp_add_rtp_port(const unsigned int);
>
> but again basic stuff haven't work for me. Perhaps I am missing
> something else when trying to modify the udp port?
>
> I am using rohc 2, not sure which version but I am working with git
> sources.

Ok, I see. Please try the attached patch. Let me know if it solves your
problem.

Regards,
Didier


Follow ups

References