twilio/video-quickstart-android

Twilio Switch Camera Error

Closed this issue · 6 comments

I am using CameraCapturerCompat class from Kotlin quickstart project. That's why I didn't share the code. This error came up when I updated my project to android 12 and twilio version to '7.0.3'. SwitchCamera function fails. I also tried it on multiple devices and got the same error.

Logs

E/tvi.webrtc.Logging: CameraCapturer: switchCamera: camera is not running.
E/Camera2Capturer: Failed to switch to camera with ID: 0
E/Camera2Capturer: switchCamera: camera is not running.
com.twilio.video.Camera2Capturer$Exception: switchCamera: camera is not running.
at com.twilio.video.Camera2Capturer$3.onCameraSwitchError(Camera2Capturer.java:153)
at tvi.webrtc.CameraCapturer.reportCameraSwitchError(CameraCapturer.java:404)
at tvi.webrtc.CameraCapturer.switchCameraInternal(CameraCapturer.java:425)
at tvi.webrtc.CameraCapturer.access$1600(CameraCapturer.java:21)
at tvi.webrtc.CameraCapturer$8.run(CameraCapturer.java:356)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:224)
at android.os.HandlerThread.run(HandlerThread.java:67)

Video Android SDK

Version 7.0.3

Android API

Android 12

Android Device

Xiaomi mi8, Samsung S12, Pixel4 XL

@yldrmsull Thank you for the report, I was unable to reproduce it with a "Pixel 4a (5g)" (Android 12) and a "Pixel 4" (Android 10). I have several questions if you don't mind.

  1. are you switching the camera before or after connecting to a room?
  2. Besides the Mi8, S12 & Pixel4 XL, did you see it on any other device?
  3. Does this require the user to switch back and fourth repetitively for awhile?

1- After
2- Yes
3- I did not fully understand your question.

@yldrmsull Sorry for the delayed response, is this issue still happening with the latest release, 7.3.0? We have made many improvements related to camera switching behavior.

hi, this is still happening with 7.3.1. guaranteed crash when switching repeatedly, so I added a delay. Even so it still happens with sm-j500fn (android 6.0.1), a oneplus, and a sm-t220 running android 11 from time to time

@gabrielParc Thank you for informing the customer! yes, there has been a reported issue with the sample code in the quickstart. If you code is based off that, it could suffer this and some other basic issues. In an effort to keep it as simple as possible, the quickstart was only intended to be a basic guide, not something that would subsequently be used in production environments and so the Ahoy application makes a better reference. That being said, I have filed a ticket regarding the quickstart camera issue.