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

EPD super slow in comparison to python library #34

Open
caemor opened this issue Nov 20, 2019 · 4 comments
Open

EPD super slow in comparison to python library #34

caemor opened this issue Nov 20, 2019 · 4 comments
Assignees

Comments

@caemor
Copy link
Owner

caemor commented Nov 20, 2019

See #33 for more info. But in short:

This seems to be about twice as slow to write to the screen as the Waveshare Python controller (specifically the July 10 2017 version, which is what I currently have hooked up to my screen), despite using the same panel settings.

Measuring some drawing times (DATA_START_TRANSMISSION_1 + DISPLAY_REFRESH):

* Old Python driver: 24s
  
  * Buffer is 30720 bytes (`= HEIGHT * WIDTH / 8`)
  * Writes 4 data bytes per buffer byte

* Latest Python driver: 30s
  
  * Buffer is `HEIGHT * WIDTH / 4` bytes
  * Writes 2 data bytes per buffer byte

* This Rust driver: 53s
  
  * Buffer is `HEIGHT * WIDTH / 8` bytes
  * Writes 4 data bytes per buffer byte

Tested on a raspberry pi zero w by @str4d

@caemor
Copy link
Owner Author

caemor commented Nov 20, 2019

@str4d
Copy link
Contributor

str4d commented Nov 21, 2019

The "Old Python driver" test does indeed use the driver from the oldest link on that wiki page. The "Latest Python driver" test used whatever was in latest master of their repo at the time of testing.

@caemor caemor self-assigned this Nov 25, 2019
@frioux
Copy link

frioux commented Dec 25, 2021

I suspect that if people want to try to implement the faster updates this would be the place to look: https://github.com/repaper/gratis/. The python "driver" just writes to a FUSE filesystem backed by C.

@kburgi
Copy link

kburgi commented Feb 28, 2024

Hi there,

I may have misunderstood, but the initial reporter said that it was way longer to write on the e-paper using this crate, versus the python equivalent.

In my case, I've the epd7in5 (first version) and it was also faaaar longer to put a simple text on the screen than the equivalent python version

It tooks ~ 30 seconds in the update_frame() function

Here is my quick test :

hardware :

    let mut delay = Delay;

    let mut epd7in5 = Epd7in5::new(&mut spi, busy, dc, rst, &mut delay, None).expect("eink initalize error");

    let mut display = Display7in5::default();

    println!("here_1 {}", Local::now());
    display.set_rotation(DisplayRotation::Rotate0);
    draw_text(&mut display, &my_string_utc, 20, 20);

    println!("here_2 {}", Local::now());
    epd7in5.update_frame(&mut spi, display.buffer(), &mut delay)?;
    println!("here_3 {}", Local::now());
    epd7in5
        .display_frame(&mut spi, &mut delay)
        .expect("display frame new graphics");

    println!("here_4 {}", Local::now());
    let new_delay: u32 = 7000;
    println!("Set delay to {} ms", new_delay);
    delay.delay_ms(new_delay);

    println!("Finished tests - going to sleep");
    epd7in5.sleep(&mut spi, &mut delay)
here_1 2024-02-28 21:03:32.851235119 +01:00
here_2 2024-02-28 21:03:32.852281108 +01:00
here_3 2024-02-28 21:04:08.387091203 +01:00            <= MORE THAN 30 seconds btw these 2 steps !
here_4 2024-02-28 21:04:08.388867185 +01:00
Set delay to 7000 ms
Finished tests - going to sleep

Any idea on how to improve this ?

Thanks

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

No branches or pull requests

4 participants