opentok / opentok-react-native

OpenTok React Native - a library for OpenTok iOS and Android SDKs
https://tokbox.com/
MIT License
210 stars 155 forks source link

Android 13 video freezes after some time #628

Closed EdShel closed 1 year ago

EdShel commented 1 year ago

Bug Report

Current behavior On Android 13 after connecting, the video suddenly freezes - the image stays the same forever (both for the current user and other subscribers). The audio still works OK.

Steps to reproduce

  1. Create and launch Android 13 simulator (API level 33) within Android Studio
  2. Clone Github repository with sample apps
  3. Go to BasicVideoChat project
  4. Inside App.js provide API key, session id, token
  5. (optional) Inside App.js add these props to the OTPublisher component (to use simulated 3D room back camera):
    properties={{cameraPosition: 'back'}} 
  6. Run the app
    yarn && yarn android
  7. You can move the camera around, but after some time the video gets stuck and never resumes.

After some time, we found out that the problem occurs on the OT Android SDK 2.23.0 and above (2.22.3 and lower worked ok) - we overrode the SDK version in gradle configuration.

We couldn't reproduce the bug on Android 12 and 11.

Android SDK sample app (Basic-Video-Chat-Java) also worked fine.

Example Project Reproduced in sample apps

What is the current bug behavior? The video randomly gets stuck on Android 13.

What is the expected correct behavior? The video should always play.

Relevant logs and/or screenshots Slice of the logs at the moment of freeze

11-28 17:15:45.153   393  6653 W android.hardware.audio@7.1-impl.ranchu: TinyalsaSource::read:143 pcm_read was late delivering frames, inserting 15238 us of silence
11-28 17:15:45.235  6485  6496 I .basicvideochat: Background concurrent copying GC freed 112658(10MB) AllocSpace objects, 8(160KB) LOS objects, 49% free, 6431KB/12MB, paused 40us,13us total 128.437ms
11-28 17:15:45.268  6485  6504 E BufferQueueProducer: [SurfaceTexture-42-6485-0](id:195500000002,api:4,p:512,c:6485) queueBuffer: BufferQueue has been abandoned
11-28 17:15:45.268   512  6589 E Surface : queueBuffer: error queuing buffer, -19
11-28 17:15:45.269   512  6589 E Camera3-PreviewFrameSpacer: queueBufferToClientLocked: Failed to queue buffer to client: No such device(-19)
11-28 17:15:45.270  6485  6634 E BufferQueueProducer: [SurfaceTexture-42-6485-0](id:195500000002,api:4,p:512,c:6485) dequeueBuffer: BufferQueue has been abandoned
11-28 17:15:45.270   512  6581 E Camera3-OutputStream: getBufferLockedCommon: Stream 0: Can't dequeue next output buffer: No such device (-19)
11-28 17:15:45.270   512  6581 W Camera2Client: notifyError: Received recoverable error 3 from HAL - ignoring, requestId 10000001
11-28 17:15:45.304   393  6653 W android.hardware.audio@7.1-impl.ranchu: TinyalsaSource::read:143 pcm_read was late delivering frames, inserting 15238 us of silence
11-28 17:15:45.310  6485  6634 E BufferQueueProducer: [SurfaceTexture-42-6485-0](id:195500000002,api:4,p:512,c:6485) queueBuffer: BufferQueue has been abandoned
11-28 17:15:45.311   512  6589 E Surface : queueBuffer: error queuing buffer, -19
11-28 17:15:45.345  6485  6504 E BufferQueueProducer: [SurfaceTexture-42-6485-0](id:195500000002,api:4,p:512,c:6485) queueBuffer: BufferQueue has been abandoned
11-28 17:15:45.345   512  6589 E Surface : queueBuffer: error queuing buffer, -19
11-28 17:15:45.518   393  6653 W android.hardware.audio@7.1-impl.ranchu: TinyalsaSource::read:143 pcm_read was late delivering frames, inserting 15238 us of silence
11-28 17:15:45.670   393  6653 W android.hardware.audio@7.1-impl.ranchu: TinyalsaSource::read:143 pcm_read was late delivering frames, inserting 15238 us of silence
11-28 17:15:45.883   393  6653 W android.hardware.audio@7.1-impl.ranchu: TinyalsaSource::read:143 pcm_read was late delivering frames, inserting 15238 us of silence

The complete log file: basic-video-chat-video-freeze-logs.txt

josmmv commented 1 year ago

I had a similar issue, publisher video freezes after about 5 seconds. I had to flip the camera position to fix it, but it happens again after a few seconds.

Enviroment:

https://user-images.githubusercontent.com/23065564/205168545-1ea56dd0-3fb6-43f0-8e43-471f2c282fd7.mp4

KiranRadish commented 1 year ago

I am having similar issue on android. publisher video freezes after few seconds. opentok-react-native": "^0.21.1

KiranRadish commented 1 year ago

@JosMMV @EdShel did you found any solution for this?

EdShel commented 1 year ago

@JosMMV @EdShel did you found any solution for this?

No, we've decided to reimplement streaming functionality on web using opentok-react and serve the new page via a web-view in the app. This approach still brings issues when connecting bluetooth headphones, but at least the video works

vineus commented 1 year ago

Same issue here, downgrading to

 "opentok-react-native": "0.20.4"

"solved" it

pietgk commented 1 year ago

@enricop89 any progress on this issue?, sorry to push but we are blocked on using vonage where we need to upgrade to use the latest android SDK and this needs to be fixed before that can happen. Thx in advance for the feedback :-)

kapilmishr commented 1 year ago

@pietgk Team is working on this issue and we will have some updates by next week.

pietgk commented 1 year ago

Hello Kapil Mishra,

I do not have a vonage account (only an account on the voyage video api). So I can not follow the issue on jira (yet). How can I obtain a Vonage Account?

Regards, Piet Groot Kormelink

On 10 Jan 2023, at 14:45, Kapil Mishra @.***> wrote:

@pietgk https://github.com/pietgk Team is working on this issue and it can be tracked via https://jira.vonage.com/browse/VIDECO-8468 https://jira.vonage.com/browse/VIDECO-8468. We will have some updates by next week.

— Reply to this email directly, view it on GitHub https://github.com/opentok/opentok-react-native/issues/628#issuecomment-1377307734, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMRBZH3MMXOSLYK65RMDP3WRVRWVANCNFSM6AAAAAASNPD3N4. You are receiving this because you were mentioned.

kapilmishr commented 1 year ago

Hi Piet Groot Kormelink,

We will provide the relevant update here from Jira next week.

Thanks, Kapil

pietgk commented 1 year ago

Thanks :-)

On 10 Jan 2023, at 17:18, Kapil Mishra @.***> wrote:

Hi Piet Groot Kormelink,

We will provide the relevant update here from Jira next week.

Thanks, Kapil

— Reply to this email directly, view it on GitHub https://github.com/opentok/opentok-react-native/issues/628#issuecomment-1377514125, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMRBZCZGODYNT4H3LBNIOLWRWDUZANCNFSM6AAAAAASNPD3N4. You are receiving this because you were mentioned.

nicwise commented 1 year ago

Hi @kapilmishr - any updates? We have a fair few users on Huawei phones, which means they get no audio until we get 2.24.x native android lib in.... and this one is blocking it, I'm told.