Bug 1346875

Summary: Off/On additional display cause 'Waiting for display...'
Product: Red Hat Enterprise Linux 6 Reporter: Radek Duda <rduda>
Component: spice-vdagentAssignee: Default Assignee for SPICE Bugs <rh-spice-bugs>
Status: CLOSED NOTABUG QA Contact: SPICE QE bug list <spice-qe-bugs>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.8CC: cfergeau, dblechte, jjongsma, rbalakri, rduda
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-16 16:31:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Radek Duda 2016-06-15 13:55:27 UTC
Description of problem:
If I turn additional monitor Off and On, blank screen appears with the message 'Waiting for display...'

Version-Release number of selected component (if applicable):
rhel6.8 nightly
spice-vdagent-0.14.0-11.el6.x86_64

How reproducible: always


Steps to Reproduce:
1.Boot guest VM, connect to it with remote-viewer
2.Enable additional display (in remote-viewer: View->Displays
3.In guest go to Diplay Preferences and turn additional monitor Off -> Apply 
4.Turn additional monitor On -> Apply

Actual results:
Additional display shows blank screen with message 'Waiting for display...'


Expected results:
The rhel desktop is visible on additional monitor after its turning on. 


Additional info:
* The problem can be workarounded if the additional display is switched off/on by the client.

* If the display is switched Off/On (by the client) in the state when the monitor is off (e.i. when shows blank screen with message 'Waiting for display...'), there is cca %50 probability that it will reappear blank again and cca 50% probability that the monitor turns on and rhel desktop appears. After turning additional monitor On (on guest side) the probability that it remain On after display Off/On (on client side) is 100% as expected (10 attempts).

vdagent log:
Jun 15 15:50:57.535956 spice-vdagent[3029]: debug: 0x1102010 received monitors config, arg1: 0, arg2: 0, size 328
Jun 15 15:50:57.535978 spice-vdagent[3029]: debug: from guest: 16, 1
Jun 15 15:50:57.535983 spice-vdagent[3029]: debug: received monitor 0 config 1024x768+0+0
Jun 15 15:50:57.535986 spice-vdagent[3029]: debug: received monitor 1 config 1024x768+1024+0
Jun 15 15:50:57.536272 spice-vdagent[3029]: debug: after zeroing: 2, 1
Jun 15 15:50:57.536284 spice-vdagent[3029]: debug: received monitor 0 config 1024x768+0+0
Jun 15 15:50:57.536288 spice-vdagent[3029]: debug: received monitor 1 config 1024x768+1024+0
Jun 15 15:50:57.536366 spice-vdagent[3029]: debug: Changing screen size to 2048x768
Jun 15 15:50:57.645732 spice-vdagent[3029]: debug: Screen 0 1024x768+0+0
Jun 15 15:50:57.645748 spice-vdagent[3029]: debug: Screen 1 1024x768+1024+0
Jun 15 15:50:57.645751 spice-vdagent[3029]: debug: 0x1102010 sent guest xorg resolution, arg1: 2048, arg2: 768, size 32
Jun 15 15:51:08.971634 spice-vdagent[3029]: debug: Screen 0 1024x768+0+0
Jun 15 15:51:08.971649 spice-vdagent[3029]: debug: 0x1102010 sent guest xorg resolution, arg1: 2048, arg2: 768, size 16
Jun 15 15:51:08.972011 spice-vdagent[3029]: debug: Root size of screen 0 changed to 1024x768 send 1
Jun 15 15:51:08.972194 spice-vdagent[3029]: debug: Screen 0 1024x768+0+0
Jun 15 15:51:08.972201 spice-vdagent[3029]: debug: 0x1102010 sent guest xorg resolution, arg1: 1024, arg2: 768, size 16
Jun 15 15:51:08.972391 spice-vdagent[3029]: debug: primary: New selection owner: 16777264
Jun 15 15:51:08.972398 spice-vdagent[3029]: debug: 0x1102010 sent clipboard release, arg1: 1, arg2: 0, size 0
Jun 15 15:51:08.972401 spice-vdagent[3029]: debug: primary: New selection owner: 0
Jun 15 15:51:08.972403 spice-vdagent[3029]: debug: primary: New selection owner: 16777264
Jun 15 15:51:08.972405 spice-vdagent[3029]: debug: primary: New selection owner: 0
Jun 15 15:51:08.972533 spice-vdagent[3029]: debug: primary: XConvertSelection refused by clipboard owner
Jun 15 15:51:13.081973 spice-vdagent[3029]: debug: primary: New selection owner: 16777264
Jun 15 15:51:13.081991 spice-vdagent[3029]: debug: primary: New selection owner: 0
Jun 15 15:51:13.081995 spice-vdagent[3029]: debug: primary: New selection owner: 16777264
Jun 15 15:51:13.081998 spice-vdagent[3029]: debug: primary: New selection owner: 0
Jun 15 15:51:13.082001 spice-vdagent[3029]: debug: primary: XConvertSelection refused by clipboard owner
Jun 15 15:51:47.835021 spice-vdagent[3029]: debug: primary: New selection owner: 29360973
Jun 15 15:51:47.835570 spice-vdagent[3029]: debug: primary: received 9 targets:
Jun 15 15:51:47.835577 spice-vdagent[3029]: debug: primary: TIMESTAMP
Jun 15 15:51:47.835580 spice-vdagent[3029]: debug: primary: TARGETS
Jun 15 15:51:47.835582 spice-vdagent[3029]: debug: primary: MULTIPLE
Jun 15 15:51:47.835584 spice-vdagent[3029]: debug: primary: UTF8_STRING
Jun 15 15:51:47.835586 spice-vdagent[3029]: debug: primary: COMPOUND_TEXT
Jun 15 15:51:47.835588 spice-vdagent[3029]: debug: primary: TEXT
Jun 15 15:51:47.835590 spice-vdagent[3029]: debug: primary: STRING
Jun 15 15:51:47.835592 spice-vdagent[3029]: debug: primary: text/plain;charset=utf-8
Jun 15 15:51:47.835594 spice-vdagent[3029]: debug: primary: text/plain
Jun 15 15:51:47.835596 spice-vdagent[3029]: debug: 0x1102010 sent clipboard grab, arg1: 1, arg2: 0, size 4
Jun 15 15:52:08.091812 spice-vdagent[3029]: debug: primary: New selection owner: 29360973
Jun 15 15:52:08.091831 spice-vdagent[3029]: debug: 0x1102010 sent clipboard release, arg1: 1, arg2: 0, size 0

Comment 3 Jonathon Jongsma 2016-06-15 16:25:11 UTC
(In reply to Radek Duda from comment #0)

> 
> Steps to Reproduce:
> 1.Boot guest VM, connect to it with remote-viewer
> 2.Enable additional display (in remote-viewer: View->Displays
> 3.In guest go to Diplay Preferences and turn additional monitor Off -> Apply 

What happens if you insert these two steps?

3.1 Close Display Preferences application
3.2 re-open Display Preferences application

> 4.Turn additional monitor On -> Apply

Comment 5 Radek Duda 2016-06-16 10:24:30 UTC
(In reply to Jonathon Jongsma from comment #3)
> (In reply to Radek Duda from comment #0)
> 
> > 
> > Steps to Reproduce:
> > 1.Boot guest VM, connect to it with remote-viewer
> > 2.Enable additional display (in remote-viewer: View->Displays
> > 3.In guest go to Diplay Preferences and turn additional monitor Off -> Apply 
> 
> What happens if you insert these two steps?
> 
> 3.1 Close Display Preferences application
> 3.2 re-open Display Preferences application
> 
> > 4.Turn additional monitor On -> Apply

If I perform these two nested steps, the additional monitor can not be turned on in Display Preferences because it is not detected. If I select 'Detect monitor' button, nothing changes. ('Detect Monitors' pressing here the same effect as steps 3.1 and 3.2)

Additional monitor is detected by xrandr:
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192
qxl-0 connected 1024x768+0+0 0mm x 0mm
   1024x768      60.00*+
   2048x2048     60.00  
   2560x1600     60.00  
   2000x2000     60.00  
   2560x1440     60.00  
   2048x1536     60.00  
   1920x1440     60.00  
   1920x1200     60.00  
   1920x1080     60.00  
   1600x1200     60.00  
   1680x1050     60.00  
   1400x1050     60.00  
   1600x900      60.00  
   1280x1024     60.00  
   1440x900      60.00  
   1280x960      60.00  
   1366x768      60.00  
   1360x768      60.00  
   1280x800      60.00  
   1152x870      60.00  
   1152x864      60.00  
   1280x768      60.00  
   1280x760      60.00  
   1280x720      60.00  
   1024x600      60.00  
   960x640       60.00  
   832x624       60.00  
   800x600       60.00  
   800x480       60.00  
   640x480       60.00  
qxl-1 disconnected
   1024x739-1     0.06  
qxl-2 disconnected
qxl-3 disconnected

I found out that additional monitor might be turned on also by these two ways
a) resize client window of primary monitor (by mouse)
b) resize client window of additional monitor

Comment 6 Jonathon Jongsma 2016-06-16 16:31:35 UTC
This is due to how spice/qxl for linux works. When you disable a monitor via spice, it's roughly equivalent to if you had unplugged a monitor on a physical machine. And if a monitor is unplugged, it is not possible to turn it back on via the control panel on the computer. In other words, this is expected behavior based on how it is designed.

It's true that windows guests behave differently, but this is due to a significant difference in the design of the QXL drivers for linux and windows guests. On windows guests, there is a separate video device for each display, whereas on Linux guests, there is a single video device that can support up to 4 displays. 

We could perhaps investigate whether it would be possible to make the Linux QXL device behave more similarly to the windows device (despite the fundamental design differences), but I don't consider this current report to be a bug. 

(Note: there may be a bug in the control panel that causes the control panel to continue displaying the second display after it has been "unplugged" by spice. This makes the user think that they can re-enable that display via the control panel even though they cannot)