Hi everyone! To start this blog I’m posting my accepted proposal on Google Summer of Code. It is useful for everyone who wants to know what are the multiseat’s problems and what I will do to solve them. From this day forward I will post weekly the updates of the project.
Use upstream pieces to make a fully plug-and-play USB multiseat solution. Name: Lucas Nascimento Ferreira e-mail: email@example.com website: www.inf.ufpr.br/lnf07 Synopsis Over the last years many multiseat solutions have appeared, but many are closed projects and some are open projects that never became stable on any distribution. Nowadays a lot of features are being added in Xorg and Linux, and now is possible to make a clear and general solution that distributions can easily include it. One of these features is the correct VGA arbitration in Xorg 1.7 and Linux Kernel 2.6.32 . This allows to set up a multiseat using multiple X servers on different graphical devices, and shows the interest of the X.org community on this area. Another feature that is important to multiseat solutions is the secondary video cards initialization , that was included in Xorg 1.7 too. These features make possible to set up a multiseat with multiple instances of X server, but a tool that is extremely useful to manage sessions and seats is the ConsoleKit. All these pieces together and correctly integrated make a clear multiseat solution. Two common problems in multiseat environments are the association and detection of the devices, one solution based on a USB hierarchy  makes this environment more controlled and this turns the problem easier to be solved. A USB hierarchy is a way of dispose the devices, a set of devices (keyboard, mouse, ...) are attached in one USB HUB and this HUB is associated to one user, making one seat. The Plugable HUBS  are more useful to make a USB hierarchy because the video is also in the HUB, so the seats are totally separated. This kind of solution has some problems, because those USB HUBS must be fully plug-and-play, because user doesn't want to manually reconfigure the devices every time a USB HUB is detached from the machine. This problem can be solved with the udev tool, that provides a way to do a dynamic detection and association of the devices. A USB Multiseat solution based on Plugable HUBS has another advantage, and this is the main attraction to end users, the cost/benefit. The USB terminals themselves are a significant cost savings over buying even low-costs netbooks. The cost of maintaining PCs goes way down, as many terminals share a single server. Plug and play nature also provides big savings. This solution is perfect to "office user", in other words, those users who only use browsers, messengers, text editors and other common applications like these. A hard work must be done to correctly integrate the new features + Linux Kernel tools (udev) + ConsoleKit + display managers to make a fully plug-and-play multiseat solution. What I am going to do is to study the state of all these pieces nowadays and, using the existing source code  of Plugable solution, refine and document it to make easily for distributions to include it. Why Multiseat ? I would like to work in the "USB Multiseat Refinement" idea because I think is very important that linux distributions have an easy way to configure a multiseat environment. This is because in Brazil multiseats are becoming very common on public schools and I have saw that they are having many problems with it. Another big incentive to work with multiseats is because this kind of solution decreases the cost of computing, so this is a good tool to the digital inclusion. Three important points that justify the advantages of multiseats are the energy-saving, CPU optimization and ease of management. The first point is the most important, because with multiseats is possible to increase the number of users in a lab just using a little more of energy. This is because there is a large decrease of devices (CPUs, hard disks, etc) by the total number of users. The second point is because in a common "office environment" (with common computers) which people are using only applications like browsers, messengers, text editors, a great part of time the CPU is idle. This is because the user is reading a document, seeing a website that is already loaded or something like these. So if in this environment is changed the common computers to multiseats, the time that the CPU is idle will be decreased, optimizing the use of CPU. The last point occurs due to the decrease of computer amount, so it turns easier the network management and the hardware maintenance. Description To create a fully plug-and-play USB multiseat solution is necessary to solve two common problems of multiseats: detection and association of devices. In a USB multiseat environment is necessary to detect every hub connected to the machine. Actually we need to detect the devices, but they will be plugged on the machine through the hub, for solve it will be created udev rules. Every hub connected will be a seat, so is necessary to create some udev attributes to label this set of devices with a common seat ID. With this settings the detection problem is solved. The association problem will be divided into two classes: basic devices and other devices. What is considered basic devices are keyboard, mouse and video. Other devices are storage/audio devices. To solve it we need to get the devices that were detected and labeled through the udev rules/attributes and write a ConsoleKit script to launch independent GDM/X session to each set of devices (HUB). Before it, is necessary to check if in each hub are connected the 3 basic devices (keyboard, mouse and video). Then is important to create some InputClass rules to cause the primary X session to ignore multiseat-assigned devices, and the appropriate seat to use them. Other devices like pendrives, mp3 players which will be attached on the machine when the sessions is already started, will also need to be detected and associated correctly. Since each seat has its own HUB, each new device attached into a hub must be associated and become available to that session user. By creating some udev rules and X init scripts this can become automatic. Project Plan Following the Google Summer of Code Timeline, these is my program schedule: April 27 - May 24 Basically it is a study period, but detailed it is: - Get some Display Link USB Hubs and set up a multiseat environment with the source code that already exists. - Study the existent source code to become expert in what already been done. - Understand how does udev works - Study the state of Xorg today to know how to set up a good configuration file and explore the new features. - Study if there is some configuration or module that will need to set up on kernel. May 24 - June 7 - Define the udev rules to detect hubs/devices which should be collectively treated as terminals - Define the udev attributes to label the set of devices with a common seat id June 8 - June 30 At this period I will be more busy because I will be at the end of semester and I will have a lot of exams. - udev triggers for on-demand generation of the appropriate Xorg config files, to allow seats to coexist with the primary display/devices. - Implement ConsoleKit scripts to launch independent GDM/X sessions for each USB terminal seat June 1 - July 15 - Write documentation and make a lot of tests (performance, plug-and-play tests, ...) July 16 - Submit mid-term evaluation. July 17 - July 29 - InputClass rules to cause the primary X session to ignore multiseat-assigned devices, and the appropriate seat to use them - udev rules and X init scripts to grant access to audio, storage, and other devices to the person logged into the matching seat July 30 - August 9 - Study the state of some of the principal distros today to assess the best way to include a multiseat solution on it. - Adapt the code to include the solution to an example distribution, like Debian or Gentoo. - Write documentation and make a lot of tests (performance, plug-and-play tests, ...) Personal Information My name is Lucas Nascimento Ferreira, I'm a 20 years old student of Computer Science at UFPR  (Federal University of Paraná). I live in Curitiba, capital of Paraná state, Brazil. I have worked with multiseats over the last 3 years in MDM project  at C3SL  (Center of Scientific Computing and Free Software). In 2008 I wrote a considerable amount of code  to MDM project and in 2009 I published a summary [10, 11] (only in portuguese) about the performance of the X Window System on the labs of the Informatics Department of UFPR. I have done one presentation (only in portuguese)  about multiseats to students of UFPR explaining the common problems and the MDM solution. From 2009 I started to work with NX server of NoMachine and Google's NeatX. References  http://bugs.freedesktop.org/show_bug.cgi?id=20817  http://bugs.freedesktop.org/show_bug.cgi?id=20816  http://www.ndiyo.org/systems/hubster/basics  http://plugable.com/products/UD-160-A  http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html  http://plugable.com/2009/11/16/setting-up-usb-multiseat-with-displaylink-on-linux-gdm-up-to-2-20  http://www.ufpr.br  http://wiki.c3sl.ufpr.br/multiseat  http://www.c3sl.ufpr.br  http://git.c3sl.ufpr.br/gitweb?p=multiseat/mdm.git;a=summary  http://www.inf.ufpr.br/lnf07/en_us/publicacoes.html  http://www.inf.ufpr.br/lnf07/arquivos/apresentacoes/apresentacao-17evinci.pdf  http://www.inf.ufpr.br/lnf07/arquivos/apresentacoes/Multiterminal.pdf