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

fix: Fix blackscreen issues and lifecycle when closing Camera #2339

Merged
merged 34 commits into from
Jan 8, 2024

Conversation

mrousavy
Copy link
Owner

@mrousavy mrousavy commented Jan 2, 2024

What

Fixes various blackscreen and out-of-sync issues on Android by deterministically closing and cleaning up the session.

Following changes:

  • fix: Fix a scenario where the concurrent configure { ... } mechanism could drop important updates
  • fix: Fix Android lifecycle by allowing Android to close the CameraDevice when isActive=false
  • fix: Fix Android blackscreens by refactoring CameraSession setup
  • fix: Fix "photo/video is not enabled" errors
  • perf: Don't re-create anything if session is closing down
  • feat: Support 60 FPS on Samsung devices (if available)

Changes

Tested on

Related issues

Copy link

vercel bot commented Jan 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-vision-camera ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 5, 2024 3:01pm

@mrousavy mrousavy merged commit 0d21bc3 into main Jan 8, 2024
12 checks passed
@mrousavy mrousavy deleted the fix/blackscreen branch January 8, 2024 10:41
@vijaykhandal1290

This comment was marked as off-topic.

@xseignard
Copy link
Contributor

xseignard commented Jan 11, 2024

Hello
I just updated our apps to 3.7.0 and at the first try I have the famous black screen of the not unmounted camera on android 🫤

I'd love to see our sponsoring dedicated to fix lifecycle issues and stability on Android
Capture d’écran 2024-01-11 à 10 55 15

@mrousavy
Copy link
Owner Author

Hey @xseignard - that's weird, I cannot reproduce this bug at all. Is there an open issue for that which uses 3.7.0? Need the adb logcat logs and a reproduction example please.

& thanks for your sponsorship, much appreciated!

@xseignard
Copy link
Contributor

Hey @mrousavy, couldn't recreate in an isolated example
But I reproduced this one #2378

You said this PR fixed #2240, but it seems it does not. May I ask how you tested it fixes the problem?

@mrousavy
Copy link
Owner Author

Hey - I tested in the Example app by navigating from and to the code scanner screen. That worked

@xseignard
Copy link
Contributor

xseignard commented Jan 11, 2024

Well, looking at all the newly raised issues with 3.7.0 on Android, the example app is definitely not a good proofing 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment