Introduction
This Howto is intended for those who have problems with resolution or screen refresh rate (flickering), regardless of how they got to this situation. A possible reason for this is that your hardware (video adapter/monitor) may not have been detected properly.
One solution will work for one person and another solution will work for someone else. I hope to provide several different solutions here, ranked in decending order from what I have seen to be the most popular and successful solution to those solutions that have helped only a few. This way, hopefully it will provide an answer for everyone. Let's start with the most popular fix.
For ATI Users I recommend reading the ATI - Refresh Rate & Resolution Quickfix part on the bottom of this Page.
Desktop Setting
First step that most people miss is to run 'System', 'Preferences', 'Screen Resolution'. Be sure to pick your preferable resolution and refresh rate for your desktop. From there, click the option that states 'Make default for desktop only'. Now, restart and login again. If that doesn't work, look below.
Run the Autodetect Script Again
I'm not sure that this is the solution that works for the most people actually, but it most certainly is the quickest and easiest one. All we're doing is running the same script that tried to detect your video hardware when you initially installed. Sometimes this does help, especially if the video card or monitor is different from when you installed Ubuntu. Run the following commands:
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.custom md5sum /etc/X11/xorg.conf |sudo tee /var/lib/x11/xorg.conf.md5sum sudo dpkg-reconfigure xserver-xorg
A configuration page will appear, asking if you want to autodetect video hardware. Select yes, and you should be able to just hit enter a bunch of times to accept the autodetected configurations. After completion, close any open windows or programs you have running on your desktop and press CTRL-ALT-Backspace to restart X. You will be asked to log into your GNOME session again and hopefully everything will be fixed. If not, try the next solution.
Undetected Monitor Specs
Open the file /etc/X11/xorg.conf in your favorite text editor. I'll assume you are using nano for an editor as it is fairly straight forward:
sudo nano /etc/X11/xorg.conf
Now look for a section in that file called Section "Monitor". Once you find this section, look at the lines of text between Section "Monitor" and EndSection. There should be two lines in there that begin with the words HorizSync and VertRefresh. If those lines don't appear there, don't worry. There is a good chance that we've found the problem already!
You will need to gather two bits of information for your monitor now, either from your Monitor User's Manual, the command line, or from online. Finding these values usually just involves searching Google with the model of your monitor. One extensive list is at the Lapis forum
We need the horizontal sync frequency (usually measured in kHz) and the vertical refresh rate (usually in Hz). Both of these values are typically given in a range such as "30-98 kHZ" or "50-160 Hz".
Alternatively, if your monitor supports it, you can just run the following command (install the 'xresprobe' package if the command is not available):
sudo ddcprobe | grep monitorrange
The first two values returned are your HorizSync rates, the second pair is your VertRefresh values.
There are two ways to enter your monitor information into the file. One way is to run the following commands which will regenerate the file and ask you for the values in the process:
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.custom md5sum /etc/X11/xorg.conf |sudo tee /var/lib/xfree86/xorg.conf.md5sum sudo dpkg-reconfigure -plow xserver-xorg
The second way is to simply add those values to our /etc/X11/xorg.conf file with a text editor. But first, lets make a backup of that file just in case an error is made:
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
Editing this file so that it works involves adding two extra lines to the Section "Monitor" section of that file. For example, mine is shown below.
Section "Monitor" Identifier "FLATRON 995F" Option "DPMS" HorizSync 30-96 VertRefresh 50-160 EndSection
Don't change anything that is written in the file for now. Just add the two lines. The snippet from my file is just an example and may not apply to your hardware. More importantly if your monitor is not detectable, the Identifier will be called Generic Monitor. In which case, don't change the Identifier to anything else otherwise X will fail to load and report that it can't find the a Monitor. |
Now save the file, close all open applications, and press CTRL-ALT-Backspace to restart X. Assuming all goes well, you will be prompted to log into your session again.
(Note: If you do not want to shut down your current applications and at the same time enjoy a safer way of trying out your new configuration, you can try the advice on this page: http://ubuntuforums.org/showthread.php?p=4211618)
(See this launchpad bug about low resolutions when horizontal/vertical sync frequencies are incorrect/missing for details about why this can happen and future work being done to prevent this problem in later versions of Ubuntu)
Also if you have an issue where only 800x600 is available in the dropdown for screen resolution, then modifying the Modes line within the section in that file called Section "Monitor" and adding the required resolution could solve this.
SubSection "Display" Depth 24 Modes "1024x768" "800x600" "640x480" EndSubSection
Incorrect DefaultDepth
Sometimes the automatic X configuration sets the colour depth to a value higher than some hardware can properly handle. To see if this is the case for you, first backup your /etc/X11/xorg.conf file:
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
Now open the file in your favourite text editor. I'll assume you'll use nano for now since it is relatively simple to use, but you can use whatever text editor you like.
sudo nano /etc/X11/xorg.conf
Search for the word DefaultDepth (notice it is one word) in that file. The default colour depth set by Hoary is typically "24", but as mentioned, some hardware may not be able to use a value that high. It's pretty safe to change it to something like "16" just to test whether it solves your video problems or not. If this change does not solve anything, it is just as simple to change it back the way it was.
Once the value of DefaultDepth is changed, save the file, close all open windows on your desktop, and press CTRL-ALT-Backspace to restart X. Assuming all goes well, you will be prompted to log into GNOME again, hopefully at a higher resolution.
ATI - Refresh Rate & Resolution QuickFix
For those of you who run an ATI card with the fglrx driver, try running (in a Terminal):
sudo aticonfig
Follow the on-screen Instructions. This should fix the issue after restarting GDM. For Instance on a Setup with:
- 1 CRT Monitor
- No TV-Out
I would be running these commands:
sudo aticonfig --initial --input=/etc/X11/xorg.conf sudo aticonfig --resolution=1600x1200,1280x1024,1024x768 sudo aticonfig --force-monitor=crt1,notv
After you ran your aticonfig commands, you need to restart GDM, to restart GDM use the following command:
/etc/init.d/gdm restart
That should fix it for good! If you experience a different Resolution being used for GDM than your Desktop, you can scroll to the bottom of this Page to: "GDM uses a different Resolution than my Desktop" to fix the issue.
GDM uses a different Resolution than my Desktop
This problem is easily solvable; to fix it do the following:
1) Make a Backup of your xorg.conf
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
2) Open xorg.conf
sudo nano /etc/X11/xorg.conf
3) Locate your Screen Entry
Section "Screen"
You will find multiple entries similar to:
SubSection "Display" Depth 24 Modes "1280x1024" "1024x768" EndSubSection
The First Entry in the "Modes" Line is what GDM will use, so change it to something lower/higher (Please make sure you know that your monitor and Graphic Card BOTH support this Resolution). Save the file.
Close all running applications, restart GDM (/etc/init.d/gdm restart). Another way is just to log out your ubuntu session and press Ctrl-Alt-Backspace in the login screen. Look if everything went fine.
If the specified display resolution - "1280x1024" in the case above - differs from the used virtual screen resolution, add a respective line in the Display subsection of xorg.conf:
Virtual 1280 1024
If these changes did not help, you can always use:
sudo cp /etc/X11/xorg.conf.bak /etc/X11/xorg.conf
to restore your system to the previous state.
You use the "nvidia" driver (Binary drivers)
It would seem that xorg cannot detect the possible resolutions when using the "nvidia" driver. For me, the only resolution I could use was my LCD's native resolution (1680x1050).
Here's how you fix this:
1) Make a backup of your /etc/X11/xorg.conf as shown in the previous examples
2) Open /etc/X11/xorg.conf as shown in the previous examples
3) Add the following line to your existing "Screen" section:
Option "UseEdidFreqs" "false"
If all else fails, try running the following command:
sudo nvidia-settings
Under Video Configuration set your resolution and refresh rate, click apply, then save X Config.
Well, it worked for me: Feisty, Intel i810 video & Widescreen LCD
Added by TonyS, 12 May 07
I impulsively bought a ViewSonic VG1930WM 19" widescreen LCD (at a distinctly newfangled 1440x900 native resolution) without considering the possible pain in making the low powered Intel i810 (82845G/GL) graphics in my old Compaq EVO desktop (and Feisty) talk to it...
It really was a hassle, but I've solved it and thought someone, somewhere, sometime might benefit from knowing how.
Just a wee note first that the "915resolution" solution described in the wiki above did NOT work. After fiddling for ages I got the mode installed and the GUI would come up OK, but the display was corrupt, with the left edge missing in action off the edge of the window, the top inch or so blank and the right hand side two inches peculiarly munted. Hopeless.
OK, here's what solved it for me...
If (like me) you've already broken X at this point and are staring at a blank screen you need to reboot (I had to use the power button hold-for-5-seconds trick), hit "escape" at the first mention of Grub on reboot, and choose to boot in Safe Mode. This boots to a command prompt. Scary for many for sure, but its not TOO painful from here, so stay brave.
First, install the newer Intel drivers. I'm not sure why these aren't installed by default, sure should be. I think you'll need Universe enabled:-
sudo apt-get install xserver-xorg-video-intel
It asks if you want to replace the old drivers. Yep, you sure do.
Then run the xserver video autodetect thingy:-
sudo dpkg-reconfigure xserver-xorg
Choose all the autodetected and default settings it offers, with these exceptions:
1. At one point it asks about allocating system memory to the video card, making specific mention of the the i810. I'm not sure if it made any difference, but I set this to 64000 KB.
2. When it lists the resolutions you want enabled MAKE SURE your monitors native solution (in my case 1440 x 900) is checked.
Now you must reboot. You can do this by typing (wait for it...) "reboot". Nice.
This time let it boot as normal. With any luck it'll pop back up beautifully. In my case it came up 1024x768, so I went to System | Preferences | Screen Resolution and chose 1440x900, which worked perfectly.
GDM 1440x900 @ 75Hz on Viewsonic VG1930WM and Intel 946GZ
Added by VivekKapoor, 10 November 2007
Update: The following method worked, but when I logged out, I couldn't see the gdm screen. I had to switch to Virtual Terminal by pressing CTRL+ALT+1 and then restart the machine. But YMMV. I got a nVidia GeForce 7300 GT to solve the problem and it works smooth!
I bought a new VG1930WM monitor and spent a few days getting 1440x900 in GDM. I was successfully able to get 1440x900 @ 75Hz in my desktop as I was able to change it via the "System -> Preferences -> Screen Resolution". However in GDM it was using 60Hz. Due to this there was around 150-200 pixel blank space on the left of the screen. The motherboard is Asus P5B-MX WIFI-AP and the graphics chipset is Intel 946GZ. The Operating System is Ubuntu Gutsy Gibbon 7.10.
The solution was to use 915resolution and i810 driver instead of the stock intel driver and 16 bit resolution. Here's what I did.
- Got the hsync and vsync from
sudo ddcprobe | grep monitorrange
Got the Modeline for xorg.conf from
root@Marqus:~# gtf 1440 900 75 # 1440x900 @ 75.00 Hz (GTF) hsync: 70.50 kHz; pclk: 136.49 MHz Modeline "1440x900_75.00" 136.49 1440 1536 1688 1936 900 901 904 940 -HSync +Vsync root@Marqus:~#
Added it in xorg.conf. The relevant sections from xorg.conf are
Section "Module" Load "i2c" Load "bitmap" #Load "ddc" Load "dri" Load "extmod" Load "freetype" Load "glx" Load "int10" Load "vbe" EndSection Section "Device" Identifier "Intel Corporation 82946GZ/GL Integrated Graphics Controller" Driver "i810" BusID "PCI:0:2:0" EndSection Section "Monitor" Identifier "VG1930wm" Option "DPMS" HorizSync 30-82 VertRefresh 50-75 # 1440x900 @ 75.00 Hz (GTF) hsync: 70.50 kHz; pclk: 136.49 MHz Modeline "1440x900_75.00" 136.49 1440 1536 1688 1936 900 901 904 940 -HSync +Vsync EndSection Section "Screen" Identifier "Default Screen" Device "Intel Corporation 82946GZ/GL Integrated Graphics Controller" Monitor "VG1930wm" DefaultDepth 16 SubSection "Display" Depth 16 Modes "1440x900_75.00" EndSubSection EndSection
Installed 915resolution through
apt-get install 915resolution
Configured 915resolution
- Listed the available resolution on the screen
915resolution -l
Chose the mode 5c
Edited /etc/default/915resolution and put the following entries
# # 915resolution default # # find free modes by /usr/sbin/915resolution -l # and set it to MODE or set to 'MODE=auto' # # With 'auto' detection, the panel-size will be fetched from the VBE # BIOS if possible and the highest-numbered mode in each bit-depth # will be overwritten with the detected panel-size. MODE=5c # # and set resolutions for the mode. # e.g. use XRESO=1024 and YRESO=768 XRESO=1440 YRESO=900 # # We can also set the pixel mode. # e.g. use BIT=32 # Please note that this is optional, # you can also leave this value blank. BIT=16
Edited /etc/init.d/915resolution and put two extra variables VALHSYNC and VALVSYNC and added them as parameters while starting 915resolution
PATH=/sbin:/bin:/usr/sbin:/usr/bin PROG=/usr/sbin/915resolution NAME=915resolution DESC=915resolution VBETOOL=/usr/sbin/vbetool VALHSYNC=30-82 VALVSYNC=50-75
From /etc/init.d/915resolution (Modified Line 7 below and added $VALHSYNC and $VALVSYNC
case "$1" in start|restart|force-reload) echo -n "Starting $DESC: " if [ "$MODE" = "auto" ] ; then auto_select_modes else $PROG $MODE $XRESO $YRESO $BIT $VALHSYNC $VALVSYNC fi echo "$NAME." ;; stop)
- Listed the available resolution on the screen
That's all, I restarted the machine and it worked!
Problem related to DVI-Interface
After I upgraded my machine to Ubuntu 8.04 I was stucked with a maximum screen resolution of 800x600. No matter what I tried, nothing helped. I worked through suggestions on this page, but nothing helped. Finally I stumbled over another site where this problem was discussed and a user there described the same issue that I had. His solution was to connect the monitor cable not to the DVI port but to the VGA port of the card. I tried it and immediately my problem was gone.
(I'm using a BNC cable to connect my monitor to the computer. Maybe this is the reason why the monitor modes could not be recognized by Ubuntu on the DVI port.)
Adjust Only Resolution Settings on Dell Laptop
1. All I needed to do was get my laptop to display a higher resolution than 800x600. When I went to Syestem -> Preferences -> Screen Resolution, it was only showing me 800x600.
2. MAKE a backup of your /etc/X11/xorg.conf.
3. Open up terminal and type: sudo dpkg-reconfigure -phigh xserver-xorg.
4. I left mine on vesa (since I knew that driver was working) and select "ok".
5. This is the fun part, go through and select the screen resolutions you want enabled by default. Whatever you check here should end up in the dropdown list in Syestem -> Preferences -> Screen Resolution,
6. Restart X server (CNTRL+Alt+Backspace).
7. It started up in the highest resolution that I had selected (1440x900). No need (for me) to install nvidia drivers.
The End
So far, this is all of the possible solutions I've collected for this problem. If none of the above corrected your situation, consider posting your question in the Ubuntu Support Forum or in the #ubuntu IRC support channel on the irc.freenode.net network.