借用Puppy Linux巧妙解决Xorg的屏幕分辨率与刷新率问题

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
头像
ws_105
帖子: 313
注册时间: 2008-10-24 8:02

借用Puppy Linux巧妙解决Xorg的屏幕分辨率与刷新率问题

#1

帖子 ws_105 » 2008-11-29 21:17

说 是巧妙,其实我还是不是十分的清楚(要好好研究xorg的配置文件才行),主要是因为Puppy Linux的xorg显示效果很好,同样是使用Xorg,显示效果却截然不同,显然是配置的问题。所以可以使用Puppy Linux的xorg的配置文件来替换Ubuntu的自动配置产生的xorg.conf文件,从而达到目的。

我的Ubuntu 8.04默认安装完成之后,默认的分辨率虽然为1024x768,可是刷新率只有60Hz,把眼睛闪得太难受了。

按照资料显示,应该是运行配置程序的时候,会配置需要使用的分辨率的,但是,在我的电脑上,从来没有见到过这个过程。
/etc/X11/xorg.conf文件的内容就事下面这样,非常的奇怪:

代码: 全选

 1 # xorg.conf (X.Org X Window System server configuration file)
 2 #
 3 # This file was generated by dexconf, the Debian X Configuration tool, using
 4 # values from the debconf database.
 5 #
 6 # Edit this file with caution, and see the xorg.conf manual page.
 7 # (Type "man xorg.conf" at the shell prompt.)
 8 #
 9 # This file is automatically updated on xserver-xorg package upgrades *only*
10 # if it has not been modified since the last upgrade of the xserver-xorg
11 # package.
12 #
13 # If you have edited this file but would like it to be automatically updated
14 # again, run the following command:
15 #   sudo dpkg-reconfigure -phigh xserver-xorg
16 
17 Section "InputDevice"
18     Identifier "Generic Keyboard"
19     Driver     "kbd"
20     Option     "XkbRules" "xorg"
21     Option     "XkbModel" "pc105"
22     Option     "XkbLayout"    "us"
23 EndSection
24 
25 Section "InputDevice"
26     Identifier "Configured Mouse"
27     Driver     "mouse"
28     Option     "CorePointer"
29     Option     "Emulate3Buttons"  "true"
30 EndSection
31 
32 Section "Device"
33     Identifier "Configured Video Device"
34     Driver     "i810"
35 EndSection
36 
37 Section "Monitor"
38     Identifier "Configured Monitor"
39 EndSection
40 
41 Section "Screen"
42     Identifier "Default Screen"
43     Monitor        "Configured Monitor"
44     Device     "Configured Video Device"
45 EndSection
46 
47 Section "ServerLayout"
48     Identifier "Default Layout"
49     Screen     "Default Screen"
50 EndSection
理论上这个文件的内容应该事比较多的,也是相当难懂的——这从的闻名度上就可窥见一斑。
在这个情况下,刷新率就只有60可以选择。

后来,搜索了一些资料,知道可以在这个配置文件的Monitor字段中添加一个Modeline语句来指定特殊的分辨率以及刷新率。
添加方法为:

代码: 全选

$ gtf 1024 768 75.0
解释:1024x768分辨率,75.0Hz刷新率
运行这条命令会得到一个Modeline数据。
2.添加Modeline到xorg.conf文件中,在Section Monitor下面添加:

代码: 全选

	HorizSync
	VertRefresh
	Option “dpms”
	Modeline "1024x768_75.0" 81.80 1024 1080 1192 1360 768 769 772 802 -HSync +Vsync
最后xorg.conf文件内容,如下所示:

代码: 全选

 1 # xorg.conf (X.Org X Window System server configuration file)
 2 #
 3 # This file was generated by dexconf, the Debian X Configuration tool, using
 4 # values from the debconf database.
 5 #
 6 # Edit this file with caution, and see the xorg.conf manual page.
 7 # (Type "man xorg.conf" at the shell prompt.)
 8 #
 9 # This file is automatically updated on xserver-xorg package upgrades *only*
10 # if it has not been modified since the last upgrade of the xserver-xorg
11 # package.
12 #
13 # If you have edited this file but would like it to be automatically updated
14 # again, run the following command:
15 #   sudo dpkg-reconfigure -phigh xserver-xorg
16 
17 Section "InputDevice"
18     Identifier "Generic Keyboard"
19     Driver     "kbd"
20     Option     "XkbRules" "xorg"
21     Option     "XkbModel" "pc105"
22     Option     "XkbLayout"    "us"
23 EndSection
24 
25 Section "InputDevice"
26     Identifier "Configured Mouse"
27     Driver     "mouse"
28     Option     "CorePointer"
29 EndSection
30 
31 Section "Device"
32     Identifier "Configured Video Device"
33 EndSection
34 
35 Section "Monitor"
36     Identifier "Configured Monitor"
37     HorizSync 28.0-81.0
38     VertRefresh 43.0-80.0
39     Option "dpms"
40     Modeline "1024x768_75.0" 81.80 1024 1080 1192 1360 768 769 772 802 -HSync +Vsync
41 EndSection
42 
43 Section "Screen"
44     Identifier "Default Screen"
45     Monitor        "Configured Monitor"
46     Device     "Configured Video Device"
47 EndSection
48 
49 Section "ServerLayout"
50     Identifier "Default Layout"
51     Screen     "Default Screen"
52 EndSection
解释一下:
HorizSync 28.0-81.0
VertRefresh 43.0-80.0
这两行数据我也不知道怎么得到的,只是从网络上原样Copy到我的配置文件中去(当然,现在我知道什么原因了~参看后面的ddcprobe命令输出中的monitorrange)。
OK,现在重启X(Ctrl + Alt + Backspace),在首选项里就可以修改刷新率为75.0和70.0了。

这样,虽然可以使用75.0Hz,但是在我的电脑上,还有问题。在75.0Hz的情况下,屏幕右边缘不能完全显示,就是会有一个黑色的竖条,好难看,没办法,将就着70.0Hz用吧。

今天下午,再一次找了一些关于xorg的配置、分辨率与刷新率的资料。
有以下一些相关的程序:
ddcprobe: 属于xresprobe包,可以检测显卡及支持的分辨率与刷新率
在我的电脑上,输出如下:

代码: 全选

vbe: VESA 3.0 detected.
oem: Intel(r) 82945G Chipset Family Graphics Chip Accelerated VGA BIOS
vendor: Intel Corporation
product: Intel(r) 82945G Chipset Family Graphics Controller Hardware Version 0.0
memory: 7872kb
mode: 1280x1024x256
mode: 1280x1024x64k
mode: 1280x1024x16m
mode: 1024x768x256
mode: 1024x768x64k
mode: 1024x768x16m
mode: 640x480x16m
mode: 800x600x64k
mode: 800x600x16m
mode: 640x480x256
mode: 800x600x256
mode: 640x480x64k
edid: �������������

edid: 1 1
id: 8080
eisa: @DE8080
serial: 00000bac
manufacture: 2 2003
input: sync on green, analog signal.
screensize: 31 23
gamma: 2.200000
dpms: RGB, active off, no suspend, standby
timing: 720x400@70 Hz (VGA 640x400, IBM)
timing: 720x400@88 Hz (XGA2)
timing: 640x480@60 Hz (VGA)
timing: 640x480@67 Hz (Mac II, Apple)
timing: 640x480@72 Hz (VESA)
timing: 640x480@75 Hz (VESA)
timing: 800x600@56 Hz (VESA)
timing: 800x600@60 Hz (VESA)
timing: 800x600@75 Hz (VESA)
timing: 832x624@75 Hz (Mac II)
timing: 1024x768@87 Hz Interlaced (8514A)
timing: 1024x768@60 Hz (VESA)
timing: 1024x768@70 Hz (VESA)
timing: 1024x768@75 Hz (VESA)
timing: 1280x1024@75 (VESA)
ctiming: 1280x1024@60
ctiming: 1024x768@85
ctiming: 800x600@85
ctiming: 640x480@85
dtiming: 640x480@130
monitorname: 
monitorname: EX700F+
monitorrange: 30-70, 50-135
xrandr: 在使用的过程中调整分辨率和刷新率,例如,设定1024x768@75.0可以这样

代码: 全选

$ xrandr -s 1024x768 -r 75.0
dexconf: 从debconf的数据生成Xorg的配置文件的工具
xdebconfigurator: 基于自动的HW检测为dexconf生成debconf数据

还有一个方法是使用:

代码: 全选

$ sudo dpkg-reconfigure xserver-xorg
命令来重新设定
网上的资料好多都是使用这个方法来重新配置Xorg的,但是在我的电脑上重新配置的结果就是重新回到最原始的状态,刷新率低得要命,无法改变。

折腾了很久,尝试了很多方法,但是都没有什么结果,不是刷新率上不来,就是”rate out of range”,直接花屏,郁闷啊!

后来,突然想到,我之前使用Puppy Linux的时候,显示效果很好,而且分辨率与刷新率的可调范围都很大,于是,就又重启了一下,启动到U盘上的Puppy Linux中,看了以下它自动产生的xorg.conf配置,与Ubuntu中的配置有很大的差异。
所以就把它拷贝到Ubuntu下面,并进行了一些必要的小修改,重启。

OK,太完美了,分辨率可调范围成为640x480—1680x1050,1024x768分辨率下的刷新率可调范围为60Hz, 70Hz, 75Hz, 85Hz,其他模式下的分辨率有60Hz,75Hz等。
使用 $ xrandr 命令查看:

代码: 全选

$ xrandr
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 1680 x 1680
VGA connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x768       85.0 +   75.0*    70.1     60.0  
   1680x1050      60.0  
   1600x1024      60.0  
   1400x1050      60.0  
   1280x1024      60.0  
   1440x900       60.2  
   1280x960       60.0  
   1280x800       60.0  
   1152x864       75.0  
   1280x768       60.0  
   1152x768       54.8  
   832x624        74.6  
   800x600        72.2     75.0     60.3     56.2  
   640x480        72.8     75.0     59.9  
我把我从Puppy Linux上拷过来的配置也一起贴出来,并添加一些注释,也给大家参考一下。
没有添加注释的都是没有做过任何修改的地方(以#号注释的如果后面没有我的注释的话,就是Puppy Linux中配置文件自带的注释)。
注意,由于里面涉及到一些pci接口以及一些具体的硬件参数,所以只能作为参考之用,切不可直接拷贝到其他电脑上直接使用,否则可能驱动不起来。

代码: 全选

  1 #Special base config file used in Puppy Linux.
  2 
  3 # **********************************************************************
  4 # Module section -- this  section  is used to specify
  5 # which dynamically loadable modules to load.
  6 # **********************************************************************
  7 #
  8 Section "Module"
  9 
 10 # This loads the DBE extension module.
 11 
 12     Load        "dbe"   # Double buffer extension
 13 
 14 # This loads the miscellaneous extensions module, and disables
 15 # initialisation of the XFree86-DGA extension within that module.
 16     SubSection  "extmod"
 17       Option    "omit xfree86-dga"   # don't initialise the DGA extension
 18     EndSubSection
 19 
 20 # This loads the font modules
 21     Load        "type1"
 22     Load        "freetype"
 23 
 24 # This loads xtrap extension, used by xrandr
 25     Load       "xtrap"
 26 
 27 # This loads the GLX module (if present)
 28     Load       "glx"
 29 
 30 # This loads dri module (if present)
 31     Load       "dri"
 32 
 33 EndSection
 34 
 35 # **********************************************************************
 36 # Files section.  This allows default font and rgb paths to be set
 37 # **********************************************************************
 38 
 39 Section "Files"
 40 
 41 # The location of the RGB database.  Note, this is the name of the
 42 # file minus the extension (like ".txt" or ".db").  There is normally
 43 # no need to change the default.
 44 
 45 #    RgbPath    "/usr/X11R7/lib/X11/rgb"(被我注释掉了,因为我发现自己的/usr/X11R6/(Ubuntu8.04是X11R6,不是X11R7,没有Puppy Linux新)目录下根本就没有lib目录,其他的字体也没有,同样紧接下来的FontPath也是被我注释掉的)
 47 # Multiple FontPath entries are allowed (which are concatenated together),
 48 # as well as specifying multiple comma-separated entries in one FontPath
 49 # command (or a combination of both methods)
 50 
 51 #    FontPath   "/usr/X11R7/lib/X11/fonts/misc/"(注释掉)
 52 #    FontPath   "/usr/X11R7/lib/X11/fonts/Type1/"(注释掉)
 53 #    FontPath   "/usr/X11R7/lib/X11/fonts/TTF/"(注释掉)
 54 
 55 EndSection
 56 
 57 # **********************************************************************
 58 # Server flags section.
 59 # **********************************************************************
 60 
 61 Section "ServerFlags"
 62 
 63 # Uncomment this to disable the <Crtl><Alt><Fn> VT switch sequence
 64 # (where n is 1 through 12).  This allows clients to receive these key
 65 # events.
 66 
 67 #    Option "DontVTSwitch"
 68 
 69 # Enables mode switching with xrandr
 70 # There is a report that this can cause Xorg not to work on some
 71 # video hardware, so default is commented-out...
 72 # but i want to use it in xorgwizard so leave on...
 73 
 74     Option "RandR" "on"
 75 
 76 EndSection
 77 
 78 #everything past here is auto-generated by Puppy's Xorg Wizard...
 79 
 80 
 81 Section "ServerLayout"
 82     Identifier     "X.org Configured"
 83     Screen      0  "Screen0" 0 0
 84     InputDevice    "Mouse0" "CorePointer"
 85     InputDevice    "Keyboard0" "CoreKeyboard"
 86 EndSection
 87 
 88 Section "InputDevice"
 89     Identifier  "Keyboard0"
 90     Driver      "kbd"
 91     Option      "XkbRules" "xorg"
 92     Option      "XkbModel" "pc105"(这里从pc102改到了pc105,因为在之前的配置中,都是pc105,而且没有出现问题,所以我认为它应该事pc105)
 93     Option      "XkbLayout" "us" #xkeymap0
 94 EndSection
 95 
 96 Section "InputDevice"
 97     Identifier  "Mouse0"
 98     Driver      "mouse"
 99     Option      "CorePointer"
100     #Option        "Protocol" "auto" #mouse0protocol(注释掉,因为第一次没有注释掉的时候登录,鼠标无法使用,而原本的配置没有这些,鼠标可以使用)
101     #Option        "Device" "/dev/mouse"(注释掉,原因同上)
102     #Option      "Emulate3Buttons"
103     #Option      "Emulate3Timeout" "50"
104     #Option      "ZAxisMapping" "4 5" #scrollwheel
105 EndSection
106 
107 Section "Monitor"
108     Identifier   "Monitor0"
109     VendorName   "Monitor Vendor"
110     ModelName    "Monitor Model"
111     HorizSync    30-70(这里注意,和ddcprobe命令的输出中的monitorrange有关,也就是这个范围一定要在monitorrange后面的第一个范围之内,否则可能花屏(rate out of range))
112     VertRefresh  50-85(同样,这个范围需要在monitorrange后面的第二个范围之内)
113     #UseModes     "Modes0" #monitor0usemodes
114     Option      "PreferredMode" "1024x768"
115     EndSection
116     
117 Section "Modes"
118     Identifier "Modes0"
119     #modes0modeline0
120 EndSection
121 
122 Section "Device"
123     ### Available Driver options are:-
124     ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
125     ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
126     ### [arg]: arg optional
127     #Option     "NoAccel"              # [<bool>]
128     #Option     "SWcursor"             # [<bool>]
129     #Option     "ColorKey"             # <i>
130     #Option     "CacheLines"           # <i>
131     #Option     "Dac6Bit"              # [<bool>]
132     #Option     "DRI"                  # [<bool>]
133     #Option     "NoDDC"                # [<bool>]
134     #Option     "ShowCache"            # [<bool>]
135     #Option     "XvMCSurfaces"         # <i>
136     #Option     "PageFlip"             # [<bool>]
137     Identifier  "Card0"
138     Driver      "intel" #card0driver
139     VendorName  "Intel Corporation"
140     BoardName   "82945G/GZ Integrated Graphics Controller"
141     BusID       "PCI:0:2:0"
142 EndSection
143 
144 Section "Screen"
145     Identifier "Screen0"
146     Device     "Card0"
147     Monitor    "Monitor0"
148     DefaultDepth 24
149     Subsection "Display"
150         Depth       24
151         Modes       "1024x768"
152     EndSubsection
153 EndSection
154 
155 #PuppyHardwareProfile=Intel_r__82945G_Chipset30_70_50_135
改为使用上面这个配置文件后,感觉好多了,也没有在出现屏幕留一个边的情况了。
上次由 ws_105 在 2008-12-02 12:51,总共编辑 1 次。
Ubuntu 8.04 @ Intel Pentium D 925 + Intel 945G Chipset + DDR2 1.0G + SATA 160G
http://hi.baidu.com/ws_105
头像
ws_105
帖子: 313
注册时间: 2008-10-24 8:02

Re: 借用Puppy Linux巧妙解决Xorg的屏幕分辨率与刷新率问题

#2

帖子 ws_105 » 2008-11-30 14:51

:em20 这么快就沉了,第一次发贴,不足之处,大家见谅~
Ubuntu 8.04 @ Intel Pentium D 925 + Intel 945G Chipset + DDR2 1.0G + SATA 160G
http://hi.baidu.com/ws_105
bbe50
帖子: 7
注册时间: 2008-12-01 11:55

Re: 借用Puppy Linux巧妙解决Xorg的屏幕分辨率与刷新率问题

#3

帖子 bbe50 » 2008-12-01 20:11

这个方法明天我试下,如果可以的话,建议置顶.
头像
ws_105
帖子: 313
注册时间: 2008-10-24 8:02

Re: 借用Puppy Linux巧妙解决Xorg的屏幕分辨率与刷新率问题

#4

帖子 ws_105 » 2008-12-02 12:53

楼上的朋友,试了吗?在你的电脑上好不好用?
Ubuntu 8.04 @ Intel Pentium D 925 + Intel 945G Chipset + DDR2 1.0G + SATA 160G
http://hi.baidu.com/ws_105
bbe50
帖子: 7
注册时间: 2008-12-01 11:55

Re: 借用Puppy Linux巧妙解决Xorg的屏幕分辨率与刷新率问题

#5

帖子 bbe50 » 2008-12-02 22:39

很遗憾的告诉你,我试了下,失败了,没有进入系统,黑屏,原因我大概知道,我用的是845GL,你的是945GL,显卡驱动不一样,仅仅改显示器刷新率好像是无效的。

我的分辨率有4个选项,1280*1240 1024*768 800*600 640*480.但是刷新率全部为0,因为我的显示器是“未知的”现在我就想解决怎么样能装一个兼容的显示器驱动。貌似没有办法解决。
头像
ws_105
帖子: 313
注册时间: 2008-10-24 8:02

Re: 借用Puppy Linux巧妙解决Xorg的屏幕分辨率与刷新率问题

#6

帖子 ws_105 » 2008-12-03 12:03

intel 的 man 中显示硬件支持包括了 845G 的,
SUPPORTED HARDWARE
intel supports the i810, i810-DC100, i810e, i815, i830M, 845G, 852GM,
855GM, 865G, 915G, 915GM, 945G, 945GM, 965G, 965Q, 946GZ, 965GM,
945GME, G33, Q33, and Q35 chipsets.
如果事device的驱动(driver)显示未知的话,可以尝试一下手动把它修改为 intel 。
Ubuntu 8.04 @ Intel Pentium D 925 + Intel 945G Chipset + DDR2 1.0G + SATA 160G
http://hi.baidu.com/ws_105
头像
ws_105
帖子: 313
注册时间: 2008-10-24 8:02

Re: 借用Puppy Linux巧妙解决Xorg的屏幕分辨率与刷新率问题

#7

帖子 ws_105 » 2008-12-03 12:12

我知道的 xorg 自带的 intel 芯片的驱动有两个,i810 和 intel ,i810 比较古老了,intel 可以支持大部分的 intel 芯片的集成显卡。我手动配置的时候使用了 i810,但是进不了X,后来Puppy自动配置改为了intel。
Ubuntu 8.04 @ Intel Pentium D 925 + Intel 945G Chipset + DDR2 1.0G + SATA 160G
http://hi.baidu.com/ws_105
@少校
帖子: 4
注册时间: 2008-12-01 23:24

Re: 借用Puppy Linux巧妙解决Xorg的屏幕分辨率与刷新率问题

#8

帖子 @少校 » 2008-12-04 2:06

:em06 貌似之需要如下设置一下就可以了
系统 ——首选项——主菜单
其他——显示器和显卡
然后选择你的对应型号,,,世界就和谐了。。。。
头像
ws_105
帖子: 313
注册时间: 2008-10-24 8:02

Re: 借用Puppy Linux巧妙解决Xorg的屏幕分辨率与刷新率问题

#9

帖子 ws_105 » 2008-12-04 13:05

昨天,在wiki页上看到在这里可以使用程序选择显卡型号:
Alt + F2
gksu displayconfig-gtk
Ubuntu 8.04 @ Intel Pentium D 925 + Intel 945G Chipset + DDR2 1.0G + SATA 160G
http://hi.baidu.com/ws_105
bbe50
帖子: 7
注册时间: 2008-12-01 11:55

Re: 借用Puppy Linux巧妙解决Xorg的屏幕分辨率与刷新率问题

#10

帖子 bbe50 » 2008-12-12 11:26

回8楼,你说的是不是在U8.04下才有的,我的U8.10好像没有这个工具。
回9楼,我按你说的运行了,没有反应。
头像
ws_105
帖子: 313
注册时间: 2008-10-24 8:02

Re: 借用Puppy Linux巧妙解决Xorg的屏幕分辨率与刷新率问题

#11

帖子 ws_105 » 2008-12-12 12:23

bbe50 写了:回8楼,你说的是不是在U8.04下才有的,我的U8.10好像没有这个工具。
回9楼,我按你说的运行了,没有反应。
这个,在我的8.04上可以调出配置窗口
Ubuntu 8.04 @ Intel Pentium D 925 + Intel 945G Chipset + DDR2 1.0G + SATA 160G
http://hi.baidu.com/ws_105
头像
drc1234
帖子: 632
注册时间: 2008-08-31 10:09

Re: 借用Puppy Linux巧妙解决Xorg的屏幕分辨率与刷新率问题

#12

帖子 drc1234 » 2008-12-12 15:20

系统 ——首选项——主菜单
其他——显示器和显卡
然后选择你的对应显示器型号和显卡驱动,很正确

本菜还修改了Section "Screen"
这样登录画面的分辨的刷新也和进入桌面一致了 :em05
头像
bighandsky
帖子: 51
注册时间: 2009-11-02 12:02

Re: 借用Puppy Linux巧妙解决Xorg的屏幕分辨率与刷新率问题

#13

帖子 bighandsky » 2011-03-09 18:33

虽然没有设置过楼主的刷新率,可是看了楼主分析的帖子,真的做的非常详细!值得学习~~~ :em11
Ubuntu 10.04 LTS
路漫漫长其修远兮,吾将上下而求索!
http://blog.sina.com.cn/linux777
回复