Unable to switch back from TV-only if TV is turned off.

Bug #830094 reported by Mattias
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
disper
New
Undecided
Unassigned

Bug Description

When trying to switch back to secondary display after physically turning off primary display it fails.

Turned of the primary display then ran the command: /usr/bin/disper -S -r 1680x1050

The mode I was in before trying to switch back was that which is generated by running: /usr/bin/disper -s -r 1920x1080
That is, the TV was the only of the two monitors displaying anything.

Got the following:
No secondary display found, falling back to primary.
deletion of dangling metamode 52 failed
X Error of failed request: BadValue (integer parameter out of range for operation)
  Major opcode of failed request: 130 (XFree86-VidModeExtension)
  Minor opcode of failed request: 10 (XF86VidModeSwitchToMode)
  Value in failed request: 0x540000e
  Serial number of failed request: 223
  Current serial number in output stream: 225

Mattias (mattias-webben)
description: updated
Revision history for this message
wvengen (wvengen) wrote :

Hi Mattias, thanks for your bug report. Maybe you can help me get it clear, could you please provide a step-by-step list of things you do exactly? Like which monitors are connected and turned on, what is enabled or not by default, and what commands you run, and what (dis)connections you make? It is important if monitors were physically connected or not (and in the case of TV possibly also if it was on or not). What cables/connectors do you use?

Revision history for this message
Mattias (mattias-webben) wrote :

My graphics card:
$ lspci | grep -i nvidia
01:00.0 VGA compatible controller: nVidia Corporation G80 [GeForce 8800 GTS] (rev a2)

It has two DVI-contacts. I use a dvi->hdmi converter to connect the TV via hdmi and I use a dvi->vga converter to connect my monitor via vga.

I always have both the monitors connected to the computer, but the TV is generally turned off.

When I want to watch something on the TV I use XBMC. To help me set everything up I have a script that does some things before XBMC is started.

One of those things is to verify that the TV is connected using CurrMonitors=$(disper -l | grep display | wc -l), if $CurrMonitors is != 2 the script will exit without doing anything else.

If both monitors are present (i.e. I've remembered to turn the TV on) the script changes the resolution to full-HD and blanks out the computer monitor using this command: disper -s -r 1920x1080

When I exit XBMC the script restores the resolution and activates both monitors using this command: disper -c -r 1680x1050

The error occurs when/if I turn off the TV before the disper -c -r 1680x1050 is run.

I do know that -c is for cloning, and cloning is impossible when the TV is turned off, but that usually only generates a error message and after that disper figures out there is only one display and puts the image there.

I've also added logic to have the script run disper -S -r 1680x1050 instead of disper -c -r 1680x1050 if the number of monitors is 1.

One easier way to reproduce the error than acquiring and running my script is this:
turn on TV
start a terminal
run 'disper -c -r 1680x1050'
run 'disper -s -r 1920x1080'
turn off TV
run 'disper -c -r 1680x1050' (or you can run disper -S -r 1680x1050, produces less error messages but does not work either)

The last command is run after you've shut the TV off, and since the TV is the only monitor with output you'll have to be able to run the command "blind". I just had the command typed in the terminal before turning the TV off and the just hit 'enter'.

Revision history for this message
wvengen (wvengen) wrote :

Hi, thank you for your description, that's useful. The nvidia driver needs at least one activated display that is physically connected or the driver or the X server will get into a state that may crash the system at some point (freed memory that is referenced). That's why you see the dangling metamode that could not be deleted.
To tackle this, disper always keeps the primary display as an activated display (even when only the secondary display is active). This works well for laptops, where the primary display is always connected as it is the laptop's internal display.

What you could do right now is switch your primary and secondary display, if your ordinary monitor is always connected. Let me know if that solves your problem.

Revision history for this message
Mattias (mattias-webben) wrote :

I read your reply as "physically switch ports for the monitors".
I've finally tried that, but it makes no difference.

Also, the computer monitor was already physically the primary one judging from the fact that that is the monitor that bios/post is displayed on.

I've also tried making sure that the computer monitor is the primary display by using the 'Make this the primary display for the X screen' checkbox in the 'NVIDIA X Server Settings' dialog. But checking that does not seem to have any effect.

Revision history for this message
Mattias (mattias-webben) wrote :

If I try to force the TV to be secondary disper refuses:

$ disper -S -r 1920x1080 -d DFP-0
specified displays ignored for secondary

Is there another way to control which display is primary and which is secondary?

Revision history for this message
wvengen (wvengen) wrote :

When choosing a secondary display, the list of displays should have more than one. The first display in the list of displays is the primary display, so
  $ disper -d DFP-0,CRT-0 -e -t right
gives the same setup as
  $ disper -d CRT-0,DFP-0 -e -t left
only in the former case DFP-0 is the primary display, whereas the latter gets CRT-0 as primary display.

The primary display is not something static, it gets set each time disper is run. So nvidia-settings' primary screen option does not change anything here.

Revision history for this message
Mattias (mattias-webben) wrote :

Reading your reply I figured that the following command would make the TV secondary and only display:

$ disper -d CRT-1,DFP-0 -r 1920x1080 -S
specified displays ignored for secondary

It did not, instead it placed the output on the computer monitor (CRT-1).

Is that weird, or am I just not understanding how this works?

Revision history for this message
wvengen (wvengen) wrote :

Disper seems to ignore the displays supplied with -S. This option only makes one output active, so it becomes the primary display as well. You cannot have a non-primary single display.

"Primary" and "secondary" refer to X's idea of what's the main output, it has nothing to do with physical connectors. As such it is only meaningful with more than one display active.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.