Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert causes a crash when using Grayscale at 96x96 res with PSRAM on ESP32-S3 #528

Closed
samw3 opened this issue Apr 5, 2023 · 2 comments
Closed

Comments

@samw3
Copy link
Contributor

samw3 commented Apr 5, 2023

We get a crash caused by a failing assert when we use the following config. In particular we see the crash when using Grayscale and 96x96 resolution. The platform is ESP32-S3 using PSRAM. We traced it to cam_hal.c attempting to create a queue of size 0. This PR has a change where we make sure the queue size is at least 1. This fixes our case, but maybe there's a more elegant or robust way of fixing it.

  config.ledc_channel  = LEDC_CHANNEL_0;
  config.ledc_timer    = LEDC_TIMER_0;
  config.pin_d0        = CAMERA_PIN_D0;
  config.pin_d1        = CAMERA_PIN_D1;
  config.pin_d2        = CAMERA_PIN_D2;
  config.pin_d3        = CAMERA_PIN_D3;
  config.pin_d4        = CAMERA_PIN_D4;
  config.pin_d5        = CAMERA_PIN_D5;
  config.pin_d6        = CAMERA_PIN_D6;
  config.pin_d7        = CAMERA_PIN_D7;
  config.pin_xclk      = CAMERA_PIN_XCLK;
  config.pin_pclk      = CAMERA_PIN_PCLK;
  config.pin_vsync     = CAMERA_PIN_VSYNC;
  config.pin_href      = CAMERA_PIN_HREF;
  config.pin_sccb_sda  = -1; // CAMERA_PIN_SIOD;
  config.pin_sccb_scl  = -1; // CAMERA_PIN_SIOC;
  config.sccb_i2c_port = 0;
  config.pin_pwdn      = CAMERA_PIN_PWDN;
  config.pin_reset     = CAMERA_PIN_RESET;
  config.xclk_freq_hz  = XCLK_FREQ_HZ;
  config.pixel_format  = PIXFORMAT_GRAYSCALE;
  config.frame_size    = FRAMESIZE_96X96;
  config.jpeg_quality  = 12;
  config.fb_count      = 2;
  config.fb_location   = CAMERA_FB_IN_PSRAM;
  config.grab_mode     = CAMERA_GRAB_LATEST;
@github-actions
Copy link

github-actions bot commented Jun 5, 2023

This issue appears to be stale. Please close it if its no longer valid.

@samw3
Copy link
Contributor Author

samw3 commented Jun 5, 2023

Fixed and merged in the suggested PR.

@samw3 samw3 closed this as completed Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant