Closed ChristopherGabba closed 6 months ago
What exactly is Error -10868
again? I remember seeing this somewhere
@mrousavy I did a bunch of googling and docs reading on it, but truthfully everyone says that "it doesn't provide any helpful info".
Hate to be that guy, but I asked GPT-4 as a last resort and the response was:
I know that it isn't coming from the react-native-video package because it's being thrown in the onCameraError package. The resolution to this issue may be just "hey fix your shit timer code" lol. But figured it may be some edge case you could protect for in the react-native-vision-camera package. I spent a good amount of time making a reproducible demo for you and adding logs this time, hopefully it doesn't take you long to dig into.
There is a line in the logs implying that some sort of state operation interrupted the camera:
VisionCamera.updateCategory(_:mode:options:): AVAudioSession category changed!
<<<< FigSharedMemPool >>>> Fig assert: "blkHdr->useCount > 0" at (FigSharedMemPool.c:591) - (err=0)
VisionCamera.sessionRuntimeError(notification:): Unexpected Camera Runtime Error occured!
@mrousavy Okay so this issue has plagued me now for a few weeks and I've tried a lot of updates.
I'm going to assume it's some sort of conflict between react-native-vision-camera and react-native-video. Maybe the AVAudioSessions or something?
Good point, yea it could be the audio sessions.
Closing this for now, as I think I am doing nothing wrong in my audio session - maybe RN Video doesn#t clean up after they are done with audio.
What's happening?
I'm using a custom countdown timer component to invoke a callback when the timer hits 0 to start the camera recording. When the timer hits 0, sometimes the camera records perfectly, other times it throws the error above. I've narrowed the cause down to my countdown component. When I start the recording with a button, it works perfectly every time.
Reproduceable Code
Take this page and copy it directly. Upon countdown completion, you will get this to replicate. If it doesn't work the first time, try it several times until it works.
Relevant log output
Camera Device
Device
iPhone 12 Physical Device
VisionCamera Version
3.9.0
Can you reproduce this issue in the VisionCamera Example app?
No, I cannot reproduce the issue in the Example app
Additional information