I can´t reproduce here. But there could be some setting you use that I don´t. Are you setting resolution to 1920x1080 in raw menu. Maybe that is causing it, idk.
I tested your changes. Just shortly. Cannot say much atm but note that black level readings will take a hit with 16:9 mode because you alter skip offsets. What happens is raw.c(back end) will miss autodetection of black level reading. Look for this part in raw.c:
/* returns 1 on success, 0 on failure */
static int autodetect_black_level(int* black_mean, int* black_stdev_x100)
{
//~ static int k = 0;
//~ bmp_printf(FONT_MED, 250, 50, "black refresh: %d ", k++);
/* also handle black level for dual ISO */
int mean1 = 0;
int stdev1 = 0;
int mean2 = 0;
int stdev2 = 0;
if ((raw_info.active_area.x1 > 50) && (shamem_read(0xC0f0b13c) != 0xd) && (shamem_read(0xC0f0b13c) != 0x11) &&
(shamem_read(0xC0f0b13c) != 0xe) && (shamem_read(0xC0f0b13c) != 0xd) && (shamem_read(0xC0f06804) != 0x5a70298) &&
(shamem_read(0xC0f0b13c) != 0xb) && (shamem_read(0xc0f0713c) != 0x456) && (shamem_read(0xC0f06804) != 0x4550298) &&
(shamem_read(0xC0f06804) != 0x93a011b) && (shamem_read(0xC0f06804) != 0x8d6011b)) /* use the left black bar for black calibration, shamem exception anamorphic and high speed frame rates crop rec.c */
{
autodetect_black_level_calc(
16, raw_info.active_area.x1 - 16,
raw_info.active_area.y1 + 20, raw_info.active_area.y2 - 20,
3, 16,
&mean1, &stdev1
);
autodetect_black_level_calc(
16, raw_info.active_area.x1 - 16,
raw_info.active_area.y1 + 22, raw_info.active_area.y2 - 20,
3, 16,
&mean2, &stdev2
);
/* for dual iso: increase tolerance of the cleaner exposure (there is interference from the noisier one) */
int ref_stdev = MAX(stdev1, stdev2);
if (!black_level_check_left(mean1, ref_stdev, raw_info.active_area.y1 + 20, raw_info.active_area.y2 - 20))
{
return 0;
}
if (!black_level_check_left(mean2, ref_stdev, raw_info.active_area.y1 + 22, raw_info.active_area.y2 - 20))
{
return 0;
}
}
else /* use the top black bar for black calibration */
{
autodetect_black_level_calc(
raw_info.active_area.x1 + 20, raw_info.active_area.x2 - 20,
4, raw_info.active_area.y1 - 4,
16, 4,
&mean1, &stdev1
);
autodetect_black_level_calc(
raw_info.active_area.x1 + 20, raw_info.active_area.x2 - 20,
6, raw_info.active_area.y1 - 4,
16, 4,
&mean2, &stdev2
);
/* todo: consistency check */
}
I do a lot of shamem_read exceptions. It´s not good lokking but it gets the job done for a few presets I tweaked.
By the way. Did you test 2.5k 1:1 centered preset?
Oh, and one more thing. I encountered a few pink frames in 2.5k mode so changed a bit in regs. Hopefully fixed. New build uploaded.
EDIT: Issue reproduced. It´s related to resolution changed to 1980x1080 in raw video menu. Must be a conflict with crop_rec changes. I can take a look. I never really built my presets to be modified in raw video. Always set to max. Resolution set in crop_rec statically instead but not working for you in this case.
Seems we need to refresh hooks after each recording has stopped.
EDIT:
Uploaded a new version again. Seems to fix 2k stay in center when reducing to 1920x1080. Not working for 3k but also not high priority. Stay with static crop rec resolutions otherwise and we´re fine.
EDIT:
If you want to dig into cmos update routines here´s a snippet from crop_rec.c:
static int patch_active = 0;
static void update_patch()
{
if (CROP_PRESET_MENU)
{
/* update preset */
crop_preset = CROP_PRESET_MENU;
/* install our hooks, if we haven't already do so */
if (!patch_active)
{
patch_hook_function(CMOS_WRITE, MEM_CMOS_WRITE, &cmos_hook, "crop_rec: CMOS[1,2,6] parameters hook");
patch_hook_function(ADTG_WRITE, MEM_ADTG_WRITE, &adtg_hook, "crop_rec: ADTG[8000,8806] parameters hook");
if (ENGIO_WRITE)
{
patch_hook_function(ENGIO_WRITE, MEM_ENGIO_WRITE, engio_write_hook, "crop_rec: video timers hook");
}
patch_active = 1;
}
}
else
{
/* undo active patches, if any */
if (patch_active)
{
unpatch_memory(CMOS_WRITE);
unpatch_memory(ADTG_WRITE);
if (ENGIO_WRITE)
{
unpatch_memory(ENGIO_WRITE);
}
patch_active = 0;
crop_preset = 0;
}
}
}
/* enable patch when switching LiveView (not in the middle of LiveView) */
/* otherwise you will end up with a halfway configured video mode that looks weird */
PROP_HANDLER(PROP_LV_ACTION)
{
update_patch();
}
/* also try when switching zoom modes */
PROP_HANDLER(PROP_LV_DISPSIZE)
{
update_patch();
}