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

S3 higher framerates due to Cam interface? #513

Closed
SinanAkkoyun opened this issue Mar 8, 2023 · 7 comments
Closed

S3 higher framerates due to Cam interface? #513

SinanAkkoyun opened this issue Mar 8, 2023 · 7 comments

Comments

@SinanAkkoyun
Copy link

Hello!
Does the Esp32s3 eye support double the framerate? The datasheet says the dedicated camera port is 40MHz, as far as I know, the normal ESP32 software cam driver only allows 20MHz?

So, what framerate can I expect at 640x480?

Thank you very much

@WangYuxin-esp
Copy link
Contributor

VGA+RGB565\YUV422\JPEG+30fps is OK.

@SinanAkkoyun
Copy link
Author

So even though the s3 has it's own camera peripheral only 30 FPS are doable?

Thank you

@WangYuxin-esp
Copy link
Contributor

This depends on the format that the sensor can output. For VGA resolution, 30 fps is recommended for data in RGB format. For JPEG format data, the frame rate can be higher. Because the amount of data in JPEG format is relatively small.

@macksal
Copy link

macksal commented May 2, 2023

I'm having success with 72 MHz PCLK on an ESP32-S3 after making some changes to the driver.

The trick is to use EDMA mode and disable the caches while the DMA is running. The cache used for code from flash competes for the SPI0 bus, which is also used for PSRAM. Ensuring that only the GDMA is using the SPI0 bus allows it to consume the full bandwidth (80MHz in an ideal world).

I am using this for full-res stills though, the situation will be different if you need to access a different framebuffer while one is being written, or to use the CPU for other tasks during the frame capture (since you can only execute code in IRAM while the cache is disabled). This means that ongoing wifi/video transmission is likely impractical.

@me-no-dev
Copy link
Member

@macksal want to provide a PR for this? It could be limited to fb = 1 and certain XCLK (much like EDMA is limited now)

@macksal
Copy link

macksal commented May 2, 2023

@macksal want to provide a PR for this? It could be limited to fb = 1 and certain XCLK (much like EDMA is limited now)

I can't get it merged as-is because I've changed the core functions quite a bit. I stole the spi_flash_disable_interrupts_caches_and_other_cpu from the (private) spi flash API, and it only works by disabling the freertos scheduler - so you can't call freertos APIs until it's enabled again. This means the IN_SUC_EOF event can't be sent via queue, I instead use a volatile bool flag which cam_task busy-waits on, and it's cleared in the ISR. I don't think this plays nice with the bounce-buffer mode used by default. There's a bit of work in cleaning things up so the driver can support either operation at once.

I'm occupied with the project that this is part of for the time being - but happy to provide more info and perhaps contribute something mergeable at a later date

@github-actions
Copy link

github-actions bot commented Jul 2, 2023

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

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

4 participants