media-kit / media-kit

A cross-platform video player & audio player for Flutter & Dart.
https://github.com/media-kit/media-kit
MIT License
916 stars 132 forks source link

[media_kit v1.1.10] Access violations when multiple Flutter apps are running media_kit concurrently #743

Open isaacy13 opened 2 months ago

isaacy13 commented 2 months ago

Howdy,

I'm getting null access violations whenever multiple Flutter apps are running media_kit at the same time

media_kit: 1.1.10 media_kit_video: 1.2.4 media_kit_libs_video: 1.0.4

Steps taken so far:

There are no obvious nulls in the local variables tab, and I don't have access to any pdb files to continue looking down the stack trace.

Is there a way I can continue to debug this issue?

isaacy13 commented 2 months ago

Have only had this pop up once, but also got a similar error from Angle

image

isaacy13 commented 2 months ago

Integer division by 0 image

isaacy13 commented 2 months ago

Unable to create ANGLE EGL surface

image

isaacy13 commented 2 months ago

eglCreatePbufferFromClientBuffer is returning error 12302 whenever second instance calls image

internal_handle_ seems to be getting allocated correctly, need to dig more into why it's causing error 12302

isaacy13 commented 2 months ago

Current workaround is disabling hardware acceleration image

However, will still dig into why ANGLESurfaceManager running into issues when multiple apps using media_kit at same time

isaacy13 commented 2 months ago

As mentioned above, issue only affects when hardware acceleration is enabled

If you want hardware acceleration working for multiple instances, then here's my current workaround

image

I have no prior experience with graphics libraries, but it seems like since different instances are displaying different things, we shouldn't need to synchronize the instances

Perhaps someone with more graphics knowledge could explain why this works, and propose a better solution