[1.1.0] Windows 7: Capture problems when changing multi monitor setup without reboot

Bug #1408486 reported by Raffles
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Confirmed
Medium
RaiMan

Bug Description

Hi,

New here but couldn't find this reported yet. On Windows 7 SP1 64-bit, I have just done a fresh install of Sikuli (the latest stable release at time of writing SikuliX-1.0.1). Tried out hello world tutorial but on the first step got a black screen when capturing image. The screen was all black but with the large white text "select an image". Once a region was selected, the captured image also came out solid black (my desktop is not black). I have tried this a few times including after restarting and get the same results each time.

Note this is not bug 752065 "Screen goes black when capturing image when running on VM Fusion" - I am not using a virtual machine. However the symptoms are otherwise similar. Of note, I do have Virtual Box installed, although it was not running at the time.

Given this release is quite old now, I am guessing it may possibly be an issue on my part, otherwise somebody else would have reported it?

Raffles (robert-finking)
tags: removed: screen
Revision history for this message
RaiMan (raimund-hocke) wrote : Re: [1.0.1] Windows 7 Fresh Install select an image black screen

Do you have more than 1 monitor in use?

you might try with 1.1.0
start here: http://sikulix.com

description: updated
summary: - Windows 7 Fresh Install select an image black screen
+ [1.0.1] Windows 7 Fresh Install select an image black screen
Revision history for this message
Raffles (robert-finking) wrote :

There is only one monitor in use at present but I do sometimes connect a second monitor. I am currently awaiting clearance from my client to use SikuliX.

Revision history for this message
RaiMan (raimund-hocke) wrote :

In any case I recommend to use 1.1.0 in case of problems like this with 1.0.1

If the problem persists, start the IDE from command line using
runsikulix.cmd -d 3 -c

and check the debug output.

In the past sometimes such problems where reported and tracked down to graphics card problems together with the Java version.

I recommend the use of Java 7 latest version, but Java 6 latest version should work as well.

Revision history for this message
Raffles (robert-finking) wrote :

Thanks. I now have permission to install 1.1.0 on my client's machine. It is not possible for me to use the online installation here since each download has to be manually authorized, however the offline install doesn't seem to work. I am following the offline setup instructions on the http://www.sikulix.com/quickstart.html page:
 - The 1.1.0-1.jar and 1.1.0-2.jar files download fine.
 - I run the setup (selecting option 1) and a dialog asks me if I want to use the local copies and I click "Yes"
 - I very briefly see an error about "1.1.0-SNAPSHOT".
 - The message disappears, then a dialog box appears saying "Something serious happened! Sikuli not useable!"

This final dialog box refers me to the install log (pasted below for convenience).

Thanks very much for your support by the way, much appreciated. I'm really hoping I can puruade my client to use Sikuli.

[debug (08/01/15 10:30:53)] Debug: setLogFile: C:\Users\NQRL8XT\Downloads\sikuli-1.1.0\SikuliX-1.1.0-SetupLog.txt
[debug (08/01/15 10:30:53)] RunSetup: ... starting with no args given
[debug (08/01/15 10:30:53)] RunSetup: Setup in: C:\Users\NQRL8XT\Downloads\sikuli-1.1.0
using: C:\Users\NQRL8XT\Downloads\sikuli-1.1.0\sikulixsetup-1.1.0.jar
[debug (08/01/15 10:30:53)] RunSetup: SikuliX Setup Build: 1.1.0 2015-01-06_11:47nightly
[debug (08/01/15 10:30:54)] RunSetup: RunningSystem: Windows 6.1
[debug (08/01/15 10:30:54)] RunSetup: parent of jar/classes: C:\Users\NQRL8XT\Downloads\sikuli-1.1.0
[debug (08/01/15 10:30:54)] RunSetup: RunningJava: Java 7 (amd64) 1.7.0_25-b17
[debug (08/01/15 10:30:59)] FileManager: deleteFileOrFolder: C:\Users\NQRL8XT\Downloads\sikuli-1.1.0\SikuliPrefs.txt
[debug (08/01/15 10:30:59)] RunSetup:
popAsk: --------------------
The following file(s) will be downloaded to
C:\Users\NQRL8XT\Downloads\sikuli-1.1.0
--- Native support libraries for Windows (sikulixlibs...)
--- Package 1 ---
1.1.0-1.jar (IDE/Scripting)
1.1.0-2.jar (Java API)
 - with Jython
Only click NO, if you want to terminate setup now!
Click YES even if you want to use local copies in Downloads!
--------------------
[debug (08/01/15 10:31:01)] ResourceLoader: SikuliX Package Build: 1.1.0 2015-01-06_11:47nightly
[error (08/01/15 10:31:01)] RunSetup: main: Maven download: could not get timestamp or buildnumber from:
https://oss.sonatype.org/content/groups/public/com/sikulix/sikulixlibswin/1.1.0-SNAPSHOT/maven-metadata.xml
with content:

[debug (08/01/15 10:31:01)] FileManager: Downloading 1.1.0-SNAPSHOT with unknown size
[error (08/01/15 10:31:01)] FileManager: problems while downloading
oss.sonatype.org
[error (08/01/15 10:31:04)] RunSetup: Fatal error 001: not able to download: 1.1.0-SNAPSHOT
[error (08/01/15 10:31:04)] RunSetup: ... terminated abnormally :-(
[debug (08/01/15 10:31:04)] RunSetup:
popError: --------------------
Something serious happened! Sikuli not useable!
Check the error log at C:\Users\NQRL8XT\Downloads\sikuli-1.1.0\SikuliX-1.1.0-SetupLog.txt
--------------------

Revision history for this message
RaiMan (raimund-hocke) wrote :

go back to the nightly build page and read through the part regarding offline setup.

This should make it clear.

Revision history for this message
RaiMan (raimund-hocke) wrote :

ok, just had a look at the quick start page:
has to be revised ;-)

thanks.

Revision history for this message
Raffles (robert-finking) wrote :

OK trying a few things, reconnected the second monitor and rebooted and the black screen went away. The reboot was not my choice - windows blue screened when I connected the second monitor and try to select desktop->right-click->Screen Resolution, so I don't know if the reboot was necessary to fix the problem or not. If I now disconnect the other monitor (both physically and in Windows) without rebooting, the black screen problem does not reappear.

However things are still not quite right. When I capture an image, the screen goes darker now as expected but also shifts down and right by about 20 pixels, with a black border appearing along the top and left, and along the bottom a similar sized border that is not shifted at all. This means there is a line of about 20 pixels wide along the bottom of the screen that can't be selected. Similarly I can't select anything below the line - if I try, it just comes out black. Finally, if I do select anything at the bottom of the screen without straying into the "capture goes black" region, although the captured image seems to be OK the matching doesn't seem to work properly. Having tried a few things I have come to the conclusion that the image capture is fine, but that the image searching code is viewing the desktop the way it shows me it when the screen goes dark. This would explain the failure to match at the bottom of the screen (it can't see it) and also the fact that the mouse pointer always seems to move to a point offset down and right of the matched image.

Reconnecting the second monitor is a workaround for now. Hopefully it is useful info to you for finding the cause of the problem. I realise that this is probably not Sikuli's fault but the underlying libraries, but maybe it helps.

Revision history for this message
Raffles (robert-finking) wrote :

Good news - I just rebooted the PC *after* (re)disconnecting the monitor. After the reboot, not only do I not see the black screen selection problem but the annoying 20 pixel offset has gone. I can re-run the script I wrote previously and it now moves the mouse to the correct places. I guess it would be nice to know what caused this but feel free to close it from my point of view. Do you want me to raise a separate ticket about the offline-install instructions on the website?

Revision history for this message
RaiMan (raimund-hocke) wrote :

--- offline-install instructions on the website?
thanks, I have already fixed it

Revision history for this message
RaiMan (raimund-hocke) wrote :

--- the cause for the problems
… is the configuration of multi monitor setups in your case.
At least on Windows 7 we have the situation, that changes while Windows is running might not be detected by Java or are not completely updated to the internal places, where Java gets the monitor setup information.
When running with a multi monitor config with Sikuli, the safest way is to take care, that the system boots with the physical monitor setup in place at startup.
Which means, that you should reboot, when changing the monitor setup, if you get these problems with SikuliX.

If you start SikuliX from command line with the options -d 3 -c you get a debug info about how Sikuli sees the monitors. If this is how it should be, then SikuliX should work.

summary: - [1.0.1] Windows 7 Fresh Install select an image black screen
+ [1.1.0] Windows 7: Capture problems when changing multi monitor setup
+ without reboot
Changed in sikuli:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 2.0.0
Revision history for this message
Raffles (robert-finking) wrote :

Thanks for the updates to the instructions I am further now, but still have problems. The sikulixlibswin-1.1.0.jar file seems to have got me past the previous problem, but I now get errors at the end of the install log and a matching dialog box when I try to run the IDE telling me "Terminating: No scripting support available: Rerun Setup!". I have re-run setup multiple times with and without deleting files/backups etc. but still get the same result.

Regarding the multi-monitor issue I think perhaps it is subtly different from the description. The problem occurred without any change to the monitor setup. The change was what fixed it. Several months ago, there had been two monitors connected, then the second monitor was re-assigned for other use. The machine has been rebooted many times since then. After all this time, I then installed Sikuli and hit the problem, which was fixed when the monitor was re-attached, the machine rebooted, and then the monitor removed and the machine rebooted again. I would not have discovered this if it was not for your insight, so thankyou! I only mention this in case it leads you to a false path trying to reproduce by disconnecting/reconnecting monitors without reboot.

Revision history for this message
RaiMan (raimund-hocke) wrote :

-- setup problem
- delete everything in the setup folder except the setup jar.
- run setup
- send the setup log file (SikuliX-1.1.0-SetupLog.txt) silently to my mail at https://launchpad.net/~raimund-hocke

Revision history for this message
RaiMan (raimund-hocke) wrote :

thanks for the additional information on the monitor setup

RaiMan (raimund-hocke)
Changed in sikuli:
status: In Progress → Confirmed
milestone: 2.0.0 → none
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.