russelltg/srt-rs

Unclear debugging when buffers are too small

aegroto opened this issue · 2 comments

I had to deal with a weird behavior from the library while implementing a simple video stream server-client system. If the buffers on the receiver or on the sender are too small, packets are dropped but no warning is shown.
Even when increasing the debug level, it is difficult to tackle these kind of problems as on the receiver no message is printed at any level about it, while on the sender the console is filled with the content of which packet, which in these cases is pretty wide.

Here is a minimum test case for this issue: https://github.com/aegroto/srt-rs-transmission-debug. When removing the option that increases the buffer size, the transmission is stuck but there are no clear messages about it.

Is it possible to improve the verbosity of the library when such errors appear? I am willing to contribute by doing it myself although I am not sure if it is a design choice. Also, I have no clue of which module handles such aspects.

@aegroto Yes, it is entirely possible to improve the verbosity of the library in this case. Look in the /srt-protocol/src/protocol/receiver/ directory. The Receiver and ReceiveBuffer structs are the places you should probably look at. There is a DataPacketError enum that should probably help. Let me know if you have any other questions.

Thanks, I will give a deeper look once I have got some spare time and open a PR in case I have some proposals.