9 USB displays illuminate energy security

Posted on 26. Jan, 2010 by Bernie Thompson in udlfb

Here’s a great application for USB displays.

Hal Glenn from 2G Engineering has created an information display (on energy security and alternative methods of energy generation) with 9 USB touch screens, all running off a single Mac Mini running Ubuntu 9.10. And all using the available open source DisplayLink drivers and scripts and info at displaylink.org.

Doing this without USB displays would

  • Require a big desktop box to support several PCIe graphics cards
  • Would have triple the cords – Hal’s setup runs a single USB cable to each display. With VGA, you’d still need the USB cable (for touch function), but then would also need VGA and power to each!
  • Would consume much more power – which would be kind of embarrassing for an energy security display, wouldn’t it?

Hal’s setup builds on and extends some of the USB terminal scripts demoed during this talk at Linux Plumbers Conference 2009.

There are several reasons why this demo is easiest on Linux, one of which is by default, DisplayLink devices are limited to 6 displays on Windows and Mac. The Linux drivers have no limit, so you can connect as many displays as you like — keeping in mind you’re sharing a 480Mbs bus (that itself has a 127 device limit). But it is enough for the apps Hal is running on those nine 800×480 touchscreens.

It will be interesting to see how many screens people get up to for various applications.

Linux USB multiseat audio support

Posted on 20. Jan, 2010 by Bernie Thompson in udlfb

Here’s how to add audio support on top of the previous instructions for getting USB multiseat running on Linux, with a Plugable UD-160-A type device.

Add the following line to the bottom of the /lib/udev/rules.d/50-usbseat.rules file created per the previous instructions.

KERNEL=="control*", SUBSYSTEM=="sound", SUBSYSTEMS=="usb", PROGRAM="/bin/cat /sys/%p/../../../../../devnum", SYMLINK+="usbseat/%c/sound"

Then create a new /etc/X11/Xsession.d/50usbseat file which will be run at Xsession create time, with the following contents

oldIFS=$IFS
IFS=:
set $DISPLAY
IFS=.
set $2
SEAT_ID=$1
LN=`ls -al /dev/usbseat/$SEAT_ID/sound`
IFS=C
set $LN
CARD_ID=$2
export ALSA_CARD=$2
export ALSA_PCM_CARD=$2
IFS=$oldIFS

Each of the users who might need access to the USB devices needs to be added to the ‘audio’ group. On Ubuntu 9.04, this can be done with these commands to backup and then modify the groups (replace MY_USERNAME, of course) …

sudo cp /etc/group /etc/group_backup
sudo chmod a-wx /etc/group_backup
sudo adduser MY_USERNAME audio

See Ubuntu Sound TroubleShooting for details on that step.

Now, as you connect UD-160-A terminals, a new X instance and GDM login will pop up as before, but also each of them will have /dev/usbseat/%SEAT_ID%/sound linking to their sound device, and the ALSA_CARD environment variable for all processes off of that X session, set to the matching sound card ID. For apps which support ALSA/Pulse (like most browsers, flash, etc.), audio will now come out the correct terminal — all in a completely plug-and-play fashion.

If you’re wondering what the strange IFS stuff is in the above script, it’s bash’s built-in Internal Field Separator variable, which is an easy way to split strings without having to launch a separate sed or awk process.

Note, as before, these instructions are specific to and tested on an older version of Ubuntu: 9.04, and may need to be ported to other distros until the distros themselves integrate these scripts.

Thanks to Alexander Todorov’s earlier work on multiseat sound support, which demonstrated how to match the USB audio devices in udev, and which ALSA_ environment variables to set. Alexander reported some problems reliably matching the audio devices, but with these scripts (with limited testing so far), things are working as expected.

DisplayLink Linux Rotation

Posted on 02. Jan, 2010 by Bernie Thompson in udlfb

With a kernel framebuffer driver that supports defio (like the version of udlfb in testing at git.plugable.com), it’s possible to use the standard xf86-video-fbdev X driver, rather than a custom DisplayLink one.

One interesting gain is xf86-video-fbdev supports rotation with a custom option (note it disables DGA and xrandr when it rotated mode).

To enable, in the xorg.conf “Device” section, add a Rotate option, setting it to CW, CCW, or UD.

Section "Device"
  Identifier "dl"
  Driver "fbdev"
  Option "rotate" "CCW"
  Option "fbdev" "/dev/fb1"
EndSection

One downside is rendering is significantly slower, as the extra work of rotation is done at the X level and the page-fault behavior of defio means even small updates refresh much of the screen. Here’s some numbers that can be compared to earlier posts (in non-rotate mode):

bernie@bernie-aspireone:~/git/misc-udlfb$ ./udlfb-perf.sh fb0 gtkperf -a
Xlib:  extension "RANDR" missing on display ":3.0".
GtkPerf 0.40 - Starting testing: Fri Jan  1 09:47:20 2010
 
GtkEntry - time:  0.00
GtkComboBox - time:  3.73
GtkComboBoxEntry - time:  2.08
GtkSpinButton - time:  0.49
GtkProgressBar - time:  0.69
GtkToggleButton - time:  0.47
GtkCheckButton - time:  0.44
GtkRadioButton - time:  0.79
GtkTextView - Add text - time:  2.30
GtkTextView - Scroll - time:  1.24
GtkDrawingArea - Lines - time:  4.14
GtkDrawingArea - Circles - time:  4.56
GtkDrawingArea - Text - time:  4.11
GtkDrawingArea - Pixbufs - time:  0.90
 ---
Total time: 25.96
 
Quitting..
 
model name      : Intel(R) Atom(TM) CPU N270   @ 1.60GHz
model name      : Intel(R) Atom(TM) CPU N270   @ 1.60GHz
cpu MHz         : 800.000
cpu MHz         : 800.000
MemTotal:        2052144 kB
Framebuffer Mode: 1920,1080
 
Rendered bytes:  1238913024 (total pixels * Bpp)
Identical bytes: 1070725304 (skipped via shadow buffer check)
sent bytes:      125732225 (compressed usb data, including overhead)
K CPU cycles:    7478653 (transpired, may include context switches)
 
% pixels found to be unchanged: 86.00 %
Compression of changed pixels : 25.00 %
Total CPU cycles spent per input pixel: 6
Total CPU cycles spent per output pixel: 59
USB Mbps: 35.52 (theoretical USB 2.0 peak 480)
Page 6 of 10« First...4567810...Last »