To manage the delay in Lopcomm RRH, it is supposed to configure:
According to Amarisoft's doc (trx_cpri.pdf)
Value of Lopcomm RRH:
CPRI Specification V7: http://www.cpri.info/downloads/CPRI_v_7_0_2015-10-09.pdf
The main confusion we have is about the value of Toffset.
To configure delays and adjust propagation delays to that TX signal is aligned to PPS and RX is aligned to TX, you need to setup cpri_tx_delay and cpri_rx_delay.
cpri_tx_delay is used to align TX signal to PPS.
The CPRI driver uses this value to start sending of hyperframes before its own PPS so that the associated signal reaches antenna at the correct time.
This delay should be set to T12 + T2a
cpri_rx_delay is used to align TX and RX signal and ensure synchronization for TDD.
The CPRI driver use this value to apply an offset to the received signal inside the hyperframes to compensate propagation delay and align RX to TX. When the CPRI driver receives an hyperframe, it uses its HFN/BFN to compute the timestamp of the signal and removes the cpri_rx_delay.
This delay should be set to T2a + T3a - Toffset
The BBU generates the signal to t=0 (Ex: start of a frame).
The signal is put in HFR:0.0 (HFN=0, BFN=0) and is sent to RRU at t=-(T12 + T2a)
HFR:0.0 reaches R2 at t=-T2a
HFR:0.0 reaches antenna at t=0 as expected
The RRU generates HFR:0.0 at t=-T2a + Toffset as it aligns on received HFR:0.0 at t=-T2a
The signal put in HFR:0.0 is the one received -T3a earlier at antenna side.
Which means that HFR:0.0 sent by RRU is filled with signal received at antenna side at t=-T2a + Toffset - T3a