-Some info:
Total shoot memory size is ~
91 MB
Total SRM memory size is ~
31 MB
Total: ~
122 MB
We are using both of these for RAW video recording (saving frames to memory before writing it to SD card), beside there is 24 MB from LV RAW buffer on 700D (5.2 MB on 100D) which is being used for RAW buffer.
I remembered that we actually
allocate buffer size as needed in very high resolution (when RAW frame size is higher than LV RAW buffer size a.k.a DEFAULT_RAW_BUFFER)
like Full-Res LiveView on 700D or 1440p and 3K on 100D (we are not restricted to 24 MB on 700D or 5.2 MB on 100D,
see):
On 700D when I use Full-Res LiveView preset (5208x3478), new RAW buffer gets allocated from shoot memory, and allocation size "RAW_LV_BUFFER_ALLOC_SIZE" is defined as "SRM_BUFFER_SIZE - 0x1000"
You can see how much is SRM_BUFFER_SIZE in consts.h for each model, on 700D/100D it's ~31 MB, so in this case LV RAW buffer will take ~31 MB from shoot memory and the remaining ~59 MB will get allocated by mlv_lite (for RAW video recording), and
SRM memory won't be used for both LV RAW buffer and RAW video recording which is weird! why SRM memory won't be allocated for RAW video recoding?
which mean
it's waste of ~31 MB of memory, probably the code in raw.c need some modifications (for SRM memory issue)?
Okay, back to 100D, when selecting 1440p (needs ~6.7 MB RAW buffer size) or 3K (needs ~7.4 MB RAW buffer size) presets, the new RAW buffer will get alloctaed from shoot memory, and you might already know that allocation size is defined as "SRM_BUFFER_SIZE - 0x1000" which is ~31MB which is
higher than what we actually need!
So we are wasting ~
24 MB of shoot memory, remaining would be
59 MB, and for some reason SRM memory won't be allocated by mlv_lite (already said that), so we are wasting total of ~
55 MB of memory for RAW video recording, and that's why RAW video recording stops very early on 100D when recording at 3K or 1440p.
So after figuring out above things, I changed "RAW_LV_BUFFER_ALLOC_SIZE" to match RAW frame size (a tiny bit higher), from "SRM_BUFFER_SIZE - 0x1000" to "raw_info.width*raw_info.height*14/8 + 0x1000", by doing that we have left of ~
83 MB from shoot memory, and also SRM memory
will get allocated by mlv_lite (RAW video)

Which mean -->
longer recording times at higher resolutions on 100D

-And regarding why you will need to turn off and on RAW video multiple times to update RAW video parameters:
That's because RAW video will allocate all shoot memory when it's on, turning off RAW video will free RAW video buffer and set shoot memory free then this thing will let crop_rec (and raw.c) allocate new RAW buffer from shoot memory (for high resolutions), then by turning on RAW video again will let it allocate remaining shoot memory.
More like a race condition, for sure this is fixable, need some code modifications for raw.c and mlv_lite.c and probably crop_rec.c.
-By figuring above things will open the door for some enhancements for Full-Res LiveView recording.
-
Test build?
Sure:
crop_rec_4k.2022Jun19.100D101.zipNote:
You will need to turn off and on RAW video multiple times after selecting 1440p or 3K presets, to let RAW video update its parameters!!
Please report for any issues.