The Problem
The Sony a7iii/a7riii and a9 all have issues with shooting in Auto Focus via the remote camera API. There is obviously a workaround to this (because it seems to work well with the PlayMemories app), which I have attempted to reproduce in the app I have made, however it doesn't seem to be entirely flawless and causes issues when repeatedly taking shots like for a timelapse.
The problem is, that with AF /w Shutter on (Don't ask why it's not the other way around) the camera will occasionally error on actTakePicture
with a 40400.
The Workaround Attempt
My attempted workaround to this is as follows:
- Check the model number and if a7iii/a7riii/a9 (And a couple others)
- Check focus state and if not focused (or nil)
- Check focus mode and if AF or nil (THIS IS THE PROBLEM!)
- Perform half-press of the shutter
- Await focusState changing to focussed
The problem is, the a7iii e.t.c. don't seem to report their focus mode via events, or respond to the getFocusMode
API request even though it's listed in their supported functions. This means instead of step 5. in the above I have to:
- Perform
actTakePicture
immediately on response from half-press, because if the camera is in MF the focus status won't change. - If this fails with 40400 (Shooting failed) ignore the error because it may be we're in AF.
This all works in theory:
Auto Focus
User Presses Shutter → Call halfPressShutter → Call actTakePicture → If succeeds, then we're done, if fails → Await move away from "focussing" event → Call actTakePicture
Manual Focus
User Presses Shutter → Call halfPressShutter → Call actTakePicture → SHOULD succeed
The Next Part Of The Problem
The next part of the problem, is that if the user is in MF, the camera will still fail every so often with a 40400, which triggers the flow under "Auto Focus" but because we're in MF we don't get any change in focus from the camera events. For this reason it is really important that I can check if the camera is in MF or AF and simply skip the halfPressShutter
for MF otherwise my code gets stuck waiting for the focusState
to change.
Calling getFocusMode
on the a7iii seems to return 40401 (Camera Not Ready) and is available under getMethodTypes
response but never seems to be made available or send events via getEvent
. If anyone has managed to make this available, or work out how it can be sent via events that would be incredible!