LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 01-01-2021, 05:23 AM   #1
riganta
Member
 
Registered: May 2007
Location: Cork (Ireland)
Distribution: Arch Xfce
Posts: 177

Rep: Reputation: 25
Every CPU cycle counts


Happy new year to all - All the best for 2021
I have a very small laptop and every CPU cycle counts.
I do not have any issues but just doubts as far as reducing CPU cycles on a small laptop and more precisely when watching Youtube videos.
My setup is KDE with vanilla arch.
I am using VAAPI for video decoding. I do have h264ify add on for firefox. Its the only consistent way for me to able to avoid the vp9 codec which is simply terrible on my machine regarding CPU cycle.
With VAAPI (h264) when watching a video using Youtube, I have up to 15% of CPU cycle.
With VP9, watching the same video, I am up to 40%.

I believe 15% with my current setup is still too much and I can do much better.
Is there any other approach, system I could use to reduce the CPU cycle on my machine when watching Videos using Youtube ? What kind of CPU cycle you guys are getting when watching Videos using Youtube ?

Just want to finish by adding, I am also using QPLAY2, SMPlayer and the result is about 15% CPU utilization. I have configured those apps to use VAAPI only.
 
Old 01-01-2021, 05:51 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,455

Rep: Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353
Personally, on a power challenged 6 year old laptop myself, my reaction was: "You can't be serious!"

You have KDE. What on earth are you doing with kde, perhaps the slowest thing to do anything with in your circumstances? I'm on XFCE. I should add that I've hacked (er, set up) the rather awful default Desktop to have something more suitable. It's not great, but I've learned my way around.

Get a lighter Desktop - Cinnamon and many others are highly thought of with a good compromise of lightness and basic essentials. Then you can notice the difference if we speed you up.
 
Old 01-01-2021, 05:55 AM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
Better still, don't use a desktop at all. Just use a window manager.
 
1 members found this post helpful.
Old 01-01-2021, 07:23 AM   #4
riganta
Member
 
Registered: May 2007
Location: Cork (Ireland)
Distribution: Arch Xfce
Posts: 177

Original Poster
Rep: Reputation: 25
Thanks for your reply.
I have tested 2 DM and 1 WM.
Between Gnome and KDE, I find that KDE has the lowest footprint regarding resources.
i3 was indeed excellent as far resources but not very user friendly when Desktop is dynamic and changing quite often.
To recap, unless I am mistaken, KDE by itself runs quite smoothly. With Firefox and a terminal window, I am never above 8% cpu cycle. I am using bpytop for measurement.
I did try Xfce also for a very brief time. I think it must have lasted about 30 minutes. It looks quite ugly but the most painful part is the little tweaks that you to do to make it confy I guess. As an ex, unless you install something like caffein, watching Youtube videos or movies is going to be very painful.

I am sticking with KDE for the time being, not saying this will be for ever. The initial query is really to try to understand when watching Youtube videos, what will be the best approach to minimize the impact on CPU other than my own setup describe in the first post.
To some extent, I believe (correct me if I am wrong), but using Xfce, i3 and whatnot wouldn't matter as Youtube being identical on all DM/WM ?
 
Old 01-01-2021, 07:28 AM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
Quote:
Originally Posted by riganta View Post
To some extent, I believe (correct me if I am wrong), but using Xfce, i3 and whatnot wouldn't matter as Youtube being identical on all DM/WM ?
Yes. That depends only on the browser you use.
 
Old 01-01-2021, 08:38 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by riganta View Post
I am using VAAPI for video decoding.
But does your browser?
There's ways to check this for both browser and OS, I'm sure the Arch wiki has instructions.

Quote:
I do have h264ify add on for firefox. Its the only consistent way for me to able to avoid the vp9 codec which is simply terrible on my machine regarding CPU cycle.
With VAAPI (h264) when watching a video using Youtube, I have up to 15% of CPU cycle.
With VP9, watching the same video, I am up to 40%.

I believe 15% with my current setup is still too much and I can do much better.
Is there any other approach, system I could use to reduce the CPU cycle on my machine when watching Videos using Youtube ?
The in-browser HTML5 media playback (which still is a whole bunch of javascript essentially) definitely adds some significant overhead. I'm sure you can save more by watching the video through your media player.

Maybe install mpv, read
Code:
man mpv
and look out for mentions of "youtube".

I don't watch youtube in the browser. Ever.
 
Old 01-01-2021, 09:21 AM   #7
riganta
Member
 
Registered: May 2007
Location: Cork (Ireland)
Distribution: Arch Xfce
Posts: 177

Original Poster
Rep: Reputation: 25
Thanks for your reply.
I have been using QMPLAY2 but still getting the same CPU Cycle as watchin with Firefox.
My browser is also tweak to use only VAAPI. Indeed, arch wiki is fantastic.
https://wiki.archlinux.org/index.php...o_acceleration

I am still quite happy with what I have achieved as far as CPU Cycles. I am thinking (not sure if I am correct) that I could do better. If I can go down to 10% CPU cycles while watching videos that would be perfect.

With my tweaking, Netflix is not hitting my CPU as hard as it used to.
 
Old 01-01-2021, 09:30 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
What's your idle CPU%?
Did you completely shut down the browser before measuring?
Are you sure you are playing back h264 and not some other codec? What codecs does your GPU/driver support?
 
Old 01-01-2021, 10:25 AM   #9
riganta
Member
 
Registered: May 2007
Location: Cork (Ireland)
Distribution: Arch Xfce
Posts: 177

Original Poster
Rep: Reputation: 25
CPU cycle idle is between 2 to 5% with all windows closed including firefox.

Bloomberg tv (h264) with all the tweaks using Firefox, I am getting about 15% cpu cycle. You can actually see the codec being in used using Youtube on the screenshot I posted below.
https://paste.pics/B7C4P

The ultimate for performance is SMPlayer. The same video (Bloomberg Live) through SMPlayer, I am using 3.5% CPU clycle. I have tweaked SMPlayer where I am using MPV and VAAPI.

I did a test with QPLAY2 but I am not going below 15% CPU Cycle. Same as Firefox.

I have a Intel(R) HD Graphics 4400. I have installed MESA latest..

If I use SMPlayer to watch my Youtube video, I have achieve my goal as far as performance. For the sake of learning, isn't there a possibility to achieve the same thing through Firefox ? Probably not as for the backend, SMPlayer uses MPV which a wonderful resilient piece of software.

My Firefox tweaks: (In order to avoid VP9 codec and enable VAAPi and try to save some CPU cycle)

media.ffmpeg.dmabuf-textures.enabled
media.ffmpeg.vaapi-drm-display.enabled
media.ffmpeg.vaapi.enabled
media.ffvpx.enabled set to false
MOZ_X11_EGL=1 env variable (Only if you are using X11)

I had to add the h262ify because for some videos, even after all the tweaks, I would still be using the VP9 codec. Its probably counter intuitive as far as performance, adding a plugin, but its the only way to reliably avoid the VP9 codec.
 
Old 01-01-2021, 11:53 AM   #10
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
probably I would try kodi.
 
Old 01-01-2021, 12:19 PM   #11
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,455

Rep: Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353
I'm regularly streaming to hdmi on Chromium and using a RazPi 4 with 4G, st streaming isn't very strenuous on cpu.

What throws me back on kde and gnome is the time from "Doubleclick" on icon, to the program actually getting useful. KDE was worst IIRC, but Gnome came a close second. Try cinnamon.

EDIT: I've also relegated Firefox to 'when-I-need-it' status, in favour of Palemoon. Firefox boasts about privacy, but has sold out and the buyers call the tune.

Last edited by business_kid; 01-01-2021 at 12:22 PM.
 
Old 01-01-2021, 12:49 PM   #12
riganta
Member
 
Registered: May 2007
Location: Cork (Ireland)
Distribution: Arch Xfce
Posts: 177

Original Poster
Rep: Reputation: 25
Ah yes. I am using FF because of Relay. Otherwise, I do not mind trying Palemoon.
I think after much reading, trial and error, what comes out is indeed KDE and FF triggering unneeded stress on the CPU.
 
Old 01-01-2021, 03:44 PM   #13
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by riganta View Post
If I use SMPlayer to watch my Youtube video, I have achieve my goal as far as performance. For the sake of learning, isn't there a possibility to achieve the same thing through Firefox ?
No. See my post #6:
Quote:
Originally Posted by ondoho View Post
The in-browser HTML5 media playback (which still is a whole bunch of javascript essentially) definitely adds some significant overhead.
It might be very slightly better with Palemoon or Chromium, but in the end it is what it is.

That said, there's an addon that allows you to open links with an application of your choice, it's called "Open with...".
Or you can copy the link, then trigger a script via hotkey, that will play the video.

Last edited by ondoho; 01-01-2021 at 03:46 PM.
 
Old 01-02-2021, 10:40 AM   #14
riganta
Member
 
Registered: May 2007
Location: Cork (Ireland)
Distribution: Arch Xfce
Posts: 177

Original Poster
Rep: Reputation: 25
I have moved cinamon.
Its indeed making a difference as far resources when comparing it with KDE. My comparison is using the same app as described in previous posts. I was completely wrong thinking that a different WM would not make any difference. Explaining it is certainly above my paygrade but its nevertheless a fact.
I have shaved off a few percentage of my CPU Cycles which is quite nice. My rig is very much thankful and so am I
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to check which processes are in wait cpu cycle brgsousa Linux - Software 1 08-10-2010 02:35 PM
Difference between HZ in linux/param.h and CPU clock cycle. drminix Linux - Hardware 0 05-26-2005 09:00 PM
How to Audit Print Counts in AIX Sanju_yumi AIX 0 06-17-2004 06:02 AM
CPU Utilization too Low With Cycle Hungry App sgovind Linux - Software 3 03-09-2004 06:29 PM
Post counts being reset? JesterDev LQ Suggestions & Feedback 3 01-19-2004 12:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 09:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration