Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 02-02-07, 08:42 PM   #1
tribble222
Registered User
 
Join Date: Jan 2007
Posts: 2
Question 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 is offline   Reply With Quote
Old 02-02-07, 08:57 PM   #2
tribble222
Registered User
 
Join Date: Jan 2007
Posts: 2
Default 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.
tribble222 is offline   Reply With Quote
Old 02-03-07, 04:15 AM   #3
pe1chl
Registered User
 
Join Date: Aug 2003
Posts: 1,026
Default 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.
pe1chl is offline   Reply With Quote
Old 11-09-10, 12:08 PM   #4
kokoko3k
Registered User
 
Join Date: Jan 2007
Posts: 120
Default 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.
kokoko3k is offline   Reply With Quote
Old 07-09-11, 04:45 AM   #5
bwheaton
Registered User
 
Join Date: Nov 2008
Location: California
Posts: 59
Send a message via AIM to bwheaton
Default 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
bwheaton is offline   Reply With Quote
Old 07-09-11, 03:15 PM   #6
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default 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.
AaronP is offline   Reply With Quote
Old 07-11-11, 02:13 AM   #7
kokoko3k
Registered User
 
Join Date: Jan 2007
Posts: 120
Default 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'
kokoko3k is offline   Reply With Quote
Old 07-11-11, 02:50 PM   #8
bwheaton
Registered User
 
Join Date: Nov 2008
Location: California
Posts: 59
Send a message via AIM to bwheaton
Default Re: modeline syntax? Please hel

@kokoko3k - did you try the startverbose tip and check the log yet? I haven't had a chance.

Bruce
bwheaton is offline   Reply With Quote

Old 07-12-11, 09:07 AM   #9
kokoko3k
Registered User
 
Join Date: Jan 2007
Posts: 120
Default 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"
kokoko3k is offline   Reply With Quote
Old 07-12-11, 01:38 PM   #10
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default Re: modeline syntax? Please hel

Quote:
Originally Posted by kokoko3k View Post
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.
AaronP is offline   Reply With Quote
Old 07-13-11, 08:13 AM   #11
kokoko3k
Registered User
 
Join Date: Jan 2007
Posts: 120
Default 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)
kokoko3k is offline   Reply With Quote
Old 07-13-11, 11:42 AM   #12
bwheaton
Registered User
 
Join Date: Nov 2008
Location: California
Posts: 59
Send a message via AIM to bwheaton
Default 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
bwheaton is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
SuSe 8.0 Problems. GaMMa NVIDIA Linux 19 09-26-02 07:51 AM
Syntax error in rc.modules Kevin NVIDIA Linux 2 07-30-02 07:55 PM
Syntax error when compiling NVOpenGL SDK thursto77 NVIDIA Linux 2 07-29-02 06:55 PM

All times are GMT -5. The time now is 05:32 PM.


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