Skip to content

Commit 3ba9e81

Browse files
committed
Improve support for changing cam clock frequency
1 parent 56c5267 commit 3ba9e81

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

esp32-cam-webserver.ino

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ unsigned long imagesServed = 0; // Total image requests
133133
// This will be displayed to identify the firmware
134134
char myVer[] PROGMEM = __DATE__ " @ " __TIME__;
135135

136+
// Camera module bus communications frequency.
137+
// Originally: config.xclk_freq_hz = 20000000, but this lead to visual artifacts on many modules.
138+
// See https://github.com/espressif/esp32-camera/issues/150#issuecomment-726473652 et al.
139+
#if !defined (XCLK_FREQ_HZ)
140+
#define XCLK_FREQ_HZ 16500000;
141+
#endif
142+
136143
// initial rotation
137144
// can be set in myconfig.h
138145
#if !defined(CAM_ROTATION)
@@ -482,8 +489,7 @@ void setup() {
482489
config.pin_sscb_scl = SIOC_GPIO_NUM;
483490
config.pin_pwdn = PWDN_GPIO_NUM;
484491
config.pin_reset = RESET_GPIO_NUM;
485-
// originally: config.xclk_freq_hz = 20000000;
486-
config.xclk_freq_hz = 16500000; // See https://github.com/espressif/esp32-camera/issues/150#issuecomment-726473652 et al.
492+
config.xclk_freq_hz = XCLK_FREQ_HZ;
487493
config.pixel_format = PIXFORMAT_JPEG;
488494
// Pre-allocate large buffers
489495
if(psramFound()){

myconfig.sample.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,8 @@ struct station stationList[] = {{"ssid1", "pass1", true},
179179
// #define CAMERA_MODEL_M5STACK_WIDE
180180
// #define CAMERA_MODEL_M5STACK_ESP32CAM // Originally: CAMERA_MODEL_M5STACK_NO_PSRAM
181181
// #define CAMERA_MODEL_TTGO_T_JOURNAL
182+
183+
// Camera module bus communications frequency, setting too high can cause visual artifacts.
184+
// Currently defaults to 16.5MHz, but some (non-clone) modules may be able to use the
185+
// original frequency of 20MHz for to allow higher framerates etc.
186+
// #define XCLK_FREQ_HZ 20000000;

src/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/* Version of upstream code */
22

3-
char baseVersion[] = "4.0.alpha";
3+
char baseVersion[] = "4.0.beta2";
44

0 commit comments

Comments
 (0)