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

Stream cache buffer not used completely (causing extra read) #39

Open
ghnicolas opened this issue Jul 11, 2024 · 3 comments
Open

Stream cache buffer not used completely (causing extra read) #39

ghnicolas opened this issue Jul 11, 2024 · 3 comments

Comments

@ghnicolas
Copy link

Hello,
In file legato_stream.c, seems that following condition prevent from using the cached buffer completely (thus causing extra reads)
Line 111
// requested data is in the local cache
if((uint32_t)addr >= stream->cache.baseAddress &&
(uint32_t)addr - stream->cache.baseAddress + size < stream->cache.logicalSize)
Need to change for following ?
(uint32_t)addr - stream->cache.baseAddress + size <= stream->cache.logicalSize)

Also, I am using a 16k cache buffer. Sometimes when iterating in the function leStream_Read the variable stream->cache.baseAddress seems to have been reseted to 0 in the middle of a transfer which causes to reload from external memory at some point where the cache buffer should still be used. Didn't find out for now.

Regards
Nicolas

@scottdmorgan
Copy link

I recall seeing the same odd behavior while debugging the streaming in my project. I am using the stream to read a splash screen graphic from a MicroSD card to display when my device starts up.

@MCHP-MCU32DC0
Copy link

Thanks for reporting this issue. We'll take a look.

@ghnicolas
Copy link
Author

For the issue where the variable stream->cache.baseAddress is reseted, this is more systematic when changing the image in the widget using setImage function. At some point in the function stage_sourceIterateSetup the state->sourceRect.height is incorrect and the state->done is set to TRUE.
Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants