Skip to content

Commit c5d2027

Browse files
committedFeb 19, 2021
RTC: Support high performance timer about 25ms resolution. 4.0.72
1 parent ebcba14 commit c5d2027

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
 

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ For previous versions, please read:
156156

157157
## V4 changes
158158

159+
* v4.0, 2021-02-12, RTC: Support high performance timer about 25ms resolution. 4.0.72
159160
* v4.0, 2021-02-10, RTC: Refine performance about 700+ streams. 4.0.71
160161
* v4.0, 2021-02-08, RTC: Print stat for pli and timer every 5s. 4.0.70
161162
* v4.0, 2021-02-07, RTC: Parse PT fast and refine udp handler. 4.0.69

‎trunk/src/core/srs_core_version4.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
#ifndef SRS_CORE_VERSION4_HPP
2525
#define SRS_CORE_VERSION4_HPP
2626

27-
#define SRS_VERSION4_REVISION 71
27+
#define SRS_VERSION4_REVISION 72
2828

2929
#endif

1 commit comments

Comments
 (1)

winlinvip commented on Feb 28, 2021

@winlinvip
MemberAuthor

For #2194

本质上timer是由于epoll导致不准确,因为任务执行时消耗了时间,需要等到所有任务都执行完成才用epoll_wait(timeout)计算定时器,这就造成了误差,详细过程分析可以看代码拜年:SRS高精度低误差定时器

  • 增加统计信息,看系统调度的间隔,也就是epoll_wait执行的间隔,也就决定了定时器的精度:e91e0ea70fb647
  • 启动一个20ms的固定timer,可以分析它的唤醒间隔,来分析timer的误差:c2332f9
  • 将定时器放到RunQ的队列头,也就是优先执行timer:d856339#diff-fd260f84706aa0cbdeaf83a8082525fc268926bf0340ce972fbf43d4b132196bR552
  • ST增加函数,支持yield,在yield时检查timer是否超时,这相当于给timer增加了运行时间提高精度:b4b9776c0fda42a049ce3
  • 直播Player的主循环,主动yield让度时间片,增加timer精度:d1bcc03
  • 直播Publisher主动yield,提高timer精度:a5a9649
  • RTC Publisher主动yield,提高timer精度:df1eca1
  • RTC Player主动yield,提高timer精度:ebcba14
Please sign in to comment.