-
Notifications
You must be signed in to change notification settings - Fork 103
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
Virtual output display platform and tests #3056
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obviously, this is hard to evaluate while it doesn't compile, but a few nits mentioned.
As the snaps built I tried Miriway:
$ snap refresh miriway --channel=edge/mir-pr3056
$ miriway --virtual-output 800x600 --virtual-output 1200x900 --platform-display-libs=mir:virt
Info: wayland endpoint 'wayland-0' already exists, using it as host
[2023-10-03 11:16:54.937811] <information> mirserver: Starting
[2023-10-03 11:16:54.953884] < - debug - > mirserver: Not using logind for session management: Logind TakeControl call failed: GDBus.Error:System.Error.EBUSY: Device or resource busy
[2023-10-03 11:16:54.954084] < - debug - > mirserver: Not using Linux VT subsystem for session management: Failed to find the current VT
[2023-10-03 11:16:54.954123] < - debug - > mirserver: No session management supported
[2023-10-03 11:16:54.954171] <information> VT switch key handler: No VT switching support available: MinimalConsoleServices does not support VT switching
[2023-10-03 11:16:54.954500] <information> mircommon: Loading modules from: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform
[2023-10-03 11:16:54.954646] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-eglstream-kms.so.20
[2023-10-03 11:16:54.954705] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.20
[2023-10-03 11:16:54.954732] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-wayland.so.20
[2023-10-03 11:16:54.954755] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/renderer-egl-generic.so.20
[2023-10-03 11:16:54.954778] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/server-virtual.so.20
[2023-10-03 11:16:54.954814] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/server-x11.so.20
[2023-10-03 11:16:54.954852] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/input-evdev.so.8
[2023-10-03 11:16:54.954869] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-dummy.so
[2023-10-03 11:16:54.954921] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/input-stub.so
[2023-10-03 11:16:54.956931] <information> mirserver: Found display driver: mir:virt (version 2.15.0)
[2023-10-03 11:16:54.956974] <information> mirserver: Driver supports:
[2023-10-03 11:16:54.956988] <information> mirserver: System (priority 192)
[2023-10-03 11:16:54.957006] <information> mirserver: Selected display driver: mir:virt (version 2.15.0) for platform
[2023-10-03 11:16:54.957248] <information> mircommon: Loading modules from: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform
[2023-10-03 11:16:54.957405] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-eglstream-kms.so.20
[2023-10-03 11:16:54.957436] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.20
[2023-10-03 11:16:54.957459] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-wayland.so.20
[2023-10-03 11:16:54.957483] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/renderer-egl-generic.so.20
[2023-10-03 11:16:54.957552] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/server-virtual.so.20
[2023-10-03 11:16:54.957605] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/server-x11.so.20
[2023-10-03 11:16:54.957623] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/input-evdev.so.8
[2023-10-03 11:16:54.957644] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-dummy.so
[2023-10-03 11:16:54.957679] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/input-stub.so
[2023-10-03 11:16:54.959316] <information> mirserver: Found rendering driver: mir:eglstream-kms (version 2.15.0)
[2023-10-03 11:16:54.959344] < - debug - > eglstream: No outputs capable of accepting EGLStream input detected
[2023-10-03 11:16:54.959360] < - debug - > eglstream: Probing will be skipped
[2023-10-03 11:16:54.959407] <information> mirserver: (Unsupported by system environment)
[2023-10-03 11:16:54.959428] <information> mirserver: Found rendering driver: mir:gbm-kms (version 2.15.0)
[2023-10-03 11:16:54.959450] < - debug - > gbm-kms: No outputs capable of accepting GBM input detected
[2023-10-03 11:16:54.959481] < - debug - > gbm-kms: Probing will be skipped
[2023-10-03 11:16:54.959492] <information> mirserver: (Unsupported by system environment)
[2023-10-03 11:16:54.959508] <information> mirserver: Found rendering driver: mir:wayland (version 2.15.0)
[2023-10-03 11:16:54.959620] <information> mirserver: Found rendering driver: mir:egl-generic (version 2.15.0)
[2023-10-03 11:16:54.959658] <information> mirserver: Driver supports:
[2023-10-03 11:16:54.959669] <information> mirserver: System (priority 192)
[2023-10-03 11:16:54.959684] <information> mirserver: Found rendering driver: mir:virt (version 2.15.0)
[2023-10-03 11:16:54.959750] <information> mirserver: Found rendering driver: mir:x11 (version 2.15.0)
[2023-10-03 11:16:54.959830] <information> mirserver: Found rendering driver: mir:stub-graphics (version 2.15.0)
[2023-10-03 11:16:54.959847] <information> mirserver: Driver supports:
[2023-10-03 11:16:54.959859] <information> mirserver: System (priority 1)
[2023-10-03 11:16:54.959903] <information> mirserver: Selected rendering driver: mir:egl-generic (version 2.15.0) for platform
ERROR: /root/parts/mir/src/src/server/graphics/default_configuration.cpp(375): Throw in function virtual const std::vector<std::shared_ptr<mir::graphics::RenderingPlatform> >& mir::DefaultServerConfiguration::the_rendering_platforms()
Dynamic exception type: boost::wrapexcept<std::runtime_error>
std::exception::what: Exception while creating rendering platform
ERROR: /root/parts/mir/src/src/platforms/virtual/graphics/platform.cpp(46): Throw in function virtual void* mir::graphics::virt::Platform::VirtualDisplayInterfaceProvider::maybe_create_interface(const mir::graphics::DisplayInterfaceBase::Tag&)::StubGenericEGLDisplayProvider::get_egl_display()
Dynamic exception type: boost::wrapexcept<std::runtime_error>
std::exception::what: Failed to initialize EGL display
$ miriway --virtual-output 800x600 --virtual-output 1200x900 --platform-display-libs=mir:virt --platform-rendering-libs=mir:virt
Info: wayland endpoint 'wayland-0' already exists, using it as host
[2023-10-03 11:19:40.177696] <information> mirserver: Starting
[2023-10-03 11:19:40.194233] < - debug - > mirserver: Not using logind for session management: Logind TakeControl call failed: GDBus.Error:System.Error.EBUSY: Device or resource busy
[2023-10-03 11:19:40.194428] < - debug - > mirserver: Not using Linux VT subsystem for session management: Failed to find the current VT
[2023-10-03 11:19:40.194444] < - debug - > mirserver: No session management supported
[2023-10-03 11:19:40.194490] <information> VT switch key handler: No VT switching support available: MinimalConsoleServices does not support VT switching
[2023-10-03 11:19:40.194906] <information> mircommon: Loading modules from: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform
[2023-10-03 11:19:40.195096] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-eglstream-kms.so.20
[2023-10-03 11:19:40.195186] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.20
[2023-10-03 11:19:40.195214] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-wayland.so.20
[2023-10-03 11:19:40.195237] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/renderer-egl-generic.so.20
[2023-10-03 11:19:40.195258] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/server-virtual.so.20
[2023-10-03 11:19:40.195280] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/server-x11.so.20
[2023-10-03 11:19:40.195299] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/input-evdev.so.8
[2023-10-03 11:19:40.195319] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-dummy.so
[2023-10-03 11:19:40.195342] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/input-stub.so
[2023-10-03 11:19:40.196666] <information> mirserver: Found display driver: mir:virt (version 2.15.0)
[2023-10-03 11:19:40.196693] <information> mirserver: Driver supports:
[2023-10-03 11:19:40.196719] <information> mirserver: System (priority 192)
[2023-10-03 11:19:40.196758] <information> mirserver: Selected display driver: mir:virt (version 2.15.0) for platform
[2023-10-03 11:19:40.196947] <information> mircommon: Loading modules from: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform
[2023-10-03 11:19:40.197106] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-eglstream-kms.so.20
[2023-10-03 11:19:40.197134] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.20
[2023-10-03 11:19:40.197155] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-wayland.so.20
[2023-10-03 11:19:40.197178] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/renderer-egl-generic.so.20
[2023-10-03 11:19:40.197196] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/server-virtual.so.20
[2023-10-03 11:19:40.197215] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/server-x11.so.20
[2023-10-03 11:19:40.197237] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/input-evdev.so.8
[2023-10-03 11:19:40.197254] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-dummy.so
[2023-10-03 11:19:40.197269] <information> mircommon: Loading module: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/input-stub.so
[2023-10-03 11:19:40.198459] <information> mirserver: Found rendering driver: mir:virt (version 2.15.0)
ERROR: /root/parts/mir/src/src/server/graphics/default_configuration.cpp(375): Throw in function virtual const std::vector<std::shared_ptr<mir::graphics::RenderingPlatform> >& mir::DefaultServerConfiguration::the_rendering_platforms()
Dynamic exception type: boost::wrapexcept<std::runtime_error>
std::exception::what: Exception while creating rendering platform
ERROR: /root/parts/mir/src/src/common/sharedlibrary/shared_library.cpp(73): Throw in function void* mir::SharedLibrary::load_symbol(const char*, const char*) const
Dynamic exception type: boost::wrapexcept<std::runtime_error>
std::exception::what: /snap/miriway/1667/usr/lib/x86_64-linux-gnu/mir/server-platform/server-virtual.so.20: undefined symbol: probe_rendering_platform, version MIR_GRAPHICS_PLATFORM_2.8
So not getting very far
937f3df
to
8eea6a3
Compare
Couple issues in CI resulting from the extra platform that gets loaded. In mir-smoke-test-runner in CI… I'm not sure what display platform is used today… will try and look. But maybe we should force it to virtual in that environment? Could we keep the actual platform name
|
Yup, we can call it virtual! We have want to keep the namespace as |
@Saviq The reason for the CI failure is that:
A fix for this could be to make the virtual platform a "dummy" platform, so that it always has lesser priority than X11. To be honest, I can't think of a situation where you would want to default to a virtual platform |
Right, so that's what I don't get… where does the X server come from? :)
Don't think that'd be DTRT, see #3071 for how I think we could handle x11/wayland. Wouldn't virtual be a good default platform when headless? Though you said it's only ever used if |
Codecov Report
@@ Coverage Diff @@
## main #3056 +/- ##
==========================================
- Coverage 78.45% 78.43% -0.02%
==========================================
Files 1064 1073 +9
Lines 74434 74717 +283
==========================================
+ Hits 58394 58604 +210
- Misses 16040 16113 +73
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
So this confirms what I thought - we shouldn't make it |
Agreed, the virtual platform shouldn't be |
Aha! I've pushed what we should make work instead. |
Oh. Didn't expect it to actually work XD. |
Why does the example above specify multiple outputs when wayvnc doesn't support this: "If the Wayland session consists of multiple outputs, only one will be captured."? Do we know of a VNC server that does? |
You can |
439b8fc
to
71902f0
Compare
Ah. But it didn't actually run the performance or smoke tests… /me dislikes |
result.push_back({ | ||
nullptr, | ||
mg::PlatformPriority::supported, | ||
nullptr | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should only execute if options.is_set(virtual_displays_option_name)
(virtual_displays_option_name, | ||
boost::program_options::value<std::vector<std::string>>() | ||
->default_value(std::vector<std::string>{"1280x1024"}, "1280x1024") | ||
->multitoken(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not be setting a default: the user needs to explicitly request the virtual platform.
We likely also need options to specify them as "disconnected" (or that they should be "unused" on startup).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We likely also need options to specify them as "disconnected" (or that they should be "unused" on startup).
Can't be disconnected, can it, as how we'd connect them again? Unused? If you've enabled it through --virtual-output
, why would you not use it? You can always have it disabled in your display layouts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about the "dynamically add a virtual output to serve to a tablet" scenario. But we agreed this could land without making that simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about the "dynamically add a virtual output to serve to a tablet" scenario.
Right, but to close that loop we'd need some means of connecting the disconnected outputs, which IMO is out of scope here. In fact, I think for that use case we should be creating / destroying virtual outputs, when we get to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user still has to explicitly request the virtual platform (via
--platform-display-libs=mir:virtual
). When that is specified, we give them a default virtual output.
Right, but then they have to know to also add gbm-kms
, or whatever else platform is appropriate.
Are you saying that the existence of a
--virtual-output
option should drive whether nor not we support a virtual platform instead?
Yes, same like --wayland-host
is handled:
Better now. So this is what we need to fix:
We should be able to use this with |
Bug
|
Everything is working on the box 🎉 I have updated comments on how to test there. X11 is still broken, but I made this ticket to deal with it at a later time: #3076 |
a24ccce
to
c37b028
Compare
Understood! |
@Saviq This doesn't work for me when the platform is X11:
We're probably running into some ordering issue here. I get:
|
@AlanGriffiths does this work for you? Getting both virtual and x11 outputs?
I don't think we have any ordering problems any more… I'll try in a couple additional setups, too. |
No:
FWIW the platforms selected are as expected:
But this difference in experience is likely because of the order display drivers are tried. @mattkae if you try the last incantation, which order are the drivers listed for you? |
Bug: For some reason, Update: Update 2: If you run a VNC, it breaks through that section and closes normally. It looks like we don't have a Renderer immediately in the virtual case (as we do in other cases). This appears to somehow be causing the eglSwapBuffers call to hang Update 3: Oof I see! We have no |
Indeed, mine has x11 first:
|
Makes sense! And on my system:
|
@Saviq @AlanGriffiths Would it be worth it to investigate the ordering as part of this task? Or is that better left for a future task? |
I think separate, but @RAOF do you think there's anything more the virtual platform can do here? |
I don't think there's anything more the virtual platform can really do here. |
c768158
to
b3e221d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few trivial tweaks. Will push fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy now
|
fe806d3
to
634c940
Compare
How to test
miral-shell
like so:gvncviewer localhost
)How to test on a test box
wayvnc
gvncviewer IP_OF_BOX
Have fun!
What's new?
CMakeList.txt
DisplayBuffer