diff --git a/esp32-cam-webserver.ino b/esp32-cam-webserver.ino index 63034f3..b5f1e35 100644 --- a/esp32-cam-webserver.ino +++ b/esp32-cam-webserver.ino @@ -133,6 +133,13 @@ unsigned long imagesServed = 0; // Total image requests // This will be displayed to identify the firmware char myVer[] PROGMEM = __DATE__ " @ " __TIME__; +// Camera module bus communications frequency. +// Originally: config.xclk_freq_hz = 20000000, but this lead to visual artifacts on many modules. +// See https://github.com/espressif/esp32-camera/issues/150#issuecomment-726473652 et al. +#if !defined (XCLK_FREQ_HZ) + #define XCLK_FREQ_HZ 16500000; +#endif + // initial rotation // can be set in myconfig.h #if !defined(CAM_ROTATION) @@ -482,8 +489,7 @@ void setup() { config.pin_sscb_scl = SIOC_GPIO_NUM; config.pin_pwdn = PWDN_GPIO_NUM; config.pin_reset = RESET_GPIO_NUM; - // originally: config.xclk_freq_hz = 20000000; - config.xclk_freq_hz = 16500000; // See https://github.com/espressif/esp32-camera/issues/150#issuecomment-726473652 et al. + config.xclk_freq_hz = XCLK_FREQ_HZ; config.pixel_format = PIXFORMAT_JPEG; // Pre-allocate large buffers if(psramFound()){ diff --git a/myconfig.sample.h b/myconfig.sample.h index ecdc1dc..2b909eb 100644 --- a/myconfig.sample.h +++ b/myconfig.sample.h @@ -179,3 +179,8 @@ struct station stationList[] = {{"ssid1", "pass1", true}, // #define CAMERA_MODEL_M5STACK_WIDE // #define CAMERA_MODEL_M5STACK_ESP32CAM // Originally: CAMERA_MODEL_M5STACK_NO_PSRAM // #define CAMERA_MODEL_TTGO_T_JOURNAL + +// Camera module bus communications frequency, setting too high can cause visual artifacts. +// Currently defaults to 16.5MHz, but some (non-clone) modules may be able to use the +// original frequency of 20MHz for to allow higher framerates etc. +// #define XCLK_FREQ_HZ 20000000; diff --git a/src/version.h b/src/version.h index 15d6631..25581dc 100644 --- a/src/version.h +++ b/src/version.h @@ -1,4 +1,4 @@ /* Version of upstream code */ -char baseVersion[] = "4.0.alpha"; +char baseVersion[] = "4.0.beta2";