Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ptp: add phc2sys synchronization. #372

Merged
merged 49 commits into from
Jul 28, 2023

Conversation

gongxiao-intel
Copy link
Contributor

@gongxiao-intel gongxiao-intel commented Jul 24, 2023

Synchronize PHC to system clock in nano seconds precision. To enable phc2sys, additional command line argument "--phc2sys" is required. The phc2sys feature is only available on Linux.

The expected output will be:
MT: * * M T D E V S T A T E * *
MT: DEV(0): Avr rate, tx: 1743.154275 Mb/s, rx: 0.017576 Mb/s, pkts, tx: 1646232, rx: 245
MT: CNI(0): eth_rx_rate 0 Mb/s, eth_rx_cnt 245
MT: PTP(0): time 1690295966844875387, 2023-07-25 14:38:49
MT: PTP(0): system clock offset max 3131
MT: PTP(0): delta avg 1155, min 565, max 3735, cnt 80
MT: PTP(0): correct_delta avg 580, min -1720, max 1999, cnt 71
MT: PTP(0): path_delay avg 1412, min 1409, max 1415, cnt 71
MT: PTP(0): mode l4, sync cnt 80, expect avg 958:[email protected]
MT: PTP(0): rx time error 0, tx time error 0, delta result error 9
MT: TX_VIDEO_SESSION(0,0:app_tx_video_0): fps 49.990945, frame 500 pkts 1646204:1646204 inflight 411472:411551
MT: TX_VIDEO_SESSION(0,0:app_tx_video_0): throughput 1743 Mb/s, cpu busy 0.019005
MT: * * E N D S T A T E * *

frankdjx and others added 25 commits December 9, 2022 09:00
pcapng may has value when pcapng_max_pkts is not updated.

Signed-off-by: Du, Frank <[email protected]>
(cherry picked from commit a0aa151)
Signed-off-by: Frank Du <[email protected]>
(cherry picked from commit 6743f16)
Signed-off-by: Ric Li <[email protected]>
(cherry picked from commit b32690a)
…isualCloud#123)

* plugin/ffmpeg: add the steps to connect kahawai with openh264 encoder

Signed-off-by: Jing Sun <[email protected]>
(cherry picked from commit e4750e9)
Signed-off-by: Ric Li <[email protected]>
(cherry picked from commit 3e8d9dd)
Signed-off-by: Ric Li <[email protected]>
(cherry picked from commit d01a600)
Signed-off-by: Frank Du <[email protected]>
Always get below log if app are running from multi thread with vf.
  _atomic_set_cmd(): There is incomplete cmd 112
  iavf_fdir_add(): fail to execute command OP_ADD_FDIR_FILTER
  iavf_flow_create(): Failed to create flow

Signed-off-by: Frank Du <[email protected]>
(cherry picked from commit 26c103a)
1. Optimize LaunchTime Tx feature based on section 3.3.2.9.3.4 of doc#682924 rev-1.4.2 requirement.

2. Configurate Qbv scheduler to isolate the video traffic and others traffic. The cycle time of
the scheduler is the frame cycle time of 50fps. According SMPTE 2110-21 standard, the video packets
transmission will end at the 784us from the end of cycle. The queue 0 is for video packets transmission.
The other queues is for others traffic. So, the queue 0 is opened during the whole cycle, and the
other queues is opened at the 784us from the end of cycle.

3. Optimize time sync precision by adding clock freqency adjustment.

4. Fix remote ptp4l NOT receiving DELAY_REQ message while send PTP message over UDP.
To enable TSN pacing, "--pacing_way tsn" command line
argurment is required.
Fix ptp not working on igc when master starts ptp4l with argument "-4" to
broadcast ptp message over UDP.
Because the first few reading tx timestamp attempts always failed,
we have set total 50 attempts to tolerate the fails. So, it is
unnecessary to print error messages of the first few attempts.
Error message is required only when the number of attempts is
larger than 50
Copy link
Collaborator

@frankdjx frankdjx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beside the comments for code. Pls consider to add a control flag(similar to MTL_FLAG_PTP_ENABLE) to enable phc2sys feature, not all user case need sync the phc to system time, specially it's probably an admin access action.

lib/src/mt_ptp.c Show resolved Hide resolved
lib/src/mt_ptp.c Outdated Show resolved Hide resolved
lib/src/mt_ptp.c Outdated Show resolved Hide resolved
lib/src/mt_ptp.c Outdated Show resolved Hide resolved
lib/src/mt_ptp.c Outdated Show resolved Hide resolved
lib/src/mt_ptp.c Outdated Show resolved Hide resolved
lib/src/mt_ptp.c Outdated Show resolved Hide resolved
lib/src/mt_ptp.c Outdated Show resolved Hide resolved
@frankdjx frankdjx merged commit bae5412 into OpenVisualCloud:main Jul 28, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants