Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Crash when join room on Windows #586

Open
thaidmfinnick opened this issue Sep 11, 2024 · 10 comments
Open

[bug] Crash when join room on Windows #586

thaidmfinnick opened this issue Sep 11, 2024 · 10 comments

Comments

@thaidmfinnick
Copy link

thaidmfinnick commented Sep 11, 2024

Describe the bug
When I start call from Windows, it throws:
[ERROR:flutter/shell/common/shell.cc(1055)] The 'FlutterWebRTC/Texture1515781191712' channel sent a message from native to Flutter on a non-platform thread. Platform channel messages must be sent on the platform thread. Failure to do so may result in data loss or crashes, and must be fixed in the plugin or application code creating that channel If I call in app productions, my app crashes immediately.

It seems relevant to many issues from WebRTC:
flutter-webrtc/flutter-webrtc#1580
flutter-webrtc/flutter-webrtc#1465
flutter-webrtc/flutter-webrtc#1525

To Reproduce
Just call from Windows platform with Livekit Client (v2.2.5)

Expected behavior
Can call from Windows. I cannot call from Windows after migrating Livekit from v1.x to v2.x
Platform information

  • Tested on Windows 10, Windows 11
  • Flutter version: Flutter v3.22.3
  • Plugin version: Livekit v2.22.5

Thank you and hope you reply!

@The-Funk
Copy link

I'm running into this exact same issue. Someone over here, apparently figured out that this specific throw can be removed from flutter_wbrtc and their application will run again.

From what I gather about platform channels, flutter_webrtc appears to be doing the right thing.

But I could be wrong. I'm still diving into this issue and trying to understand what's going wrong and why Flutter doesn't like the MethodChannel created by flutter_webrtc, and what might be causing the video to fail for me in Windows builds.

One thing I noticed with the Livekit docs was that they say to use VS 2019 build tools. I'm using VS 2022. I don't know if that's problematic or not. I think most people are using 2022 by now.

@thaidmfinnick
Copy link
Author

thaidmfinnick commented Sep 22, 2024

I'm running into this exact same issue. Someone simonbengtsson/simple_peer_flutter#3, apparently figured out that this specific throw can be removed from flutter_wbrtc and their application will run again.

Thank you for your contribution about this issue! Before figuring out what happened to flutter_webrtc on Windows, I need to call functionality working again. I will try your solution you mention. Really look forward to hearing issue's updates from you.

But I could be wrong. I'm still diving into this issue and trying to understand what's going wrong and why Flutter doesn't like the MethodChannel created by flutter_webrtc, and what might be causing the video to fail for me in Windows builds.

I'm not sure but I use audioplayers lib and catch the same error.

@The-Funk
Copy link

The-Funk commented Sep 22, 2024

@thaidmfinnick I've seen the same error with audioplayers as well, which is yet another well maintained library that claims Windows support. This leads me to believe the issue is deeper and possibly something Flutter related and not library related. Disclaimer: I am not a flutter_webrtc contributor, just someone else investigating these issues with Windows builds.

@thaidmfinnick
Copy link
Author

Disclaimer: I am not a flutter_webrtc contributor, just someone else investigating these issues with Windows builds.

Yes, respect.

@The-Funk
Copy link

@thaidmfinnick I set up an MVP and I can confirm that without the changes/patch and with VS tools 2022 you can in fact get the video to display even with the platform channel warnings.

@thaidmfinnick
Copy link
Author

thaidmfinnick commented Sep 27, 2024

I'm running into this exact same issue. Someone simonbengtsson/simple_peer_flutter#3, apparently figured out that this specific throw can be removed from flutter_wbrtc and their application will run again.

This solution you mention above helps my app doesn't crash. Room can be started but no participants join, no media published. Windows' user feels like...

@DanielBerrioB
Copy link

I'm facing the same issue, hope this can get solved quickly, participants join but no media is published

@cloudwebrtc
Copy link
Contributor

Since there is no method to get the current thread in the flutter windows plugin, we need to wait for this flutter/flutter#134346 to be resolved

@The-Funk
Copy link

Since there is no method to get the current thread in the flutter windows plugin, we need to wait for this flutter/flutter#134346 to be resolved

I figured this was the case, your code looked good. So the platform thread warning is a Flutter issue after all. I learned a lot about platform channels from reading your code by the way. Looks a lot like Java reflection lol!

@thaidmfinnick
Copy link
Author

thaidmfinnick commented Sep 27, 2024

Since there is no method to get the current thread in the flutter windows plugin, we need to wait for this flutter/flutter#134346 to be resolved

So it means until this flutter/flutter#134346 to be resolved, Windows users cannot call with Livekit and Flutter WebRTC??
Do we have another way to workaround?

Thank you for all supports!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants