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

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

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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?

        Attachments

          Activity

          Hide
          orrc 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...

          Show
          orrc 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...
          Hide
          svadu svadu added a comment -

          Still not working - same symptoms.

          Show
          svadu svadu added a comment - Still not working - same symptoms.
          Hide
          orrc 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
          Show
          orrc 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
          Hide
          svadu 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)

          Show
          svadu 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)
          Hide
          orrc 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.

          Show
          orrc 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.
          Hide
          svadu 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

          Show
          svadu 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
          Hide
          orrc 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.
          Show
          orrc 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.
          Hide
          svadu svadu added a comment -

          Great, I can't wait!

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

            People

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

              Dates

              • Created:
                Updated:
                Resolved: