← Back to team overview

ubuntu-multiseat team mailing list archive

[Bug 1356332] Re: New approach for nested-X-server multiseat support

 

Let's take another use case, which is the one I'm currently working on (and is the most simple case IMHO): a 3-seat system consisting of:
  - 1 CPU
  - 2 video cards (1 integrated graphics device for seat0 + 1 PCI/PCI-e dual-head graphics card for the other seats)
  - 2 USB hubs (1 for each non-seat0 seat)
  - 3 keyboards/mice

For logind versions older than 198, such a setup was impossible, because
a framebuffer device is required in order to create a new seat. But now
logind is much more flexible: the only requirement for a new seat to be
created is that at least one suitable device tagged in Udev as "master-
of-seat" is attached to that seat (in my setup, the USB hubs are tagged
as "master-of-seat").

Which this flexibility, logind can work properly with much more graphics
scenarios, like video cards with non-KMS drivers (e.g. NVIDIA/AMD
proprietary drivers), and nested X servers. From current logind
perspective, the display server setup is irrelevant, provided that it
can handle input/sound devices attached to a given seat (which is
currently done in Xorg by passing "-seat" option to its command line).

For nested X servers (required to load 2 seats on a single dual-head
graphics device), an additional requirement is that a bare X server
spanning all available outputs must be previously started and ready for
connections. Because nested X servers don't reach VTs, I'm affraid of
using a nested X server for seat0, so I'm proposing the use case above
as the most simple one.

It's important that this bare X server doesn't interfere with any seat
at all, i.e., it should neither "steal" a VT expected for the seat0 X
server, nor grab input devices expected by a non-seat0 X server. Since
Xorg currently doesn't check validity of value passed with "-seat"
option, we can satisfy both requirements with a small trick: passing an
"invalid", from logind perspective, seat ID, i.e., any name not starting
with "seat" (e.g. "-seat __fake-seat__").

We have currently two choices for the nested X server: either Xephyr
(built with --enable-kdrive-evdev option) with some wrapper that
calculates input devices' paths from logind seat ID and Xephyr window
geometry (like https://launchpad.net/multi-seat-xephyr) or a proper Xorg
with some video driver that allows nesting (like
http://cgit.freedesktop.org/xorg/driver/xf86-video-nested).

In my point of view, what LightDM needs to do for handling nested-X-server based multiseat is the following:
  - When a new seat is loaded, check if it tries to load a nested X server (maybe setting explicitly a seat property like "require-nesting" will be enough).
  - If at least one new seat requires nesting, check if a host (bare) X server is already loaded and ready for connections. If not, LightDM should start it, and the new seat shoud wait until it can start properly.
  - The new seat should set properly environment variables DISPLAY and XAUTHORITY from host X server before starting a nested X server.
  - If all seats that require nesting are removed, LightDM should stop the host X server.

One possible approach for this is using a special "empty" seat (which
should not start local sessions) for handling the host X server, and a
secondary DisplayManager object for handling the seats which require
nesting. When all these seats are removed, this secondary DisplayManager
object should be stopped, and then that "empty" seat should be stopped,
too. We can link them with signals/callbacks.

-- 
You received this bug notification because you are a member of Ubuntu
Multiseat, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1356332

Title:
  New approach for nested-X-server multiseat support

Status in Light Display Manager:
  Triaged

Bug description:
  I'm opening this bug to discuss ideas for a new approach for
  supporting nested-X-server multiseat setups in LightDM, so we can
  easily configure e.g. 2 seats using a single dual-head graphics card.

  I have the following initial ideas:

  1. Provide a special "empty" seat module, which doesn't spawn
  greeters, doesn't handle sessions at all, etc. I will only start a
  host bare X server spanning all available monitors.

  1.1 [OPTIONAL] Set property "xdg-seat" for this seat to any invalid
  value (from logind's perpective), in order to ensure host X server
  will neither grab input devices (as a non-seat0 X server do) nor touch
  VTs (as a seat0 X server do). Xorg-server 1.16 or newer is required.
  Example: xdg-seat=__lightdm-fake-seat__

  2. Link this seat to a secondary DisplayManager object which will
  handle all other nested-X-server seats. When this secondary display
  manager is stopped, that host-X-server seat should be stopped, too.
  Set environment variables DISPLAY and XAUTHORITY before starting
  nested-X-server seats.

  2.1 [OPTIONAL] subscribe all nested-X-server seats to main
  DisplayManager object as well, so they can be registered in LightDM
  D-Bus API.

  3. Seats could gain a new boolean property "require-nesting" or
  something similar. If it's true, then the seat in question should wait
  until host X server is ready before starting itself. If no host X
  server is available, start a new one.

To manage notifications about this bug go to:
https://bugs.launchpad.net/lightdm/+bug/1356332/+subscriptions