You are not logged in.

#1 2010-11-06 00:00:50

getdown
Member
Registered: 2010-11-05
Posts: 4

[xrandr] using xrandr with nvidia non-free drivers

Hello,

I have a problem with nvidia non-free drivers. I would like to use xrandr to manage my screen configuration but it doesn't work with this drivers.
I saw in different wikis or forums that I had to add to my "Device Section" in /etc/X11/xorg.conf.d/20-nvidia.conf this line : 

 Option "DynamicTwinView" "false" 

But it doesn't change anything.

Here is my file "20-nvidia.conf" : (maybe some lines are useless ?)

Section "Device"
        Identifier "Default nvidia Device"
        Driver "nvidia"
        Option "NoLogo" "True"

        Option "TripleBuffer" "1"
        Option "DynamicTwinView" "false"
        Option "TripleBuffer" "True"
        Option "AddARGBGLXVisuals"
EndSection

Section "Extensions"
  Option "Composite" "Enable"
EndSection


Has someone an idea to fix my problem ?

Thanks and sorry if I make some language errors (I'm french).
Getdown

Offline

#2 2010-11-06 00:10:02

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,358

Re: [xrandr] using xrandr with nvidia non-free drivers

Why are you trying to use xrandr? nvidia's drivers don't support anything past xrandr1.1. You should use nvidia-settings instead (it can be run as command-line), or the helper apps disper and auto-disper.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#3 2010-11-06 13:11:26

getdown
Member
Registered: 2010-11-05
Posts: 4

Re: [xrandr] using xrandr with nvidia non-free drivers

Hi,
thanks for your quick answer.
Actually I didn't know disper and auto-disper and it's exactly what I was expecting for my laptop.
I will try it and I tell you if it works but I am not able to try it before a few days.

Getdown

Last edited by getdown (2010-11-06 13:13:41)

Offline

#4 2010-11-10 17:30:25

getdown
Member
Registered: 2010-11-05
Posts: 4

Re: [xrandr] using xrandr with nvidia non-free drivers

Hi,

I tested disper which is very good software, and auto-disper which works pretty well. But I still have an "issue" with this one.

I would like to use 3 configurations for my two screens (laptop screen and vga screen plugged in) : only my laptop, only my vga screen, and extended desktop on both.
I have a problem when my additional screen is plugged because by default auto-disper only reconizes the "extended desktop" config and not the "only vga" one, while I would like "only vga" by default. I can still load "only vga" one with --load argument.

here are some results when my second screen is plugged in :

myhost .auto-disper]$ auto-disper
dual (detected)

[me@myhost .auto-disper]$ auto-disper --load vga
 -> loading profile vga
unrecognised scaling value for DFP-0 from nvidia-settings: 131073

[me@myhost .auto-disper]$ auto-disper --change
dual (detected)
 -> loading profile dual

Another probleme is that I would like to use fn+F4 to make a call to auto-disper and I don't manage to find fn key code, and then how am I supposed to assigned I combination of keycode ?

Sorry I don't know if my message is clear enough
Thanks for helping me.
Getdown

Last edited by getdown (2010-11-10 17:54:13)

Offline

#5 2010-11-10 22:49:42

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,358

Re: [xrandr] using xrandr with nvidia non-free drivers

If you look at the auto-disper script, they only support 2 monitors.

Go search for xbindkeys.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#6 2010-11-11 11:20:51

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,420

Re: [xrandr] using xrandr with nvidia non-free drivers

Is still possible to use xrandr with twinview to switch between modes, but the behavior is different.
On my dual head setup, i've:

xrandr: Failed to get size of gamma for output default
Screen 0: minimum 1280 x 1024, current 2560 x 1024, maximum 2560 x 1024
default connected 2560x1024+0+0 0mm x 0mm
   2560x1024      50.0* 
   1280x1024      51.0  

Actually, the reported screen refresh is wrong because it identify a unique metamode id rather than the real screen refresh,
but you can still switch between metamodes using something like:

xrandr -s 2560x1024 -r 50.0

Also, inside the nvidia-utils source package, there's a tool named nv-control-dpy, in the samples subdir.
It allows you to print,show,add and delete metamodes on the fly.
So the idea is to use nvidia-settings to create new metamodes with various configuration, print and add them to the pool with nv-control-dpy, and switch between them using xrandr (which you can call with an hotley using xbindkeys).

Here's a sample workflow:
* open nvidia-settings, go to X Server Display Configuration, choose a layout, click Apply
* in a console, get the current metamode:

Gozer ~ # nv-control-dpy --print-current-metamode

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

current metamode: "id=52, switchable=no, source=nv-control :: DFP-0: 1280x1024 @1280x1024 +1280+0, DFP-1: nvidia-auto-select @1280x1024 +0+103"

- use nvidia-settings again to switch to another mode, or else the following step will not work:
- add the previous metamode to the pool:

Gozer ~ # nv-control-dpy --add-metamode "DFP-0: 1280x1024 @1280x1024 +1280+0, DFP-1: nvidia-auto-select @1280x1024 +0+103"

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

Added MetaMode "DFP-0: 1280x1024 @1280x1024 +1280+0, DFP-1: nvidia-auto-select @1280x1024 +0+104"; pOut: "id=55"

- check via xrandr:

xrandr
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 1280 x 1024, current 2560 x 1127, maximum 2560 x 1127
default connected 2560x1127+0+0 0mm x 0mm
   2560x1024      50.0
   1280x1024      51.0
   2560x1128      55.0 

Bingo, issuing xrandr -s 2560x1128 -r 55 will set your new metamode.

-EDIT-
I'm using a wrapper script i called nvrandr to switch between modes, which has the advantage of allowing real refresh rate to be specified instead of ids, here is it:

#!/bin/bash
res=$1
hz=$2
id=$(nv-control-dpy --print-metamodes|grep _$hz|grep $res|cut -d "=" -f 2|cut -d "," -f 1|head -n 1)
xrandr -s $res -r $id

Usage is simple: "nvrandr.sh 2560x1128 60".
Assuming the real refresh rate of the display is 60hz, that will set the metamode 2560x1128 with id 55.

Last edited by kokoko3k (2010-11-11 11:28:29)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#7 2010-11-12 18:27:14

getdown
Member
Registered: 2010-11-05
Posts: 4

Re: [xrandr] using xrandr with nvidia non-free drivers

hi,

@kokoko3k : thank you for this other solution

@ngoonee : I looked for xbindkeys and also xev, but I don't manage to find key code for "Fn+F4".

Actualy I managed to assign "Fn + F4" combination using gnome control center application, but I would like to use it whatever the DE I'm on. So Gnome assigned to this combination the code "Mod4 + P".
But when I try with xev or xbindingkeys I have different results :

xev :

KeyRelease event, serial 35, synthetic NO, window 0x4a00001,
    root 0x27a, subw 0x0, time 2121599, (316,634), root:(319,687),
    state 0x40, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

xbindingkeys :

[me@myhost ~]$ xbindkeys -k
Press combination of keys or/and click under the window.
You can use one of the two lines after "NoCommand"
in $HOME/.xbindkeysrc to bind a key.
"(Scheme function)"
    m:0x40 + c:133
    Mod4 + Super_L

So I tried to put in my xbindkeysrc this (using kbindingkey results) :

"auto-disper --auto"
    m:0x40 + c:133
    Mod4 + Super_L

and I also tried with this (using parameter gnome used in shortcut control center application) :

"auto-disper --auto"
    Mod4 + P

But nothing seems to work (I tried with juste "F4" to see if it was really a configuration problem and it was ok, so it is).

Has someone an idea about how I could resolve this problem ?
Thx for helping me

[EDIT]

I finally manage to assign combination. Actually, my issue was because a conflict with compiz-fusion what is now solved !

Last question ... : I would like to run automatically "xbindkeys" and I tried to put this command in ~/.initrc which didn't exist, and it doesn't do anything. Where could I put the command call ? inittab ?
Same question with "auto-disper --change" that I would like to run when X server starts.

Last edited by getdown (2010-11-12 19:23:43)

Offline

#8 2010-11-13 14:55:20

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,358

Re: [xrandr] using xrandr with nvidia non-free drivers

getdown wrote:

Last question ... : I would like to run automatically "xbindkeys" and I tried to put this command in ~/.initrc which didn't exist, and it doesn't do anything. Where could I put the command call ? inittab ?
Same question with "auto-disper --change" that I would like to run when X server starts.

Autostart is DE-specific normally. There's no non-DE specific way that I'm aware off. You COULD do it from your DM (SLIM is able to, I think, stopped using it already).


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

Board footer

Powered by FluxBB