sony / flutter-embedded-linux

Embedded Linux embedding for Flutter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

angelobt opened this issue · comments

we are using weston compositor with kiosk shell.

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

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

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

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

I feel #374 is probably the cause.

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?

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);
}

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

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/display_manager.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?

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

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

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

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?

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?

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.

I am using 3.7.7 so that might be it.

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.

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