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

Replay integration race condition (Hybrid SDK integration) #3951

Open
vaind opened this issue Dec 2, 2024 · 0 comments
Open

Replay integration race condition (Hybrid SDK integration) #3951

vaind opened this issue Dec 2, 2024 · 0 comments

Comments

@vaind
Copy link
Collaborator

vaind commented Dec 2, 2024

Description

I'm making changes to the Flutter integration to fix the size and support resizing and orientation change.

I've faced two errors that occur randomly during startup, when first we need to init() the SDK and only afterwards we get the actual widget size in Flutter so we update it.

What happens is that sometimes the video encoder would get started with the old configuration (with zero bitrate). See logs for details:zero-bitrate.log, namely:

D/Sentry  (  634): Encoder doesn't support the provided bitRate: 0, the value will be clamped to the closest one
W/OMXUtils(  634): do not know color format 0x7f000789 = 2130708361
E/ACodec  (  634): [OMX.hisi.video.encoder.avc] failed to set input port definition parameters.
E/ACodec  (  634): [OMX.hisi.video.encoder.avc] configureCodec returning error -22
E/ACodec  (  634): signalError(omxError 0x80001001, internalError -22)
E/MediaCodec(  634): Codec reported err 0xffffffea, actionCode 0, while in state 3
E/MediaCodec(  634): configure failed with err 0xffffffea, resetting...
I/OMXClient(  634): IOmx service obtained
I/ACodec  (  634): In onAllocateComponent create compenent, codec name: OMX.hisi.video.encoder.avc
E/Sentry  (  634): Failed to execute task SessionCaptureStrategy.add_frame
E/Sentry  (  634): java.lang.IllegalArgumentException
E/Sentry  (  634): 	at android.media.MediaCodec.native_configure(Native Method)
E/Sentry  (  634): 	at android.media.MediaCodec.configure(MediaCodec.java:2023)
E/Sentry  (  634): 	at android.media.MediaCodec.configure(MediaCodec.java:1951)
E/Sentry  (  634): 	at io.sentry.android.replay.video.SimpleVideoEncoder.start(SimpleVideoEncoder.kt:151)
E/Sentry  (  634): 	at io.sentry.android.replay.ReplayCache.createVideoOf(ReplayCache.kt:160)
E/Sentry  (  634): 	at io.sentry.android.replay.ReplayCache.createVideoOf$default(ReplayCache.kt:130)
E/Sentry  (  634): 	at io.sentry.android.replay.capture.CaptureStrategy$Companion.createSegment(CaptureStrategy.kt:78)
E/Sentry  (  634): 	at io.sentry.android.replay.capture.BaseCaptureStrategy.createSegmentInternal(BaseCaptureStrategy.kt:140)
E/Sentry  (  634): 	at io.sentry.android.replay.capture.BaseCaptureStrategy.createSegmentInternal$default(BaseCaptureStrategy.kt:126)
E/Sentry  (  634): 	at io.sentry.android.replay.capture.SessionCaptureStrategy.onScreenshotRecorded$lambda$3(SessionCaptureStrategy.kt:97)
E/Sentry  (  634): 	at io.sentry.android.replay.capture.SessionCaptureStrategy.$r8$lambda$cCx11Mai_BMmwptoXQhWdiRj4lw(Unknown Source:0)
E/Sentry  (  634): 	at io.sentry.android.replay.capture.SessionCaptureStrategy$$ExternalSyntheticLambda1.run(D8$$SyntheticClass:0)
E/Sentry  (  634): 	at io.sentry.android.replay.util.ExecutorsKt.submitSafely$lambda$2(Executors.kt:56)
E/Sentry  (  634): 	at io.sentry.android.replay.util.ExecutorsKt.$r8$lambda$vDu4aDIfWey-ssnK2M6wckmJiUQ(Unknown Source:0)
E/Sentry  (  634): 	at io.sentry.android.replay.util.ExecutorsKt$$ExternalSyntheticLambda1.run(D8$$SyntheticClass:0)
E/Sentry  (  634): 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
E/Sentry  (  634): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/Sentry  (  634): 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
E/Sentry  (  634): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/Sentry  (  634): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/Sentry  (  634): 	at java.lang.Thread.run(Thread.java:929)

and

E/Sentry  (  634): java.lang.ArithmeticException: divide by zero
E/Sentry  (  634): 	at io.sentry.android.replay.ReplayCache.createVideoOf(ReplayCache.kt:163)
E/Sentry  (  634): 	at io.sentry.android.replay.ReplayCache.createVideoOf$default(ReplayCache.kt:130)
E/Sentry  (  634): 	at io.sentry.android.replay.capture.CaptureStrategy$Companion.createSegment(CaptureStrategy.kt:78)
E/Sentry  (  634): 	at io.sentry.android.replay.capture.BaseCaptureStrategy.createSegmentInternal(BaseCaptureStrategy.kt:140)
E/Sentry  (  634): 	at io.sentry.android.replay.capture.BaseCaptureStrategy.createSegmentInternal$default(BaseCaptureStrategy.kt:126)
E/Sentry  (  634): 	at io.sentry.android.replay.capture.SessionCaptureStrategy.onScreenshotRecorded$lambda$3(SessionCaptureStrategy.kt:97)
E/Sentry  (  634): 	at io.sentry.android.replay.capture.SessionCaptureStrategy.$r8$lambda$cCx11Mai_BMmwptoXQhWdiRj4lw(Unknown Source:0)
E/Sentry  (  634): 	at io.sentry.android.replay.capture.SessionCaptureStrategy$$ExternalSyntheticLambda1.run(D8$$SyntheticClass:0)
E/Sentry  (  634): 	at io.sentry.android.replay.util.ExecutorsKt.submitSafely$lambda$2(Executors.kt:56)
E/Sentry  (  634): 	at io.sentry.android.replay.util.ExecutorsKt.$r8$lambda$vDu4aDIfWey-ssnK2M6wckmJiUQ(Unknown Source:0)
E/Sentry  (  634): 	at io.sentry.android.replay.util.ExecutorsKt$$ExternalSyntheticLambda1.run(D8$$SyntheticClass:0)
E/Sentry  (  634): 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
E/Sentry  (  634): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/Sentry  (  634): 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
E/Sentry  (  634): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/Sentry  (  634): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Discussion
Development

No branches or pull requests

2 participants