opentok-android-sdk-samples
opentok-android-sdk-samples copied to clipboard
Android devices too much heating issue
Multiparty video calls up to 4 subscribers are giving heating issues after 10-15 minutes. Same result in pixel 4a and One Plus 8T. It was serious issue in all the android devices as the application heats the devices and shutdowns the application.
@igorwojda
Are you using a SurfaceView or a TextureView to render your preview ?
I changed the default config to solve this:
OpenTokConfig.setPreferH264Codec(OpenTokConfig.PreferH264.ENABLE)
@nikul014 How did you render subscriber name in multipart
Facing same issue... After 15-20 minutes joining the session, phone is getting heat.
Using below dependency,
com.opentok.android:opentok-android-sdk:2.23.1
Using below code,
Publisher.Builder(this)
.name(getProviderJSONString())
.resolution(Publisher.CameraCaptureResolution.MEDIUM)
.frameRate(Publisher.CameraCaptureFrameRate.FPS_1)
.build()
One for @adrienrx
I had that issue last year when I wanted to use TextureView in my app. Rolling it back to GLSurfaceView fixed the heating problem.
You probably did the swap to TextureView for the better handling of that component of android constraint. If you are struggling with the Z order, this is the line you need ((GLSurfaceView) (publisher.getView())).setZOrderOnTop(true);
Note that if you are using Relayed session, the impact on your phone is higher than if you rely on routed session. Especially with 4 participants.
Already used below code with GlSurfaceView...
if (mPublisher?.view is GLSurfaceView) { (mPublisher?.view as GLSurfaceView).setZOrderOnTop(true) }
And you're not using useTextureViews is the SessionOptions right ?
I have a below code,
mSession = Session.Builder(this, mSTRotAPIKey, mSTRotSessionId) .sessionOptions(object : Session.SessionOptions() { override fun useTextureViews(): Boolean { return true } }) .connectionEventsSuppressed(true) .build() mSession?.setSessionListener(this) mSession?.setSignalListener(this)
@adrienrx
Yeah so you want to have the useTextureViews set to false to have the SDK provide GLSurfaceView
And what about isHwDecodingSupported
and isCamera2Capable
?
Will it be by default false or I have to change these methods as well?
I have tried to play with these in the past, my experience is, just don't play with those and leave these settings to their default value :rofl:
Okay one more thing I want to ask that why we can't use TextureView and why device will be get hitted if we use this?
Just ask for the knowledge..
I literally have no idea, it could be the way the vonage renderer is built, or the way the textureview implementation is done. But the result is that the phone gets very hot and results in angry users. So I use GLSurfaceView.
By using GlSurfaceView, the icons of end call and others will be covered. I can see only the view of front camera.
Yup, that's your new challenge now. GLSurfaceView isn't respecting the Z-Index of Android. I did struggle a bit to adapt my UI to it.
By using GlSurfaceView, the icons of end call and others will be covered. I can see only the view of front camera.
FWIW You can overcome it with setZOrderMediaOverlay(true).