You are not logged in.

#1 2017-05-28 20:52:58

Ocye
Member
Registered: 2011-12-07
Posts: 29

xrandr reports BadMatch

I try to connect a secondary display per DVI.  It's an old TV with a native WSVG resolution. So my steps are

>cvt 1024 600
Modeline "1024x600_60.00"   49.00  1024 1072 1168 1312  600 603 613 624 -hsync +vsync
>xrandr --newmode "WSVGA" 49.00  1024 1072 1168 1312  600 603 613 624 -hsync +vsync
(no feedback, means okay)
>xrandr --addmode DVI-D-0 "WSVGA"
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  18 (RRAddOutputMode)
  Serial number of failed request:  45
  Current serial number in output stream:  46

Of course xrandr cannot find the mode 1024x600 nor WSVGA. It reports:

Screen 0: minimum 8 x 8, current 3200 x 1080, maximum 32767 x 32767
DVI-D-0 connected 1280x720+1920+0 (normal left inverted right x axis y axis) 800mm x 450mm
   1440x900      59.89 +  84.84  
   1920x1440     75.00  
   1920x1200     84.93  
   1920x1080     59.94    50.00    23.97    60.00    50.04  
   1680x1050     84.94  
   1600x1200     85.00  
   1280x1024     75.02  
   1280x960      85.00  
   1280x720      59.94*   50.00  
   1152x864      85.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    72.81    59.94    59.93  
HDMI-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
...

Those resolutions work but look awkward. What can I do?

Offline

#2 2017-05-29 10:48:43

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

Re: xrandr reports BadMatch

$ cvt 1024 600
# 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz
Modeline "1024x600_60.00"   49.00  1024 1072 1168 1312  600 603 613 624 -hsync +vsync
$

The line with the # lists the hsync and pixel clock values needed for this mode.
One or both of them may be out of range for your screen.

In your xorg log look for lines like these :

[   324.987] (II) RADEON(0): Serial No: FE30923001399
[   324.987] (II) RADEON(0): Monitor name: Philips 240PW
[   324.987] (II) RADEON(0): Ranges: V min: 48 V max: 85 Hz, H min: 24 H max: 94 kHz, PixClock max 175 MHz

The 3rd line has the values you want to know.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2017-05-29 18:32:08

Ocye
Member
Registered: 2011-12-07
Posts: 29

Re: xrandr reports BadMatch

Sounds reasonable, but the reported 600MHz would be more than what cvt reports (hsync: 37.35 kHz; pclk: 49.00 MHz). I suspect the connection via DVI to HDMI adapter and a cable to the Lenco TFT-1026 as the fly in the ointment. From the values I don't see anything what I can do.

tail /var/log/Xorg.0.log wrote:

[     7.052] (--) NVIDIA(GPU-0): Ancor Communications Inc ASUS VX278 (DFP-1): connected
[     7.052] (--) NVIDIA(GPU-0): Ancor Communications Inc ASUS VX278 (DFP-1): Internal TMDS
[     7.052] (--) NVIDIA(GPU-0): Ancor Communications Inc ASUS VX278 (DFP-1): 600.0 MHz maximum pixel clock
[     7.052] (--) NVIDIA(GPU-0):
[     7.052] (--) NVIDIA(GPU-0): DFP-2: disconnected
[     7.052] (--) NVIDIA(GPU-0): DFP-2: Internal DisplayPort
[     7.052] (--) NVIDIA(GPU-0): DFP-2: 1440.0 MHz maximum pixel clock
...
[   277.914] (--) NVIDIA(GPU-0): SPV Sunplus TV (DFP-0): connected
[   277.914] (--) NVIDIA(GPU-0): SPV Sunplus TV (DFP-0): Internal TMDS
[   277.914] (--) NVIDIA(GPU-0): SPV Sunplus TV (DFP-0): 600.0 MHz maximum pixel clock

Offline

#4 2017-05-29 23:17:00

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: xrandr reports BadMatch

You should have mentioned you use nvidia drivers. I think you did everything right and this could just be a bug in them. When I last experimented with xrandr --addmode etc., I remember seeing similar errors with nvidia. It might work if you add your modelines through an Xorg config instead of doing it live with xrandr.

Offline

#5 2017-05-30 08:50:32

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: xrandr reports BadMatch

I'd have to agree with Ropid on this one. I suppose nothing should prevent you from adding new modes to an output, maybe even modes that make no sense (I don't know if there are any basic sanity checks for parameters outside of what the output's hardware actually supports). The trouble should only come once you try to actually make use of the new mode(s) and the hardware refuses to work.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#6 2017-05-30 11:58:39

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

Re: xrandr reports BadMatch

I try to connect a secondary display per DVI.  It's an old TV with a native WSVG resolution.

That's the screen you want to get the Hsync / pixelclcock values for.

I do agree with ropid there's a good chance the nvidia driver doesn't play nice with xrandr but can work with this mode in a config file.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2017-05-31 18:15:41

Ocye
Member
Registered: 2011-12-07
Posts: 29

Re: xrandr reports BadMatch

Generated the xorg.conf with nvidia tool and modified the section for the TV as following

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "SPV Sunplus TV"
    Modeline       "WSVGA"   49.00  1024 1072 1168 1312  600 603 613 624 -hsync +vsync
    Option         "PreferredMode" "WSVGA"
EndSection

No luck, though. Neither this mode is offered at the tool nor with xrandr. And I still cannot add the mode.

PS: For completeness the (unchanged) screen section

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "metamodes" "DVI-D-0: nvidia-auto-select +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Last edited by Ocye (2017-05-31 18:16:39)

Offline

#8 2017-05-31 18:31:04

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: xrandr reports BadMatch

Can you show what X and the nvidia driver are printing in /var/log/Xorg.0.log while using this xorg.conf experiment?

Offline

#9 2017-05-31 20:43:18

Ocye
Member
Registered: 2011-12-07
Posts: 29

Re: xrandr reports BadMatch

Ropid wrote:

Can you show what X and the nvidia driver are printing in /var/log/Xorg.0.log while using this xorg.conf experiment?

Nothing else than what I quoted in comment 3.

Offline

#10 2017-05-31 21:36:52

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

Re: xrandr reports BadMatch

Ocye, please post full xorg log.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#11 2017-05-31 22:05:38

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: xrandr reports BadMatch

Ocye wrote:
Ropid wrote:

Can you show what X and the nvidia driver are printing in /var/log/Xorg.0.log while using this xorg.conf experiment?

Nothing else than what I quoted in comment 3.

What I'm interested in is, are the Screen and Monitor objects it actually uses in practice named the same as what's in your config? It might completely ignore what you've defined in your config and instead use a second set of objects built with settings it auto-detected. If this is happening, the identifiers that are mentioned in the log should show this. It should also print lines about what settings it applies to the different objects. That will be printed by the X server itself, while the messages in comment 3 are printed by the nvidia driver.

You could use more interesting identifiers in your config to makes it obvious what's defined by you and what the X server creates by itself. I mean instead of "Monitor1" use something like "My Sunplus TV", and instead of "Screen1" use "My X screen", instead of "Device1" use "My NVIDIA card".

Offline

#12 2017-06-02 12:03:16

Ocye
Member
Registered: 2011-12-07
Posts: 29

Re: xrandr reports BadMatch

Removed the generated xorg.conf and updated  my own with meaning full names:

Section "Monitor"
    Identifier  "Primary"
    Option      "PreferredMode" "1920x1080"
    Option      "Position" "0 0"
    VendorName     "ASUS"
    ModelName      "Ancor Communications Inc ASUS VX278"
    HorizSync       24.0 - 83.0
    VertRefresh     50.0 - 75.0
    Option         "DPMS"
EndSection

Section "Monitor"
    Identifier  "Secondary"
    Modeline "1024x600"   49.00  1024 1072 1168 1312  600 603 613 624 -hsync +vsync
    Option      "PreferredMode" "1024x600"
    Option      "Position" "1920 0"
    VendorName     "Lenco"
    ModelName      "SPV Sunplus TV"
    Modeline       "WSVGA"   49.00  1024 1072 1168 1312  600 603 613 624 -hsync +vsync
    Option         "PreferredMode" "WSVGA"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1060 6GB"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1060 6GB"
    BusID          "PCI:1:0:0"
    Screen          1
EndSection

Section "Screen"
    Identifier    "Main"
    Device         "Device0"
    Monitor       "Primary"
    Option         "Stereo" "0"
#    Option         "nvidiaXineramaInfoOrder" "DFP-1"
#    Option         "metamodes" "HDMI-0: nvidia-auto-select +0+0, DVI-D-0: 1024x600 +1920+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    Option         "DPI" "96 x 96"
EndSection

Section "Screen"
    Identifier    "Supp"
    Device         "Device1"
    Monitor       "Secondary"
    Option         "Stereo" "0"
#    Option         "metamodes" "DVI-D-0: nvidia-auto-select +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
EndSection

which is half-way ignored (wrong screen placement, default resolution).  XOrg reports

[     3.504] (==) Log file: "/var/log/Xorg.0.log", Time: Fri Jun  2 13:52:58 2017
[     3.506] (==) Using config directory: "/etc/X11/xorg.conf.d"
[     3.506] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[     3.507] (==) No Layout section.  Using the first Screen section.
[     3.507] (**) |-->Screen "Main" (0)
[     3.507] (**) |   |-->Monitor "Primary"
[     3.507] (**) |   |-->Device "Device0"
[     3.507] (**) |   |-->GPUDevice "Device1"

There is no line with HDMI-0 or DVI-D-0 in the X11 log but xrandr still reports these values.

Offline

#13 2017-06-02 12:30:15

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: xrandr reports BadMatch

Try adding a "ServerLayout" section. It looks like this according to "man xorg.conf":

ServerLayout sections have the following format:

    Section "ServerLayout"
        Identifier   "name"
        Screen       "screen-id"
        ...
        InputDevice  "idev-id"
        ...
        options
        ...
    EndSection

Each ServerLayout section must have an Identifier entry and at least one Screen entry.

There's also a "ServerFlags" section that you could add as well. Inside the ServerFlags section, this option here is available:

Option "DefaultServerLayout"  "layout-id"
       This  specifies the default ServerLayout section to use in the absence of the -lay‐
       out command line option.

EDIT: Also, I think you misunderstood what a "Screen" is. You want just one Screen. You do not want each monitor in its own Screen. This would mean that you can't move windows from one monitor to the other.

You need to somehow tie a "Monitor" section to the real monitor. Those "VendorName" and "ModelName" options are not used for that. They are just informational for you, same as the identifier. The xorg.conf man-page says this about how to tie stuff to a real monitor:

With  RandR  1.2-enabled  drivers, monitor sections may be tied to specific outputs of the
video card.  Using the name of the output defined by the video driver plus the  identifier
of  a monitor section, one associates a monitor section with an output by adding an option
to the Device section in the following format:

Option "Monitor-outputname" "monitorsection"

EDIT2: About what that "outputname" should be, you should search for that in the Xorg log. For me here, it seems the names shown in xrandr are different. Now thinking about all of this, I'm guessing you can chop away nearly everything out of the config, and just keep a section for the nvidia device, and monitor section for the TV, something like this:

Section "Device"
    Identifier "my nvidia gpu"
    Driver "nvidia"
    Option "Monitor-DFP-2" "my tv"
EndSection

Section "Monitor"
    Identifier "my tv"
    ...
EndSection

Last edited by Ropid (2017-06-02 12:49:37)

Offline

Board footer

Powered by FluxBB