sony / flutter-embedded-linux

Embedded Linux embedding for Flutter
BSD 3-Clause "New" or "Revised" License
1.16k stars 122 forks source link

waylnd: [FATAL:flutter/shell/common/display_manager.cc(32)] Check failed: displays_.empty(). #384

Closed angelobt closed 10 months ago

angelobt commented 10 months ago

we are using weston compositor with kiosk shell.

We have a flutter application using flutter-wayland-client.

updating from 05b0377d52662a33d53370f745e2f127d4ec0248 to head (1 sept 2023) we run into this error

[FATAL:flutter/shell/common/displaymanager.cc(32)] Check failed: displays.empty().

that happens if an other application (like gstreamer) wants to render something through wayland.

HidenoriMatsubayashi commented 10 months ago

I feel https://github.com/sony/flutter-embedded-linux/pull/374 is probably the cause.

HidenoriMatsubayashi commented 10 months ago

that happens if an other application (like gstreamer) wants to render something through wayland.

Specifically, can you please tell me how to reproduce this issue?

HidenoriMatsubayashi commented 10 months ago

This issue shouldn't occur in release flavor.

https://github.com/flutter/engine/blob/main/shell/common/display_manager.cc#L27C15-L27C23

void DisplayManager::HandleDisplayUpdates(
    std::vector<std::unique_ptr<Display>> displays) {
  FML_DCHECK(!displays.empty());
  std::scoped_lock lock(displays_mutex_);
  displays_ = std::move(displays);
}
angelobt commented 10 months ago

Thanks for the support. As soon as possible we will try the release flavor

HidenoriMatsubayashi commented 10 months ago

This failure is really strange. It can't happen as I've implemented UpdateDiplayInfo API call with display_count = 1.

https://github.com/sony/flutter-embedded-linux/blob/master/src/flutter/shell/platform/linux_embedded/flutter_elinux_view.cc#L578:

void FlutterELinuxView::UpdateDisplayInfo(double refresh_rate,
                                          size_t width_px,
                                          size_t height_px,
                                          double pixel_ratio) {
  const FlutterEngineDisplaysUpdateType update_type =
      kFlutterEngineDisplaysUpdateTypeStartup;
  const FlutterEngineDisplay displays = {
      .struct_size = sizeof(FlutterEngineDisplay),
      .display_id = 0,
      .single_display = true,
      .refresh_rate = refresh_rate,
      .width = width_px,
      .height = height_px,
      .device_pixel_ratio = pixel_ratio,
  };
  const size_t display_count = 1;
  engine_.get()->UpdateDisplayInfo(update_type, &displays, display_count);
}

[FATAL:flutter/shell/common/displaymanager.cc(32)] Check failed: displays.empty().

Also, this error shows the line number is 32, but it should be line 27. https://github.com/flutter/engine/blob/main/shell/common/display_manager.cc#L27C15-L27C23

@angelobt What flutter/engine version are you using? Also, are you using this software (flutter-embedded-linux) as is?

omarhogni commented 10 months ago

+1 for this issue, same setup weston, kiosk shell

HidenoriMatsubayashi commented 10 months ago

Can you please share the detailed steps to reproduce this crash?

omarhogni commented 10 months ago

Switching to 7f83ccb9a9790ab31758e76b3b5498be2af32af7 it looks like the error is gone.

omarhogni commented 10 months ago

For me this is not a crash but just at startup. But I am consuming this project through meta-flutter and using that project to build the engine and do the heavy lifting. then I just start it.

What kind of steps are you looking for?

HidenoriMatsubayashi commented 10 months ago

What version of flutter/engine are you using?

What kind of steps are you looking for?

Just how to reproduce this issue / your steps. I have never used weston + kiosk shell. Also, can this issue be reproduced on desktop PCs?

HidenoriMatsubayashi commented 10 months ago

Just in case, FlutterEngineDisplay API of flutter/engine's embedder has been supported since flutter 3.13.0. If you use the latest this software, you need to use flutter version 3.13.0 or higher.

omarhogni commented 10 months ago

I am using 3.7.7 so that might be it.

HidenoriMatsubayashi commented 10 months ago

Definitely, yes. Please use 3.13.0 or higher. I'll close this issue. Please let me know if you get this error even if you use the correct versions. I'll re-open it.

angelobt commented 10 months ago

I'm using flutter-engine 3.3.10. So it makes sense