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

Add Partial Update Support #68

Open
aaronr8684 opened this issue Mar 8, 2022 · 5 comments
Open

Add Partial Update Support #68

aaronr8684 opened this issue Mar 8, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@aaronr8684
Copy link
Contributor

aaronr8684 commented Mar 8, 2022

If I have time, I can work on a solution, but in the meantime, I'm just going to add this here as a future feature request. Not sure if MissionFloyd wants to take a crack at it. I imagine that it could be another mode since only the bw/grey screens seem to support it.

Screens with official partial update support:

  • 1.02
  • 1.54
  • 2.13
  • 2.66
  • 2.9
  • 3.7
  • All IT8951 based HD screens
@robweber robweber assigned robweber and unassigned robweber Mar 8, 2022
@robweber robweber added the enhancement New feature or request label Mar 8, 2022
@robweber
Copy link
Owner

robweber commented Mar 8, 2022

Just to add to this a bit I can see a few hurdles to the partial implementation. T

Project Developer Experience

We'll need a unified way of flagging what screens support it and which don't. This will more than likely require some sort of partial_supported boolean being added to the VirtualEPD class. This would allow developers to code around support easily.

When trying to use the partial update functionality a developer could call epd.display(image, partial=True). If the screen supports partial updates that method would be used vs the full update. A point of debate here would be what does omni-epd do as a fallback?

  1. Do a full update if partial is not supported? This may cause issues with parts of the expected image just not working
  2. Throw an error, something along the lines of Partial Update not supported

Neither of these are ideal. The alternative would be that the developer will need to check if the display supports partial updating and code their stuff accordingly. An alternative might be making the developer code for if(epd.partial_supported) and call either display() or display_partial() as appropriate. The latter could still throw an error if called the screen didn't support it?

Driver Implementation

Often the displays that support partial refresh use separate init() and display() functions for the partial update, or you need to pass in some kind of variable to alert the driver to the fact that you're doing a partial update. A child class _display_partial() could be implemented for devices that allow for partial display. Similarly the prepare() method will need both a full and partial update check as well.

@Nico04
Copy link

Nico04 commented Feb 8, 2024

I'm new here, looking for a good library to control FAST refreshing EPD like the Waveshare 6inch IT8951 display. Partial refreshing is also key for fast refresh. This project looks very promising, do you know if this feature is implemented yet? Thanks 😊

@robweber
Copy link
Owner

robweber commented Feb 8, 2024

It is not implemented. Personally I don't have a screen that supports it for testing. To even get one working it would take someone with a partial display EPD to flesh out the details, implement, and test. Once one is working the code could likely be applied to the others that support it.

@W11T
Copy link

W11T commented Oct 1, 2024

I tried omni-epd with a waveshare_epd.epd1in54_V2.
omni-epd-test fails with

Loaded waveshare_epd.epd1in54_V2 with width 200 and height 200
Drawing rectangle of width 150.0 and height 150.0
Drawing rectangle of width 75.0 and height 75.0
Drawing rectangle of width 18.75 and height 18.75
Traceback (most recent call last):
  File "/media/pi/INTENSO/RBP-IN/home/welf/bin/epd/venv_epd/bin/omni-epd-test", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/media/pi/INTENSO/RBP-IN/home/welf/bin/epd/venv_epd/lib/python3.11/site-packages/omni_epd/test_utility.py", line 138, in main
    test.draw()
  File "/media/pi/INTENSO/RBP-IN/home/welf/bin/epd/venv_epd/lib/python3.11/site-packages/omni_epd/test_utility.py", line 84, in draw
    self.__draw_on_display(im)
  File "/media/pi/INTENSO/RBP-IN/home/welf/bin/epd/venv_epd/lib/python3.11/site-packages/omni_epd/test_utility.py", line 64, in __draw_on_display
    self.epd.prepare()
  File "/media/pi/INTENSO/RBP-IN/home/welf/bin/epd/venv_epd/lib/python3.11/site-packages/omni_epd/displays/waveshare_display.py", line 129, in prepare
    self._device.init()
TypeError: EPD.init() missing 1 required positional argument: 'isPartial'

Looks like this parameter is requested by the waveshare drivers:

venv_epd/lib64/python3.11/site-packages/waveshare_epd/epd1in54_V2.py:    def init(self, isPartial):
venv_epd/lib64/python3.11/site-packages/waveshare_epd/epd1in54_V2.py:        if(isPartial):

@robweber
Copy link
Owner

robweber commented Oct 5, 2024

Just wanted to note here that I did see this. I'll probably break this out into it's own issue as the "fix" will be to just add the argument as False given that this library does not support partial refresh right now. This will get the omni-epd class working in line with how the other displays function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants