Brandon Harris |

Matrox DualHead2Go, TripleHead2Go on Ubuntu, with ATI/AMD

I recently purchased a matrox dualhead2go digital edition off of ebay on a whim. I did this because I wanted to make use of some extra monitors sitting around the office. I have also come to the realization that I have grown up as a developer and I have enough confidence to look anyone straight in the eye and say – “Yes, I need 3 monitors”.

My current setup is a Dell XPS 1640 running Ubuntu 10.04, with a Radeon 3670 graphics card. Yeah, enter the wonderful world of linux graphics drivers.

My first attempt was to simply, plug it in and see what would happen, resulted in a mild success. I was able to have my laptop lcd set at a resolution of 1920×1080 and the two 1680×1050 monitors would only go up to 2560×1024. It looked warped, but it gave me a taste of what was possible.

After much configuring with xrandr —addmode, et. al ad nauseum, I came to the conclusion that the matrox just wouldn’t support a higher resolution than 2560×1024, even though the site claims that it will. Some searching prompted me to discover that you need to configure the device to support your desired resolutions using the matrox powerdesk tool. Windows and Mac users can rejoice, this exists for you both. Linux users, go get on that old Windows test box that you use for IE testing and configure this mutha.

Armed with the following resolutions 3360×1050, 3840×1080, I set to work on my dream display.

I hit another snag. I could crank the resolution on my laptop, or the two 22" monitors, but setting both to 11 caused really odd horizontal sync issues on my laptop. The text would be fuzzy and move from side to side. Clearly this wasn’t going to work using just Xrandr, and the Gnome Display tool.

This brings up another one of my errors. DO NOT USE THE GNOME DISPLAY TOOL after using the AMD/ATI Catalyst Control panel. The Gnome tool will nuke your xorg.conf file, and leave you scratching your head. Once you go FGLRX, forget that the Gnome display tool even exists, and trust yourself to learn the AMD/ATI Catalyst Control Panel as well as the aticonfig command line tool. If you are a complete badass and can handcraft your own xorg.conf file and modelines (why are you reading this?) skip ahead to the modeline cheats below.

I had clearly stepped into a limitation of the linux fglrx display driver, or so I thought. At one point, I had inadvertently nuked my xorg.conf file, so fglrx was no longer being loaded. (See cautionary statement above) I went through the relatively simple process of removing all traces of fglrx from my system. I reinstalled the proprietary drivers (because I also require dropshadows, and transparency, that’s how I roll) and set back to work.

Now the magic steps to make your mutliple display work:

1 Make sure you have the necessary modes available.
2 Add the modelines that you require to the display that you want them added to.
3 Set your resolution in the ATI/AMD Catalyst Control Panel

To see 1:

xrandr

Will display all the modes available for you devices.

I am going to cheat and give you the “magic” modelines needed by the Matrox DualHead2Go, TripleHead2Go:

DualHead:
2x 1680x1050:  ModeLine "3360x1050" 238.00 3360 3424 3488 3680 1050 1053 1061 1080 +HSync +VSync
2x 1600x1200:  ModeLine "3200x1200" 281.40 3200 3264 3456 3752 1200 1201 1206 1250 +HSync +VSync
2x 1920x1080:  ModeLine "3840x1080" 277.00 3840 3904 3968 4160 1080 1083 1092 1111 +HSync +VSync
2x 1920x1200:  ModeLine "3840x1200" 308.00 3840 3904 3968 4160 1200 1203 1213 1235 +HSync +VSync

TripleHead:
3x 1280x1024:  ModeLine "3840x1024" 254.31 3840 3856 3872 3976 1024 1025 1032 1066 +HSync +VSync
3x 1360x768:   ModeLine "4080x768"  200.38 4080 4104 4136 4200  768  771  779  795 +HSync +VSync
3x 1440x900:   ModeLine "4320x900"  320.10 4320 4400 4688 5712  900  903  915  934 +HSync +VSync
3x 1680x1050:  ModeLine "5040x1050" 326.66 5040 5104 5168 5376 1050 1053 1057 1066 +HSync +VSync

To add one of these to your display:

xrandr --newmode <Mode``Line>
xrandr --addmode DEVICE "AAAAxBBBB" 

Where DEVICE is the device name for your display, probably CRT1, DFP1, LVDS, etc. and the “AAAAxBBBB” is the name of the modeline that you copied from above. So in my case:

xrandr --newmode "3360x1050" 238.00 3360 3424 3488 3680 1050 1053 1061 1080 +HSync +VSync
xrandr --addmode CRT1 "3360x1050"

Then I popped open the AMD/ATI Catalyst Control Panel – Voila! that resolution showed up. I set all my monitors to their desired resolution and it worked.

To make you changes permanent add the xrandr commands to you .xprofile. I move around between monitors at home and at work, so I don’t make this too automatic. If you made it this far, you can probably google your way into a more automated setup. Will upload a pic tomorrow of the working setup.

Oracle, Rails and Ubuntu 10.04

I recently setup an Ubuntu based server that needed ruby to talk to oracle and mysql. If you are a rails developer, you should be familiar with mysql, but what about Oracle? It isn’t quite as straightforward as you might assume, but it is within the grasp of mere mortals. Please keep in mind that due to changing version numbers, all version numbers are replaced with *. It is up to the reader to properly translate the following commands. Don’t simply copy and paste. I am making the assumption that you are installing on Ubuntu 10.04 (Lucid Lynx) and you are using the 64-bit version.

First Go to:
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxx86_64.html

Select the latest versions of:

oracle-instantclient*-basiclite-*.rpm
oracle-instantclient*-sqlplus-*.rpm
instantclient-sdk-*.zip

Replace the * above with the appropriate latest version number.

Now you will need to install the alien package management tool. It converts .rpm to .deb and works amazingly well most of the time.

sudo apt0get install alien

Now run the alien command on the rpms you downloaded from oracle:

sudo alien oracle-instantclient*-basiclite-*.rpm
sudo alien oracle-instantclient*-sqlplus-*.rpm

This will produce .deb files in your current directory. To install the freshly minted pacakges run:

sudo dpkg -i oracle-instantclient-*.deb

Now unzip the sdk contents, you need to extract the header files for everything to work later.

unzip instantclient-sdk-*
cd instantclient-sdk-*/include/
cp *.h /usr/include/oracle/<version>/client64/lib

If you are going to be using the tnsnames.ora file to specify your connections, you will need to set the TNS_ADMIN environment variable. In Debian based distros, you will want to edit /etc/environment. Editing this file ensures that environment variables are set for all users.

Add the following environment variables to your /etc/environment file.

LD_LIBRARY_PATH=/usr/lib/oracle/<version>/client64/lib
TNS_ADMIN="your path to your tnsnames.ora file"

You are all set for interacting with oracle from your Ubuntu server. To test just run:

sqlplus64

If you would like to enable your rails app to use oracle as well you have a few more steps.

sudo gem install ruby-oci8

If that fails, you may need to specify to LD_LIBRARY_PATH:

sudo gem install LD_LIBRARY_PATH=$LD_LIBRARY_PATH ruby-oci8

Pay close attention to errors if you receive them, they are actually very clear and coherent. Pay close attention to your environment variables and the inclusion of the header files.

If you have reached this point you can test your oci8 connection:

1 irb
2 irb(main):001:0>require 'rubygems'
3 => true
4 irb(main):002:0>require 'oci8'
5 => true
6 irb(main):003:0>oracle_connection = OCI8.new(user,password,schema)
7 => #<OCI8:RTD_ODBC>
8 irb(main):004:0> oracle.exec("select 1 from dual")
9 => #<OCI8::Cursor:0x7f9ea9a72430>

Now if you are planning on using Ruby on Rails with Oracle, you will need to install the activerecord adapter. I used the enhanced adapter, but the choice is yours.

sudo gem install activerecord-oracle_enhanced-adapter

Now the final part, your database.yml file should look like the following:

1 production: 
2   adapter: oracle_enhanced 
3   database: <oracle database>
4   username: <oracle username>
5   password: <oracle password>

The oracle enhanced adapter has some more config options for your database.yml file, please refer to:
http://wiki.github.com/rsim/oracle-enhanced/

Dell Studio 15 "White Screen of Death" Karmic Koala Workaround

It’s a horrible feeling to watch your system die after an upgrade. You may have experienced this problem before. Fear not, there is a workaround, and you will be back into your computer in no time. Just follow these directions, they may appear slightly more advanced than what you might be used to, but this can be fixed.

Add “nomodeset” to the boot options in grub. Use vim (or nano, or whatever you like to use) to edit the boot options. If you are booting from your hard drive on a recent upgrade, you can hit “Esc” at the grub boot screen and select the kernel after 2.6.31.

In my case it was 2.6.28-16. You will be booting into Karmic with an Intrepid Kernel, don’t be surprised if some stuff doesn’t work perfectly, you are just doing this to have a way to edit the grub configuration.

Once you get into your system, do the following:

sudo vim /boot/grub/menu.lst

Change:

title           Ubuntu 9.10, kernel 2.6.31-14-generic
uuid            76c6b53b-0181-4ebe-af5e-2abe3db988d7
kernel          /boot/vmlinuz-2.6.31-14-generic root=UUID=76c6b53b-0181-4ebe-af5e-2abe3db988d7 ro xforcevesa quiet splash
initrd          /boot/initrd.img-2.6.31-14-generic
quiet

title           Ubuntu 9.10, kernel 2.6.31-14-generic (recovery mode)
uuid            76c6b53b-0181-4ebe-af5e-2abe3db988d7
kernel          /boot/vmlinuz-2.6.31-14-generic root=UUID=76c6b53b-0181-4ebe-af5e-2abe3db988d7 ro xforcevesa  single
initrd          /boot/initrd.img-2.6.31-14-generic

To read like this:

title           Ubuntu 9.10, kernel 2.6.31-14-generic
uuid            76c6b53b-0181-4ebe-af5e-2abe3db988d7
kernel          /boot/vmlinuz-2.6.31-14-generic root=UUID=76c6b53b-0181-4ebe-af5e-2abe3db988d7 ro xforcevesa quiet splash nomodeset
initrd          /boot/initrd.img-2.6.31-14-generic
quiet

title           Ubuntu 9.10, kernel 2.6.31-14-generic (recovery mode)
uuid            76c6b53b-0181-4ebe-af5e-2abe3db988d7
kernel          /boot/vmlinuz-2.6.31-14-generic root=UUID=76c6b53b-0181-4ebe-af5e-2abe3db988d7 ro xforcevesa  single nomodeset
initrd          /boot/initrd.img-2.6.31-14-generic

Don’t just copy-paste from this post, simply add “nomodeset” to the end of the line that starts with the word “kernel”, and only do this for the 2.6.31-14 kernel.

Reboot, and watch as you boot into your new Karmic upgrade.

This bug is being worked on in this ticket

Keep in mind that any new kernel updates might need this same workaround if you experience the “White Screen of Death”.

Blame AUO for jacking up the EDID for the panel, blame Dell for picking cheap parts, blame yourself for buying cheap hardware, certainly don’t blame the hardworking developers who provide you a great OS, they are hard at work fixing these issues.

Upgrade from 8.10 to 9.04

My upgrade from Intrepid to Jaunty went smoothly. I run off of a Dell Studio 15 with an external monitor at work. Unfortunately, this creates a virtual screen size greater than 2048×2048 which is an issue with the intel graphics driver, not compiz, so I unfortunately cannot enjoy the bling. However, when I am remote, compiz works great. Metacity is great, but after being spoiled by the eye candy it is hard to go back. This is coming from a guy whose favorite window manager was Enlightenment

The popups on Jaunty have received a major facelift and are more pleasant. The login screen has changed, as well as the bootup splash screen. In my normal use, I have not stumbled upon any issues. If you have a similar setup, feel free to take the automatic upgrade path.

EDIT: Two things that have annoyed me, that might annoy you:

I prefer to restart the X server through keystroke: Re-Enable Ctrl + Alt + Backspace

  sudo apt-get install dontzap
  sudo dontzap --enable

Enable blacklisted X3100 (GMA965) graphics for compiz:

  echo &quot;SKIP_CHECKS=yes&quot; &gt;&gt; ~/.config/compiz/compiz-manager

There is a bug in the intel driver that has caused it to become blacklisted. Enable at your own risk, but since we have been running this driver for a while, it is probably safe.

Tags

  • e (1)