Take the 2-minute tour ×

This occurs using a few apks that make use of the camera (e.g., zxing, opencv). It displays a glitched image in the preview but it is still a function of what the camera sees so it appears to be an encoding mismatch. The native camera preview works fine, so the internal apps do not exhibit this problem.

share|improve this question
This bug still exists as of XE12. –  slugchewer Dec 20 '13 at 19:22

5 Answers 5

up vote 28 down vote accepted

For now, please try adding the following workaround after you acquire the Camera but before you setup and start the preview:

    Camera.Parameters params = camera.getParameters();
    params.setPreviewFpsRange(30000, 30000);

(Or just add the setPreviewFpsRange call to your existing parameters if you're setting others as well.)

share|improve this answer
30FPS seems a bit too high. I recommend something lower, 5FPS, especially for a battery hungry device like Glass. –  swooby Feb 13 at 1:25

For anyone using ZXing on their Glass, you can build a version from the source code with the above fix.

Add the following method into CameraConfigurationManager.java

  public void googleGlassXE10WorkAround(Camera mCamera) {
        Camera.Parameters params = mCamera.getParameters();
        params.setPreviewFpsRange(30000, 30000);

And call this method immediately after anywhere you see Camera.setParameters() in the ZXing code. I just put it in two places in the CameraConfigurationManager and it worked.

I set the Preview Size to be 640x360 to match the Glass resolution.

share|improve this answer
30FPS seems to be a lot, and the 640x360 preview size is not needed to fix the problem. The problem was the default FPS was too high at 60FPS. See my answer below... –  swooby Feb 13 at 1:21

30 FPS preview is pretty high. If you want to save some battery and CPU, consider the slowest supported FPS to be sufficient:

List<int[]> supportedPreviewFpsRanges = parameters.getSupportedPreviewFpsRange();
int[] minimumPreviewFpsRange = supportedPreviewFpsRanges.get(0);
parameters.setPreviewFpsRange(minimumPreviewFpsRange[0], minimumPreviewFpsRange[1]);
share|improve this answer
I don't know why someone voted this down. This is fact the exact code that ZXing accepted as a Pull Request from me to fix the problem: github.com/zxing/zxing/commit/… –  swooby Feb 13 at 1:13
Works for me. Best answer here IMO. –  Zarokka Mar 26 at 18:38

The bug still exists as of XE16 and XE16.11 but this code gets past the glitch and shows a normal camera preview, note the three parameter setting lines and their values. I have also tested this at 5000 (5FPS) and it works, and at 60000 (60FPS) and it does not work:

        if (mCamera == null) return;

        Camera.Parameters camParameters = mCamera.getParameters();
        camParameters.setPreviewFpsRange(30000, 30000);
        camParameters.setPreviewSize(1920, 1080);
        camParameters.setPictureSize(2592, 1944);
        try {
        } catch (Exception e) {
            mCamera = null;
share|improve this answer

You can set the params.setPreviewSize(1200,800). You can change the values around this range until you can clear color noise.

share|improve this answer
This does not fix the problem. –  swooby Feb 13 at 1:23

Your Answer


