Thank you for your continued support, you have been invaluable!
I’m pleased to report that the rpisurv streams have been rock solid since my last post; it no longer does the ‘stream freezes every 1-3 hours’ thing that it was doing back on Buster, and the streams themselves even seem to load noticeably quicker.
However, in the end it depends on what applications do/how they use it, so quote possible that rpisurv still requires more.
It would seem that 256mb is about right for two streams (one ‘main’ and one ‘sub’ rtsp stream), so I do wonder if SvenVD wrote that README.md early on in development when it wasn’t quite so refined, or if it was a result of a hardware complication.
You were exactly right about that configuration file; it looks like I caused that issue myself by editing the memory splits myself rather than using dietpi-config
. I did a quick test by setting a 16mb GPU memory split in dietpi-config
, rebooting, checking the file, and then confirming that it removed the .conf file after setting memory back to 128mb (via dietpi-config):
- Set dietpi-config … to ‘Server’ (16MB).
- Rebooted.
- dietpi-disable_vcsm.conf created and populated as expected.
- Set dietpi-config … to ‘Video de/encoding’ (256MB).
- Rebooted.
- dietpi-disable_vcsm.conf removed, as expected.
- Streams started normally!

Also keeping it removed with <32 MiB GPU memory does not really hurt, just means 2 additional errors at boot when the driver tries to load (and fails to do so) and still the additional non-functional kernel module being loaded and consuming some memory.
Ahh, but that’s the point of dietpi, is it not? To trim things down to run as smoothly and streamlined as possible! Every mb of unnecessary memory that is freed up is a victory in that end! 
I love this distro for that very reason, otherwise I’d not have been trying so hard to try and get rpisurv working correctly on it for so long; I’ve 5 Raspberry Pis of my own and a handful that have been deployed as CUPS print servers for my customers, and every single one of them is running DietPi!
About the h264 error, is the related codec enabled?
Nope, it wasn’t! Another modprobe.d .conf file situation:
DietPi-Set_hardware
─────────────────────────────────────────────────────
Mode: rpi-codec (enable)
[ OK ] DietPi-Set_hardware | rm /etc/modprobe.d/dietpi-disable_rpi_codec.conf
[ OK ] DietPi-Set_hardware | Added setting dtoverlay=rpivid-v4l2 to end of file /boot/config.txt
[ OK ] rpi-codec enable | Completed
What would I normally have to do to enable this codec? Is it related to the GPU memory splits, or something else?
I was still getting errors related to the codec with a 256mb GPU memory split:
-- Journal begins at Tue 2023-04-25 10:11:11 BST. --
Apr 25 10:11:33 EOD-Office rpisurv[583]: MultiFramedRTPSource::doGetNextFrame1(): The total received frame size exceeds the client's buffer size (250000). 61389 bytes of trailing data will be dropped!
Apr 25 10:11:33 EOD-Office rpisurv[590]: [f44154a8] main decoder error: buffer deadlock prevented
Apr 25 10:11:33 EOD-Office rpisurv[583]: [f4715580] main decoder error: buffer deadlock prevented
Apr 25 10:11:33 EOD-Office rpisurv[603]: [f46154a8] main decoder error: buffer deadlock prevented
Apr 25 10:11:38 EOD-Office rpisurv[583]: [f4715580]
Apr 25 10:11:38 EOD-Office rpisurv[590]: [f44154a8] avcodec decoder:
Apr 25 10:11:38 EOD-Office rpisurv[583]: avcodec decoder: Using DRM Video Accel for hardware decoding
Apr 25 10:11:38 EOD-Office rpisurv[590]: Using DRM Video Accel for hardware decoding
Apr 25 10:11:38 EOD-Office rpisurv[603]: [f46154a8] avcodec decoder: Using DRM Video Accel for hardware decoding
Apr 25 10:11:38 EOD-Office rpisurv[603]: [f46154a8] main decoder error: buffer deadlock prevented
I tried 512mb and still got the errors (log below), so I don’t think it’s anything to do with the GPU memory available. I do wonder if this is an rpisurv bug or misconfiguration?
-- Journal begins at Tue 2023-04-25 10:21:46 BST. --
Apr 25 10:22:00 EOD-Office rpisurv[581]: unspecified video dimensions
Apr 25 10:22:00 EOD-Office rpisurv[601]: [f4715500] avcodec decoder error: unspecified video dimensions
Apr 25 10:22:00 EOD-Office rpisurv[581]: MultiFramedRTPSource::doGetNextFrame1(): The total received frame size exceeds the client's buffer size (250000). 63878 bytes of trailing data will be dropped!
Apr 25 10:22:00 EOD-Office rpisurv[588]: [f4115450]
Apr 25 10:22:00 EOD-Office rpisurv[601]: [f4715500]
Apr 25 10:22:00 EOD-Office rpisurv[588]: avcodec decoder: Using DRM Video Accel for hardware decoding
Apr 25 10:22:00 EOD-Office rpisurv[601]: avcodec decoder: Using DRM Video Accel for hardware decoding
Apr 25 10:22:00 EOD-Office rpisurv[588]: [f4115450] main decoder error: buffer deadlock prevented
Apr 25 10:22:00 EOD-Office rpisurv[581]: [f4715450] main decoder error: buffer deadlock prevented
Apr 25 10:22:05 EOD-Office rpisurv[581]: [f4715450] avcodec decoder: Using DRM Video Accel for hardware decoding
I’ve set the GPU memory split to 256mb for the time being, as that seems to be the sweet spot; if I go for 128mb I occasionally get a timestamp error during the startup of rpisurv that does not seem to appear when the memory split is set 256mb:
rpisurv[554]: [f4115710] main decoder error: Could not convert timestamp 1682372383562739 for FFmpeg