Mimo UM-740 on Ubuntu Linux 9.10/10.04
What follows is some general information about getting the DisplayLink devices going on Ubuntu 9.10/10.04, specifically the Mimo UM-740 (with touchscreen).I found it pretty damn painful scraping together info from all over the net, so hopefully it's here in one place :(
By default, it seems Ubuntu understands about the displaylink device itself, and creates a /dev/fbX device, as well as a text console going on it.
This page libdlo.freedesktop.org/wiki/TextConsole - tells you how to get rid of the text console, but blacklisting loads of stuff seems a tad extreme.
You can edit /lib/udev/rules.d/80-drivers.rules and comment out the line beginning 'SUBSYSTEM=="graphics"' - which appears to start fbcon whenever a graphics device is plugged in... I don't know masses about this, but it seems to work well.
For the Mimo 740, the /dev/fb0 device is 800x480,16 bit. So you can quite happily just copy a raw RGB565 16 bit data file to /dev/fbX and have it displayed...
Ubuntu 10.04 Lucid Lynx
This has just got a whole lot easier - everything you need is in the Ubuntu distribution by default. You should be able to do:
sudo apt-get install xserver-xorg-video-displaylink xserver-xorg-input-evtouch
Then create an empty directory xorg.conf.d, and copy the following into a file called xorg.conf:
Section "ServerFlags" Option "AutoAddDevices" "False" Option "AllowEmptyInput" "False" EndSection Section "ServerLayout" Identifier "touchscreen" Screen 0 "DisplayLinkScreen" 0 0 InputDevice "dummy" InputDevice "Touch0" "CorePointer" EndSection Section "Files" ModulePath "/usr/lib/xorg/modules" ModulePath "/usr/local/lib/xorg/modules" EndSection Section "Device" Identifier "DisplayLinkDevice" Driver "displaylink" Option "fbdev" "/dev/fb1" EndSection Section "Monitor" Identifier "DisplayLinkMonitor" EndSection Section "Screen" Identifier "DisplayLinkScreen" Device "DisplayLinkDevice" Monitor "DisplayLinkMonitor" SubSection "Display" Depth 16 Modes "800x480" EndSubSection EndSection Section "InputDevice" Identifier "Touch0" Driver "evtouch" Option "Device" "/dev/input/by-id/usb-e2i_Technology__Inc._USB_Touchpanel_L000000000-event-if00" Option "DeviceName" "touchscreen" Option "MinX" "630" Option "MinY" "31000" Option "MaxX" "31700" Option "MaxY" "1000" Option "DragTimer" "200" Option "MoveLimit" "600" Option "ReportingMode" "Raw" EndSection Section "InputDevice" Identifier "dummy" Driver "void" Option "Device" "/dev/input/mice" EndSection
Make sure the line 'Option "fbdev" "/dev/fb1"' points to the correct framebuffer device (probably the last one you've got)
Then you can just run:
sudo xinit xclock -- :1 -config `pwd`/xorg.conf -configdir `pwd`/xorg.conf.d -sharevts
and you should see a clock. This doesn't share the desktop at all - it's an entirely new X server (which is great for monitoring/etc - but not so much for other things). Hopefully you could copy the 'Device' and 'Monitor' sections into your main xorg.conf and get the monitor as an extension to your main desktop, but I haven't tried this.
This isn't ideal as it doesn't use the displaylink driver (so it might not be as quick). But hey, there's no compiling or anything this way - see the X11 section below for info about the displaylink X module.
Note 1 : It seems Lucid uses an X config directory by default now - /usr/lib/X11/xorg.conf.d - and this contains stuff which appears to 'claim' any touchscreens that are connected for the main X server 0. If the touchscreen isn't working on a separate X server, it might be worth removing all the touchscreen-related entries from it - specifically:
Comment out the touchscreen bit at the bottom on of /usr/lib/X11/xorg.conf.d/05-evdev.conf (with #)
Comment out everything in /usr/lib/X11/xorg.conf.d/10-evtouch.conf
Either that, or it looks like it may just need calibrating. http://tias.ulyssis.org/calibration/
Note 2: it looks from http://lists.freedesktop.org/archives/libdlo/2009-September/000348.html as if you can use evdev for touchscreen input without even installing/using evtouch. I haven't tried this though...
Note 3: if you want your device on the same X server you're probably best off looking at the xorg.conf from somewhere like the following link - and maybe ignoring Note 1: http://lists.freedesktop.org/archives/libdlo/2009-September/000349.html
Ubuntu 9.10 Karmic
X11
Getting X going should be possible with the fbdev driver, but there's also a proper displaylink driver which I used. Compiling is relatively easy...
(do this in a temporary directory)
sudo apt-get install linux-headers-$(uname -r) xorg-dev wget http://projects.unbit.it/downloads/udlfb-0.2.3_and_xf86-video-displaylink-0.3.tar.gz tar -xvf udlfb-0.2.3_and_xf86-video-displaylink-0.3.tar.gz cd xf86-video-displaylink ./configure make sudo make install sudo ln -s /usr/local/lib/xorg/modules/drivers/displaylink_drv.so /usr/lib/xorg/modules/drivers/displaylink_drv.so
For my uses, I created a separate xorg file called 'xorg_touch.conf' and ran a separate X server. Example file is below (note you'll need the touchscreen stuff from below)
Section "ServerFlags" Option "AutoAddDevices" "False" Option "AllowEmptyInput" "False" EndSection Section "ServerLayout" Identifier "touchscreen" Screen 0 "DisplayLinkScreen" 0 0 InputDevice "dummy" InputDevice "Touch0" "CorePointer" EndSection Section "Files" ModulePath "/usr/lib/xorg/modules" ModulePath "/usr/local/lib/xorg/modules" EndSection Section "Device" Identifier "DisplayLinkDevice" driver "displaylink" Option "fbdev" "/dev/fb0" EndSection Section "Monitor" Identifier "DisplayLinkMonitor" EndSection Section "Screen" Identifier "DisplayLinkScreen" Device "DisplayLinkDevice" Monitor "DisplayLinkMonitor" SubSection "Display" Depth 24 Modes "800x480" EndSubSection EndSection Section "InputDevice" Identifier "Touch0" Driver "evtouch" Option "Device" "/dev/input/by-id/usb-e2i_Technology__Inc._USB_Touchpanel_L000000000-event-if00" Option "DeviceName" "touchscreen" Option "MinX" "630" Option "MinY" "31000" Option "MaxX" "31700" Option "MaxY" "1000" Option "DragTimer" "200" Option "MoveLimit" "600" Option "ReportingMode" "Raw" EndSection Section "InputDevice" Identifier "dummy" Driver "void" Option "Device" "/dev/input/mice" EndSection
Then you can just run:
sudo xinit xclock -- :1 -config /full/path/to/xorg_touch.conf -sharevts
Where xclock is whatever app you want to run. Note that if you do this, the keyboard goes to *both* displays. I have heard using a separate vt with the 'vt08' option (instead of -sharevts) may fix this.
Touchscreen
Note: The Lucid Lynx (10.4) kernel usbtouchscreen module actually contains the code for the E2I touchscreen, and it 'just works' out of the box. So you can safely ignore all the stuff in this section.
At least for me it appears as /dev/input/by-id/usb-e2i_Technology__Inc._USB_Touchpanel_L000000000-event-if00
It seems the Mimo UM-740's e2i touchscreen isn't supported by Ubuntu yet. You can check by plugging in the display and running
lsusb
You should get something like:
Bus 002 Device 006: ID 17e9:401a Newnham Research Bus 002 Device 005: ID 1ac7:0001 Bus 002 Device 004: ID 0ac8:c339 Z-Star Microelectronics Corp. Bus 002 Device 003: ID 058f:6254 Alcor Micro Corp. USB Hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
If the line containing 1ac7:0001 has nothing after it, you don't have the correct kernel module and you'll have to do what is below...
NOTE: The usbtouchscreen module that is in the upstream kernel does seem to support this fine, so hopefully at some point it'll work its way down to Ubuntu and the display will be almost plug and play :) Link to a copy of usbtouchscreen that supports E2I already: lxr.free-electrons.com/source/drivers/input/touchscreen/usbtouchscreen.c
You need the file e2itouch.diff from here: markmail.org/message/oyflembp52hwvcpl
Then do the following:
sudo apt-get install xserver-xorg-input-evtouch dpkg-dev apt-get source linux-image-$(uname -r) cd linux-* cp -vi /boot/config-`uname -r` .config cd drivers/input/touchscreen patch -p1 < e2itouch.diff
Now you may want to add the line:
#define CONFIG_TOUCHSCREEN_USB_E2I
to usbtouchscreen.c, right after the line:
//#define DEBUG
This may not be needed, but it doesn't hurt... Finally you build the module and install it...
make -C /usr/src/linux-headers-`uname -r` M=`pwd` modules sudo make -C /usr/src/linux-headers-`uname -r` M=`pwd` modules_install sudo depmod -a
And then when you run X as described above, it should all work....
Java
Note that you can also use the whole thing *without* X11 (although you'll still need the touchscreen driver above to get anywhere with input). Getting the X and Y values from the touchscreen can be done direct from the event interface. The following site isn't for this specific touchscreen, but it should work fine to get the values: www.opentom.org/Hardware_Touchscreen
The Java code to render directly to the screen from an Image is:
static void outputImage(BufferedImage buffer) { DataBufferInt dbi = (DataBufferInt)(buffer.getRaster().getDataBuffer()); int rgb[] = dbi.getData(); byte dpy[] = new byte[800*480*2]; int n = 0; for (int i=0;i<800*480;i++) { short s = (short)(((rgb[i]&0xF8)>>3) | ((rgb[i]&0xFC00)>>5) | (rgb[i]&0xF80000)>>8); dpy[n++] = (byte)(s & 0xFF); dpy[n++] = (byte)((s>>8) & 0xFF); } try { DataOutputStream fw = new DataOutputStream(new FileOutputStream(new File("/dev/fb0"))); fw.write(dpy); fw.close(); } catch (Exception e) { e.printStackTrace(); } } static void test() { BufferedImage im = new BufferedImage(800,480,BufferedImage.TYPE_INT_ARGB); // render some stuff using im.getGraphics() outputImage(im); }
Links
libdlo.freedesktop.org/wiki/HowTo
plugable.com/2009/11/16/setting-up-usb-multiseat-with-displaylink-on-linux-gdm-up-to-2-20/
Thanks to Florian Echtler for coming up with the E2I patch in the first place - which really saved the day :)
I got information from a bunch of other places too. Sorry if I haven't linked to you or given you credit.