opentok-android-sdk-samples icon indicating copy to clipboard operation
opentok-android-sdk-samples copied to clipboard

Android devices too much heating issue

Open nikul014 opened this issue 3 years ago • 17 comments

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.

heating heat

@igorwojda

nikul014 avatar Jun 09 '21 12:06 nikul014

Are you using a SurfaceView or a TextureView to render your preview ?

adrienrx avatar Jun 28 '21 14:06 adrienrx

I changed the default config to solve this: OpenTokConfig.setPreferH264Codec(OpenTokConfig.PreferH264.ENABLE)

UrielFrankel avatar Feb 07 '22 12:02 UrielFrankel

@nikul014 How did you render subscriber name in multipart

rituapplocum avatar Jun 10 '22 12:06 rituapplocum

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()

vmeditab avatar Sep 20 '22 11:09 vmeditab

One for @adrienrx

igorwojda avatar Sep 20 '22 11:09 igorwojda

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);

adrienrx avatar Sep 21 '22 07:09 adrienrx

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.

adrienrx avatar Sep 21 '22 07:09 adrienrx

Already used below code with GlSurfaceView...

if (mPublisher?.view is GLSurfaceView) { (mPublisher?.view as GLSurfaceView).setZOrderOnTop(true) }

vmeditab avatar Sep 21 '22 09:09 vmeditab

And you're not using useTextureViews is the SessionOptions right ?

adrienrx avatar Sep 21 '22 09:09 adrienrx

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

vmeditab avatar Sep 21 '22 09:09 vmeditab

Yeah so you want to have the useTextureViews set to false to have the SDK provide GLSurfaceView

adrienrx avatar Sep 21 '22 09:09 adrienrx

And what about isHwDecodingSupported and isCamera2Capable?

Will it be by default false or I have to change these methods as well?

vmeditab avatar Sep 21 '22 09:09 vmeditab

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:

adrienrx avatar Sep 21 '22 09:09 adrienrx

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..

vmeditab avatar Sep 21 '22 09:09 vmeditab

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.

adrienrx avatar Sep 21 '22 09:09 adrienrx

By using GlSurfaceView, the icons of end call and others will be covered. I can see only the view of front camera.

vmeditab avatar Sep 21 '22 09:09 vmeditab

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.

image

adrienrx avatar Sep 21 '22 09:09 adrienrx

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).

UrielFrankel avatar Oct 27 '22 07:10 UrielFrankel