You are not logged in.

#1 2017-06-27 01:23:51

alexv305
Member
Registered: 2017-06-27
Posts: 8

Hardware Acceleration and CPU usage during Web Browsing

Hello Arch Linux Forums!

I have a question about hardware acceleration and web browsing. A few months ago I purchased an Asus UX330UA laptop with Kaby-lake. The specs include i5-7200u, 8gb Ram, 256GB SSD.. It's pretty decent and I'm happy with It as the price was right! The first few weeks it was running Windows 10. Youtube videos and web browsing was flawless and snappy. Being a linux enthusiassed, a fresh copy of Arch was installed running with MATE. For the most part everything worked out of the box after installing xorg, mate, network utilities, etc.. But I can't seem to get video playback to be hardware accelerated. When I visit youtube.com/html5 every option has a checkmark in firefox and chromium but the CPU usage is at averaging 80-90% when watching 4k videos. In Windows 10, it was averaging less than 10%. Even plain old web browsing visiting major news websites causes my CPU to top out loading items on the page. Windows 10 doesn't seem to have that high of a load. I love Arch linux and I'm not planning on switching back to Windows because video is a small percentage of what I normally use my laptop for, but web browsing is a daily task.

I was wondering if anyone has experienced a similar issue, or would you be able to point out some things I should be looking at / tweaking to improve web browsing and video play back?

Sidenote, I did try H264ify but 1440p and 4k videos still have very high CPU usage, doesn't seem to be hardware decoded at all.

Thanks in Advance!

-alexv305

Offline

#2 2017-06-27 05:02:53

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: Hardware Acceleration and CPU usage during Web Browsing

glxinfo | grep renderer

Which browser you are using ?
Have you tried playing videos with mpv/youtube-dl?

Offline

#3 2017-06-27 05:51:33

HiImTye
Member
From: Halifax, NS, Canada
Registered: 2012-05-09
Posts: 1,072

Re: Hardware Acceleration and CPU usage during Web Browsing

the website lists the video hardware as integrated graphics

Integrated Intel HD Graphics 520

have you installed the intel drivers? have you taken a look at the video acceleration page?

Last edited by HiImTye (2017-06-27 05:52:05)

Offline

#4 2017-06-27 06:14:09

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Hardware Acceleration and CPU usage during Web Browsing

Linux browsers do not have hardware video acceleration. There's a VAAPI patch for Chromium which may or may not work, but that's it. If your CPU can't handle high-resolution video (a laptop CPU will unlikely be able to handle 4K, 1080p might or might not work), don't watch it in the browser, download it and use a dedicated player configured to use hardware decoding (mpv --hwdec=vaapi for example).

Offline

#5 2017-06-27 20:09:13

alexv305
Member
Registered: 2017-06-27
Posts: 8

Re: Hardware Acceleration and CPU usage during Web Browsing

Docbroke wrote:
glxinfo | grep renderer

Which browser you are using ?
Have you tried playing videos with mpv/youtube-dl?

Using firefox and chromium,

glxinfo says unknown command. Which pkg should I install?

Last edited by alexv305 (2017-06-27 20:09:39)

Offline

#6 2017-06-27 20:10:33

alexv305
Member
Registered: 2017-06-27
Posts: 8

Re: Hardware Acceleration and CPU usage during Web Browsing

HiImTye wrote:

the website lists the video hardware as integrated graphics

Integrated Intel HD Graphics 520

have you installed the intel drivers? have you taken a look at the video acceleration page?

I tried with and without xf86-video-intel. The graphics page recommends mesa.. I tried both, still no hardware acceleration..

Offline

#7 2017-06-27 20:11:27

alexv305
Member
Registered: 2017-06-27
Posts: 8

Re: Hardware Acceleration and CPU usage during Web Browsing

Gusar wrote:

Linux browsers do not have hardware video acceleration. There's a VAAPI patch for Chromium which may or may not work, but that's it. If your CPU can't handle high-resolution video (a laptop CPU will unlikely be able to handle 4K, 1080p might or might not work), don't watch it in the browser, download it and use a dedicated player configured to use hardware decoding (mpv --hwdec=vaapi for example).

Sigh, that seems like too much effort just to watch a video.

Where is the patch / how do I install it?

Offline

#8 2017-06-27 20:11:47

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,645

Re: Hardware Acceleration and CPU usage during Web Browsing

alexv305 wrote:

glxinfo says unknown command. Which pkg should I install?

$ pkgfile glxinfo
extra/mesa-demos

$ pacman -Fs glxinfo
extra/mesa-demos 8.3.0-2
/usr/bin/glxinfo

Last edited by 2ManyDogs (2017-06-27 20:18:58)


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

#9 2017-06-27 20:35:56

alexv305
Member
Registered: 2017-06-27
Posts: 8

Re: Hardware Acceleration and CPU usage during Web Browsing

2ManyDogs wrote:
alexv305 wrote:

glxinfo says unknown command. Which pkg should I install?

$ pkgfile glxinfo
extra/mesa-demos

$ pacman -Fs glxinfo
extra/mesa-demos 8.3.0-2
/usr/bin/glxinfo

    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 620 (Kaby Lake GT2)

Offline

#10 2017-06-27 20:36:50

alexv305
Member
Registered: 2017-06-27
Posts: 8

Re: Hardware Acceleration and CPU usage during Web Browsing

alexv305 wrote:
2ManyDogs wrote:
alexv305 wrote:

glxinfo says unknown command. Which pkg should I install?

$ pkgfile glxinfo
extra/mesa-demos

$ pacman -Fs glxinfo
extra/mesa-demos 8.3.0-2
/usr/bin/glxinfo

    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 620 (Kaby Lake GT2)

Forgot to add I just removed xf86-video-intel.. It feels sluggish compared to Mesa..

Offline

#11 2017-06-27 20:51:50

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Hardware Acceleration and CPU usage during Web Browsing

alexv305 wrote:

Where is the patch / how do I install it?

Here's the compiled version: https://aur.archlinux.org/packages/chromium-vaapi-bin. If that won't work, you'll have to compile yourself (which will take at least two hours, likely even more): https://aur.archlinux.org/packages/chromium-vaapi/. If not even that will do, the last resort is chromium-dev: https://aur.archlinux.org/packages/chromium-dev/ - here you need to modify the PKGBUILD, change the _enable_vaapi variable at the top.

Offline

#12 2017-06-27 22:42:34

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,645

Re: Hardware Acceleration and CPU usage during Web Browsing

alexv305 wrote:

Forgot to add I just removed xf86-video-intel.. It feels sluggish compared to Mesa..

You can edit your posts to add information to them -- you don't have add another post. And even if you do add another post, you don't have to quote everything in the previous post.


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

#13 2017-06-28 02:55:51

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: Hardware Acceleration and CPU usage during Web Browsing

alexv305 wrote:

Sigh, that seems like too much effort just to watch a video.

Where is the patch / how do I install it?

It may seem like that but in reality this option is quite easy and stable. You just need to install mpv, youtube-dl. Get "open with" add-on for firefox (or chromium), and add option to open links with mpv(or your script, if you want to use extended options, as an example look at the script I am using below). Modify ".config/mpv/mpv.conf" to include "hwdec=yes" You can also download videos using youtube-dl.

#!/bin/bash

[[ ! $1 ]] && exit

shopt -s lastpipe

url="$1"
youtube-dl -F "$url"
echo "choose quality (from first column)"
read quality
echo choose "p) play d) download"
read -n 1 choice 
    case $choice in
        p) mpv --ytdl-format="$quality" --no-resume-playback "$url" ;;
        d) youtube-dl -f "$quality" "$url" ;;
    esac

Offline

Board footer

Powered by FluxBB