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

Performance issues on Raspberry Pi 4 #523

Closed
cyberplant opened this issue May 21, 2020 · 15 comments
Closed

Performance issues on Raspberry Pi 4 #523

cyberplant opened this issue May 21, 2020 · 15 comments
Labels

Comments

@cyberplant
Copy link
Contributor

Specification

  • pywebview version: 3.2
  • platform / version: raspbian 10 (ARMv7l 32 bits)

Description

Hello!

I have an electron app that I would like to migrate to pywebview, and I'm very happy so far, but I'm having much slower performance on pywebview compared to chromium on the same RPi4.

I would like to investigate this, if it's something pywebview can change, using different flags for the rendering engines (to mimic what chromium has configured for the RPi), or if I should report this to upstream. I tested GTK and QT bindings, with different results, but with problems on both.

GTK ones work better in general, but I have one video on the app and it shows at 1 or 2 FPS. (the same video plays perfectly on chromium). QT works a bit faster but I need to double-click on links most of the time and no video at all.

Any ideas?

Practicalities

  • YES I am willing to work on this issue myself.

  • NO I am prepared to support this issue financially.

@r0x0r
Copy link
Owner

r0x0r commented May 22, 2020

Would you check what Chromium version is used both with GTK and QT? A wild guess is that it is using an ancient Chromium that results in poor performance. Also how did you install dependencies, via apt or pip?

@cyberplant
Copy link
Contributor Author

I'm not sure how to get the real version, so I got the user agent on both cases:
With GTK:
Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15

With QT:
Mozilla/5.0 (X11; Linux) AppleWebKit/602.1 (KHTML, like Gecko) Qt/5.11.3 Version/9.0 Safari/602.1

On the chromium itself on the OS:
Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Raspbian Chromium/78.0.3904.108 Chrome/78.0.3904.108 Safari/537.36

GTK bindings came with the OS (I guess) as I installed pywebview using pip and it didn't install much. With QT it installed a lot of things (with pip as well, and I think I also installed some things on the OS manually according to your instructions).

@r0x0r
Copy link
Owner

r0x0r commented May 26, 2020

I do not have access to Raspberry Pi, so cannot check it for myself. I have got the same WebKit version on my desktop system (Intel Nuc based) and videos play with no problems.
Sorry no clue about this one. Maybe somebody else can chime in.

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

@tnagels
Copy link

tnagels commented Dec 23, 2020

I have similar problems. On RPI my jpg-stream works perfectly in Chromium, but in pywebview, I only get 1-2 frames per second which flash into view and then go. So in effect I get flickering images.

I'm willing to provide you with an RPI if that helps resolve the issue.

@r0x0r
Copy link
Owner

r0x0r commented Dec 29, 2020

@tnagels I can take a look if you provide me with a RPI. Send me a message at roman at flowrl.com

@tnagels
Copy link

tnagels commented Dec 30, 2020

@r0x0r I just sent you an email!

@r0x0r r0x0r reopened this Jan 9, 2021
@r0x0r
Copy link
Owner

r0x0r commented Jan 9, 2021

Thanks to @tnagels I got an opportunity to investigate this. No results yet, but the status of current investigations are

  1. GTK shows a warning about lack of hardware acceleration, which I suppose the reason of poor performance. Upgrading GTK dependencies would probably the best course of action. I vaguely remember installing GTK dependencies outside of the default repos on Raspbian. There might be an instruction for that somewhere among the issues.
  2. Managed to install PyQT5, but no luck with webkit/webengine dependencies. QTWebKit seems to be easier to install on Raspbian.

@github-actions github-actions bot removed the stale label Jan 10, 2021
@r0x0r
Copy link
Owner

r0x0r commented Jan 16, 2021

Ok more findings:

I am not very good at or keen on building Linux packages, so maybe somebody else could give it a try and report results back here.

@tnagels
Copy link

tnagels commented Feb 3, 2021

Any chance of trying the Ubuntu build for the RPI4? There is one which is supported by the RPI Imager. Maybe that has different/more packages.

@r0x0r
Copy link
Owner

r0x0r commented Feb 4, 2021

Yeah, I will give it a try.

@r0x0r
Copy link
Owner

r0x0r commented Feb 16, 2021

@tnagels Good news. I got adequate video performance with Ubuntu for RPI4. 480p at 30fps, on par with performance of Chromium.

I used this command for installing dependencies

sudo apt install python3-pyqt5 python3-pyqt5.qtwebengine python3-pyqt5.qtwebchannel libqt5webkit5-dev

@tnagels
Copy link

tnagels commented Feb 21, 2021

@r0x0r that is indeed good news! I will give this a try as soon as I have some time on my hands.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Mar 24, 2021
@github-actions
Copy link

The message to post on the issue when closing it. If none provided, will not comment when closing an issue.

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

No branches or pull requests

3 participants