Correcting display issues in Ubuntu


I recently decided to start using Ubuntu inspired partly by an Open-Source mag that I read in my college Lib and partly by a friend on twitter who had a lot of great things to say about Ubuntu. So I decided to install it and I’m running Ubuntu 11.10 right now. And to be honest, it feels really great! But my start with Ubuntu was not necessarily an easy one. My display did not look proper because it was set at a lower resolution that the one Im used to with Windows. And the other problem I faced was my monitor went on flickering in regular intervals and that kinda frightened me. I’ve managed to solve these issues using help from the vast number of Linux and Ubuntu forums and after reading ’em I realized that 80% of the people face these issues. So I decided to write an article about this. Here’s how I fixed the issues…

The Flickering Problem…

After reading a lot of threads at a variety of forums I found that the flickering was actually caused by a power-save feature that alters the clock frequency depending upon the GPU usage and whenever the changes were being made, the screen goes blank for a fraction of a second and comes back. That was the issue that I was facing. So to resolve this we need to turn this off. This can done by editing the grub.conf file under /boot/grub/ directory

Before editing it, lets make a backup of the file so that we can use it if something goes wrong. To do that just use the following command on the terminal.

sudo cp /boot/grub/grub.cfg /boot/grub/grub.cfg.bak

Now lets edit the file. Open it up using Gedit using the following command.

sudo gedit /boot/grub/grub.cfg

You should get a file with all sorts of configuration stuff. Lets goto the part where you see following lines..

menuentry 'Ubuntu, with Linux 3.0.0-12-generic' --class ubuntu --class gnu-linux --class gnu --class os {
 set gfxpayload=$linux_gfx_mode
 insmod part_gpt
 insmod ntfs
 set root='(hd0,gpt2)'
 search --no-floppy --fs-uuid --set=root B02EE0652EE02656
 loopback loop0 /ubuntu/disks/root.disk
 set root=(loop0)
 linux /boot/vmlinuz-3.0.0-12-generic root=UUID=B02EE0652EE02656 loop=/ubuntu/disks/root.disk ro quiet splash vt.handoff=7
 initrd /boot/initrd.img-3.0.0-12-generic
 }

This should probably be on the 100th line of the file. Once you found it add the text i915.powersave=0 to the 3rd line from bottom after the word ro. After that the above text must look like this.

menuentry 'Ubuntu, with Linux 3.0.0-12-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    set gfxpayload=$linux_gfx_mode
    insmod part_gpt
    insmod ntfs
    set root='(hd0,gpt2)'
    search --no-floppy --fs-uuid --set=root B02EE0652EE02656
    loopback loop0 /ubuntu/disks/root.disk
    set root=(loop0)
    linux    /boot/vmlinuz-3.0.0-12-generic root=UUID=B02EE0652EE02656 loop=/ubuntu/disks/root.disk  ro i915.powersave=0  quiet splash vt.handoff=7
    initrd    /boot/initrd.img-3.0.0-12-generic
}

Save it and close it and reboot. Now you will not be experiencing such flickering (at least many people incl. myself got this problem resolved using this solution 😉 )

Using Custom Resolution…

Now when I figured out that my resolution was not correct I opened up the display settings but it displayed only two resolutions 1024×768 and 800×600 whereas the native resolution of my monitor is 1440×900. So I thought of using the Nvidia Control Panel (called as Nvidia X Server Settings on Ubuntu). But that also didnt help a lot and only showed the above resolutions. As before, I looked to the linux forums for help and I understood that my Nvidia Driver was kinda weak and couldn’t probe exact details of the monitor and hence it could not report the right resolutions and refresh rates to the OS. We had to do that manually. All I had to do was to edit a file called xorg.conf located under /etc/X11 file and it contains various display configurations.

The reason for this problem was that the Horizontal Synchronization (HorizSync) and Vertical Refresh (VertRefresh) rates were not set to match the monitor. So I had to find these frequencies and update the xorg.conf file accordingly. My monitor is ViewSonic VA1703wb and I found that my frequency ranges were HorizSync: 24.0 – 70.0 VertRefresh: 50.0 – 75.0

I found these values through ViewSonic’s website. You can find the right values for your monitor from the manufacturer’s website or you can use a very nice website called Monitor World to get the values. Get those values and lets edit the xorg.conf file.

As always, before editing the file make a backup copy of the file as before. And run the following command to open up the file with administrator privileges (sudo).

sudo gedit /etc/X11/xorg.conf

Now scroll to the section named “monitor” and update the HorizSync and VertRefresh fields with your values. Save it and logout and login again. Now if you go to your Nvidia X Server settings a bunch of new resolutions should come up and your native resolution should also be found there! Thats all! We’re done!

Well, Im kinda happy that I managed to learn a lot in my first “day” with Ubuntu. Although I had experience of working with Unix at college and Open-Solaris for a short period at home, Im new to the Linux environment. And btw, Im writing this post from ubuntu and its awesome! Browsing is significantly faster than in Windows and the UI is sleek. May be not as sophisticated as the Mac but still its way better than Windows, I feel. I recommend my non-ubuntu readers to try ubuntu and see for yourselves its magnificence!

2 thoughts on “Correcting display issues in Ubuntu

    • Yes. that is 100% true. You dont find problems at first but as you use one component after another, some problem pops up and you have a hard time fighting it considering that you’re new to Unix/Linux. But It feels great wen you finally manage to conquer the problem which you will for sure because of the massive support material available for these distros of Linux. I must agree that Windows is stable. Anyway thanks 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s