Remote display

From OLPC

(Redirected from Remote Display)
Jump to: navigation, search
This describes how to control/display your XO-computer from a non-XO PC or Mac or Linux box, or how to hook up the XO to an external VGA monitor or projector. To display another computer's output on your XO's screen, see Reverse remote display

If you are trying to project the user interface of an XO laptop, this page is for you. It describes how to bring up the user interface of an XO laptop (the source computer) across the network on another computer running X11 or Windows (the display computer). Three methods are described below. The first method lets you run a remote Sugar session on the display computer. Using the second method, the current Sugar session is cloned to the display computer. The third method (which isn't actually using the network) requires a soldering iron.

Contents

[edit] First method: direct output, via USB or VGA

It has been suggested that this article or section be merged with Remote display. (Discuss)


[edit] Adding an USB-SVGA adapter

It is possible to make use of the USB connectors on the XO to plug in an USB-SVGA adapter. Note that Linux supports these kind of chips with the sisusbvga driver for the kernel side and sisusb module for the Xorg side. The hardware we used is branded as blue box and detected as :

Bus 004 Device 005: ID 0711:0900 Magic Control Technology Corp. SVGA Adapter

This driver supports cards based on the Net2280/SiS315 chipset, according to the author's page here. Some devices reported to work according to the NSLU2 wiki

Important notice : unless you compiled the sisusbvga module for your kernel, the module can possibly not be fully powered on, do not think the XO is not powerful enough to handle it, just insert the module to make sure it gets powered on.

[edit] Compiling the kernel module

You will need to follow the instructions about rebuilding your kernel at Rebuilding_OLPC_kernel

Modify the olpc_defconfig to include the SiS USB-SVGA driver :

diff --git a/arch/i386/configs/olpc_defconfig b/arch/i386/configs/olpc_defconfig
index 8439431..74abf3b 100644
--- a/arch/i386/configs/olpc_defconfig
+++ b/arch/i386/configs/olpc_defconfig
@@ -215,7 +215,6 @@ CONFIG_NR_QUICK=1
 # CONFIG_MATH_EMULATION is not set
 # CONFIG_MTRR is not set
 # CONFIG_SECCOMP is not set
-# CONFIG_VGA_NOPROBE is not set
 CONFIG_HZ_100=y
 # CONFIG_HZ_250 is not set
 # CONFIG_HZ_300 is not set
@@ -1711,7 +1710,8 @@ CONFIG_USB_SERIAL_PL2303=m
 # CONFIG_USB_IDMOUSE is not set
 # CONFIG_USB_FTDI_ELAN is not set
 # CONFIG_USB_APPLEDISPLAY is not set
-# CONFIG_USB_SISUSBVGA is not set
+CONFIG_USB_SISUSBVGA=m
+CONFIG_USB_SISUSBVGA_CON=y
 # CONFIG_USB_LD is not set
 # CONFIG_USB_TRANCEVIBRATOR is not set
 # CONFIG_USB_IOWARRIOR is not set

Note that we actually chose to have support for the console on the driver, which is not mandatory but can be convenient when testing.

Now recompile your kernel using this olpc_defconfig. The newly generated kernel RPM package will include this driver.

[edit] Including the driver in the OLPC development image

Now that you compiled the kernel it would be good to have it included into a testing image. Assuming that you use pilgrim, apply the following patch to get the xorg module installed as well as the kernel module not being removed by the installer script :

diff --git a/streams.d/olpc-development.stream b/streams.d/olpc-development.stream
index 58fdd0b..5a8c608 100755
--- a/streams.d/olpc-development.stream
+++ b/streams.d/olpc-development.stream
@@ -70,6 +70,7 @@ xorg-x11-drv-evdev
 xorg-x11-drv-keyboard
 xorg-x11-drv-mouse
 xorg-x11-drv-cirrus
+xorg-x11-drv-sisusb
 xorg-x11-utils
 xorg-x11-xinit
 xorg-x11-xauth
@@ -535,7 +536,7 @@ EOF
     mkdir -p $INSTALL_ROOT/etc/sysconfig/modules
     cat <<EOF > $INSTALL_ROOT/etc/sysconfig/modules/olpc-1.modules
 #!/bin/sh
-module_list="i8042 i2c-dev sdhci dcon_bl gxfb_dcon psmouse ovcamchip cafe_ccic cafe-nand battery-class olpc-battery mousedev evdev atkbd leds-olpc"
+module_list="i8042 i2c-dev sdhci dcon_bl gxfb_dcon psmouse ovcamchip cafe_ccic cafe-nand battery-class olpc-battery mousedev evdev atkbd leds-olpc sisusb"
 for i in \$module_list ; do
         modprobe \$i >/dev/null 2>&1
 done
@@ -1315,6 +1316,10 @@ EOF
        lib/modules/*/kernel/net/ieee80211/ieee80211*.ko \
        lib/firmware/*.bin | \
        cpio -O boot/olpcrd -o -A -c
+   # add the sisusb driver
+   echo " - Adding sisusb SVGA adapter driver"
+   ls  lib/modules/*/kernel/drivers/usb/misc/sisusbvga/sisusbvga.ko | \
+       cpio -O boot/olpcrd -o -A -c
     case $VARIANT in
        ext3|devel_ext3)
            # the piix ide drivers are only needed for emulation


[edit] Compiling the xorg module

The package xorg-x11-drv-sisusb is outdated and therefore will cause ABI mismatch between this particular module and the Xorg server. As I could not recompile this module, I used an Ubuntu package to get the sisusb_drv.so file.

mkdir -p extract/
wget http://fr.archive.ubuntu.com/ubuntu/pool/main/x/xserver-xorg-video-sisusb/xserver-xorg-video-sisusb_0.8.1-9_i386.deb
dpkg -x xserver-xorg-video-sisusb_0.8.1-9_i386.deb extract/
scp extract/usr/lib/xorg/modules/drivers/sisusb_drv.so olpc@laptop:/usr/lib/xorg/modules/drivers/

Now that the module is copied to the laptop, we can start with the Xorg configuration file.

[edit] Configuring the Xorg

Add a monitor section for your projector :

Section "Monitor"
        Identifier      "Monitor1"
        ModelName       "Monitor Model"
        Option          "DPMS"
EndSection

and a device section for the SiS USB-SVGA device :

Section "Device"
        Identifier      "Card1"
        Driver          "sisusb"
EndSection

Kill your existing Xorg server and restart it with olpc-dm.

[edit] Binaries

If you wish to get started quickly, here are some binaries :

Kernel module : sisusbvga.ko Xorg server module :sisusb_drv.so

Those modules can be used with joyride builds >= 1597.

To install those binaries:

mkdir -p /lib/modules/`uname -r`/kernel/drivers/usb/misc/sisusbvga/
cp sisusbvga.ko /lib/modules/`uname -r`/kernel/drivers/usb/misc/sisusbvga/
depmod
cp sisusb_drv.so /usr/lib/xorg/modules/drivers/


WARNING: The Kernel module and the Xorg server module file links are NOT working!!! Anyone can repost these files please?

[edit] Pictures

Here are some pictures of the OLPC working with the USB-SVGA adapter.


[edit] Hacking into the on-board VGA output

While on Gen1 XO laptops (the B1/B2/B3/C1/MP builds) it will continue to be possible to attach a VGA connector to the XO motherboard, making use of it requires soldering a jumper (pins 1 and 3 of CN18) and cutting the laptop case to make room for it. In B3/C1/MP versions, additional required passive components will not be populated on the motherboard (but are easier to obtain than the required VGA connector!)

Caveats :

  • One problem with this approach (on B2, but not B3/C1/MP machines) is a weird gamma correction currently applied by software to fix a hardware wiring error.
  • An additional problem is that many displays are very unhappy with the 1200x900 resolution video output by default by the XO laptop.


[edit] Second method: remote and cloned Sugar sessions

[edit] Remote Sugar session (using X11)

[edit] Preparations

Note: This method of access can be very slow

There are some harmless changes to the XO which only need to be done once. You will need to assign a password to the olpc user, and create the script which is remotely executed to start Sugar.

To assign a password to the laptop user, obtain a console window, either through the debugging interface accessed by alt + "=", or by bringing up a console with ctl + alt + Image:Mesh_key_f1_small.png (ctl + alt + F1 on a PC keyboard). Become root and change the password by typing:

su
passwd olpc
exit

Now go to the laptop user's home directory, and create the script which will start sugar:

cd /home/olpc
cp /usr/bin/olpc-session remotedisplay
chmod a+x remotedisplay

[edit] Stopping Sugar on the XO

Due to current limitations of Sugar, there can only be one copy of Sugar running on any given XO. This will mean that you need to shut down Sugar and X on the XO from which you want to forward the user interface. There are several ways you can do this, but the simplest (and temporary) way is to first change to the console, by typing control + alt + F1 (Eye). Log in as root, then change the runlevel of the XO to runlevel 3 by typing:

init 3

After doing this, the XO should still be associated with any wireless network it already found, but it will have forgotten about its IP address. You need to manually request an address using:

ifup eth0

If this doesn't work because you aren't associated with a wireless network, you can manually bring up the network using:

iwconfig eth0 essid "some local wifi SSID"
ifup eth0

You can get a list of the local WiFi networks using

 iwlist s eth0

Check the network address assigned to the XO by DHCP, as you will need it for the next steps.

 ifconfig eth0

[edit] Bringing up the display remotely

At this point, you will need a version of X on the display computer which is running bare (no display or session manager). The easiest way seems to be to create a new user on the display computer, and give them an .xinitrc (or .xsession file under Debian) which consists simply of:

ssh olpc@xo-ip-address -C -X /home/olpc/remotedisplay

[edit] Cloning a current Sugar session (using VNC)

Note: These methods do not allow mouse or keyboard input on the remote display (unless you explicitly enable it as per below).

The following guide has been put in to VncLauncher Activity. Please download from VncLauncher-1.xo. The activity will run you olpc as a server. You only need to run the viewer (UltraVNC or VNCViewer) on the client side.

x11vnc is known to work, does not require messing with passwords, and will allow mouse movement input, but still no mouse buttons or keyboard (but see end of section on how to enable these). This can be achieved as follows:

 rpm -i ftp://rpmfind.net/linux/dag/fedora/7/en/i386/RPMS.dries/x11vnc-0.9.3-1.fc7.rf.i386.rpm

You can search for the latest x11vnc package at [rpmfind.net] Note, if rpm gets an unexpected error in the middle, you may have too many activities running (not enough memory?). Try closing everything but the Terminal window.

After the yum and rpm steps complete successfully, simply running 'x11vnc' as user olpc (don't forget an 'su - olpc' if you're still root from before!) on the XO (e.g., via terminal or through ssh session) will open a password-less VNC session to which to connect with vncviewer.

[UltraVNC] works well for Windows, and it's Resize option is helpful to display the XO's 1200x900 on an e.g. 1024x768 laptop screen to project during a demo.

One problem is that the mechanism to show the "border" (the activities launcher at the bottom and Home etc. icons on top) does not show when you move the mouse pointer in vncviewer to the sides/corner... at least with x11vnc; I haven't tested yet if this better with vncserver; update this if you do.

[edit] Alternatively

Install and run x0vncserver on the XO computer. The display computer runs a vncviewer that clones the XO display. (Note that this method will not work yet when the laptops are in mesh mode—we need to do packet-forwarding on the School Server to enable the vnc connection. Until then, put the laptop in infrastructure mode by using an access point for your network access. If you want to project from a machine running Linux with a recent kernel, you can compile the Marvell driver on it and add an 8388 dongle in mesh mode to communicate with XOs in the mesh.)

[edit] Preparations

You have to fetch and install the vnc-server on the XO computer. Login as root to a shell, and run the following:

 rpm -i -v --nodeps ftp://rpmfind.net/linux/fedora/core/updates/6/i386/vnc-server-4.1.2-9.fc6.i386.rpm

You can search for a newer package at rpmfind.net.

Now, login as an olpc user and create a password for vnc sessions.

 cd /home/olpc
 vncpasswd

Create an activation script for the x0vncserver, still as olpc user, using vi or nano or cat:

 File: ~/x0server
#!/bin/sh
nice -19 x0vncserver PasswordFile=/home/olpc/.vnc/passwd AcceptPointerEvents=0 AcceptKeyEvents=0 &
disown

The x0vncserver must run very very nicely (nice -19), since otherwise it takes all available CPU and leaves no room for other processes to run. The last two options of the x0vncserver (AcceptPointerEvents and AcceptKeyEvents) runs the server in a "view only" mode.

Don't forget to make the script executable.

 chmod a+x /home/olpc/x0server

[edit] Just before the presentation

The XO computer and the display computer should be on the same Wifi network (or, depending on the Wifi network there, stability may be better off connecting via Ethernet: XO - USB ethernet adaptor - ethernet cable - USB ethernet adaptor - other laptop hooked up to projector). You will need to know the IP of the XO computer (run /sbin/ifconfig eth0 if you don't know it). Now, from within Sugar, open a console (Alt-0 or Alt-=), and run the /home/olpc/x0server script you have prepared in advanced.

 /home/olpc/x0server

It will write to the console; then you can close the console.

 main: XTest extension present - version 2.2
 main: Listening on port 5900

In the display computer, run the vnc client/viewer.

 vncviewer xxx.xxx.xxx.xxx FullScreen=1 ViewOnly=1

or, on some clients,

 vncviewer xxx.xxx.xxx.xxx -fullscreen -viewonly

Where xxx.xxx.xxx.xxx is the XO computer IP address.

In order to close the vnc viewer, press F8 in the displaying computer. This is the escape key which gives you a context menu with various options. You can change the full-screen mode, exit the viewer, and set other options as well.

[edit] Caveats

  • Modifying WiFi: Whatever you do, don't click on the WiFi signal strength when using the remote display. Even if you select the network you are already using, you will freeze the display.
  • 'Screen resolution : The vnc server dies when the resolution is changed. You will have to restart the server and the client if the screen orientation is changed.

[edit] Enabling Keyboard and Mouse

By default, the XTEST extension is disabled for security reasons. To enable keyboard and mouse usage through a VNC connection, you can enable the XTEST extension by modifying /etc/X11/xorg.conf, changing the line:

 Option "XTEST" "Disable" # Mostly a debugging tool

either by commenting it out:

 # Option "XTEST" "Disable" # Mostly a debugging tool

or explicitly enabling it:

 Option "XTEST" "Enable" # Mostly a debugging tool

Be sure to omit the '-viewonly' option to vncviewer when connecting.

[edit] Simple emulation (no XO required)

Given a proper network (fast DSL/LAN) and a fast qemu server your presentation can be fast and authentic.


[edit] Server side

First start the qemu session on the host:

  qemu -kernel-kqemu -vnc 0 -k en-us olpc-redhat-stream-development-devel_ext3.img

The flag -vnc 0 tells qemu to direct the VGA output to the VNC session 0.

Next connect with a proper VNC viewer on your laptop/PC which has the VGA output .

[edit] client: Mac OS X

On Mac OS X Chicken of the VNC can not properly handle the VGA output of the qemu emulation. So, instead use VNCviewer Direct VNCViewer to your host running the qemu instance and set it to fullscreen. Voila! You should have a much faster remote access possibility than with X11 forwarding.

[edit] client: Windows

Use UltraVNC:

Image:Uvncpic.png


Please note that sometimes with UltraVNC you have to play around with the speed settings so that the screen does not refresh all the time to fast.

[edit] client: Linux

you know your stuff anyway. Use vncviewer from apt or yum --AaronKaplan 21:45, 17 June 2007 (EDT)

Personal tools
  • Log in / create account
About OLPC
About the XO
Projects
OLPC wiki
Toolbox