Open disbelief opened 4 years ago
Hi what device and OS version are you using
@triniwiz hi 😊
This was on a Samsung Galaxy Tab running Android 7.1.1
Just FYI: added jitpack to my build.gradle so I could install fancycamera version 1.2.4
and having the same problem.
Also: the error does not happen in the Android Studio device emulator (Pixel 3a, API 29), though I can't fully test functionality on the emulator since it doesn't actually save a real video to the device storage.
@triniwiz I was able to test it on a newer Android phone and same error.
Device Huawei Y6s, Android version 9.1.0.246
Hi again @triniwiz
Maybe a long shot, but I was wondering if you have any recommendations for what I can do to debug this issue?
I created an example repo with a simple version of my app to ease debugging here: https://github.com/disbelief/video-recorder-test
And I added an issue with all the details I've come up with thus far: https://github.com/disbelief/video-recorder-test/issues/1
Any help/advice would be greatly appreciated.
Looking at the log this app passed NULL surface 2020-04-06 15:27:35.928 W/SurfaceTextureRenderer: No output surfaces configured for GL drawing. 2020-04-06
stands out it might since it showing the recording it might be a config issue you can try commenting some of the config changes an let the camcorder profile set everything needed
Thanks will I try cutting down on the custom configuration and relying on the defaults of the camcorder.
I think possibly that "NULL surface" is where the preview would be displayed typically... possibly two processes trying to access the camera output at the same time?
@triniwiz sorry, something else I just noticed: there's a stacktrace printed earlier in the logs saying "The camera device has been disconnected".
This is when the camera is first initialized in preview mode, before startRecording
is called.
Oddly the preview continues to work and the app does not crash. However perhaps this has something to do with the subsequent error thrown by startRecording?
Here's the earlier stack trace, which is thrown when startPreview
is called:
I/Capacitor/Console: File: http://localhost/static/js/main.4b5f70bb.chunk.js - Line 1 - Msg: VideoRecorderContainer.render
I/Capacitor/Console: File: http://localhost/static/js/main.4b5f70bb.chunk.js - Line 1 - Msg: VideoRecorder.onMount initializing camera
V/Capacitor/Plugin: To native (Capacitor plugin): callbackId: 128373272, pluginId: VideoRecorder, methodName: initialize
V/Capacitor: callback: 128373272, pluginId: VideoRecorder, methodName: initialize, methodData: {"camera":0,"previewFrames":[{"id":"video-recorder","stackPosition":"back","x":0,"y":177,"width":360,"height":360}],"quality":1,"audio":false}
D/Capacitor: Handling local request: http://localhost/favicon.ico
I/Capacitor/Console: File: http://localhost/static/js/main.4b5f70bb.chunk.js - Line 1 - Msg: VideoRecorderContainer.render
I/CameraManagerGlobal: Connecting to camera service
I/PermissionManager: camera remind result:true
I/CameraManager: open camera: 1, package name: ca.auka.videorecorder
I/BackgroundPermManager: pkgName: ca.auka.videorecorder,pid: 27309 ,uidOf3RdApk: 10132 ,permType: 0 ,permCfg: 1
I/HwCameraUtil: notifySurfaceFlingerCameraStatus : isFront = true , isOpend = true
I/HwCameraUtil: notifySurfaceFlingerFrontCameraStatus 8011 transact success!
I/PermissionManager: camera remind result:true
I/CameraManager: open camera: 1, package name: ca.auka.videorecorder
I/BackgroundPermManager: pkgName: ca.auka.videorecorder,pid: 27309 ,uidOf3RdApk: 10132 ,permType: 0 ,permCfg: 1
I/HwCameraUtil: notifySurfaceFlingerCameraStatus : isFront = true , isOpend = true
I/HwCameraUtil: notifySurfaceFlingerFrontCameraStatus 8011 transact success!
W/System.err: android.hardware.camera2.CameraAccessException: CAMERA_DISCONNECTED (2): checkPidStatus:1773: The camera device has been disconnected
W/System.err: at android.hardware.camera2.CameraManager.throwAsPublicException(CameraManager.java:753)
W/System.err: at android.hardware.camera2.impl.ICameraDeviceUserWrapper.createDefaultRequest(ICameraDeviceUserWrapper.java:161)
W/System.err: at android.hardware.camera2.impl.CameraDeviceImpl.createCaptureRequest(CameraDeviceImpl.java:769)
W/System.err: at co.fitcom.fancycamera.Camera2.startPreview(Camera2.java:755)
W/System.err: at co.fitcom.fancycamera.Camera2.access$500(Camera2.java:70)
W/System.err: at co.fitcom.fancycamera.Camera2$2.onOpened(Camera2.java:389)
W/System.err: at android.hardware.camera2.impl.CameraDeviceImpl$1.run(CameraDeviceImpl.java:147)
W/System.err: at android.os.Handler.handleCallback(Handler.java:907)
W/System.err: at android.os.Handler.dispatchMessage(Handler.java:105)
W/System.err: at android.os.Looper.loop(Looper.java:216)
W/System.err: at android.os.HandlerThread.run(HandlerThread.java:65)
W/System.err: Caused by: android.os.ServiceSpecificException: checkPidStatus:1773: The camera device has been disconnected (code 4)
W/System.err: at android.os.Parcel.createException(Parcel.java:1967)
W/System.err: at android.os.Parcel.readException(Parcel.java:1921)
W/System.err: at android.os.Parcel.readException(Parcel.java:1871)
W/System.err: at android.hardware.camera2.ICameraDeviceUser$Stub$Proxy.createDefaultRequest(ICameraDeviceUser.java:556)
W/System.err: at android.hardware.camera2.impl.ICameraDeviceUserWrapper.createDefaultRequest(ICameraDeviceUserWrapper.java:159)
W/System.err: ... 9 more
I/CameraDevice-JV-1: close camera: 1, package name: ca.auka.videorecorder
I/BackgroundPermManager: pkgName: ca.auka.videorecorder,pid: 27309 ,uidOf3RdApk: 10132 ,permType: 0 ,permCfg: 0
I/HwCameraUtil: notifySurfaceFlingerCameraStatus : isFront = true , isOpend = false
I/HwCameraUtil: notifySurfaceFlingerFrontCameraStatus 8012 transact success!
V/Capacitor/VideoRecorder: Notifying listeners for event onVolumeInput
D/Capacitor/VideoRecorder: No listeners found for event onVolumeInput
E/ion: ioctl c0044901 failed with code -1: Invalid argument
Does this indicate anything to you?
I'm also trying to have a camera functionality work with TeamHive/capacitor-video-recorder, but it's broken. Android 9.0, latest capacitor versions + jetifier executed.
Did you ever figure it out? @disbelief
I’m currently working on some v2 updates which should address a couple issues
@mesqueeb no sorry I haven't found a solution that works with capacitor-video-recorder
. The error is coming from deep within the bowels of Android native code.
@triniwiz thank you, looking forward to it!
This is on a Samsung device running Android 7.1.1
For background,
fancycamera
is a dependency of the capacitor-video-recorder plugin. I've updated the plugin to use the latest version of fancycamera from maven (v1.2.2
).Calling
startRecording
throws an uncaught IOException which locks up my app. Here is the log output:Previous to calling
startRecording
my app displays the video preview correctly, so access to the camera and audio are not an issue.