java.lang.RuntimeException: startPreview failed

JIRA | Alastair McKinstry | 2 years ago
  1. 0

    Hi, My camera crashes on trying to use the front camera. Main camera works fine. If I select the front camera, it crashes immediately, and I need to clear all camera data to get it back working again. This has been happening to me on all cyanogenmod roms; CM11 mainstream, nightlies and lately the CM12 unofficial image. I've wiped everything, caches, etc. between installs, and it keeps happening. Strangely, this also happened to me on my previous phone, a Samsung Galaxy Ace 3 with all CM roms. Looking at the ADB logs, I can see the Java backtraces: D/exynos_camera( 3025): exynos_camera_set_parameters(0x419140b0, antibanding=auto;exposure-compensation=0;exposure-compensation-step=0.5;focal-length=2.73;focus-distances=0.20,0.25,Infinity;focus-mode=fixed;focus-mode-values=fixed;full-video-snap-supported=false;horizontal-view-angle=51.2;iso=auto;iso-values=auto;jpeg-quality=90;jpeg-thumbnail-height=120;jpeg-thumbnail-quality=85;jpeg-thumbnail-size-values=160x120,0x0;jpeg-thumbnail-width=160;max-exposure-compensation=4;min-exposure-compensation=-4;picture-format=jpeg;picture-format-values=jpeg;picture-size=1600x1200;picture-size-values=1600x1200,640x480;preferred-preview-size-for-video=640x480;preview-format=yuv420sp;preview-format-values=yuv420sp,yuv420p,rgb565;preview-fps-range=7000,30000;preview-fps-range-values=(7000,30000);preview-frame-rate=30;preview-frame-rate-values=30,25,20,15,10,7;preview-size=640x480;preview-size-values=640x480,352x288,320x240,176x144;recording-hint=false;rotation=270;vertical-view-angle=39.4;video-frame-format=yuv420sp;video-size=640x480;video-size-va E/exynos_param( 3025): exynos_param_string_get: Unable to get data for key focus-areas E/exynos_param( 3025): exynos_param_string_get: Unable to get data for key flash-mode E/exynos_param( 3025): exynos_param_string_get: Unable to get data for key whitebalance E/exynos_param( 3025): exynos_param_string_get: Unable to get data for key scene-mode E/exynos_param( 3025): exynos_param_string_get: Unable to get data for key effect D/exynos_camera( 3025): exynos_camera_params_apply: Preview size: 640x480, picture size: 1600x1200, recording size: 640x480 D/exynos_camera( 3025): exynos_camera_preview_enabled(0x419140b0) D/exynos_camera( 3025): exynos_camera_preview_enabled(0x419140b0) D/exynos_camera( 3025): exynos_camera_set_preview_window(0x419140b0, 0x43e671d0) E/exynos_camera( 3025): exynos_camera_set_preview_window: Invalid preview buffers count D/exynos_camera( 3025): exynos_camera_start_preview(0x419140b0) D/exynos_camera( 3025): Found 8 preview buffers available! I/RequestQueue( 7919): Repeating capture request cancelled. I/RequestQueue( 7919): Repeating capture request set. E/exynos_v4l2( 3025): exynos_v4l2_streamon: ioctl failed E/exynos_camera( 3025): exynos_camera_preview_start: streamon failed! E/AndroidRuntime( 7919): FATAL EXCEPTION: RequestThread-1 E/AndroidRuntime( 7919): Process: com.android.camera2, PID: 7919 E/AndroidRuntime( 7919): java.lang.RuntimeException: startPreview failed E/AndroidRuntime( 7919): at android.hardware.Camera.startPreview(Native Method) E/AndroidRuntime( 7919): at android.hardware.camera2.legacy.RequestThreadManager.startPreview(RequestThreadManager.java:275) E/AndroidRuntime( 7919): at android.hardware.camera2.legacy.RequestThreadManager.doPreviewCapture(RequestThreadManager.java:317) E/AndroidRuntime( 7919): at android.hardware.camera2.legacy.RequestThreadManager.access$1600(RequestThreadManager.java:61) E/AndroidRuntime( 7919): at android.hardware.camera2.legacy.RequestThreadManager$5.handleMessage(RequestThreadManager.java:756) E/AndroidRuntime( 7919): at android.os.Handler.dispatchMessage(Handler.java:98) E/AndroidRuntime( 7919): at android.os.Looper.loop(Looper.java:135) E/AndroidRuntime( 7919): at android.os.HandlerThread.run(HandlerThread.java:61) W/ActivityManager( 3307): Force finishing activity com.android.camera2/com.android.camera.CameraLauncher I/CAM_PhotoModule( 7919): stopPreview How do I proceed?

    JIRA | 2 years ago | Alastair McKinstry
    java.lang.RuntimeException: startPreview failed
  2. 0

    Hi, My camera crashes on trying to use the front camera. Main camera works fine. If I select the front camera, it crashes immediately, and I need to clear all camera data to get it back working again. This has been happening to me on all cyanogenmod roms; CM11 mainstream, nightlies and lately the CM12 unofficial image. I've wiped everything, caches, etc. between installs, and it keeps happening. Strangely, this also happened to me on my previous phone, a Samsung Galaxy Ace 3 with all CM roms. Looking at the ADB logs, I can see the Java backtraces: D/exynos_camera( 3025): exynos_camera_set_parameters(0x419140b0, antibanding=auto;exposure-compensation=0;exposure-compensation-step=0.5;focal-length=2.73;focus-distances=0.20,0.25,Infinity;focus-mode=fixed;focus-mode-values=fixed;full-video-snap-supported=false;horizontal-view-angle=51.2;iso=auto;iso-values=auto;jpeg-quality=90;jpeg-thumbnail-height=120;jpeg-thumbnail-quality=85;jpeg-thumbnail-size-values=160x120,0x0;jpeg-thumbnail-width=160;max-exposure-compensation=4;min-exposure-compensation=-4;picture-format=jpeg;picture-format-values=jpeg;picture-size=1600x1200;picture-size-values=1600x1200,640x480;preferred-preview-size-for-video=640x480;preview-format=yuv420sp;preview-format-values=yuv420sp,yuv420p,rgb565;preview-fps-range=7000,30000;preview-fps-range-values=(7000,30000);preview-frame-rate=30;preview-frame-rate-values=30,25,20,15,10,7;preview-size=640x480;preview-size-values=640x480,352x288,320x240,176x144;recording-hint=false;rotation=270;vertical-view-angle=39.4;video-frame-format=yuv420sp;video-size=640x480;video-size-va E/exynos_param( 3025): exynos_param_string_get: Unable to get data for key focus-areas E/exynos_param( 3025): exynos_param_string_get: Unable to get data for key flash-mode E/exynos_param( 3025): exynos_param_string_get: Unable to get data for key whitebalance E/exynos_param( 3025): exynos_param_string_get: Unable to get data for key scene-mode E/exynos_param( 3025): exynos_param_string_get: Unable to get data for key effect D/exynos_camera( 3025): exynos_camera_params_apply: Preview size: 640x480, picture size: 1600x1200, recording size: 640x480 D/exynos_camera( 3025): exynos_camera_preview_enabled(0x419140b0) D/exynos_camera( 3025): exynos_camera_preview_enabled(0x419140b0) D/exynos_camera( 3025): exynos_camera_set_preview_window(0x419140b0, 0x43e671d0) E/exynos_camera( 3025): exynos_camera_set_preview_window: Invalid preview buffers count D/exynos_camera( 3025): exynos_camera_start_preview(0x419140b0) D/exynos_camera( 3025): Found 8 preview buffers available! I/RequestQueue( 7919): Repeating capture request cancelled. I/RequestQueue( 7919): Repeating capture request set. E/exynos_v4l2( 3025): exynos_v4l2_streamon: ioctl failed E/exynos_camera( 3025): exynos_camera_preview_start: streamon failed! E/AndroidRuntime( 7919): FATAL EXCEPTION: RequestThread-1 E/AndroidRuntime( 7919): Process: com.android.camera2, PID: 7919 E/AndroidRuntime( 7919): java.lang.RuntimeException: startPreview failed E/AndroidRuntime( 7919): at android.hardware.Camera.startPreview(Native Method) E/AndroidRuntime( 7919): at android.hardware.camera2.legacy.RequestThreadManager.startPreview(RequestThreadManager.java:275) E/AndroidRuntime( 7919): at android.hardware.camera2.legacy.RequestThreadManager.doPreviewCapture(RequestThreadManager.java:317) E/AndroidRuntime( 7919): at android.hardware.camera2.legacy.RequestThreadManager.access$1600(RequestThreadManager.java:61) E/AndroidRuntime( 7919): at android.hardware.camera2.legacy.RequestThreadManager$5.handleMessage(RequestThreadManager.java:756) E/AndroidRuntime( 7919): at android.os.Handler.dispatchMessage(Handler.java:98) E/AndroidRuntime( 7919): at android.os.Looper.loop(Looper.java:135) E/AndroidRuntime( 7919): at android.os.HandlerThread.run(HandlerThread.java:61) W/ActivityManager( 3307): Force finishing activity com.android.camera2/com.android.camera.CameraLauncher I/CAM_PhotoModule( 7919): stopPreview How do I proceed?

    JIRA | 2 years ago | Alastair McKinstry
    java.lang.RuntimeException: startPreview failed
  3. 0

    android Camera2 Hit timeout for jpeg callback

    Stack Overflow | 2 years ago
    java.lang.RuntimeException: startPreview failed
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    GitHub comment 13#186844328

    GitHub | 9 months ago | i-marszi
    java.lang.RuntimeException: startPreview failed
  6. 0

    Add default camera activity back. current one is not stable.

    GitHub | 4 months ago | bieliaievays
    java.lang.RuntimeException: startPreview failed

  1. emmanuelstroem 1 times, last 4 months ago
3 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.RuntimeException

    startPreview failed

    at android.hardware.Camera.startPreview()
  2. Android Platform
    Camera.startPreview
    1. android.hardware.Camera.startPreview(Native Method)
    1 frame
  3. Android
    RequestThreadManager$5.handleMessage
    1. android.hardware.camera2.legacy.RequestThreadManager.startPreview(RequestThreadManager.java:275)
    2. android.hardware.camera2.legacy.RequestThreadManager.doPreviewCapture(RequestThreadManager.java:317)
    3. android.hardware.camera2.legacy.RequestThreadManager.access$1600(RequestThreadManager.java:61)
    4. android.hardware.camera2.legacy.RequestThreadManager$5.handleMessage(RequestThreadManager.java:756)
    4 frames
  4. Android Platform
    HandlerThread.run
    1. android.os.Handler.dispatchMessage(Handler.java:98)
    2. android.os.Looper.loop(Looper.java:135)
    3. android.os.HandlerThread.run(HandlerThread.java:61)
    3 frames