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

MODE_PACKING_2PPB renders "stripes" #284

Closed
j4k32 opened this issue Mar 6, 2024 · 12 comments · Fixed by #353
Closed

MODE_PACKING_2PPB renders "stripes" #284

j4k32 opened this issue Mar 6, 2024 · 12 comments · Fixed by #353
Assignees
Labels
bug Something isn't working Waiting for feedback If it's in this state more than 2 months without feedback then the Issue will be closed

Comments

@j4k32
Copy link

j4k32 commented Mar 6, 2024

When using MODE_PACKING_2PPB

epd_draw_base(epd_full_screen(), state->front_fb, epd_full_screen(), MODE_PACKING_2PPB | PREVIOUSLY_WHITE | MODE_GC16, temperature, NULL, state->waveform);

instead of MODE_PACKING_1PPB_DIFFERENCE where diff_area = epd_difference_image_cropped(...)

epd_draw_base(epd_full_screen(), state->difference_fb, diff_area, MODE_PACKING_1PPB_DIFFERENCE | MODE_GC16, temperature, state->dirty_lines, state->waveform);

the front_fb is printed in "stripes" on the eink, see attached image.

IMG_6153

ED133UT2
epdiy v7 esp32s3

@martinberlin
Copy link
Collaborator

This has to be checked by Valentin when he is back but for the moment use another method.
It can be that this combination:

MODE_PACKING_2PPB | PREVIOUSLY_WHITE | MODE_GC16

is not really supported. I must say that I never tried to concatenate so many settings like this. It would be great if you also analyze in the code what is doing to understand better how the library works.

@vroland
Copy link
Owner

vroland commented Mar 14, 2024

@j4k32 How does the buffer you're rendering look then? Did you also change the buffer layout accordingly?

@martinberlin martinberlin added the Waiting for feedback If it's in this state more than 2 months without feedback then the Issue will be closed label Mar 14, 2024
@j4k32
Copy link
Author

j4k32 commented Mar 16, 2024

Hi again, sorry for my late response.

@martinberlin MODE_PACKING_2PPB | PREVIOUSLY_WHITE | MODE_GC16 is taken from the highlevel rendering function epd_hl_update_screen so I thought it would be a legit combination (However, the bool previously_white and bool previously_black is always false, so the function never updates the eink with that combination.).

@vroland I use the script imgconvert.py to create the buffer which is copied to the highlevel front_fb, but I have modified the script to json format instead of .h format. The json is then sent to the epdiy over a tcp connection. I first thought it was some kind of mismatch between the sent data and how the data is saved to the buffer, but I get the same result with the dragon-example you provide in the repository. Note: The same buffer (recreated with the epd_difference_image_cropped function) and MODE_PACKING_1PPB_DIFFERENCE works well.

Update: not sure if this is helpful as the waveforms are a black boxes to me, but I've tried with different waveforms and get the same result.

@vroland
Copy link
Owner

vroland commented Mar 29, 2024

Note: The same buffer (recreated with the epd_difference_image_cropped function) and MODE_PACKING_1PPB_DIFFERENCE works well.

What do you mean here exactly?

@martinberlin
Copy link
Collaborator

Dear @j4k32 please give feedback about this issue.
We really do not want to have issues forever open without feedback so those issues marked as "waiting for feedback" have a 2 months limit to get an answer. If you don't answer in this timeframe then the Issue will be closed

@j4k32
Copy link
Author

j4k32 commented May 5, 2024

@vroland The dragon buffer provided in the example directory of your repo works fine when rendered using the epd_hl_update_area function, which uses the epd_difference_image_cropped together with MODE_PACKING_1PPB_DIFFERENCE. The stripes occurs when I try to render the dragon buffer using the epd_draw_base function together with the MODE_PACKING_2PPB, but without the epd_difference_image_cropped

@vroland
Copy link
Owner

vroland commented May 10, 2024

Ok, I see. Which display are you using and can you provide a working example program? It could be either your buffer settings not matching the buffer or an actual bug, that that is easier to test with a reproducible example.

@j4k32
Copy link
Author

j4k32 commented May 20, 2024

I am using ED133UT2 display together with epdiy v7 esp32s3 driver board.
As mentioned before, the issue also occurs when loading the dragon example provided in the repo, so you can use that to reproduce. The only thing that needs to be changed is from (in the examples/dragon/main.c)
// enum EpdDrawError _err = epd_hl_update_screen(&hl, MODE_GC16, temperature);
to
enum EpdDrawError _err = epd_draw_base(epd_full_screen(), state->front_fb, epd_full_screen(), MODE_PACKING_2PPB | PREVIOUSLY_WHITE | MODE_GC16, temperature, NULL, state->waveform);

@vroland
Copy link
Owner

vroland commented Jun 21, 2024

Working on refactoring the LUT code, I actually found a bug in the 2bpp lookup calculation code. I'll tag this issue in the PR, hopefully that resolves it :)

@j4k32
Copy link
Author

j4k32 commented Jul 7, 2024

Sounds promising! Thank you very much

@vroland vroland added bug Something isn't working and removed Waiting for feedback If it's in this state more than 2 months without feedback then the Issue will be closed labels Aug 5, 2024
@martinberlin
Copy link
Collaborator

Hello @j4k32
Can you please switch branch to lut-refactor in this MR
https://github.com/vroland/epdiy/tree/lut-refactor and confirm if this works for you? Thanks

@martinberlin martinberlin added the Waiting for feedback If it's in this state more than 2 months without feedback then the Issue will be closed label Sep 10, 2024
@j4k32
Copy link
Author

j4k32 commented Sep 15, 2024

Works perfectly, thank you!

vroland added a commit that referenced this issue Sep 24, 2024
Refactors waveform lookup calculations to be more maintainable and adds
tests to avoid regressions. In the process, line masking is simplified
and ordering problems in 2ppB mode are fixed (this should fix #284).
8ppB now supports both PREVIOUSLY_BLACK and PREVIOUSLY_WHITE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Waiting for feedback If it's in this state more than 2 months without feedback then the Issue will be closed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants