Recentemente ho deciso che era giunto il tempo di risolvere un fastidioso problema con la mia installazione debian testing xfce 64bit (buster).
Mi riferisco ad un fastidioso picco della cpu praticamente costante oltre il 90% (spesso fisso al 100%) con conseguente rallentamento dell’intero sistema e quindi inevitabile “scattosità” dei video su youtube in alta risoluzione (eg, trailer, e simili) – soprattutto a schermo intero.
Per risolvere le stavo provando tutte, ma niente riusciva a sistemare questa situazione decisamente antipatica.
Stavo persino pensando di cambiare scheda video con un’altra che ho in casa (e che vendo dato che non la utilizzo):
Ma i problemi mi piace risolverli, non montare schede video inferiori sperando che driver diversi diano risultati migliori, e quindi ho voluto indagare di più…
Così ho aperto una discussione su facebook: https://www.facebook.com/groups/debianitalia/permalink/10155023114318163/
Dove, come potete leggere, si consigliava di passare al kernel rt (realtime, bassa latenza), ma questo non è disponibile su testing e quindi… niente, pazienza!
Poi si è passato a xorg:
Section "Device" Identifier "Radeon" Driver "radeon" Option "AccelMethod" "glamor" Option "DRI" "3" Option "TearFree" "on" Option "ColorTiling" "on" Option "ColorTiling2D" "on" EndSection
Ma anche qui, purtroppo, non ho ottenuto grandi risultati (la cpu era comunque alta – infatti scattava comunque).
Infine qualcuno ha tirato in ballo chromium… e dunque ho provato e… “tutto ok! andava alla grande” 😀
Ho dunque scoperto che il problema sembra dipendere da quanto segnalato qui:
Since the introduction of VP9, youtube videos are now mostly streamed in VP9, requiring a lot of CPU computing to decode and killing my battery. In safari, which is not compatible VP9, videos are streamed in h.264 and the CPU load is very low due to hardware acceleration for this format.
Insomma, l’introduzione del formato VP9 causa problemi di cpu (almeno a me e a qualcun altro) e quindi bisogna trovare qualche browser non compatibile con VP9 per evitare il problema.
Ora, VP9, in teoria, dovrebbe essere presente su chromium, ma andando su: https://www.youtube.com/html5
otteniamo questo:

Così il video viene “servito” in h.264 o altri formati (validissimi, ma che non causano il problema della cpu al 100%).
Da test fatti, pertanto, se avete il problema della cpu alta con i video di youtube su chrome con linux, potete provare a passare a chromium e vedere se risolvete (io ho risolto).
Un’altra alternativa è l’estensione: https://chrome.google.com/webstore/detail/h264ify/aleakchihdccplidncghkekgioiakgal
Risultato dopo l’installazione dell’estensione:
Per maggiori info su “le differenze tra chrome e chromium”:
The Difference between Google Chrome and Chromium on Linux
Chromium on Linux has two general flavors: You can either get Google Chrome or chromium-browser (see Linux Chromium Packages. This page tries to describe the differences between the two.
In short, Google Chrome is the Chromium open source project built, packaged, and distributed by Google. This table lists what Google adds to the Google Chrome builds on Linux.
Google Chrome
- Colorful logo
- Reports crashes only if turned on. Please include symbolized backtraces in bug reports if you don’t have crash reporting turned on.
- User metrics only if turned on
- Video and Audio codecs (may vary by distro)
- AAC, H.264, MP3, Opus, Theora, Vorbis, VP8, VP9, and WAV
- Sandboxed PPAPI (non-free) Flash plugin included in release
- Code is tested by Chrome developers
- Sandbox is always on
- Single deb/rpm package
- Profile is kept in
~/.config/google-chrome
- Cache is kept in
~/.cache/google-chrome
- New releases are tested before being sent to users
- Google API keys are added by Google
Chromium
- Blue logo
- Does not ever report crashes. Please include symbolized backtraces in bug reports.
- User metrics are never reported.
- Video and Audio codecs (may vary by distro)
- Opus, Theora, Vorbis, VP8, VP9, and WAV by default
- Supports NPAPI (unsandboxed) Flash plugins, including the one from Adobe in Chrome 34 and below
- Code may be modified by distributions
- Sandbox depends on the distribution (navigate to about:sandbox to confirm)
- Packaging depends on the distribution
- Profile is kept in
~/.config/chromium
- Cache is kept in
~/.cache/chromium
- New release testing depends on the distribution
- Distributions are encouraged to track stable channel releases: see http://googlechromereleases.blogspot.com/, http://omahaproxy.appspot.com/ and http://gsdview.appspot.com/chromium-browser-official/
- Google API keys depend on the distribution
https://chromium.googlesource.com/chromium/src/+/master/docs/chromium_browser_vs_google_chrome.md