gphoto / libgphoto2

The libgphoto2 camera access and control library.
GNU Lesser General Public License v2.1
991 stars 317 forks source link

Sony FX3 control overshoot #896

Closed nrplyx closed 1 year ago

nrplyx commented 1 year ago

Hey! Trying to control the Sony FX3 camera, however, control seems to overshoot controls for ISO / Iris (Shutterspeed works properly). When I use gphoto2 --set-config iso=400 command, I can see the ISO value is stepping to value 400, however, once the value is reached, actual ISO jumps immediately to AUTO.

A similar situation is for Iris control, it seems to be stepping correctly to desired value, but then it jumps to maximum aperture f22 or f2.8 depending on the value. If trying to set Aperture f8.0 and more, final value is f22, if I set Aperture f7.1 and below, final value will be f2.8.

Output of "gphoto2 --debug --set-config iso=400": https://sharetext.me/raw/fzkrxojvwh

Camera USB ID 054c:0da3 Any help will be appreciated.

nrplyx commented 1 year ago

I played a bit around and If I change camlibs/ptp2/config.c code in "PUT_SONYVALUE" macro definition to return GP_ERROR at the moment of "Value matched!" moment (when the code steps to proper value) it seems to not overshoot anymore (it of course returns error, but does the job). So I guess the issue is hidden in the code following this procedure.

define PUT_SONYVALUE(bits,inttype) \

... do { \ C_PTP_REP (ptp_sony_getalldevicepropdesc (params)); \ C_PTP_REP (ptp_generic_getdevicepropdesc (params, prop, &dpd)); \ \ if (dpd.CurrentValue.bits == value) { \ printf ("Value matched!\n"); \ return GP_ERROR; \

msmeissn commented 1 year ago

well spotted, this was doing unnecessary work.

nrplyx commented 1 year ago

I can not confirm this as a solution, I just tried to apply fix 17bc414, but FX3 overshooting remains for iso and aperture.

Maybe I should remark in my comment that if I use escape "return GP_OK;", overshoot remains. Only when "return GP_ERROR;" is used as an escape after "Value Matched!" event, overshooting disappears. I believe the error is not in this macro, but in the code after the macro.

msmeissn commented 1 year ago

ok, background:

msmeissn commented 1 year ago

(need to add code to handle this)

msmeissn commented 1 year ago

can you try current git, i add some code to the apis

nrplyx commented 1 year ago

Thanks! I just tested 51b3c23 and the overshooting issue is solved!

msmeissn commented 1 year ago

thanks!