2 new buffers for record mode found - canon a530 - page 2 - General Discussion and Assistance - CHDK Forum supplierdeeply

2 new buffers for record mode found - canon a530

  • 13 Replies
  • 4417 Views
Re: 2 new buffers for record mode found - canon a530
« Reply #10 on: 27 / May / 2014, 05:26:41 »
Advertisements
@nafraf Thank You. I only tested that a540 code for a530, You did the rest  :)

@reyalp
you could check MD response with and without this change http://chdk.wikia.com/wiki/Testing#MD_tune.bas although given the a540 is correct and the values are the same, it's probably fine.
I believe it's fine. I tested that via ptp.

Also worth noting that vid_get_viewport_live_fb() is set up to get the current frame buffer

You mean the buffer that camera currently writes to? That's what is this code for, I believe:
Code: [Select]
if (buff == 0) {
        buff = 2;
    }
    else {
        buff--;
    }
Then buff is index of the most recent fully written buffer (and my observations confirm that). I have edited description of vid_get_viewport_live_fb and vid_get_viewport_fb at http://chdk.wikia.com/wiki/Frame_buffers. If You have better description, please correct me.
 
which means you may see more tearing than you saw with the old version
There is no tearing in my app. Tearing by using (buff+1)%3 is pronounced (tested in my app), which means vid_get_viewport_live_fb works on the right buffer.

*

Offline reyalp

  • ******
  • 13439
Re: 2 new buffers for record mode found - canon a530
« Reply #11 on: 27 / May / 2014, 17:35:39 »
I believe it's fine. I tested that via ptp.
I'm not sure what you tested. I was suggesting you specifically test motion detection reaction time, since that is one of the primary uses for vid_get_viewport_live_fb().

Quote
Then buff is index of the most recent fully written buffer (and my observations confirm that). I have edited description of vid_get_viewport_live_fb and vid_get_viewport_fb at http://chdk.wikia.com/wiki/Frame_buffers. If You have better description, please correct me.
 
In previous testing the setup with the fastest MD response also results in visible tearing in PTP. However, I thought verified A540 motion detection with MD tune as well, so in theory it should be correct, and the meaning of the indexes is unlikely to be different on A530...

I'll try to test this on my A540 when I get a chance.
Don't forget what the H stands for.

Re: 2 new buffers for record mode found - canon a530
« Reply #12 on: 28 / May / 2014, 17:17:26 »
I'm not sure what you tested. I was suggesting you specifically test motion detection reaction time, since that is one of the primary uses for vid_get_viewport_live_fb().

I tested that by fetching from camera and displaying in loop that buffer, which upgraded vid_get_viewport_live_fb() points to gives me smoother than before, video with no tearing. But You are right, testing MD_tune is a good idea.

However I don't know how to make it work. When I run MD_Tune.bas, there's no AF assist and I get no times displayed (only "t cells, trigger N").

I attach the changes I made before recompiling CHDK and uploading to my cam.

*

Offline reyalp

  • ******
  • 13439
Re: 2 new buffers for record mode found - canon a530
« Reply #13 on: 31 / May / 2014, 23:14:42 »
I tested that by fetching from camera and displaying in loop that buffer, which upgraded vid_get_viewport_live_fb() points to gives me smoother than before, video with no tearing. But You are right, testing MD_tune is a good idea.

However I don't know how to make it work. When I run MD_Tune.bas, there's no AF assist and I get no times displayed (only "t cells, trigger N").

I attach the changes I made before recompiling CHDK and uploading to my cam.
The OPT_MD_AF_LED_TUNING build time option should no longer be required.

You should use the MD_Tune.bas script from the CHDK distribution, not any posted in the original thread (I realize the "documentation" link in the wiki is probably a bit confusing).

In chdkptp, does
=set_led(9,1)
 turn the AF led on? (9,0) should turn it off.

The stats should appear at the top of the screen, not in the script console. They might fight with other OSD elements, you can turn the OSD off to avoid this.

Anyway, this whole tangent is probably not important, what you have now for the a530 should be as correct as the a540 port is now.

FWIW, I definitely do see tearing on the A540 with the current chdkptp live view code. See attached screenshot. It's not super obvious unless the camera or subject is moving fairly quickly.

edit:
Out of curiosity, I tested on a540
current trunk code gives ~30ms MD, tearing.
using fb[buff] gives ~100ms times, tearing
using fb[(buf+1)%3] gives ~60ms times, no tearing.
This makes sense because PTP code isn't synchronized with the frame updates, so the "current" buffer can switch into the oldest one in the middle of a transfer.
« Last Edit: 31 / May / 2014, 23:40:15 by reyalp »
Don't forget what the H stands for.


 

Related Topics