Open akateleplan opened 3 years ago
While running some more tests, this text appeared when using Ctrl+C to exit the hanging process:
Initialized direct3d renderer.
[NULL @ 000001639185a540] Opening 'srt://localhost:5555' for reading
[srt @ 000001639185abc0] No default whitelist set
[srt @ 000001639185abc0] Connection to srt://localhost:5555 failed (I/O error), trying next address
12:51:55.305000/T5*E:SRT.ea: EID:1 no sockets to check, this would deadlock
[srt @ 000001639185abc0] Operation not supported: All sockets removed from epoll, waiting would deadlock
12:51:55.305000/T5*E:SRT.ea: remove_usock: @233216972 not found as either socket or group. Removing only from epoll system.
[srt @ 000001639185abc0] Connection to srt://localhost:5555 failed: Unknown error occurred
The log you showed doesn't look for me like something that hangs. It reports errors and the first error log from SRT looks like all sockets (one, in particular) were broken during connecting. This looks like the socket was early broken and then removed from epoll waiting function. This one seems to have exit.
I'll try to repeat this on Windows myself, but if you could help me in the meantime - could you please use srt-live-transmit
application from the SRT applications instead of ffmpeg, more-less like this:
srt-live-transmit.exe srt://localhost:5555 file://con -v 2>srt.log
and see if this can be reproduced?
I made a test on Windows with non-reconnecting srt-live-transmit
so that it can be run in this kind of loop, and it reached 18227 case overnight and didn't hang. A hangup in the waiting function may happen in case when the timeout is set as -1 (indefinitely) and none of the sockets reports readiness (even for error). Entering waiting with no sockets in the EID by default ends with an error, so this shouldn't be a case. Would you be able to reproduce this at least with the use of ffmpeg
command line (stream to a file instead of playing)?
I tested and was able to reproduce this after about 20 loops with ffmpeg writing to file as such:
ffmpeg -i srt://localhost:5555 -c copy -f mpegts file.ts
I believe this not to be reproduceable with the srt applications because the error seems to lie somewhere in the connection between srt and ffmpeg.
I have problems with compiling ffmpeg with SRT and debug support on Windows. Instructions on the ffmpeg website are kinda unclear and not always work. Do you have a possibility to make a statically linked ffmpeg with debug support for Windows?
Found this autobuild tool: media-autobuild_suite. I used it several years ago to build FFMpeg under windows. Maybe would be helpful here.
Ok, I gave it a try, but the number of bugs to fix in this script and mysterious further problems led me to giving up.
Well, I tried and it didn't help. Likely it's outdated and no longer helps.
We've noticed a semilar error message also on Linux with SRT version 1.4.2. It seems that the issue happens sometimes if the CALLER couldn't established the connection to the LISTENER because it was already used by another application and we've noticed it also sometimes at the LISTENER side if we stop the CALLER application with CTRL-C. May this information helps. It happens rarely!
Error messages on LISTENER after CTRL-C on CALLER: 09:57:31.238025/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.238096/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:30.903491/SRT:RcvQ:w3.N:SRT.cn: PASSING request from: 192.168.162.83:58728 to agent:100103653 09:57:31.238132/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.238344/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.238422/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:30.903544/SRT:RcvQ:w1.N:SRT.cn: Listener managed the connection request from: 192.168.162.83:58727 result:waveahand 09:57:31.238646/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:30.903731/SRT:RcvQ:w2.N:SRT.cn: Listener managed the connection request from: 192.168.162.83:62236 result:waveahand 09:57:31.238742/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.238782/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.238799/SRT:RcvQ:w1.N:SRT.cn: PASSING request from: 192.168.162.83:58727 to agent:100103654 09:57:31.238814/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.238861/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.238894/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.238764/SRT:RcvQ:w2.N:SRT.cn: PASSING request from: 192.168.162.83:61180 to agent:100103673 09:57:31.238929/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.238960/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.238968/SRT:RcvQ:w2.N:SRT.cn: Listener managed the connection request from: 192.168.162.83:61180 result:waveahand 09:57:31.238989/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.239003/SRT:RcvQ:w2.N:SRT.cn: PASSING request from: 192.168.162.83:61180 to agent:100103673 09:57:31.239019/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.239048/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.239048/SRT:RcvQ:w2.N:SRT.cn: Listener managed the connection request from: 192.168.162.83:61180 result:waveahand 09:57:31.239078/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.239082/SRT:RcvQ:w2.N:SRT.cn: PASSING request from: 192.168.162.83:52730 to agent:100103673 09:57:31.239107/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.239126/SRT:RcvQ:w2.N:SRT.cn: Listener managed the connection request from: 192.168.162.83:52730 result:waveahand 09:57:31.239136/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.239162/SRT:RcvQ:w2.N:SRT.cn: PASSING request from: 192.168.162.83:52919 to agent:100103673 09:57:31.239181/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.239211/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.238883/SRT:RcvQ:w1.N:SRT.cn: Listener managed the connection request from: 192.168.162.83:58727 result:waveahand 09:57:31.239244/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.239252/SRT:RcvQ:w1.N:SRT.cn: PASSING request from: 192.168.162.83:58727 to agent:100103654 09:57:31.239294/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock 09:57:31.239351/SRT:RcvQ:w3.N:SRT.cn: Listener managed the connection request from: 192.168.162.83:58728 result:waveahand 09:57:31.239383/2ThreadE:SRT.ea: EID:7 no sockets to check, this would deadlock
Error Message from second caller if another SRT caller is previous locked to the same receiver ... sometimes in an interval of micro seconds: 04:20:15.835264/SRTThreadE:SRT.ea: EID:3 no sockets to check, this would deadlock 04:20:15.835296/SRTThreadE:SRT.ea: EID:3 no sockets to check, this would deadlock 04:20:15.835311/SRTThreadE:SRT.ea: EID:3 no sockets to check, this would deadlock 04:20:15.835326/SRTThreadE:SRT.ea: EID:3 no sockets to check, this would deadlock 04:20:15.835344/SRTThreadE:SRT.ea: EID:3 no sockets to check, this would deadlock 04:20:15.835362/SRTThreadE:SRT.ea: EID:3 no sockets to check, this would deadlock 04:20:15.835377/SRTThreadE:SRT.ea: EID:3 no sockets to check, this would deadlock 04:20:15.835398/SRTThreadE:SRT.ea: EID:3 no sockets to check, this would deadlock 04:20:15.835443/SRTThread*E:SRT.ea: EID:3 no sockets to check, this would deadlock
... or sometimes with an intervall of seconds: 04:21:04.669727/SRTThreadE:SRT.ea: remove_usock: @133962359 not found as either socket or group. Removing only from epoll system. 04:21:05.669794/SRT:GCE:SRT.ei: epoll/update: IPE: update struck E4 which is NOT SUBSCRIBED to @133962359 04:21:05.669833/SRT:GCE:SRT.ei: epoll/update: IPE: update struck E4 which is NOT SUBSCRIBED to @133962359 04:21:05.754017/SRTThreadE:SRT.ea: remove_usock: @133962348 not found as either socket or group. Removing only from epoll system. 04:21:06.754134/SRT:GCE:SRT.ei: epoll/update: IPE: update struck E4 which is NOT SUBSCRIBED to @133962348 04:21:06.754170/SRT:GCE:SRT.ei: epoll/update: IPE: update struck E4 which is NOT SUBSCRIBED to @133962348
Hi @hhhansen,
I am encountering a similar problem and was wondering if you managed to find the root cause or a solution to this issue?
Thanks!
Describe the bug First of all, I'm unsure if this bug is in ffmpeg's libsrt.c or in srt itself. When trying to connect to any srt stream that isn't streaming with ffmpeg or ffplay on windows, doing so repeatedly will eventually make ffmpeg hang in libsrt.c libsrt_network_wait_fd while calling srt_epoll_wait. This can be circumvented by using the timeout parameter, but does not reflect how it should behave. Reproduction on Linux have been unsuccessful. Batch script for running indefinitely:
To Reproduce Steps to reproduce the behavior:
Expected behavior Not hanging
Desktop (please provide the following information):