Discussion:
X11 modeline calculator?
l***@optushome.com.au
2005-01-26 03:42:53 UTC
Permalink
I have a spiffy new monitor that is capable of doing ***@85Hz and
even ***@75Hz, but the modes don't seem to be recognised. The
closest I get is:

(II) NV(0): Supported Future Video Modes:
(II) NV(0): #0: hsize: 1920 vsize 1440 refresh: 85 vid: 22993
....
(--) NV(0): Virtual size is 1920x1440 (pitch 1920)
(**) NV(0): Default mode "1600x1200": 229.5 MHz, 106.2 kHz, 85.0 Hz
(**) NV(0): Default mode "1920x1440": 297.0 MHz, 112.5 kHz, 75.0 Hz
....

Is there an X11 modelines calculator that you can feed the specs of the
display modes into, to get correct modelines to add in manually? I
confess that the description in the howto either leaves some terms
undefined, or else the failing is with me and I just can't wrap my head
around how to calculate it manually from the info I have in the vendor's
specs.

luke
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Peter Chubb
2005-01-26 09:59:25 UTC
Permalink
lukekendall> I have a spiffy new monitor that is capable of doing
lukekendall> ***@85Hz and even ***@75Hz, but the modes
lukekendall> don't seem to be recognised. The closest I get is:

lukekendall> Is there an X11 modelines calculator that you can feed
lukekendall> the specs of the display modes into, to get correct
lukekendall> modelines to add in manually? I confess that the
lukekendall> description in the howto either leaves some terms
lukekendall> undefined, or else the failing is with me and I just
lukekendall> can't wrap my head around how to calculate it manually
lukekendall> from the info I have in the vendor's specs.

It's not actually that hard to calculate the modeline.

You need to know the maximum clock frequency and vertical refresh
frequency of your monitor, and the minimum vertical and horiz sync
times.

Then the modeline is in two halves -- horizontal and vertical.
I usually use the new format now.

Then your modeline will be something like:
Mode "1920x1440"
DotClock 300 # Max frequency
HTimings 1920 Hxxxx Hyyyy Hzzzz
VTimings 1440 Vxxxx Vyyyy Vzzzz
EndMode

where Hxxxx is 1920 plus how many dot clocks after the scan before
the horizontal sync pulse, Hyyyy is Hxxxx plus the Hsync width divided
by the dot clock, and Hzzzz is the total time for each horzontal scan.

Vertical timings are similar.

Anyway, the standard VESA GTF timings for 1920x1440 are close to:

Mode "1920x1440"
DotClock 341.35
HTimings 1920 2072 2299 2656
VTimings 1440 1441 1444 1512
Flags "-HSync +VSync"
EndMode

And for ***@75 they are

Mode "2048x1536"
DotClock 340.5
HTimings 2048 2216 2440 2832
VTimings 1536 1537 1540 1603
Flags "-HSync +VSync"
EndMode

You can tweak them a little if you need to.

--
Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au
The technical we do immediately, the political takes *forever*
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
l***@optushome.com.au
2005-01-26 12:08:21 UTC
Permalink
Post by Peter Chubb
It's not actually that hard to calculate the modeline.
You need to know the maximum clock frequency and vertical refresh
frequency of your monitor, and the minimum vertical and horiz sync
times.
Then the modeline is in two halves -- horizontal and vertical.
I usually use the new format now.
Mode "1920x1440"
DotClock 300 # Max frequency
HTimings 1920 Hxxxx Hyyyy Hzzzz
VTimings 1440 Vxxxx Vyyyy Vzzzz
EndMode
where Hxxxx is 1920 plus how many dot clocks after the scan before
the horizontal sync pulse, Hyyyy is Hxxxx plus the Hsync width divided
by the dot clock, and Hzzzz is the total time for each horzontal scan.
Ah. Yes, I remember the problem I had, now: not enough knowledge. :-)
How do you work out the horizontal sync pulse? If X says:

(II) NV(0): Supported additional Video Mode:
(II) NV(0): clock: 229.5 MHz Image Size: 392 x 294 mm
(II) NV(0): h_active: 1600 h_sync: 1664 h_sync_end 1856 h_blank_end 2160 h_border: 0
(II) NV(0): v_active: 1200 v_sync: 1201 v_sync_end 1204 v_blanking: 1250 v_border: 0
(II) NV(0): Serial No: 24-CD405
(II) NV(0): Monitor name: IBM C220P CRT
(II) NV(0): Ranges: V min: 50 V max: 160 Hz, H min: 30 H max: 130 kHz, PixClock max 370 MHz
(II) NV(0): end of DDC Monitor info

(==) NV(0): Using gamma correction (1.0, 1.0, 1.0)
(II) NV(0): IBM C220P CR: Using hsync range of 30.00-130.00 kHz
(II) NV(0): IBM C220P CR: Using vrefresh range of 50.00-160.00 Hz
(II) NV(0): Clock range: 12.00 to 350.00 MHz

I assume this means the maximum clock frequency is 350 MHZ (dot
clock 350)? Or is it PixClock max, 370? And if the manual says it can
do 1920x1440 at 85HZ, then that means the vertical frequency is 85? The
minimum vertical and hztl sync times ...? I have no idea. Are they
related to V min (50) and H min (30)? What is the hsync width?

Sigh. There are just too many variables that I don't have a definition
for, and only a vague understanding of. :-(
Post by Peter Chubb
Vertical timings are similar.
Mode "1920x1440"
DotClock 341.35
HTimings 1920 2072 2299 2656
VTimings 1440 1441 1444 1512
Flags "-HSync +VSync"
EndMode
Mode "2048x1536"
DotClock 340.5
HTimings 2048 2216 2440 2832
VTimings 1536 1537 1540 1603
Flags "-HSync +VSync"
EndMode
You can tweak them a little if you need to.
I tried this in the Monitor section:

Mode "1920x1440"
DotClock 350
HTimings 1920 2072 2299 2656
VTimings 1440 1441 1444 1512
Flags "-HSync +VSync"
EndMode
Mode "2048x1536"
DotClock 350
HTimings 2048 2216 2440 2832
VTimings 1536 1537 1540 1603
Flags "-HSync +VSync"
EndMode

But got the error:

Parse error on line 59 of section Monitor in file /etc/X11/XF86Config-4
Unknown flag string
(EE) Problem parsing the config file
(EE) Error from xf86HandleConfigFile()

By commenting out the Flags lines, I was able to get the 2048x1536 mode
to work, though the 1920x1440 mode looks dangerous - the screen sort of
folds back over itself and looks dark. You can recognise where the
windows (folded horizontally) are.

Should I have left the DotClock at your 341.5, or perhaps tried 370?
Does that affect the other numbers? Since it divides the dot clock,
you said, I thought it should.

Sorry for being so thick.

luke
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Peter Chubb
2005-01-26 22:16:32 UTC
Permalink
Post by Peter Chubb
It's not actually that hard to calculate the modeline.
where Hxxxx is 1920 plus how many dot clocks after the scan before
the horizontal sync pulse, Hyyyy is Hxxxx plus the Hsync width
divided by the dot clock, and Hzzzz is the total time for each
horzontal scan.
lukekendall> Ah. Yes, I remember the problem I had, now: not enough
lukekendall> knowledge. :-) How do you work out the horizontal sync
lukekendall> pulse? If X says:


lukekendall> (II) NV(0): Supported additional Video Mode: (II) NV(0):
lukekendall> clock: 229.5 MHz Image Size: 392 x 294 mm (II) NV(0):
lukekendall> h_active: 1600 h_sync: 1664 h_sync_end 1856 h_blank_end
lukekendall> 2160 h_border: 0 (II) NV(0): v_active: 1200 v_sync: 1201
lukekendall> v_sync_end 1204 v_blanking: 1250 v_border: 0 (II) NV(0):
lukekendall> Serial No: 24-CD405 (II) NV(0): Monitor name: IBM C220P
lukekendall> CRT (II) NV(0): Ranges: V min: 50 V max: 160 Hz, H min:
lukekendall> 30 H max: 130 kHz, PixClock max 370 MHz (II) NV(0): end
lukekendall> of DDC Monitor info

lukekendall> I assume this means the maximum clock frequency is 350
lukekendall> MHZ (dot clock 350)? Or is it PixClock max, 370? And if

No, 370MHz. But you need to use a lower freq. to get the
characteristics you want.lukekendall> I tried this in the Monitor section:

lukekendall> Mode "1920x1440" DotClock 350 HTimings 1920 2072
lukekendall> 2299 2656 VTimings 1440 1441 1444 1512 Flags "-HSync
lukekendall> +VSync" EndMode Mode "2048x1536" DotClock 350 HTimings
lukekendall> 2048 2216 2440 2832 VTimings 1536 1537 1540 1603 Flags
lukekendall> "-HSync +VSync" EndMode

lukekendall> But got the error:

lukekendall> Parse error on line 59 of section Monitor in file
lukekendall> /etc/X11/XF86Config-4 Unknown flag string (EE) Problem
lukekendall> parsing the config file (EE) Error from
lukekendall> xf86HandleConfigFile()

lukekendall> By commenting out the Flags lines, I was able to get the
lukekendall> 2048x1536 mode to work, though the 1920x1440 mode looks
lukekendall> dangerous - the screen sort of folds back over itself and
lukekendall> looks dark. You can recognise where the windows (folded
lukekendall> horizontally) are.

That implies the HSync pulse is wrong. Try running xvidtune, and
adjusting it.

lukekendall> Should I have left the DotClock at your 341.5, or perhaps
Yes.
lukekendall> tried 370? Does that affect the other numbers?
And yes.
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
l***@optushome.com.au
2005-01-27 13:17:46 UTC
Permalink
Post by Peter Chubb
No, 370MHz. But you need to use a lower freq. to get the
characteristics you want
[...]
Post by Peter Chubb
lukekendall> By commenting out the Flags lines, I was able to get the
lukekendall> 2048x1536 mode to work, though the 1920x1440 mode looks
lukekendall> dangerous - the screen sort of folds back over itself and
lukekendall> looks dark. You can recognise where the windows (folded
lukekendall> horizontally) are.
That implies the HSync pulse is wrong. Try running xvidtune, and
adjusting it.
I could actually see xvidtune enough to operate it, but couldn't find
any combination of Hsync start and end (via left/right off the
scale, and wider/narrower) that came anywhere near making a worthwhile
improvement. :-(

I also realised that I somehow fooled myself that I had 1920x1440
working - actually, it was being rejected by X:

(II) NV(0): Not using mode "1920x1440" (hsync out of range)
(II) NV(0): Not using mode "1920x1440" (no mode of this name)
Post by Peter Chubb
lukekendall> Should I have left the DotClock at your 341.5, or perhaps
Yes.
lukekendall> tried 370? Does that affect the other numbers?
And yes.
Interestingly, I tried both 341.5 and 370, and the results were a
complete failure - for 341.5,X rejected the modelines as invalid for my
monitor, and when I (foolishly?) tried 370 the monitor went instantly
into power saving mode when I tried to switch resolutions - a safety
feature, I assume.

I think I simply don't understand the variables well enough to
experiment properly. Thanks for your help, though!

luke
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Mike MacCana
2005-01-27 05:21:52 UTC
Permalink
The solutions in the thread so far seem a little labor intensive: are
y'all aware it should be possible to get exact modelines from your
Windows monitor.inf file?

I think there's even tools to put them into the format you'd use in
xorg.conf (or XF86ConFiGrANdoMCAPS.CONFOMGWTFBBQ for those so inclined).

Mike
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Geoff Reidy
2005-01-27 05:21:13 UTC
Permalink
Post by l***@optushome.com.au
(II) NV(0): #0: hsize: 1920 vsize 1440 refresh: 85 vid: 22993
....
(--) NV(0): Virtual size is 1920x1440 (pitch 1920)
(**) NV(0): Default mode "1600x1200": 229.5 MHz, 106.2 kHz, 85.0 Hz
(**) NV(0): Default mode "1920x1440": 297.0 MHz, 112.5 kHz, 75.0 Hz
....
Is there an X11 modelines calculator that you can feed the specs of the
display modes into, to get correct modelines to add in manually? I
confess that the description in the howto either leaves some terms
undefined, or else the failing is with me and I just can't wrap my head
around how to calculate it manually from the info I have in the vendor's
specs.
luke
This is what I use:
/usr/X11R6/bin/gtf

Geoff
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Michael Lake
2005-01-27 11:29:49 UTC
Permalink
Hi all

Last week I was asking if anyone had a graphics card I could use as mine failed.
After a reboot I kept getting a "(EE) No devices detected." when starting X.
Stephen Grady has kindly sent me a card and so I have a known good card to work with.
I am still getting exactly the same error !
This suggests that my Matro card may not be the problem - maybe its my motherboard.
Does anyone have suggestions on what I shoudl now try?

Information:

XFree86.0.log says
......
(II) MGA: driver for Matrox chipsets: mga2064w, mga1064sg, mga2164w,
mga2164w AGP, mgag100, mgag100 PCI, mgag200, mgag200 PCI, mgag400,
mgag550
(II) Primary Device is: ISA
(EE) No devices detected.

Fatal server error:
no screens found

I have configured XF86Config-4 using dpkg-reconfigure.

lspci says
0000:00:05.0 VGA compatible controller: Matrox Graphics, Inc. MGA 2064W [Millennium] (rev 01)

/proc/pci says
PCI devices found:
Bus 0, device 5, function 0:
VGA compatible controller: Matrox Millennium (rev 1).
Medium devsel. Fast back-to-back capable. IRQ 18.
Non-prefetchable 32 bit memory at 0x9000000 [0x9000000].
Non-prefetchable 32 bit memory at 0x9800000 [0x9800000].

So according to the above I have a video device detected at boot time.

The XF86Config-4 file has:

Section "Device"
Identifier "Matrox Millenium"
Driver "mga"
BusID "PCI:0:5:0"
EndSection

I DO get a screen of vga text i.e. a console and I can login fine but just cant 'startx'

Googling for this error indicates that this occurs if X cannot determine what video card one is running.
This should not be a problem as it used to work and Matrox cards are supported by the mga driver.

Is there another way to get more info on what the problem might be?

Mike
--
Mike Lake
Caver, Linux enthusiast and interested in anything technical.
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Michael Lake
2005-01-30 01:34:15 UTC
Permalink
Hi all

I have been googling over newsgroups and places trying to work out why I can't start X on an Alpha.
I have little progress but have made some interesting observations.

Posts by people with the same problem as me were caused by them
1. using the wrong driver or
2. needing to specify the PCI:bus:slot:function.
In my case I have the right driver and the right PCI slot (from lspci and /proc).

Now in XFree86.0.log file (--) stands for a probed value. Comparing an XFree86.0.log file
from now PowerBook I have this....

log$ grep '(--)' XFree86.0.log
Markers: (--) probed, (**) from config file, (==) default setting,
(--) using VT number 7
(--) PCI:*(0:16:0) ATI Technologies Inc Radeon Mobility M7 LW [Radeon Mobility 7500]
(--) Assigning device section with no busID to primary device
(--) Chipset ATI Radeon Mobility M7 LW (AGP) found
(**) RADEON(0): Depth 24, (--) framebuffer bpp 32
(--) RADEON(0): Chipset: "ATI Radeon Mobility M7 LW (AGP)" (ChipID = 0x4c57)
(--) RADEON(0): Linear framebuffer at 0xb8000000
(--) RADEON(0): BIOS at 0xb0020000
(--) RADEON(0): VideoRAM: 32768 kByte (128 bit DDR SDRAM)
(--) RADEON(0): Virtual size is 1280x854 (pitch 1280)
(--) Depth 24 pixmap format is 32 bpp
...... snipped
(II) Primary Device is: PCI 00:10:0

Now looking at the XFree86.0.log file fom the Alpha there is NO probing of
the PCI bus.
I addition there is the line:
(II) Primary device is: ISA

To me this seems strange. Why isnt X probing? Why is the primary device ISA when the video
card is in a PCI slot?

Mike

-----------------------------
Post by Michael Lake
Last week I was asking if anyone had a graphics card I could use as mine
failed. After a reboot I kept getting a "(EE) No devices detected." when
starting X.
.... snipped...
Post by Michael Lake
XFree86.0.log says
......
(II) MGA: driver for Matrox chipsets: mga2064w, mga1064sg, mga2164w,
mga2164w AGP, mgag100, mgag100 PCI, mgag200, mgag200 PCI, mgag400,
mgag550
(II) Primary Device is: ISA
(EE) No devices detected.
no screens found
I have configured XF86Config-4 using dpkg-reconfigure.
lspci says 0000:00:05.0 VGA compatible controller: Matrox Graphics,
Inc. MGA 2064W [Millennium] (rev 01)
/proc/pci says
VGA compatible controller: Matrox Millennium (rev 1).
Medium devsel. Fast back-to-back capable. IRQ 18.
Non-prefetchable 32 bit memory at 0x9000000 [0x9000000].
Non-prefetchable 32 bit memory at 0x9800000 [0x9800000].
So according to the above I have a video device detected at boot time.
Section "Device"
Identifier "Matrox Millenium"
Driver "mga"
BusID "PCI:0:5:0"
EndSection
--
Mike Lake
Caver, Linux enthusiast and interested in anything technical.
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
l***@optushome.com.au
2005-01-27 13:30:24 UTC
Permalink
Post by l***@optushome.com.au
Ah. Yes, I remember the problem I had, now: not enough knowledge. :-)
Umm, {:-), have you read the Video-Timings(?)-HowTO (or RTFM politely).
It is a bit head turning.
I tried - but some of the variables aren't defined - they're assumed
knowledge I think (I had the same problem with Peter Chubb's attempt to
explain to me).
My 2c, can your video card handle these modes?
Ah. Excellent question. It's an Nvidia Riva TNT2. I found a random
web page discussing the Riva TNT2 M64 and that it supports 2048x1536.
I'll continue to check.
Post by l***@optushome.com.au
Sorry for being so thick.
Naah, just don't try the readings or calcs after a party in the week
prior. {:-).
:-) You can say *that* again.

Geoff Reidy uses gtf - I'll see if I can find the source for that (or
try it on one of my newer Linux distros) and see how that works out
(it's not part of my old but continuously updated RH7.2).
The solutions in the thread so far seem a little labor intensive: are
y'all aware it should be possible to get exact modelines from your
Windows monitor.inf file?
I think there's even tools to put them into the format you'd use in
xorg.conf (or XF86ConFiGrANdoMCAPS.CONFOMGWTFBBQ for those so inclined).
I did have a look at that file originally, but couldn't find any meaty
looking numbers in it. In fact I got the impression that Windows must
do its own calculations after querying the monitor, there was so little
info in the .inf file. But I'll look again - perhaps I only looked at
XP's one.

Thanks, guys, for all the leads.

luke
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
Loading...