Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-6912

android-plugin doesn't detect display (running with xvnc) on openSuse

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • openSuse 11.2 headless

      Running on headless openSuse 11.2 with xvnc plugin. From hudson logs vncserver starts successfully:

      Starting xvnc
      [workspace] $ env HOME=/home/hudson env USER=$USER vncserver :3 -geometry 800x600

      note: I had to feed the vnc plugin the two env variables otherwise it lso doesn't start.

      Anyway the emulator can't detect the display:

      [android] Starting Android emulator
      $ /opt/android-sdk-linux_86/tools/emulator -ports 46440,56478 -no-boot-anim -avd 1.6test
      SDL init failure, reason is: No available video device

      New 'X' desktop is hudsonsrv:3

      Not sure what he reasons are. Is the plugin starting before the xvnc is ready (I see the message about the desktop displayed just after the emulator failed to start) or does it simply not use wrong display?

          [JENKINS-6912] android-plugin doesn't detect display (running with xvnc) on openSuse

          Yes, I believe this happens if the VNC server isn't yet ready when the Android Emulator process starts.

          I've seen this behaviour myself, but it's not consistent. I imagine it has a lot to do with the speed and current load of a machine.

          Attached is an update to the 1.2 plugin that introduces a 10 second delay before starting the emulator process.

          Try that out and let us know whether you get any further.

          In a next release I'll either need to allow for a configurable delay before starting the emulator, or possibly find some way of detecting that a VNC server has been started and wait for it to be ready...

          Christopher Orr added a comment - Yes, I believe this happens if the VNC server isn't yet ready when the Android Emulator process starts. I've seen this behaviour myself, but it's not consistent. I imagine it has a lot to do with the speed and current load of a machine. Attached is an update to the 1.2 plugin that introduces a 10 second delay before starting the emulator process. Try that out and let us know whether you get any further. In a next release I'll either need to allow for a configurable delay before starting the emulator, or possibly find some way of detecting that a VNC server has been started and wait for it to be ready...

          svadu added a comment -

          Still not working - same symptoms.

          svadu added a comment - Still not working - same symptoms.

          Christopher Orr added a comment - - edited

          Ok, so you always see the "New 'X' desktop is hudsonsrv:3" after the emulator starts? Is it generally a consistent delay between the job starting and that message being displayed (possibly longer than 10 seconds)?

          Does starting the Android emulator succeed if you start the VNC server and emulator manually as the Hudson user?
          e.g.

          hudson$ env HOME=/home/hudson env USER=$USER vncserver :3 -geometry 800x600
          hudson$ DISPLAY=:3 /opt/android-sdk-linux_86/tools/emulator -ports 46440,56478 -no-boot-anim -avd 1.6test

          Christopher Orr added a comment - - edited Ok, so you always see the "New 'X' desktop is hudsonsrv:3" after the emulator starts? Is it generally a consistent delay between the job starting and that message being displayed (possibly longer than 10 seconds)? Does starting the Android emulator succeed if you start the VNC server and emulator manually as the Hudson user? e.g. hudson$ env HOME=/home/hudson env USER=$USER vncserver :3 -geometry 800x600 hudson$ DISPLAY=:3 /opt/android-sdk-linux_86/tools/emulator -ports 46440,56478 -no-boot-anim -avd 1.6test

          svadu added a comment -

          Ok, so you always see the "New 'X' desktop is hudsonsrv:3" after the emulator starts?

          Yeah, except that I thought it was the Xvnc's output and not the android plugin... (but I guess you know better ) ?

          Is it generally a consistent delay between the job starting and that message being displayed (possibly longer than 10 seconds)?

          YesI see a delay now, but eventually I still get the "SDL init failure, reason is: No available video device". In case its indeed just timing then delay might need to be much longer and it will actually be different per user... I think a real emulator detection is needed...

          Does starting the Android emulator succeed if you start the VNC server and emulator manually as the Hudson user?

          What I do is I add the emulator command to the xstartup script that executes whatever is listed there when a vncserver is starting and that works:

          /opt/android-sdk-linux_86/tools/emulator -ports 46440,56478 -no-boot-anim -avd 1.6test

          In this case it works with only having Xvnc plugin (of course it's not as configurable then)

          svadu added a comment - Ok, so you always see the "New 'X' desktop is hudsonsrv:3" after the emulator starts? Yeah, except that I thought it was the Xvnc's output and not the android plugin... (but I guess you know better ) ? Is it generally a consistent delay between the job starting and that message being displayed (possibly longer than 10 seconds)? YesI see a delay now, but eventually I still get the "SDL init failure, reason is: No available video device". In case its indeed just timing then delay might need to be much longer and it will actually be different per user... I think a real emulator detection is needed... Does starting the Android emulator succeed if you start the VNC server and emulator manually as the Hudson user? What I do is I add the emulator command to the xstartup script that executes whatever is listed there when a vncserver is starting and that works: /opt/android-sdk-linux_86/tools/emulator -ports 46440,56478 -no-boot-anim -avd 1.6test In this case it works with only having Xvnc plugin (of course it's not as configurable then)

          Yeah, except that I thought it ("New 'X' desktop is hudsonsrv:3") was the Xvnc's output and not the android plugin... (but I guess you know better ) ?

          YesI see a delay now, but eventually I still get the "SDL init failure, reason is: No available video device". In case its indeed just timing then delay might need to be much longer and it will actually be different per user... I think a real emulator detection is needed...

          Yes, the "New 'X' desktop..." message comes from the VNC server, so it would seem a good indication that the VNC server is taking longer than 10 seconds to start up.

          The Android Emulator plugin has no VNC or display-related code; the only thing it does it makes sure it runs after the other plugins do (i.e. the Xvnc plugin).

          I don't think there's really a guaranteed way to determine that a VNC server has fully started-up. We could maybe detect that the Xvnc plugin is enabled, read the DISPLAY variable and wait for a TCP port based on that to become available. But that doesn't seem particularly ideal.

          What I do is I add the emulator command to the xstartup script that executes whatever is listed there when a vncserver is starting and that works.

          Can you just start the VNC server without the emulator in the xstartup script and see how long it takes?

          I think the short-term solution is to add a configurable delay between when the Android Emulator plugin gains control and when it actually starts the emulator process.

          Christopher Orr added a comment - Yeah, except that I thought it ("New 'X' desktop is hudsonsrv:3") was the Xvnc's output and not the android plugin... (but I guess you know better ) ? YesI see a delay now, but eventually I still get the "SDL init failure, reason is: No available video device". In case its indeed just timing then delay might need to be much longer and it will actually be different per user... I think a real emulator detection is needed... Yes, the "New 'X' desktop..." message comes from the VNC server, so it would seem a good indication that the VNC server is taking longer than 10 seconds to start up. The Android Emulator plugin has no VNC or display-related code; the only thing it does it makes sure it runs after the other plugins do (i.e. the Xvnc plugin). I don't think there's really a guaranteed way to determine that a VNC server has fully started-up. We could maybe detect that the Xvnc plugin is enabled, read the DISPLAY variable and wait for a TCP port based on that to become available. But that doesn't seem particularly ideal. What I do is I add the emulator command to the xstartup script that executes whatever is listed there when a vncserver is starting and that works. Can you just start the VNC server without the emulator in the xstartup script and see how long it takes? I think the short-term solution is to add a configurable delay between when the Android Emulator plugin gains control and when it actually starts the emulator process.

          svadu added a comment -

          ok, it takes almost 42 seconds on my server (it's busy)

          I agree that as a short term solution what you're proposing might do

          svadu added a comment - ok, it takes almost 42 seconds on my server (it's busy) I agree that as a short term solution what you're proposing might do

          Added a new configuration option (under "Advanced") allow a configurable delay per-build.

          Version 1.3 of the plugin should appear in the Update Center within the next 12 hours or so.

          ------------------------------------------------------------------------
          r33025 | orrc | 2010-07-18 14:39:03 +0200 (Sun, 18 Jul 2010) | 6 lines

          [android-emulator] Add several new configuration options:

          • The presence and size of an SD card can be controlled.
          • The emulator can have its state reset at every start up.
          • The emulator UI can be hidden during the build.
          • Starting the emulator can be delayed by a configurable period, e.g. to allow a VNC server to start up.

          Christopher Orr added a comment - Added a new configuration option (under "Advanced") allow a configurable delay per-build. Version 1.3 of the plugin should appear in the Update Center within the next 12 hours or so. ------------------------------------------------------------------------ r33025 | orrc | 2010-07-18 14:39:03 +0200 (Sun, 18 Jul 2010) | 6 lines [android-emulator] Add several new configuration options: The presence and size of an SD card can be controlled. The emulator can have its state reset at every start up. The emulator UI can be hidden during the build. Starting the emulator can be delayed by a configurable period, e.g. to allow a VNC server to start up.

          svadu added a comment -

          Great, I can't wait!

          svadu added a comment - Great, I can't wait!

            orrc Christopher Orr
            svadu svadu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: