Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Implement Flash for Android ($3,000) #1890

Closed
mrousavy opened this issue Sep 30, 2023 · 5 comments · Fixed by #2558
Closed

✨ Implement Flash for Android ($3,000) #1890

mrousavy opened this issue Sep 30, 2023 · 5 comments · Fixed by #2558
Labels
🤖 android Issue affects the Android platform Fund hacktoberfest Hacktoberfest 2023

Comments

@mrousavy
Copy link
Owner

mrousavy commented Sep 30, 2023

What feature or enhancement are you suggesting?

Flash (photo/video) or Torch currently does not work on Android because of the Camera2 rewrite. It's quite tricky to add flash capture, as the exposure has to be handled manually in Camera2.

What Platforms whould this feature/enhancement affect?

Android

$3,000

I will implement flash for $3,000. Donate to this polar pool to support this feature.

Fund with Polar
@mrousavy mrousavy changed the title ✨ Implement Flash for Android ✨ Implement Flash for Android ($3,000) Sep 30, 2023
@polar-sh polar-sh bot added the Fund label Sep 30, 2023
@mrousavy mrousavy pinned this issue Sep 30, 2023
@mrousavy mrousavy added 🤖 android Issue affects the Android platform and removed ✨ enhancement labels Sep 30, 2023
@LiamBateman
Copy link

I'm happy to take a look at this as this seems like a critical item for this package. Is there any starting point on this implementation?

@jthure
Copy link
Contributor

jthure commented Oct 10, 2023

I'm happy to take a look at this as this seems like a critical item for this package. Is there any starting point on this implementation?

Take a look at my comment here: #1726 (comment). I would guess this is related to implementing the pre-capture sequence.

@mrousavy mrousavy added the hacktoberfest Hacktoberfest 2023 label Oct 24, 2023
@mrousavy
Copy link
Owner Author

Thanks to everyone who already sponsored towards this goal in the polar pool linked here - we're at $190 right now. $2,810 left to go 😅

As a teaser I just implemented very basic flash capture which uses an OS feature - classic Android; this does not work on every phone. It's a short torch burst which does not wait for AE/AF exposure to be settled.

A proper implementation requires a fully custom precapture sequence that enables the torch, then waits for AE/AF to adjust, then lock AE/AF to that value, turn off the torch again, then capture with a single flash burst, and then turn the torch off again, and return to auto-AE/AF. This is quite complex, that's why this feature request is marked at $3,000.

mrousavy added a commit that referenced this issue Oct 25, 2023
Implements a semi-working version of flash photo capture for Android.

This isn't properly implemented because a proper implementation requires a fully custom precapture sequence that enables the torch, then waits for AE/AF to adjust, lock AE/AF, then capture with a single torch burst, and then turn the torch off again. This is quite complex, that's why the feature request #1890 is marked at $3,000.

For now, this is a simple flash burst which _sometimes works_, _sometimes not_ - highly depends on the device.

If anyone wants true working flash capture, sponsor in #1890.
@mrousavy
Copy link
Owner Author

Update: We're far off from the $3,000, but I decided to implement Flash anyways - PR is up, I'm testing everything now!!! 🥳🎉🚀

feat: Flash with AE Pre-capture trigger for Android (#2558)

(check out the code changes, there's a ton of stuff required for this lol)

@mrousavy
Copy link
Owner Author

I just released VisionCamera 3.9.0-beta.4, which contains flash support! (will continue testing more, then release 3.9.0 as stable)

With that I'd say this feature request is now finished - thanks to everyone who donated to the money pool!!! ❤️

@mrousavy mrousavy unpinned this issue Feb 14, 2024
isaaccolson pushed a commit to isaaccolson/deliveries-mobile that referenced this issue Oct 30, 2024
Implements a semi-working version of flash photo capture for Android.

This isn't properly implemented because a proper implementation requires a fully custom precapture sequence that enables the torch, then waits for AE/AF to adjust, lock AE/AF, then capture with a single torch burst, and then turn the torch off again. This is quite complex, that's why the feature request mrousavy#1890 is marked at $3,000.

For now, this is a simple flash burst which _sometimes works_, _sometimes not_ - highly depends on the device.

If anyone wants true working flash capture, sponsor in mrousavy#1890.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 android Issue affects the Android platform Fund hacktoberfest Hacktoberfest 2023
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants