-
Notifications
You must be signed in to change notification settings - Fork 10
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
Remove delay of getting device screen #93
Conversation
A while ago for the last patch I also played around with adbblitz but I run into the issue in a fork of this bot where because of the many sleeps the screenshots were often out of sync with the real current image of the game. Also I keept running into that when running it with more then one device it's starts to really laag the game. Since this pass don't offer a duoq boost, that doesn't matter i guess. |
That's fortunately not the case with this approach, thanks to the recording happening in a different task. The only thing that may seem out of sync is that previously we tried to get the image as little as possible since screencap takes a while. We could increase the frequency of getting the screen now, but I'd want to make sure that it'd still run fine with screencap and that needs a code refactor.
I'll test this, thanks for letting me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense in theory and sounds like a good stepping stone that may (potentially) be sufficient to stop at! 🚀
Implements screen recording to get live image data from the device. We record at ~30-60fps depending on device.
Normally, screen recording keeps the shell busy due to the constant stream of bytes. We work around that by loading off the recording and decoding into a separate asyncio task.
The shell may still be overwhelmed at times (usually roughly once an hour) and time out, but we have a catch mechanism in place and the session restarts properly.
While the implemented solution seems stable, I added the config option to disable this feature.
In the future, I know of a second workaround which reduces timeouts, but this needs a bigger code refactor to be properly implemented.