[TRACKING] Linux Hardware Video Decoding Power Consumption

Hello people,

I’m in a rabbit hole, trying to get my some useful battery endurance while watching (YouTube) Videos. I read through many threads here in the forum and many articles on ArchWiki. I managed to enable hardware accelerated video decoding, also in Firefox (my primary web browser).
Here are my results:

Used Hardware:

  • Framework Laptop 13 DIY Edition
  • Intel 12th Gen Alder Lake i5-1240P
  • 32GB DDR4 3200
  • 500GB WD_BLACK SN850 NVMe
  • Intel WiFi 6E AX210
  • no HDMI card plugged in
  • no peripheral devices connected

Operation System Setup:

  • ArchLinux with kernel version 6.2.10
  • Xorg as display server
  • i3wm as window manager
  • PipeWire

Relevant Services:

  • TLP with default configuration
  • auto cpu-freq

Video Acceleration Related:

  • installed intel-media-driver package
  • vainfo report includes support H264 and V9 hardware en-/decoding
  • basically everything the ArchWiki is recommending is working out of the box for me

Runtime Software:

  • Firefox version 112.0 with settings in about:config option media.ffmpeg.vaapi.enabled as true
  • mpv version 0.35.1
  • PowerTOP version 2.15
  • yt-dlp version 2023.03.04
  • intel-gpu-tools version 1.27
  • Chromium version 112.0.5615.49 without any configuration

I ran all scenarios using a clean started system, just opening a terminal and depending on the scenario the respective browser or video player.
Display brightness on moderate level.
Power supply from battery.
Video is played on YouTube or downloaded from it.
Video resolution is constantly fixed to 1080p (has an impact).
Window playing the video is ~80% of the screen (has an impact).
I wait for about a minute to let the system settle on a more stable power consumption for each scenario.

Idle system with graphical environment and terminal running powertop and Intel GPU top:
~5W power consumption
GPU video NOT active

Firefox:
~10W power consumption
GPU video active

Chromium:
~11W power consumption
GPU video NOT active

MPV with already downloaded video (mpv —hwcodec=auto <local_file_path>):
~9W power consumption
GPU video active

MPV with piped active download (yt-dlp —format-sort “res:1080” <URL> —output - | mpv - —hwcodec=auto):
~9W
GPU video active

Same Video in Firefox with 4K resolution:
~11W
GPU video active

The laptop gets noticeably warm on my lap. Though the fan stays pretty silent when using hardware supported video decoding. Looking also into ‘htop’, the CPU is actually pretty idle. Though the Firefox process is still causing much more load when switching between video pause or playing.

I must admit I’m not too happy with the results. Especially when I see the MacBook M1 of my wife in comparison.
Would be amazing if you could share your results, experience and maybe tips how to improve more.

Thank you very much everyone!

1 Like

My power consumptions mirrors yours almost exactly. I expect it to improve somewhat as the drivers improve. You will never see anything close to what you would get on an Apple M1 or M2. The Apple is a monolithic system, everything is soldered to the board, every program is tuned to work with a very limited set of equipment, every driver is very specific and tuned to be used with a very limited set of adjoining hardware. If your laptop is a toy…buy Apple, if it is actually a tool that you need to use for a multitude of tasks on pretty much any equipment, with a variety of one off programs, languages etc, stick with what you have.

Apple makes substandard products for users who are comfortable with being limited in what they can do.

1 Like

How is that worse than a pretty similar setup on my much older t480s?

You sure hw decoding is actually working in your case and it isn’t using av1 or something that the gpu in the 12th gen can’t decode?

I just did a quick experiment, bit under 4w idle and between 6 and 7w playing a 720p youtube video in firefox with hw acceleration (yt didn’t have a higher resolution available in a format that my cpu could hw decode). So getting much higher numbers on a much newer platform sounds a but wrong.

You can use intel_gpu_top from the intel-gpu-tools package to check if it is actually using the decode hw. Might also just be linux not being able to deal with the mixed core arrangement of the 12th gen or something. I hope the amd version is going to work better in that reguard.

@nadb
I’m a professional software engineer and work with Linux since 23 years. A lot of time I just live in the terminal and do not even launch a desktop environment. And I love to see the performance of my Framework when the Rust compiler takes all cores to 100%.
Nevertheless I also like to do some other stuff with my laptop. Like consuming YouTube videos related to my hobbies and interests.
Of course I know that a MacBook is a different setup with different fundamentals. Just the gap is so huge that I was wondering a little. And as Video playing is a quite unique and good to observe/measurable/optimisable task, I thought it would be great to get in exchange.

@Adrian_Joachim
Good question with the AV1. Though I haven’t listed it, I also run the tests with the H264lify plugin in a Firefox and also set the parameter to yt-dlp to use H264. With basically the same result.
And as you might have read in my original post: I used your recommended intel_gpu_top and denoted the video usage report for each scenario.
Anyway, as your systems seems to consume a little less power (though watching with less resolution) would you like to share any other/additional optimisation steps (to mine) you took to achieve this? Or is it just out-of-the box for you?

Thanks for responding people! :pray:

What framerate are we talking about? I’ve found that 30fps vs. 60fps makes more of an impact than the resolution.
For a 1080p30 video I see around 7W (low-ish screen brightness) and for 1080p60 it is around 9W. MPV is usually a bit more efficient, say 0.5W better.

@stratho I have a similar use case. I spend most of my day in a terminal. Completely understand the desire to use it for things other than work, but video playback has always been a pain point with linux in so far as making it power efficient.

@mcz now this is something i have not tested. Every test I performed was at 60fps. I will have to give this a try. 30fps is usually bearable and more than enough for most youtube videos.

Is there even a out of the box with arch, but I didn’t do anything too fancy, tlp with default conf and force hw decoder in firefox + h265ify. Using kodi to play video is still quite a bit more efficient so firefox still has some room for improvement. I just tried streaming high ish bitrate 4k60 from my nas in kodi over sshfs and it stayed under 7w.

How much power consumption does inte_gpu_top report while playing video? Cause currently I am blaming the mixed core fuckery of the 12th gen.

We don’t actively provide direct support for Arch, but tracking in the meantime.

Is power consumption better on other distros?

We do have a TLP guide for Ubuntu, Fedora matches this as well.

(I don’t have a framework jet, preordered a r7 13, and me preordering something is a really rare thing)

Do you have some rough numbers, idle (sitting on a simple desktop with as little as possible running, 20% brigthness, wifi on and connected), firefox playing a 720p youtube video (not full screen) and maybe firefox playing a 4k60 youtube video (also not full screen)?

I am asuming the amd version is going to do better in this reguard but if the intel version is actually doing this bad that’s not good.

I can share my experiences with the Framework 13. My use case and the hours we see are expressed on the TLP guide. That said, we have users seeing far better numbers by taking additional steps. Again, note the + sign next to the numbers.

Additionally we’re working on internal changes to further battery life with expansion modules in use as well. This is an ongoing process that will be reflected in BIOS updates.

We recommend following the guide, which goes beyond just TLP.

I use my Framework 13 12th Gen throughout my workday without needing to charge it with this TLP config and following the guide.

Unused expansion modules removed, TLP enabled per the guide and brightness down, keyboard lights off with Bluetooth turned off as well, you will see far better battery life than without these changes.

1 Like

Well, I’ve only been using linux for about a year, but I also found the issue of video decoding on linux to be bewildering, and I also undertook a sort of survey. See this thread I made. I’m now using Endeavour OS on the Framework laptop, and hardware acceleration isn’t working with this distro either. Last week I tried again to follow the directions on the arch wiki and clean things up, and what I got for my efforts was a non-booting system.

It seems like this is neither an arch-specific issue nor a framework-specific issue. I hope it gets resolved eventually. I see people on this forum reporting incredibly low power usage, like under 5W. I’d sure like to see that performance on my machine.

As a new linux convert, I think that this might actually be my biggest gripe with the linux experience.

Hi @Aidan , I’m curious about the non-booting arch setup, do you have a separate thread for that issue?

are you still using Endeavour OS at the moment? cheers!

@Loell_Framework Yes, I’m using that Endeavour OS system right now. I got it fixed with help from the Endeavour OS forum. I didn’t come here for help because I don’t think it was a Framework-specific issue. I wish I could tell you the whole story, but unfortunately I don’t remember what I did which broke it. I thought I was being very careful with what I tried, but I guess when you don’t know linux, you don’t know what it means to be careful with linux.

I switched to Endeavour because someone suggested it might be better with hardware acceleration. It wasn’t, but it seemed to work better “out of the box” with framework than other Distros, at least with KDE on top of it, and the Endeavour/Arch community is just more knowledgeable than others. My new attitude is that linux WILL break, severely and unpredictably, so it’s better to be among people who can help you fix what’s broken than to use an “easy” distro that won’t break.

1 Like

What exactly are you trying to hardware accelerate?

HW video decode has worked in kodi and some other video players for ages, firefox only recently and for chromium only recently (without a cutom build that is). In the browsers it still may need to be force enabled and the power savings are not as big as in the case of a dedicated video player like kodi but still noticable, asuming you are actually streaming a codec that can be hardware decoded by your cpu.

I have been messing with hw decode on linux for a while and it has got a lot better (at least in the browser space, kodi has worked great for ages) recently.

1 Like

@Adrian_Joachim what kind of power usage are you seeing on Kodi running youtu e videos for instance. On Firefox it is around 9-10w on a i7-1260p. Obviously it has room for improvement.

Don’t really have youtube videos in kodi but as I said, high bitrate 4k60 streamed via sshfs on kodi takes about 7w on my t480s.

Is firefox actually using the hw decoder in your case?

@Adrian_Joachim yeah I have full hardware acceleration enabled. It works. Without it it bounces around between 10-15w. Just wild. I will see if Kodi gets better power efficiency. Strangely enough the T480s is my emergency backup, i.e. my old daily driver. Great machine.

How much is your idle power? Like on the desktop with nothing going on at low ish brightness with wifi connected?