-
Notifications
You must be signed in to change notification settings - Fork 104
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
Optimizing refresh rate on 7.8'' Waveshare e-ink #107
Comments
I'm not one of the maintainers of this project, but: If you are using terminal mode, you could take a look at my fork of papertty. |
Here's a very low res version of the test I did yesterday, which already was a lot better than when I wrote this issue, but I'm really interested in your fork @mcarr823. Hardware: RPI 3B+ with A1 microSD card and Full Raspberry OS Changes that I've done:
Yes, I'm using PaperTTY to run terminal. The idea is to make a very basic word processor for writing drafts without thinking too much about editing, like the Freewrite line of products. Here's a bigger version of the video on reddit with more info about the project, in case you're interested. I really want to try your build @mcarr823 but I don't have any prior knowledge of python, Linux, RPi and I just dabbled installing software from my MacOS Terminal. If I could have a 10/20% improvement from what you can see in this video it would be a world of difference to me! IMG_5296.mp4 |
@javierdepascual Ah, good point on the font. I didn't think about font thinness/thickness. Yeah, it makes sense that a thinner font would perform better. The screen you're using is 1872×1404, which is the same as the 10" waveshare screen I've been testing with. The main difference in that branch on my fork is that I've changed the partial refresh implementation. If you did want to test it out, you can just copy papertty.py from my fork *Note that you might need to grab |
Thank you so much @mcarr823 for keeping this project alive. I think there's a lot of writers like me that would love to have a single-purpose device without spending a fortune and this is definitely the way to do it. when do you think you'll finish development? I'm gonna test it today after backing it up and will post my results. I'll also make my font smaller to keep optimizing. I'm also gonna search for alternatives to wordgrinder. Right now I'm feeling like I'm wasting half of my screen real state just because the way it behaves, and maybe there's software that behaves the way you're describing. |
@javierdepascual It depends on when I stop finding things to try to improve lol. The first is mostly done and the second shouldn't take long. I'm hoping to finish it off this weekend. Edit: regarding writing software, you could try using nano. It's not specifically intended for writing. It's just a simple terminal-based text editor. It'll still slow down when you reach the end of the screen and the whole page has to move up. I'm not sure how best to handle that. |
Thank you! Excited about those changes. I'll let you know how it works at the moment when I test it and I'll try nano in the meantime. |
Thanks for the improvements and discussion. FWIW, with some minor tweaks my 6" HD one on a Pi4(00) has been in a "pixels per second" way probably the fastest configuration so far of the displays I have. A couple of vids can be found via here #81 (comment) With a beefier RPi the bottleneck is just pushing the data out and there's a lot of potential to improve that. This may be of interest: #36 (comment) |
Hi @mcarr823, unfortunately while testing your branch I'm not able to make it work, but I get the following error: Started displaying /dev/vcsa1, minimum update interval 0.1 s, exit with Ctrl-C Do you know why this could be happening? thank you! |
@javierdepascual Based on the error message, are you perhaps passing in a string as the number of rows when running papertty? Edit: I've done a bit more work on this today, so you should grab the updated version if you're using my fork. |
@mcarr823 this is the command I'm using sudo papertty_venv/bin/papertty --driver it8951 terminal --font /home/javierdepascual/.fonts/couriernew.ttf --size 49 --rows 31 --cols 62 --spacing 3 --portrait Specifically I get this error whenever I try to access the VM through my terminal. I'm using Raspbian OS, I have a terminal window open with the virtual environment to launch the command, and from there I press CTRL + ALT + F1 to switch to the Virtual Machine Window so I can write into the e-ink screen. I don't know why, but there's no error before I press CTRL + ALT + F1. Also to clarify I used --flipy and it didn't go to landscape mode on my e-ink model. I used your most recent build and still get the same error. |
Thanks @javierdepascual it looks like the problem is that manually specifying the rows/columns (as opposed to using --autofit) automatically changes the type from string to int. Papertty then casts it to an int every time it's used. I'm not sure I understand what you mean about --flipy. If you want to change to landscape you should omit --portrait. Edit: I've just pushed a couple more commits to handle odd font sizes and spacing correctly. Edit2: I've just created a new branch https://github.com/mcarr823/PaperTTY/tree/A2-mode |
So... just tested it right now. What I did and the problems I'm having:
EDIT: I just uploaded a 3min test to my Google Drive to show you how it looks: https://drive.google.com/file/d/1buWPD53bs6rYyHf8MFdLnijClFj0M0Am/view?usp=sharing So @mcarr823 the only issue for me would be to use it in landscape mode. In a previous comment you told me I should omit --portrait for landscape mode. What should I use then? i feel that in order to properly use this I would need to switch to landscape mode, as in portrait line breaks happen way too often, therefore slowing down the overall refresh rate considerably. In any case, tremendous work and definitely an improvement over the original drivers. I'm really excited to get the batteries, case and keyboard going and finishing the build to start typing away! |
Ok, I just tested it using --autofit and --portrait and it works almost perfectly on landscape mode. The only issue happens occasionally when doing anything that requires a full refresh (i.e. when going from terminal to wordgrinder or viceversa, as I previously said). It slows down a lot and even freezes randomly, something that doesn't happen when in non-portrait mode, I don't know why. For the most part it works, even though it doesn't seem as consistently faster as the non-portrait mode. |
Thanks for the feedback @javierdepascual
Removing the word count would speed things up a bit. Landscape mode works for me except with --flipy. Anyway, I've taken a couple of videos below to show how it's working for me. Still, you should be able to get a general idea of the speed improvement by 2 things.
I probably shouldn't have applied both patches. That makes it harder to say what's improved where. And here with a pi2b *To clarify, when I mention speeds in the video (200ms, 8ms, etc.) I'm not including the panel refresh rate or the IT8951 board speed, since I can't measure those. I'm only referring to the speed of papertty's logic and the it_8951 driver. |
Thank you for this detailed account of your progress @mcarr823. Right now and as per your suggestion, I'm gonna try out vim, since it has a bunch of plugins that can turn it into a very capable markdown processor, and since it's so customizable, I feel I might be able to optimize it for this type of e-ink screen (i.e. instead of scrolling down whenever I write beyond the bottom limit of the screen, maybe turning a "page" and going back to a blank screen). Do you think that might make it work faster on these type of displays? On another note, something that worries me is the fact that when using --portrait --autofit to make it work on landscape mode it becomes noticeably slower, and it almost freezes when going in/out of terminal and/or the word processor. Is this an issue you're aware of when working in landscape mode? Do you need me to test it out so you can see it and update the fork? I'll keep sharing my tests if they're helpful. Let me know if you have any other suggestions or if you need anything else to be tested. I'm really greatful by everyone's work and I hope this project stays alive for the sake of all of us, distracted writers in the digital era lol. |
@javierdepascual Turning a page would certainly be faster. Could you take a video of the freezing which occurs when entering/exiting a word processor? Thank you for your testing, it's all a big help. I only have one panel to test with, and the way I use it will be different than how you and other people use theirs, so any input should help to make the program better for everyone. |
Hi @mcarr823, I'll test it by monday as I'm travelling this week. In any case, I don't think I've changed max_speed_hz. The value I have right now is 200000. Let me know which one would be safer and I'll test both. i also changed VCOM from 2000 to 1560, as Waveshare documentation told me I should change that value as indicated by the screen label. |
I've made a few more changes. I haven't taken a video, but the short version is that the single-line-refresh branch is substantially faster for the scenarios it was bad at before. Things like opening a text editor or using an application like wordgrinder which updates multiple parts of the screen simultaneously are now significantly faster. |
Hi @mcarr823. Sorry it took me so long to give it another try, but I did try today the most recent branch and it works wonders. Definitely comparable to the Freewrite and similar e-ink devices. Right now I'm struggling to set up terminal at boot. Will create a separate issue for that matter. Thank you so much for everything. |
Thanks for the feedback @javierdepascual |
@mcarr823 I have a question about fonts and the tty limitations: since I'm using vim as my text editor I was wondering if the Virtual Console/tty is able to display underlined characters, italics and bold. Since I'm using a couple of plugins for vim, ideally I'd like to use them sparingly for certain purposes. Thing is right now VIM doesn't display them, and I feel it's a limitation of the environment. I'm also wondering if maybe I could load the tty with a font that includes different weights. |
@javierdepascual I'm not really sure. |
@javierdepascual were you ever able to work through the issues you were having in getting a terminal at boot? I'm grateful for all your work here—I also will be trying @mcarr823 's branch on a Waveshare 7.8" screen. Will let you know how it goes! |
Hello and thank you to the people involved in this project. I found this looking for a cheap substitute of the Freewrite product line. I had a Raspberry 3B+ lying around, no experience in python or linux, but I felt building a portable, usable word processor for writing drafts and brain dumping would really make a difference to me.
Anyway, yesterday I spent the whole day trying to figure everything out. I got to make PaperTTY work after hours of browsing on past issues and documentation here. It really is simpler than it seems but I feel the key points of the documentation are scattered around. I know you guys are pretty aware of this and I hope by the time I finish my project I can make suggestions or even a tutorial for people at my level (newb).
My current problem is that the refresh rate for my display (https://www.waveshare.com/wiki/7.8inch_e-Paper_HAT) is supposed to be 350ms but right now it's very inconsistent, which got me worried about how manageable the whole thing can be from a usability standpoint. After writing a few sentences it can go from very responsive to more than a couple of seconds of delay. Just to be thorough: I cranked the max refresh rate parameter in the driver to 20Mhz (apparently in the Waveshare documentation it says the maximum is 24Mhz, but I saw on another issue that it might make the Pi crash) and tried running the Virtual Terminal after reboot to see if it's a Raspberry Pi performance issue. Since I have a LCD monitor mirroring the VT and a Full Raspberry OS I was also thinking it might be a performance issue of the system itself, since I feel the fluctuation of the refresh rate might indicate that.
I'm trying to attack this problem from every angle: I saw on reddit there was an user that got a workable word processor from a Waveshare 5.5'' without using PaperTTY, just the Waveshare drivers, and it's much more responsive than mine (with a similar refresh rate). I also saw there's similar projects that could work better than this one. In both cases I feel like I'm missing something to make mine work. So, I just want you guys to help me answering a couple of questions:
Thank you to anyone that can help me. I hope I can get something usable out of this to share my findings and help other people that might want to make this work without any prior knowledge.
The text was updated successfully, but these errors were encountered: