Closed dsugisawa-mixi closed 2 years ago
@6by9 I have no idea on this one, have you?
It needs some explanation by the submitter beyond two statements and a patch, none of which are obviously related.
fwrite(3) is implemented in buffering mode by default, I thought it will be L2 cache polluting, and then resuls in poor performance.
it was also the case in the BCM2711.
./build/bin/raspivid -w 640 -h 360 -o udp://192.168.15.202:50002 -fps 30 --codec H264 -n -t 0
https://www.cplusplus.com/reference/cstdio/setvbuf/
_IONBF No buffering: No buffer is used. Each I/O operation is written as soon as possible. In this case, the buffer and size parameters are ignored.
Nothing to do with CPU caches.
You're not saving much anyway as there is already an option for flushing after every packet with -fl
.
UDP supports a max 65507 bytes when over IPv4 (65535 - 8 byte UDP header - 20 byte IP header), and then then needs to be fragmented down to a typically max 1500 byte ethernet frame.
I agree, and thanks your comments.
This change makes low-latency udp streaming more stable in the BCM2835:Zero W environment. (BCM2835 provides a 128KB system L2 cache, which is used primarily by the GPU)