Fix USB Camera BufferQueue abandoned crash

This commit is contained in:
Jannik committed 2026-08-24 07:26:18 +02:00
1 parent 735642b372
commit b5fd82fe16
11 files changed
+76 -48

No files matched your search

@@ -54,3 +54,5 @@
3 103 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465
5 39 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465
3 34 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465
4 98 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465
5 45 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/arm64-v8a/CMakeFiles/cmake.verify_globs 5250f1b80cb55465
@@ -2,41 +2,41 @@ C/C++ Structured Logg
e
cC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\additional_project_files.txtC
A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ‘�½„ƒ4Å, Üû—ö‚4d
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ©þꑃ4Å, Üû—ö‚4d
b
`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\android_gradle_build.json  ‘�½„ƒ4û" Þû—ö‚4i
`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\android_gradle_build.json  ©þꑃ4û" Þû—ö‚4i
g
eC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\android_gradle_build_mini.json  ‘�½„ƒ4ï —ü—ö‚4V
eC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\android_gradle_build_mini.json  ©þꑃ4ï —ü—ö‚4V
T
RC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build.ninja  ‘�½„ƒ4œÞ Íø—ö‚4Z
RC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build.ninja  ©þꑃ4œÞ Íø—ö‚4Z
X
VC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build.ninja.txt  ‘�½„ƒ4_
VC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build.ninja.txt  ©þꑃ4_
]
[C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build_file_index.txt  ‘�½„ƒ4� ™ü—ö‚4`
[C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\build_file_index.txt  ©þꑃ4� ™ü—ö‚4`
^
\C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\compile_commands.json  ‘�½„ƒ4‘Ø Ëø—ö‚4d
\C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\compile_commands.json  ©þꑃ4‘Ø Ëø—ö‚4d
b
`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\compile_commands.json.bin  ‘�½„ƒ4 Ê„ Ëø—ö‚4j
`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\compile_commands.json.bin  ©þꑃ4 Ê„ Ëø—ö‚4j
h
fC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\metadata_generation_command.txt  ‘�½„ƒ4
fC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\metadata_generation_command.txt  ©þꑃ4
¸ ˜ü—ö‚4]
[
YC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\prefab_config.json  ‘�½„ƒ4 € ˜ü—ö‚4b
YC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\prefab_config.json  ©þꑃ4 € ˜ü—ö‚4b
`
^C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\symbol_folder_index.txt  ‘�½„ƒ4␍ ] ˜ü—ö‚4{
^C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\arm64-v8a\symbol_folder_index.txt  ©þꑃ4␍ ] ˜ü—ö‚4{
y
wC:\GitHub\Schnappix\node_modules\react-native-gesture-handler\android\build\generated\source\codegen\jni\CMakeLists.txt  ‘�½„ƒ4␍¾ ‡•‚ö‚4v
wC:\GitHub\Schnappix\node_modules\react-native-gesture-handler\android\build\generated\source\codegen\jni\CMakeLists.txt  ©þꑃ4␍¾ ‡•‚ö‚4v
t
rC:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\generated\source\codegen\jni\CMakeLists.txt  ‘�½„ƒ4ö ’•‚ö‚4µ
rC:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\generated\source\codegen\jni\CMakeLists.txt  ©þꑃ4ö ’•‚ö‚4µ
²
¯C:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json  ‘�½„ƒ4Y
¯C:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json  ©þꑃ4Y
W
UC:\GitHub\Schnappix\node_modules\react-native-svg\android\src\main\jni\CMakeLists.txt  ‘�½„ƒ4½ œ§ØÖç3u
UC:\GitHub\Schnappix\node_modules\react-native-svg\android\src\main\jni\CMakeLists.txt  ©þꑃ4½ œ§ØÖç3u
s
qC:\GitHub\Schnappix\node_modules\react-native-view-shot\android\build\generated\source\codegen\jni\CMakeLists.txt  ‘�½„ƒ4ê û”‚ö‚4t
qC:\GitHub\Schnappix\node_modules\react-native-view-shot\android\build\generated\source\codegen\jni\CMakeLists.txt  ©þꑃ4ê û”‚ö‚4t
r
pC:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\generated\source\codegen\jni\CMakeLists.txt  ‘�½„ƒ4ê Ÿ•‚ö‚4³
pC:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\generated\source\codegen\jni\CMakeLists.txt  ©þꑃ4ê Ÿ•‚ö‚4³
°
­C:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json  ‘�½„ƒ4k
­C:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json  ©þꑃ4k
i
gC:\GitHub\Schnappix\node_modules\react-native\ReactAndroid\cmake-utils\default-app-setup\CMakeLists.txt  ‘�½„ƒ4ð ®¡ÈÑç3
gC:\GitHub\Schnappix\node_modules\react-native\ReactAndroid\cmake-utils\default-app-setup\CMakeLists.txt  ©þꑃ4ð ®¡ÈÑç3
@@ -54,3 +54,5 @@
8 95 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74
3 34 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74
4 37 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74
3 53 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74
3 42 0 C:/GitHub/Schnappix/android/app/.cxx/RelWithDebInfo/3x5j4n2e/armeabi-v7a/CMakeFiles/cmake.verify_globs 1eb2d1da6ebc2e74
@@ -2,41 +2,41 @@ C/C++ Structured Logi
g
eC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\additional_project_files.txtC
A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ÌŽ½„ƒ4ý, Óì™ö‚4f
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  áÿꑃ4ý, Óì™ö‚4f
d
bC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\android_gradle_build.json  ÌŽ½„ƒ4�# Øì™ö‚4k
bC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\android_gradle_build.json  áÿꑃ4�# Øì™ö‚4k
i
gC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\android_gradle_build_mini.json  ÌŽ½„ƒ4‘ ˆí™ö‚4X
gC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\android_gradle_build_mini.json  áÿꑃ4‘ ˆí™ö‚4X
V
TC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build.ninja  ÌŽ½„ƒ4Áå  é™ö‚4\
TC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build.ninja  áÿꑃ4Áå  é™ö‚4\
Z
XC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build.ninja.txt  ÌŽ½„ƒ4a
XC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build.ninja.txt  áÿꑃ4a
_
]C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build_file_index.txt  ÍŽ½„ƒ4� �í™ö‚4b
]C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\build_file_index.txt  áÿꑃ4� �í™ö‚4b
`
^C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\compile_commands.json  ÍŽ½„ƒ4´à žé™ö‚4f
^C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\compile_commands.json  áÿꑃ4´à žé™ö‚4f
d
bC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\compile_commands.json.bin  ÍŽ½„ƒ4 ò„ žé™ö‚4l
bC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\compile_commands.json.bin  áÿꑃ4 ò„ žé™ö‚4l
j
hC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\metadata_generation_command.txt  ÍŽ½„ƒ4
hC:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\metadata_generation_command.txt  áÿꑃ4
Ä Ší™ö‚4_
]
[C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\prefab_config.json  ÍŽ½„ƒ4 € ‹í™ö‚4d
[C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\prefab_config.json  áÿꑃ4 € ‹í™ö‚4d
b
`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\symbol_folder_index.txt  ÍŽ½„ƒ4␍ _ Œí™ö‚4{
`C:\GitHub\Schnappix\android\app\.cxx\RelWithDebInfo\3x5j4n2e\armeabi-v7a\symbol_folder_index.txt  áÿꑃ4␍ _ Œí™ö‚4{
y
wC:\GitHub\Schnappix\node_modules\react-native-gesture-handler\android\build\generated\source\codegen\jni\CMakeLists.txt  ÍŽ½„ƒ4␍¾ ‡•‚ö‚4v
wC:\GitHub\Schnappix\node_modules\react-native-gesture-handler\android\build\generated\source\codegen\jni\CMakeLists.txt  áÿꑃ4␍¾ ‡•‚ö‚4v
t
rC:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\generated\source\codegen\jni\CMakeLists.txt  ÍŽ½„ƒ4ö ’•‚ö‚4µ
rC:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\generated\source\codegen\jni\CMakeLists.txt  áÿꑃ4ö ’•‚ö‚4µ
²
¯C:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json  ÍŽ½„ƒ4Y
¯C:\GitHub\Schnappix\node_modules\react-native-reanimated\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json  áÿꑃ4Y
W
UC:\GitHub\Schnappix\node_modules\react-native-svg\android\src\main\jni\CMakeLists.txt  ÍŽ½„ƒ4½ œ§ØÖç3u
UC:\GitHub\Schnappix\node_modules\react-native-svg\android\src\main\jni\CMakeLists.txt  áÿꑃ4½ œ§ØÖç3u
s
qC:\GitHub\Schnappix\node_modules\react-native-view-shot\android\build\generated\source\codegen\jni\CMakeLists.txt  ÍŽ½„ƒ4ê û”‚ö‚4t
qC:\GitHub\Schnappix\node_modules\react-native-view-shot\android\build\generated\source\codegen\jni\CMakeLists.txt  áÿꑃ4ê û”‚ö‚4t
r
pC:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\generated\source\codegen\jni\CMakeLists.txt  ÍŽ½„ƒ4ê Ÿ•‚ö‚4³
pC:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\generated\source\codegen\jni\CMakeLists.txt  áÿꑃ4ê Ÿ•‚ö‚4³
°
­C:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json  ÍŽ½„ƒ4k
­C:\GitHub\Schnappix\node_modules\react-native-worklets\android\build\intermediates\prefab_package_configuration\release\prefabReleaseConfigurePackage\prefab_publication.json  áÿꑃ4k
i
gC:\GitHub\Schnappix\node_modules\react-native\ReactAndroid\cmake-utils\default-app-setup\CMakeLists.txt  ÍŽ½„ƒ4ð ®¡ÈÑç3
gC:\GitHub\Schnappix\node_modules\react-native\ReactAndroid\cmake-utils\default-app-setup\CMakeLists.txt  áÿꑃ4ð ®¡ÈÑç3
+2 -2
View File
@@ -92,8 +92,8 @@ android {
applicationId 'de.orfel.schnappix'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 65
versionName "23.01.65"
versionCode 66
versionName "23.01.66"
buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\""
}
Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -3,7 +3,7 @@
"newArchEnabled": true,
"name": "Schnappix",
"slug": "Schnappix",
"version": "23.01.65",
"version": "23.01.66",
"orientation": "landscape",
"icon": "./Icon.png",
"userInterfaceStyle": "dark",
@@ -13,7 +13,7 @@
},
"android": {
"package": "de.orfel.schnappix",
"versionCode": 65,
"versionCode": 66,
"usesCleartextTraffic": true,
"adaptiveIcon": {
"backgroundColor": "#050510",
@@ -156,9 +156,25 @@ class UsbCameraView(context: Context, appContext: AppContext) : ExpoView(context
}
} catch (ioe: Exception) {}
// Start the camera preview asynchronously
post {
startPreview()
// Handle SurfaceTexture lifecycle to prevent BufferQueue abandonment
// when the view is obscured (e.g. by PreviewScreen)
textureView.surfaceTextureListener = object : android.view.TextureView.SurfaceTextureListener {
override fun onSurfaceTextureAvailable(surface: android.graphics.SurfaceTexture, width: Int, height: Int) {
startPreview()
}
override fun onSurfaceTextureSizeChanged(surface: android.graphics.SurfaceTexture, width: Int, height: Int) {}
override fun onSurfaceTextureDestroyed(surface: android.graphics.SurfaceTexture): Boolean {
try {
sharedCameraClient?.getCameraStrategy()?.stopPreview()
} catch (e: Exception) {
android.util.Log.e("UsbCameraView", "SurfaceTextureDestroyed err", e)
}
return true
}
override fun onSurfaceTextureUpdated(surface: android.graphics.SurfaceTexture) {}
}
} catch (e: Throwable) {
val errorMsg = "CRASH IN INIT: ${e.message}\n${android.util.Log.getStackTraceString(e)}"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "schnappix",
"version": "23.01.65",
"version": "23.01.66",
"main": "index.ts",
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.7.2",
+7 -2
View File
@@ -200,8 +200,13 @@ export default function CameraScreen({
if (usbCameraRef.current) {
const connected = await usbCameraRef.current.isCameraConnected();
if (connected !== isUsbConnected) {
logger.log(`USB Connection status changed to: ${connected}`);
setIsUsbConnected(connected);
if (!connected && isObscuredRef.current) {
// Do not update state if we intentionally stopped the preview because it's obscured (e.g. PreviewScreen is shown)
// This prevents the ActivityIndicator from flashing when returning to CameraScreen
} else {
logger.log(`USB Connection status changed to: ${connected}`);
setIsUsbConnected(connected);
}
}
if (!connected && !hasFetchedLogcat) {
hasFetchedLogcat = true;