nV News Forums

 
 

nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   NVIDIA Linux (http://www.nvnews.net/vbulletin/forumdisplay.php?f=14)
-   -   modeline syntax? Please hel (http://www.nvnews.net/vbulletin/showthread.php?t=85594)

tribble222 02-02-07 07:42 PM

modeline syntax? Please hel
 
Short version:

What is the proper syntax for the modeline when adding it with XNVCTRLSetStringAttribute?


Long version:

I compiled the sample program in the nvidia-settings source tarball /nvidia-settings-1.0/samples/nv-control-dpy and am trying to use it to add a modeline to the current modepool. When I run the command ./nv-control-dpy --add-modeline 0x00020000 "1280x720 74.2 1280 1344 1352 1648 720 725 730 750 -HSync -VSync" it returns Failed to add the modeline "1280x720" to DFP-1's mode pool. I also cannot delete modelines even when I copy paste the exact modeline printed when I query all available modelines. All the other functions of the program work perfectly so it must be something to do with my syntax. So I looked at the NVCtrl.h and it says

/*
* NV_CTRL_STRING_ADD_MODELINE - Adds a ModeLine to the specified
* display device. The ModeLine is not added if validation fails.
*
* The ModeLine string should have the same syntax as a ModeLine in
* the X configuration file; e.g.,
*
* "1600x1200" 229.5 1600 1664 1856 2160 1200 1201 1204 1250 +HSync +VSync
*/

So somehow my modelines aren't passing validation. I even copy-pasted the example modeline and it didn't work. I'm probably doing something stupid. Can anybody tell the exact proper syntax?

tribble222 02-02-07 07:57 PM

Re: modeline syntax? Please hel
 
Update:

I figured out how to successfully remove modelines. When I query the list of available modelines, they come back like

source=xserver :: "320x240d60" 12.6 320 328 376 400 240 490 492 524 DoubleScan -HSync -VSync

In order to delete that modeline I just refer to it as "320x240d60" when I run the program.

i.e. ./nv-control-dpy --delete-modeline 0x00020000 "320x240d60"

This works great. I cannot add modelines in the same way however. So I am stuck.

pe1chl 02-03-07 03:15 AM

Re: modeline syntax? Please hel
 
The problem is probably not the syntax, but the checks that the driver makes to compare your modeline with the EDID data received from the screen.
E.g. when your screen says "my native resolution is 1280x1024" and you send a modeline that says "use 1600x1200 resolution" the driver will reject the modeline.

You can turn that off with an option in the X configuration file.

kokoko3k 11-09-10 11:08 AM

Re: modeline syntax? Please hel
 
I'm sorry to bump this ancient thread, but could some developer put some light upon us?
I've disabled the relevant checks in xorg.conf, but i still have that problem.

bwheaton 07-09-11 03:45 AM

Re: modeline syntax? Please hel
 
Sorry to resurrect this very old thread, but not much has changed... so:

I'm trying to use the NV-control API to add modelines. To test, I'm also using the nv-control-dpy sample. It fails to add modelines, on the whole. I got it once, with an odd modeline, but not reliably. Is this an EDID check problem? Our xorg.conf tries to hit every possible 'ignore EDID' flag. Does nv-control not have an equivalent?

Bruce

AaronP 07-09-11 02:15 PM

Re: modeline syntax? Please hel
 
Try running "nvidia-xconfig --mode-debug" or starting X with "startx -- -logverbose 6". I believe it will log mode validation failures to /var/log/Xorg.0.log even if they're added at runtime via NV-CONTROL. Hopefully that will tell you why your modes are being rejected.

kokoko3k 07-11-11 01:13 AM

Re: modeline syntax? Please hel
 
@AaronP, as staded here:
http://www.nvnews.net/vbulletin/showthread.php?t=156273
Even trying to add a 'just deleted and working' modeline, fails.

Also, adding a modeline to xorg.conf works, the same modeline is refused when using 'nv-control-dpy --add-modeline'

bwheaton 07-11-11 01:50 PM

Re: modeline syntax? Please hel
 
@kokoko3k - did you try the startverbose tip and check the log yet? I haven't had a chance.

Bruce

kokoko3k 07-12-11 08:07 AM

Re: modeline syntax? Please hel
 
Yes i did, all it says is "Invalid modeline"
Here's what i did (successfully removed an edid modeline from the edid pool and unsucessfully tried to add it again)
Code:

Gozer ~ # nv-control-dpy  --print-used-modelines|grep -i edid
  DFP-0: source=xserver, source=vesa, source=edid :: "nvidia-auto-select"  108.000  1280 1328 1440 1688  1024 1025 1028 1066  +HSync +VSync
  DFP-0: source=xserver, source=vesa, source=edid :: "1280x1024_75"  135.000  1280 1296 1440 1688  1024 1025 1028 1066  +HSync +VSync
  DFP-0: source=xserver, source=vesa, source=edid :: "1280x960_60"  108.000  1280 1376 1488 1800  960 961 964 1000  +HSync +VSync
  DFP-0: source=xserver, source=vesa, source=edid :: "1152x864"  108.000  1152 1216 1344 1600  864 865 868 900  +HSync +VSync
  DFP-0: source=xserver, source=vesa, source=edid :: "1024x768_75"  78.750  1024 1040 1136 1312  768 769 772 800  +HSync +VSync
  DFP-0: source=xserver, source=vesa, source=edid :: "1024x768_70"  75.000  1024 1048 1184 1328  768 771 777 806  -HSync -VSync
  DFP-0: source=xserver, source=vesa, source=edid :: "1024x768_60"  65.000  1024 1048 1184 1344  768 771 777 806  -HSync -VSync
  DFP-0: source=xserver, source=vesa, source=edid :: "800x600_75"  49.500  800 816 896 1056  600 601 604 625  +HSync +VSync
  DFP-0: source=xserver, source=vesa, source=edid :: "800x600_72"  50.000  800 856 976 1040  600 637 643 666  +HSync +VSync
  DFP-0: source=xserver, source=vesa, source=edid :: "800x600_60"  40.000  800 840 968 1056  600 601 605 628  +HSync +VSync
  DFP-0: source=xserver, source=vesa, source=edid :: "800x600_56"  36.000  800 824 896 1024  600 601 603 625  +HSync +VSync
  DFP-0: source=xserver, source=vesa, source=edid :: "640x480_75"  31.500  640 656 720 840  480 481 484 500  -HSync -VSync
  DFP-0: source=edid :: "640x480_73"  31.500  640 656 696 832  480 481 484 520  -HSync -VSync
  DFP-0: source=edid :: "640x480_60"  25.180  640 648 744 800  480 482 484 525  -HSync -VSync
Gozer ~ # nv-control-dpy  --delete-modeline 0x00010000 "1024x768_70"

Using NV-CONTROL extension 1.27 on :1
Connected Display Devices:
  DFP-0 (0x00010000): Samsung SyncMaster
  DFP-1 (0x00020000): Samsung SyncMaster

Deleted modeline "1024x768_70" from DFP-0's mode pool.

Gozer ~ # nv-control-dpy  --add-modeline 0x00010000 "1024x768_70"  75.000  1024 1048 1184 1328  768 771 777 806  -HSync -VSync

Using NV-CONTROL extension 1.27 on :1
Connected Display Devices:
  DFP-0 (0x00010000): Samsung SyncMaster
  DFP-1 (0x00020000): Samsung SyncMaster

Failed to add the modeline "1024x768_70" to DFP-0's mode pool.

Gozer ~ # nv-control-dpy  --add-modeline 0x00010000 "1024x768_70"  "75.000  1024 1048 1184 1328  768 771 777 806  -HSync -VSync"

Using NV-CONTROL extension 1.27 on :1
Connected Display Devices:
  DFP-0 (0x00010000): Samsung SyncMaster
  DFP-1 (0x00020000): Samsung SyncMaster

Failed to add the modeline "1024x768_70" to DFP-0's mode pool.

Gozer ~ # nv-control-dpy  --add-modeline 0x00010000 "1024x768_70  75.000  1024 1048 1184 1328  768 771 777 806  -HSync -VSync"

Using NV-CONTROL extension 1.27 on :1
Connected Display Devices:
  DFP-0 (0x00010000): Samsung SyncMaster
  DFP-1 (0x00020000): Samsung SyncMaster

Failed to add the modeline "1024x768_70  75.000  1024 1048 1184 1328  768 771 777 806  -HSync -VSync" to DFP-0's mode pool.

Code:

Gozer ~ # tail /var/log/Xorg.1.log
[355601.374] (II) AT Translated Set 2 keyboard: Configuring as keyboard
[355601.374] (II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD)
[355601.374] (**) Option "xkb_rules" "evdev"
[355601.374] (**) Option "xkb_model" "evdev"
[355601.374] (**) Option "xkb_layout" "it"
[355601.374] (II) XKB: Reusing cached keymap
[355766.637] (WW) NVIDIA(0): Invalid ModeLine "1024x768_70"
[355784.359] (WW) NVIDIA(0): Invalid ModeLine "1024x768_70"
[355791.730] (WW) NVIDIA(0): Invalid ModeLine "1024x768_70  75.000  1024 1048 1184 1328
[355791.730] (WW) NVIDIA(0):    768 771 777 806  -HSync -VSync"


AaronP 07-12-11 12:38 PM

Re: modeline syntax? Please hel
 
Quote:

Originally Posted by kokoko3k (Post 2454838)
Yes i did, all it says is "Invalid modeline"
Here's what i did (successfully removed an edid modeline from the edid pool and unsucessfully tried to add it again)
Code:

Gozer ~ # nv-control-dpy  --add-modeline 0x00010000 "1024x768_70  75.000  1024 1048 1184 1328  768 771 777 806  -HSync -VSync"

Here's your problem. You need to pass the entire string to the server, which is what you did by enclosing it in double quotes to prevent the shell from expanding it, but you also need to enclose the mode name in quotes when passing it to the server. E.g.,
Code:

nv-control-dpy  --add-modeline 0x00010000 '"1024x768_70"  75.000  1024 1048 1184 1328  768 771 777 806  -HSync -VSync'
You may also need to change the name of the mode to disambiguate it, e.g. "custom_1024x768" or something.

kokoko3k 07-13-11 07:13 AM

Re: modeline syntax? Please hel
 
Great, finally i managed to add a modeline 'runtime', thanks AaronP.

I needed to do both things (double quotes and using a different name)

bwheaton 07-13-11 10:42 AM

Re: modeline syntax? Please hel
 
So, in nv-control-dpy (and the API), the same thing? I was trying modelines with no name, and that didn't work. The modeline name in quotes should be the key? I'll try it.

Bruce


All times are GMT -5. The time now is 10:06 PM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.