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

Option to turn on/off hardware acceleration #13648

Closed
austinhuang0131 opened this issue May 13, 2020 · 13 comments · Fixed by element-hq/element-desktop#365
Closed

Option to turn on/off hardware acceleration #13648

austinhuang0131 opened this issue May 13, 2020 · 13 comments · Fixed by element-hq/element-desktop#365
Labels
A-Electron Help Wanted Extra attention is needed O-Uncommon Most users are unlikely to come across this or unexpected workflow T-Enhancement

Comments

@austinhuang0131
Copy link

austinhuang0131 commented May 13, 2020

Is your suggestion related to a problem? Please describe.
Mac tends to freeze a lot when hardware acceleration is frequently used. A known example is patch 2020-002. Also this would help low-end devices running the app.

Describe the solution you'd like
A switch to enable/disable hardware acceleration for graphics.

Describe alternatives you've considered
The switch certainly exists for Discord (which is also electron)...

Additional context

edit: typo

@turt2live turt2live changed the title [Suggestion] Hardware acceleration switch Option to turn on/off hardware acceleration May 13, 2020
@austinhuang0131
Copy link
Author

Also, my computer (MacBook Air) froze with that specific fault (in linked article) when launching the YouTube widget, so that sorta makes the issue somewhere between an issue and a suggestion...

@turt2live
Copy link
Member

that would probably be a different issue, though likely to be closed as a duplicate of this due to lack of the feature in the first place.

@jryans jryans added A-Electron P3 S-Critical Prevents work, causes data loss and/or has no workaround labels Apr 6, 2021
@kittykat kittykat added the O-Uncommon Most users are unlikely to come across this or unexpected workflow label Aug 2, 2021
@novocaine
Copy link
Contributor

@MRAAGH
Copy link

MRAAGH commented Mar 16, 2022

Seems this is still relevant, since hardware acceleration is causing #21405
It would be great to have an option for this. All it needs to do is call app.disableHardwareAcceleration() at startup

@novocaine novocaine removed S-Critical Prevents work, causes data loss and/or has no workaround P3 labels Mar 16, 2022
@novocaine
Copy link
Contributor

novocaine commented Mar 16, 2022

Seems this is still relevant, since hardware acceleration is causing #21405 It would be great to have an option for this. All it needs to do is call app.disableHardwareAcceleration() at startup

You (or the OP) could verify whether your suggestion indeed resolves #21405 by running app.disableHardwareAcceleration() in the developer console (ctrl/cmd+alt+I). If you can show that, it would help motivate this enhancement request.

Note that Electron's documentation doesn't draw that conclusion, and in the past, we've found it hasn't been that simple.

@MRAAGH
Copy link

MRAAGH commented Mar 16, 2022

https://www.electronjs.org/docs/latest/api/app#appdisablehardwareacceleration states that this can only be called before the app is ready; so I don't think we can do this while it is already running. Additionally, I don't seem to be able to find app, it either exists under a different name or is not globally defined
Screenshot_20220316-181028_r8KQb

@novocaine
Copy link
Contributor

https://www.electronjs.org/docs/latest/api/app#appdisablehardwareacceleration states that this can only be called before the app is ready; so I don't think we can do this while it is already running. Additionally, I don't seem to be able to find app, it either exists under a different name or is not globally defined Screenshot_20220316-181028_r8KQb

ah right. well, its not too complicated to to a local build and hack the line in to test, instructions are over at https://github.com/vector-im/element-desktop/

@SapphyThyHybrid
Copy link

Seems this is still relevant, since hardware acceleration is causing #21405 It would be great to have an option for this. All it needs to do is call app.disableHardwareAcceleration() at startup

You (or the OP) could verify whether your suggestion indeed resolves #21405 by running app.disableHardwareAcceleration() in the developer console (ctrl/cmd+alt+I). If you can show that, it would help motivate this enhancement request.

Note that Electron's documentation doesn't draw that conclusion, and in the past, we've found it hasn't been that simple.

I'll do my best then

@t3chguy
Copy link
Member

t3chguy commented Mar 21, 2022

Additionally, I don't seem to be able to find app, it either exists under a different name or is not globally defined

Its only available from the Main process, not the Renderer process.

image

@MRAAGH
Copy link

MRAAGH commented Mar 21, 2022

I am not personally experiencing this issue, but for anyone who is, here is how you can test if disabling hardware acceleration is the solution:

  1. install yarn (for example from https://github.com/yarnpkg/yarn/releases)
  2. go to https://github.com/vector-im/element-desktop/ click Code and then Download ZIP. Extract the zip
  3. open a terminal in the extracted folder and run these commands:
yarn install
yarn run fetch --noverify --cfgdir ""
yarn add electron
yarn start

Your freshly compiled Element should start. Please check that your issue still happens in this version. Then quit Element.

  1. open the folder src and edit electron-main.ts. Find the line that says app.on('ready', async () => { (should be line number 846). Before this line, add the following line:
app.disableHardwareAcceleration();

Save and close.

  1. Run the command yarn start again. Element starts again. Check that the issue does not happen any more.

@SapphyThyHybrid
Copy link

Seems this is still relevant, since hardware acceleration is causing #21405 It would be great to have an option for this. All it needs to do is call app.disableHardwareAcceleration() at startup

You (or the OP) could verify whether your suggestion indeed resolves #21405 by running app.disableHardwareAcceleration() in the developer console (ctrl/cmd+alt+I). If you can show that, it would help motivate this enhancement request.
Note that Electron's documentation doesn't draw that conclusion, and in the past, we've found it hasn't been that simple.

I'll do my best then

Continuing with this and with the help of friends, eventually we go there, thanks to this person and these steps (as well as other cause windows wants to be windows

I am not personally experiencing this issue, but for anyone who is, here is how you can test if disabling hardware acceleration is the solution:

  1. install yarn (for example from https://github.com/yarnpkg/yarn/releases)
  2. go to https://github.com/vector-im/element-desktop/ click Code and then Download ZIP. Extract the zip
  3. open a terminal in the extracted folder and run these commands:
yarn install
yarn run fetch --noverify --cfgdir ""
yarn add electron
yarn start

Your freshly compiled Element should start. Please check that your issue still happens in this version. Then quit Element.

  1. open the folder src and edit electron-main.ts. Find the line that says app.on('ready', async () => { (should be line number 846). Before this line, add the following line:
app.disableHardwareAcceleration();

Save and close.

  1. Run the command yarn start again. Element starts again. Check that the issue does not happen any more.

disabling hardware acceleration has fixed the issue for me

Before disabling:
image

and after disabling:
image
I waited a couple of mins after disabling to see if it comes back (usually takes about 10 seconds for it to become blurry for me) and it stayed readable. I hope this is enough proof that disabling hardware acceleration fixes the issue for me, and sorry it took a while. Life happened.

@MRAAGH
Copy link

MRAAGH commented Apr 16, 2022

tl;dr: yes, app.disableHardwareAcceleration(); fixed everything, and there should probably be a setting for this.

@MRAAGH
Copy link

MRAAGH commented May 23, 2022

🎉

su-ex added a commit to SchildiChat/element-desktop that referenced this issue Jun 7, 2022
* Builds Windows 32-bit builds once more! ([\element-hq#369](element-hq#369)). Fixes element-hq/element-web#13175.
* Option to disable hardware acceleration ([\element-hq#365](element-hq#365)). Fixes element-hq/element-web#13648. Contributed by @novocaine.
* Make Lao translation available ([\#22358](element-hq/element-web#22358)). Fixes element-hq/element-web#22327.
* Option to disable hardware acceleration on Element Desktop ([\#22295](element-hq/element-web#22295)). Contributed by @novocaine.
* Configure custom home.html via `.well-known/matrix/client["io.element.embedded_pages"]["home_url"]` for all your element-web/desktop users ([\#7790](matrix-org/matrix-react-sdk#7790)). Contributed by @johannes-krude.
* Live location sharing - open location in OpenStreetMap ([\#8695](matrix-org/matrix-react-sdk#8695)). Contributed by @kerryarchibald.
* Show a dialog when Jitsi encounters an error ([\#8701](matrix-org/matrix-react-sdk#8701)). Fixes element-hq/element-web#22284.
* Add support for setting the `avatar_url` of widgets by integration managers. ([\#8550](matrix-org/matrix-react-sdk#8550)). Contributed by @Fox32.
* Add an option to ignore (block) a user when reporting their events ([\#8471](matrix-org/matrix-react-sdk#8471)).
* Add the option to disable hardware acceleration ([\#8655](matrix-org/matrix-react-sdk#8655)). Contributed by @novocaine.
* Slightly better presentation of read receipts to screen reader users ([\#8662](matrix-org/matrix-react-sdk#8662)). Fixes element-hq/element-web#22293. Contributed by @pvagner.
* Add jump to related event context menu item ([\#6775](matrix-org/matrix-react-sdk#6775)). Fixes element-hq/element-web#19883.
* Add public room directory hook ([\#8626](matrix-org/matrix-react-sdk#8626)).
* Revert back to using libsqlcipher0 for Debian & Ubuntu packages of Desktop ([\element-hq#367](element-hq#367)). Fixes element-hq/element-web#22325.
* Stop Jitsi if we time out while connecting to a video room ([\#22301](element-hq/element-web#22301)). Fixes element-hq/element-web#22283.
* Remove inline margin from UTD error message inside a reply tile on ThreadView ([\#8708](matrix-org/matrix-react-sdk#8708)). Fixes element-hq/element-web#22376. Contributed by @luixxiul.
* Move unread notification dots of the threads list to the expected position ([\#8700](matrix-org/matrix-react-sdk#8700)). Fixes element-hq/element-web#22350. Contributed by @luixxiul.
* Prevent overflow of grid items on a bubble with UTD generally ([\#8697](matrix-org/matrix-react-sdk#8697)). Contributed by @luixxiul.
* Create 'Unable To Decrypt' grid layout for hidden events on a bubble layout ([\#8704](matrix-org/matrix-react-sdk#8704)). Fixes element-hq/element-web#22365. Contributed by @luixxiul.
* Fix - AccessibleButton does not set disabled attribute ([\#8682](matrix-org/matrix-react-sdk#8682)). Contributed by @kerryarchibald.
* Fix font not resetting when logging out ([\#8670](matrix-org/matrix-react-sdk#8670)). Fixes element-hq/element-web#17228.
* Fix local aliases section of room settings not working for some homeservers (ie ([\#8698](matrix-org/matrix-react-sdk#8698)). Fixes element-hq/element-web#22337.
* Align EventTile_line with display name on message bubble ([\#8692](matrix-org/matrix-react-sdk#8692)). Fixes element-hq/element-web#22343. Contributed by @luixxiul.
* Convert references to direct chat -> direct message ([\#8694](matrix-org/matrix-react-sdk#8694)). Contributed by @novocaine.
* Improve combining diacritics for U+20D0 to U+20F0 in Chrome ([\#8687](matrix-org/matrix-react-sdk#8687)).
* Make the empty thread panel fill BaseCard ([\#8690](matrix-org/matrix-react-sdk#8690)). Fixes element-hq/element-web#22338. Contributed by @luixxiul.
* Fix edge case around composer handling gendered facepalm emoji ([\#8686](matrix-org/matrix-react-sdk#8686)).
* Fix a grid blowout due to nowrap displayName on a bubble with UTD ([\#8688](matrix-org/matrix-react-sdk#8688)). Fixes element-hq/element-web#21914. Contributed by @luixxiul.
* Apply the same max-width to image tile on the thread timeline as message bubble ([\#8669](matrix-org/matrix-react-sdk#8669)). Fixes element-hq/element-web#22313. Contributed by @luixxiul.
* Fix dropdown button size for picture-in-picture CallView ([\#8680](matrix-org/matrix-react-sdk#8680)). Fixes element-hq/element-web#22316. Contributed by @luixxiul.
* Live location sharing - fix square border for image-less avatar (PSF-1052) ([\#8679](matrix-org/matrix-react-sdk#8679)). Contributed by @kerryarchibald.
* Stop connecting to a video room if the widget messaging disappears ([\#8660](matrix-org/matrix-react-sdk#8660)).
* Fix file button and audio player overflowing from message bubble ([\#8666](matrix-org/matrix-react-sdk#8666)). Fixes element-hq/element-web#22308. Contributed by @luixxiul.
* Don't show broken composer format bar when selection is whitespace ([\#8673](matrix-org/matrix-react-sdk#8673)). Fixes element-hq/element-web#10788.
* Fix media upload http 413 handling ([\#8674](matrix-org/matrix-react-sdk#8674)).
* Fix emoji picker for editing thread responses ([\#8671](matrix-org/matrix-react-sdk#8671)). Fixes matrix-org/element-web-rageshakes#13129.
* Map attribution while sharing live location is now visible ([\#8621](matrix-org/matrix-react-sdk#8621)). Fixes element-hq/element-web#22236. Contributed by @weeman1337.
* Fix info tile overlapping the time stamp on TimelineCard ([\#8639](matrix-org/matrix-react-sdk#8639)). Fixes element-hq/element-web#22256. Contributed by @luixxiul.
* Fix position of wide images on IRC / modern layout ([\#8667](matrix-org/matrix-react-sdk#8667)). Fixes element-hq/element-web#22309. Contributed by @luixxiul.
* Fix other user's displayName being wrapped on the bubble message layout ([\#8456](matrix-org/matrix-react-sdk#8456)). Fixes element-hq/element-web#22004. Contributed by @luixxiul.
* Set spacing declarations to elements in mx_EventTile_mediaLine ([\#8665](matrix-org/matrix-react-sdk#8665)). Fixes element-hq/element-web#22307. Contributed by @luixxiul.
* Fix wide image overflowing from the thumbnail container ([\#8663](matrix-org/matrix-react-sdk#8663)). Fixes element-hq/element-web#22303. Contributed by @luixxiul.
* Fix styles of "Show all" link button on ReactionsRow ([\#8658](matrix-org/matrix-react-sdk#8658)). Fixes element-hq/element-web#22300. Contributed by @luixxiul.
* Automatically log in after registration ([\#8654](matrix-org/matrix-react-sdk#8654)). Fixes element-hq/element-web#19305. Contributed by @justjanne.
* Fix offline status in window title not working reliably ([\#8656](matrix-org/matrix-react-sdk#8656)).
* Align input area with event body's first letter in a thread on IRC/modern layout ([\#8636](matrix-org/matrix-react-sdk#8636)). Fixes element-hq/element-web#22252. Contributed by @luixxiul.
* Fix crash on null idp for SSO buttons ([\#8650](matrix-org/matrix-react-sdk#8650)). Contributed by @hughns.
* Don't open the regular browser or our context menu on right-clicking the `Options` button in the message action bar ([\#8648](matrix-org/matrix-react-sdk#8648)). Fixes element-hq/element-web#22279.
* Show notifications even when Element is focused ([\#8590](matrix-org/matrix-react-sdk#8590)). Contributed by @sumnerevans.
* Remove padding from the buttons on edit message composer of a event tile on a thread ([\#8632](matrix-org/matrix-react-sdk#8632)). Contributed by @luixxiul.
* ensure metaspace changes correctly notify listeners ([\#8611](matrix-org/matrix-react-sdk#8611)). Fixes element-hq/element-web#21006. Contributed by @justjanne.
* Hide image banner on stickers, they have a tooltip already ([\#8641](matrix-org/matrix-react-sdk#8641)). Fixes element-hq/element-web#22244.
* Adjust EditMessageComposer style declarations ([\#8631](matrix-org/matrix-react-sdk#8631)). Fixes element-hq/element-web#22231. Contributed by @luixxiul.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Electron Help Wanted Extra attention is needed O-Uncommon Most users are unlikely to come across this or unexpected workflow T-Enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants