Content-Length: 287492 | pFad | https://github.com/adafruit/circuitpython/issues/8692

9E Intermittent Delay while reading Capacitive Touch: heap size related · Issue #8692 · adafruit/circuitpython · GitHub
Skip to content

Intermittent Delay while reading Capacitive Touch: heap size related #8692

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

Open
makermelissa opened this issue Dec 4, 2023 · 8 comments
Open
Assignees
Labels
bug espressif applies to multiple Espressif chips
Milestone

Comments

@makermelissa
Copy link
Collaborator

makermelissa commented Dec 4, 2023

CircuitPython version

Adafruit CircuitPython 9.0.0-alpha.5 on 2023-11-15; Adafruit-Qualia-S3-RGB666 with ESP32S3

Code/REPL

See https://github.com/adafruit/Adafruit_CircuitPython_Qualia/blob/main/examples/qualia_paint.py

Behavior

After about every 10 reads or so from the capacitive touch screen, there is a noticeable delay. You can really tell by running the paint program:
IMG_5512

Description

  • Run Paint Program
  • Draw

Additional information

Switching to CP Alpha 2 fixes the issue. With CP Alpha 4, the problem is there, but you need to make sure the PYSTACK size and such is big enough to run it. My guess is it's related to the split heap stuff.

Using different touch drivers, touch controllers, and optimizing code did not help.

@tannewt tannewt added the espressif applies to multiple Espressif chips label Dec 4, 2023
@tannewt tannewt added this to the 9.0.0 milestone Dec 4, 2023
@tannewt
Copy link
Member

tannewt commented Dec 4, 2023

My guess is that we're doing a collect when the heap is full to see if we can allocate into it (and we can.) This will happen earlier with split heap than it did with the one big heap. The pauses should be shorter though.

@tannewt
Copy link
Member

tannewt commented Dec 4, 2023

Raising the starting heap size may give you enough buffer to capture a full finger drag before triggering the GC. You could also try running gc.collect() when a finger isn't active.

@makermelissa
Copy link
Collaborator Author

Ok, I'll try those to see if it helps...

@makermelissa
Copy link
Collaborator Author

Raising starting heap size did help. Garbage collection didn't help.

@dhalbert dhalbert changed the title Intermittant Delay while reading Capacitive Touch Intermittant Delay while reading Capacitive Touch: heap size related Jan 24, 2024
@tannewt
Copy link
Member

tannewt commented Jan 24, 2024

Do we want a larger default heap? This seems like a pretty specific case to change a default for.

@tannewt
Copy link
Member

tannewt commented Feb 14, 2024

Raising starting heap size did help. Garbage collection didn't help.

What did you set it to? 128k? We could make it default on PSRAM builds.

@jepler jepler changed the title Intermittant Delay while reading Capacitive Touch: heap size related Intermittent Delay while reading Capacitive Touch: heap size related Feb 15, 2024
@makermelissa
Copy link
Collaborator Author

Tested this on latest CP 9 version and 512K seemed to work better than 128K or 256K.

@tannewt tannewt modified the milestones: 9.0.0, 9.x.x Feb 21, 2024
@tannewt
Copy link
Member

tannewt commented Feb 21, 2024

Thanks for the update! I've moved this to 9.x.x. I'd like to see if any other uses like this crop up before we change the default heap size. Having it in stable should make it clearer.

@dhalbert dhalbert self-assigned this May 29, 2024
@dhalbert dhalbert modified the milestones: 9.x.x, Long term Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug espressif applies to multiple Espressif chips
Projects
None yet
Development

No branches or pull requests

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/adafruit/circuitpython/issues/8692

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy