Getting this thread back on topic. I still try to get true mv1080 and mv720 with 60fps working.
Using the dm-spy-experiments branch I tried to see if I can isolate a function that changes the camera into mv1080 mode when normal h264 recording starts.
So far I came up with the following:
Normal operation to recording 1080
Evf:00014b0c:ad:03: PATH_Select S:0 Z:10000 R:0 DZ:0 SM:1 SV:0 DT:0
Evf:00014ca0:ad:03: PathDriveMode Change: 11->6
Evf:ff37b5e8:ad:03: GetPathDriveInfo[6]
Evf:ff50478c:ad:03: Rec_HD_SelectPath LCD
Normal operation to HDMI output
Evf:00014b0c:ad:03: PATH_Select S:1 Z:10000 R:1 DZ:0 SM:1 SV:0 DT:0
Evf:ff37b5e8:ad:03: GetPathDriveInfo[11]
Evf:ff509db8:ad:03: RecStandby_x1_60fps_SelectPath HDMI(480)
HDMI output back to normal operation
Evf:00014b0c:ad:03: PATH_Select S:1 Z:10000 R:1 DZ:0 SM:1 SV:0 DT:0
Evf:ff37b5e8:ad:03: GetPathDriveInfo[11]
Evf:ff509d90:ad:03: RecStandby_x1_60fps_SelectPath LCD
So it seems the PATH_Select function decides if the camera should change the Evf mode (from mode 11 to mode 6). I hooked the PATH_Select function and overwrote the struct pointed to by reg0 to with the values that evaluate to the Rec_HD mode 11 inside PATH_Select like this:
PATH_SELECT = 0x14ac4;
MEM_PATH_SELECT = 0xe92d4030;
patch_hook_function(PATH_SELECT, MEM_PATH_SELECT, &path_select_hook, "evf_mode: PATH_select hook");
static void path_select_hook(uint32_t* regs, uint32_t* stack, uint32_t pc)
{
uint32_t *mode_struct = (uint32_t *) regs[0];
printf("mode_struct: %x %x %x %x\n %x %x %x %x\n %x %x %x %x\n %x\n",
mode_struct[0], mode_struct[1], mode_struct[2], mode_struct[3],
mode_struct[4], mode_struct[5], mode_struct[6], mode_struct[7],
mode_struct[8], mode_struct[9], mode_struct[10], mode_struct[11],
mode_struct[17]);
if (is_EOSM)
{
switch(evf_mode_index)
{
case LV_REC_MV1080_24FPS:
mode_struct[0] = 1;
mode_struct[2] = 0;
mode_struct[3] = 0;
mode_struct[5] = 1;
break;
}
}
}
Sadly when I activate the hook the live view freezes as soon as the PATH_Select function is called, e.g. by switching to info view and back or by half pressing shutter to focus. Deactivating the hook returns everything to normal.
Interestingly though is that under Debug Image buffers and EDMAC channel 1 change:
Before Image buffers: 720x480, 960x639
After Image buffers: 720x480, 1728x1151
Before EDMAC[1]: 1920x639
After EDMAC[1]: 3456x1151
So I'm not sure what's going on, if my hook is working as intended (need to log debug msgs while hooked) and certainly not sure if I'm actually looking in the right place.