Posts tagged ‘Video’

I bought a Sewell USB External Video Card as I wanted to extend my 2 monitor setup on my desktop machine into a 3 monitor setup. The desktop machine is my ‘beefiest’ rig and it’s where I do work when home. I mainly run Linux – Ubuntu 9.04 (64 bit) – and then fire up VMware Workstation when I need to get into Windows to do other stuff. When in Windows via VMware Workstation I put it in fullscreen mode then have it grab the other monitor so that Windows is full screen’d across both monitors. This works great but I’m finding now it would be helpful to have a 3rd monitor for VMware Workstation to use: enter DisplayLink.

DisplayLink lets you attach monitors via USB 2.0 and has official drivers for Windows & Mac. I’ve used my Sewell device on both Windows [Vista Ultimate (64 bit) & XP Professional (32 bit)] and Mac [OS X (10.5.7) with beta DisplayLink driver] and it works just fine. Attaching extra monitors is painless and for my use the refresh rate is just fine (I’m not watching movies or anything on the DisplayLink device). Now comes Linux.

I want to use the device with my desktop machine to add a 3rd monitor but the closest I’ve come is getting 2 monitors going on a different laptop machine and the rest of this post will be directed at how I accomplished this. I’ll be using a package created by Roberto De Ioris found on the Libldo mailing list. Additionally, a lot of the steps I take are from various posts and references on the Libldo mailing list as well.

I’m using an old laptop that I have – a Lenovo 3000 N100 clunky beast – with Ubuntu 8.10 (32 bit). I installed Ubuntu onto the laptop after resizing the primary Windows partition to make room for Ubuntu.

Once Ubuntu was installed I did this (and I’m using Gnome so if your menus don’t match up then that’s why):

  1. Open a terminal (Applications > Accessories > Terminal)
  2. sudo apt-get update
  3. sudo apt-get install libusb-dev xorg-dev build-essential
  4. cd ~/Desktop
  5. wget http://projects.unbit.it/downloads/udlfb-0.2.3_and_xf86-video-displaylink-0.3.tar.gz
  6. tar xzvf udlfb-0.2.3_and_xf86-video-displaylink-0.3.tar.gz
  7. cd udlfb
  8. make && sudo make install && sudo depmod -a
  9. cd ../xf86-video-displaylink
  10. ./configure && make && sudo make install
  11. gksudo gedit /etc/X11/xorg.conf

Here’s where things may get a bit different for you depending on your existing xorg.conf file and what all you need to put in that file for your machine configuration. Essentially, we have to tell X that we’ll be using two screens. We need to add a new “Device” section, a new “Monitor” section, and a new “Screen” section at the minimum. Additionally, we need to modify the “Files” section (if it exists or add it if it doesn’t exist) so that X can find the displaylink_drv.so that we just built and we need to modify the “ServerLayout” section (if it exists or add it if it doesn’t exist) so that X knows we’re using two screens. You also need to tailor the “Modes” sections of the screens so that they match supported resolutions for your monitors. YOU CANNOT JUST COPY AND PASTE THIS NEXT SEGMENT.

Here is what my xorg.conf looks like:

# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# Note that some configuration settings that could be done previously
# in this file, now are automatically configured by the server and settings
# here are ignored.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
#   sudo dpkg-reconfigure -phigh xserver-xorg                                                                     

############ Original Video Settings ###########                                                                  

Section "Device"
        Identifier      "Configured Video Device"
EndSection

Section "Monitor"
        Identifier      "Configured Monitor"
EndSection

Section "Screen"
        Identifier      "Default Screen"
        Monitor         "Configured Monitor"
        Device          "Configured Video Device"
        SubSection "Display"
                Depth   24
                Modes   "1280x800"
        EndSubSection
EndSection

#################################################                                                                 

Section "ServerLayout"
        Identifier      "Server Layout"
        Screen  0       "Default Screen" 0 0
        Screen  1       "DisplayLinkScreen" LeftOf "Default Screen"
EndSection

#################################################                                                                 

Section "Files"
        ModulePath      "/usr/lib/xorg/modules"
        ModulePath      "/usr/local/lib/xorg/modules"
EndSection

############### DisplayLink Stuff ###############                                                                 

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   "1280x1024"
        EndSubSection
EndSection

So that’s what the xorg.conf looks like on the laptop.

The first section titled “Original Video Settings” is what was automatically created by Ubuntu during installation. I edited the screen section to explicitly indicate I wanted 1280×800 for the laptop’s screen resolution.

The next item in my xorg.conf is the “ServerLayout” section but I’m going to leave that alone for now and come back to it.

The next item in my xorg.conf is the “Files” section and it’s needed because when doing “sudo make install” in the xf86-video-displaylink directory it puts the displaylink_drv.so in a different place than where X normally looks (/usr/local/lib/xorg/modules as opposed to /usr/lib/xorg/modules).

The next item is the “Device”, “Monitor”, & “Screen” section for the DisplayLink device. The “Device” & “Monitor” sections can be copy/pasted as-is but make sure to modify the “Screen” section so that the “Display” sub-section has the correct resolution or resolutions that your monitor can use.

Back to the “ServerLayout” section – this is where you indicate the position of the monitors. Essentially what my file says is that the laptop screen will be the primary screen and to the left of it will be the DisplayLink screen. I should note that more advanced users might want to throw in a “Xinerama” “On” line but I haven’t been able to get things to work with Xinerama enabled (- X crashes when it starts). So for now leave any cloning/Xinerama/TwinView/MergedFb/BigDesktop/whatever else out of the config.

Plug the DisplayLink device’s USB connector into the computer and reboot! (NOTE: I was using a DVI -> VGA adapter on the DisplayLink device and that would cause it to not work so stick with DVI if you can).

Here’s what things look like for me:

  1. Computer booting:
  2. Ubuntu loading:
  3. DisplayLink screen turns green showing it working:
  4. X sees two screens (left side has htop on it, right side has a terminal on it):
  5. The Sewell USB External Video Card

So, that’s it! Since there’s no Xinerama (or other such program) running the monitors are separate and you can’t drag windows back and forth but the mouse should be able to move between the monitors and you can fire up separate applications on each screen.

Hopefully in the upcoming months the Linux driver will keep getting better and better and catch up with the Mac & Windows DisplayLink drivers.