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

expand a desktop #3390

Open
totaam opened this issue Dec 17, 2021 · 10 comments
Open

expand a desktop #3390

totaam opened this issue Dec 17, 2021 · 10 comments
Labels
enhancement New feature or request shadow

Comments

@totaam
Copy link
Collaborator

totaam commented Dec 17, 2021

Taking advantage of #3320, make it possible to modify an existing "real" desktop session to add a new virtual output that we then shadow somewhere else, effectively expanding a desktop onto a remote output.
Something like:

xpra expand :0,size=1920x1080 

Even better would be if we could do this from the client:

xpra expand ssh://host/0

And have the expanded area match that of the client's display. The client could run in full-screen mode from the start.

The are virtual adapters for most OSes: #3320 (comment)

@totaam
Copy link
Collaborator Author

totaam commented May 5, 2022

The commit above adds a work in progress evdi capture codec, which requires these extra files to build on Fedora 34 which provides libevdi in fedora-multimedia, but no libevdi-devel:

$ more /usr/lib64/pkgconfig/evdi.pc 
prefix=/usr
libdir=${prefix}/lib64
includedir=${prefix}/include

Name: evdi
Description: Extensible Virtual Display Interface
Version: 1.10
Libs: -L${libdir} -levdi
Cflags: -I${includedir}

/usr/include/evdi_lib.h can just be copied from the evdi source.

It doesn't capture any pixel data and seems to hang my local X11 session for many seconds!
Perhaps looking at what evdipp is doing would help?
(their example does work - though not perfectly either..)

The evdi docs aren't very clear on the sequence of events needed to start capturing pixels.

Pre-requisite: modprobe evdi initial_device_count=2 as per Unable to add a VIRTUAL display to Xorg

@totaam
Copy link
Collaborator Author

totaam commented Jul 9, 2022

Difficult to test when the latest release (many months ago) doesn't support the latest kernels..
https://github.com/displaylink-rpm/displaylink-rpm/releases

totaam added a commit that referenced this issue Jul 18, 2022
totaam added a commit that referenced this issue Sep 11, 2022
(evdi version 1.12.0)
totaam added a commit that referenced this issue Sep 12, 2022
totaam added a commit that referenced this issue Sep 12, 2022
none of the distributions ship a recent enough version
and none of them ship the development headers either...
at least we try
totaam added a commit that referenced this issue Sep 12, 2022
totaam added a commit that referenced this issue Sep 12, 2022
totaam added a commit that referenced this issue Sep 13, 2022
totaam added a commit that referenced this issue Sep 13, 2022
totaam added a commit that referenced this issue Sep 13, 2022
totaam added a commit that referenced this issue Sep 14, 2022
totaam added a commit that referenced this issue Sep 17, 2022
totaam added a commit that referenced this issue Sep 18, 2022
@totaam
Copy link
Collaborator Author

totaam commented Sep 19, 2022

Using the glue commits above, here is the updated platform support.

  • Debian and Ubuntu are all missing the evdi.pc pkgconfig file
  • Debian Buster: evdi 1.6.0, too old: no amount of glue can fix that
  • Debian Bullseye: evdi 1.9.0, OK
  • Debian Bookworm: no evdi anywhere in the repositories! And somewhat hard to build from source..
  • Ubuntu 20.04: evdi 1.9.1 OK
  • Ubuntu 22.04: evdi 1.9.1 OK
  • Fedora: no evdi packages in the repos
  • Fedora 37: needed an updated Cython first 58ef3e0

totaam added a commit that referenced this issue Sep 19, 2022
and we can build 1.9.0 with the compat header
totaam added a commit that referenced this issue Sep 20, 2022
totaam added a commit that referenced this issue Sep 20, 2022
(hangs far too often to be used - no idea why yet)
@totaam
Copy link
Collaborator Author

totaam commented Sep 21, 2022

Still TODO:

  • figure out why it hangs the X11 server for many seconds at a time!
  • why can't we hot unplug the driver? (use xrandr to remove the provider first?)
  • get the select.select mode to work somehow? (is this related to the hangs?)
  • don't inherit from shadow mode, get closer to seamless mode since we should be using the damage rects
  • use the damage rects (if we get them... maybe with the select mode?)
  • sometimes it doesn't work at all and we never get pixel data, detect this with a timeout and bail out
  • disable clipboard when the client and server are using the same display
  • show the remote pointer
  • more helpful error message when the kernel module is not loaded (especially when running remotely via ssh)
  • too many problems with outdated Debian builds (now disabled): f9d33b2, d1b8a7c

totaam added a commit that referenced this issue Mar 1, 2023
totaam added a commit that referenced this issue Mar 1, 2023
@normanr
Copy link

normanr commented Apr 20, 2023

Did you figure out why it hangs the X11 server? When I tried it (over a year ago) I wondered if it might be that something in X11 is trying to callback into the application which is running with an X11 event loop (so causing a deadlock and eventually something times out).

@totaam
Copy link
Collaborator Author

totaam commented Apr 21, 2023

@normanr perhaps, I just tried it now and have some new data points:

  • the evdi virtual display was automatically added to my local Wayland desktop session rather than the X11 display I wanted to test it with
  • there are no hangs this time (so perhaps you are correct and the problem comes from the X11 event loop) but the pointer is leaving a mess behind it and the screen updates are often slightly corrupted

I don't have time to look into this further, which is a shame because this looks almost usable and extremely useful.

@normanr
Copy link

normanr commented Jun 14, 2023

fwiw, I tried this recently and also discovered that it hung less. The evdipp example app didn't hang at all; only the monitorsim app did, and even then it was for a "shorter" time (15s maybe).

Doing it manually (with xrandr, etc) caused the messy screen, but using the example & monitorsim apps didn't have that issue. The monitorsim app even showed the pointer (even though xpra did not).

Setup: debian testing with Xorg 21.1.7 with evdi 1.12, I had to change evdipp/CMakeLists.txt GIT_TAG to v1.11.0 to get the example apps to run correctly.

@normanr
Copy link

normanr commented Jun 15, 2023

fwiw, I did the above testing with xpra shadow. I've now also tried xpra expand, which seems to hang slightly longer/worse (I had to compile & install the evdi codec library for xpra v4.4.5 to get it to work). Oddly hangs seem to be triggered more when the cursor transitions into-or-outof of the virtual screen. I did manage to get the pointer to display by commenting out the call to enable_cursor_events() (which makes evdi compose the cursor into the framebuffer).

@normanr
Copy link

normanr commented Jan 27, 2024

So I came across pavlobu/deskreen#86, and ended up trying https://dri.freedesktop.org/docs/drm/gpu/vkms.html and, although I had to enable and compile the kernel module, once it was loaded X11 detected the display and it just worked flawlessly. No hangs, no weirdness, it just worked. Gnome display settings could position it, and change the display resolution.

update: I spoke too soon. My laptop with Intel graphs worked flawlessly, but my desktop with Nvidia graphics doesn't init the vkms device properly and x11/gnome can't change the display resolution :-(

@totaam
Copy link
Collaborator Author

totaam commented Mar 23, 2024

For Wayland desktops, there's also RecordVirtual: Record a virtual area that will be represented as a virtual monitor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request shadow
Projects
None yet
Development

No branches or pull requests

2 participants