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

srt live transmit UDP buffer size config #1152

Merged

Conversation

maxsharabayko
Copy link
Collaborator

@maxsharabayko maxsharabayko commented Feb 24, 2020

Added the possibility to set the buffer size of the UDP socket.

It turned out at high and bursty data rates (~60 Mbps) the epoll_wait(udp_socket) is not fast enough to signal about the possibility to read from a socket. It results in loosing data when there

Waiting on a UDP socket with ::select(...) works perfect, but we can't use it in the current implementation of the srt-live-transmit.

UDP socket needs a bigger buffer to store incomming data. For example, setting 64 MB buffer seems to workaround the issue #933.

Increase the system-default max rcv buffer size

$ cat /proc/sys/net/core/rmem_max
212992
$ sudo sysctl -w net.core.rmem_max=26214400
net.core.rmem_max = 26214400
$ cat /proc/sys/net/core/rmem_max
26214400

Specify the size of the UDP socket buffer via the URI

Example URI:

"udp://:4200?rcvbuf=67108864"

Example full URI:

./srt-live-transmit "udp://:4200?rcvbuf=67108864" srt://192.168.0.10:4200 -v

TODO

  • Remove verbose messages regarding the size of the buffer

apps/transmitmedia.cpp Outdated Show resolved Hide resolved
apps/transmitmedia.cpp Outdated Show resolved Hide resolved
@maxsharabayko
Copy link
Collaborator Author

Ran the experiment for 2 minutes. No losses on the UDP socket when streaming 60 Mbps with the timing taken from #933 (udp-mcast-60mbps-timing.zip).

The following pipeline was used:

./srt-live-transmit "udp://:4200?rcvbuf=67108864" srt://192.168.0.10:4200 -v
13:10:11.393867 [I] VALIDATOR Overal pkts received: 1, lost: 0
...
13:12:11.211656 [I] VALIDATOR Overal pkts received: 682557, lost: 0

@maxsharabayko maxsharabayko marked this pull request as ready for review February 25, 2020 12:24
@maxsharabayko maxsharabayko added the [apps] Area: Test applications related improvements label Feb 26, 2020
@maxsharabayko maxsharabayko added this to the v1.5.0 milestone Feb 26, 2020
@maxsharabayko maxsharabayko added the Type: Maintenance Work required to maintain or clean up the code label Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[apps] Area: Test applications related improvements Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source bitrate bigger then 30Mbps problem ?
4 participants