element-hq / riot-android

A glossy Matrix collaboration client for Android
Apache License 2.0
1.4k stars 394 forks source link

Video call crashes and almost-resets app #3266

Open madduck opened 5 years ago

madduck commented 5 years ago

Hey there,

Video calling lately (no idea when this started, I don't use the feature often, because it hardly ever works) has been really funky, to the point where it now reliably crashes the app, which then seems to lose all local status.

Of course, right now I cannot reproduce the issue between my phone and riot-web on the laptop, but as I've seen this multiple times, I am leaving an issue, and promise I'll augment with logs etc. later.

Here's what happens:

  1. I place a call on my Android phone using Riot (F-Droid version 0.8.28a (F-3bc5baad3)).

  2. The other party answers, which is confirmed on my timeline:

    Screenshot_20190817-084705_Riotim

  3. My phone continues to beep-beep, i.e. it's still pretending to be ringing the other side. You can see that while the other party answered at 20:06, I didn't end the call until 20:07. Also, because the timeline is hidden behind the call screen, I didn't actually know that the other party had answered.

  4. When I hang up, Riot crashes. In the screenshot, this is what happened before I could read the other party's response at 20:07 (suggesting a phone call).

  5. The app is reloaded, but I am shown a completely empty directory; None of my rooms show up.

  6. After I kill and restart the app, it takes about 3–5 minutes to load, displaying the "R" spinner. Only then it's back to normal.

As said, I'll try to produce logs as soon as I can reproduce the issue. If you can suggest logcat filters to use, that would be sensible, else there'll be a massive dump, I suspect.

0xlne commented 5 years ago

I encounter the similar issue since the 0.9.x versions regardless whether I use the google store or f-droid versions. I usually use a de-googlified handset thus use the f-droid version, but it seems it still relies on some google bits for connection or signalling. It's really frustrating as I have to use an old handset just to make riot audio/video calls. The last version which worked for me was 0.8.2 I think.

root562 commented 5 years ago

I have tried video call on v0.9.6. Same issue. More details https://github.com/vector-im/riot-android/issues/3311 Seems to me related to this issue three years ago. https://github.com/vector-im/riot-android/issues/501 If there is no fast solution maybe somebody can suggest a workaround. E.G: automatic restart app at hangup. PS: I may not be knowledgeable enough to fix the SDK(I think the problem is in the SDK). New to android programming. I probably can modify the source code of riot-android as a workaround. If I can find a way to programmatically restart the app at video call hangup. Also need to find the part of source code where the hangup handler is.

root562 commented 5 years ago

I posted this before #3311 (comment) Tracing the Riot 0.9.6 code for the bug. It happens at CallsManager.Java, onHangup(). mActiveCall.hangup() cause the program to crash. This is a call to SDK. The code is not in Riot 0.9.6. Can someone doing the matrix-android-sdk check what is happening inside IMXCall.hangup()? How do I forward this to matrix-android-sdk thread?

root562 commented 5 years ago

I managed to complete a workaround. This is not a proper fix. But at least the app won't crash. My workaround reload the app upon video call hangup. The cons of this is hangup notification is not sent to the other side. So the other party has to manually press the hangup button. I send a blank screen to the other side so that he/she knows a hangup has happened. This will prevent Riot app from crashing. I wonder if anybody here has interest on the workaround?

rajil commented 4 years ago

@root562 I certainly do. But i have the google play version so i am not sure how to use your version.