-
Notifications
You must be signed in to change notification settings - Fork 717
fix jpeg soi check for psram_mode (DMA) #776
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
fix jpeg soi check for psram_mode (DMA) #776
Conversation
1d950f1
to
c45e7d8
Compare
ab36a5d
to
cac4990
Compare
- Added a configurable probe length for PSRAM JPEG validation via CAM_SOI_PROBE_BYTES - For PSRAM mode, CAM_SOI_PROBE_BYTES is copied from the first DMA block into a stack buffer and validated by cam_verify_jpeg_soi() to verify that it's a valid jpeg image before continuing the capture. - Reading from PSRAM directly with cam_verify_jpeg_soi() is here avoided due to latency of small operations done by cam_verify_jpeg_soi().
cac4990
to
1c0f7bd
Compare
have you tested this? If so, at what XCLK and what is the success rate? |
I can't yet test this. The SOI check should now work, but the end of image byte check needs the same treatment. Once I've done this I will check this with the m5 thingy I got here, with the 16 MHz you suggested, which previously would just fail with "no SOI" |
I've just sent the PR for the EOI fix. Will test both ASAP. |
Okay, testing reveals additional bugs on the So the fixes here do work, it's just that it hits further bugs. :) |
This comment was marked as outdated.
This comment was marked as outdated.
@me-no-dev wrote:
Success rate is now nearly 100%, but the frames are broken most of the time. 🥲 The PRs I've used for this are: The beginning and end markers will now be found reliably, and there's no crash fetching frames in FHD with the fasted ESPHome can send them via wifi for 10 minutes. The begin marker is basically always found, but the end marker, but the end marker is sometimes not found, probably because of corruption. This is XCLK 20 MHz, 240 MHz CPU clock, FHD resolution, CAMERA_TASK_STACK_SIZE Screencast_20250805_065816.webmAnd this is the same settings, but XCLK 16 MHz: Screencast_20250805_071433.webmI think that's a tad cleaner? but no large difference.
Don't be confused here, "esp32_camera" log messages with these "Got Image" are from the ESPHome component "esp32_camera", not from this driver. |
Description
Related
Related #775
Checklist
Before submitting a Pull Request, please ensure the following: