Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

On Linux Firefox suffers from lack of hardware decoding and encoding (it doesn't plug into vaapi), which makes performance quite bad on laptops. I suspect something like WebEx, for example, works horribly in result. Or may be it's just Cisco not doing a good job. Conferencing experience with their WebRTC client in Firefox on Linux is horrendous.


We were just talking about VA on Linux. There is a chance for it to be enabled soon.


Oh, that's great to hear! I thought this might come into focus, once WebRender is officially released.

By the way, how is the progress for WebRender over Vulkan?


Current state of Vulkan port is that the correctness is on par with GL, minus a few driver bugs. We still need to re-architect WebRender a bit in order to get the performance advantage over GL.


I just switched to Firefox again after some shortsighted changes on Chrome. Neither give me GPU decode on Linux, but FF is SIGNIFICANTLY worse than Chrome on CPU decode. I can do a build in the background using all 12 threads and have no issues with video play back on Chrome (well, maybe not 4k60) but FF it's unwatchable, even at 900p60. (i7 8700k if you're wondering hardware wise, not OC'd because horrible chip and not worth it)


So VAAPI support can soon land in Firefox for Linux? Cool. This is great news for me.

Can you give us some details? When? Can I somehow help in testing, for example in Firefox nightly? What hardware can be supported? What formats, h264 or/and vp9?


We can't promise anything yet, sorry, but we are looking into it.


The bug report is 4 years old:

https://bugzilla.mozilla.org/show_bug.cgi?id=1210726

It's such a disappointment that this hasn't been fixed yet.


Sadly Linux has been a 3rd class citizen for years as far as Mozilla is concerned.


Or maybe it's a complex engineering challenge?

The Firefox Devs aren't just sitting there not clicking a button called "enable hardware acceleration"


Well at least Chromium has support for this. I don't know why it is taking Mozilla so long honestly, but I'm guessing most of their developers don't use Linux and the org just loves to virtual-signal and not practice what they preach.


Chromium/Chrome does not support HW video decoding on desktop Linux:

https://bugs.chromium.org/p/chromium/issues/detail?id=463440

Patches exist to address it, though.


So you're saying it does support it, and is often packaged that way in Linux. Remind me how it doesn't support it again?


Chromium won't take your bug reports on this feature.


google refuses to support this on desktop linux though, it requires a patched chromium build. The only reason vaapi support is there at all is because their chromeOS uses it.


I used Chromium and it is very easy to use on Arch. Not sure why you act like it isn't supported. A lot more than what is available for Firefox.


because it isn't supported, just look at the comments from google employees on the bug: https://bugs.chromium.org/p/chromium/issues/detail?id=463440...

sure the situation is better than it is with firefox, but having to use a patched chromium build isn't exactly ideal


The zealots whining and not respecting the few rules in place regarding Mozilla's Bugzilla sure have helped...


Seems to be limited to playback. Encoding is probably more critical for this.


It's weird, my Firefox seems to use the vaapi (but my iGPU is only able to hw-decode h264 and VP8 and VP9.Too old for AV1.) I have a not so powerful laptop so I think the HW decoding capability of the iGPU is actually used, otherwise I couldn't play 1080p videos at 60 FPS (h264 and VP9). I use the static Firefox from Mozilla. Not distro repo's one.


Nope. It's just software decoders from FFmpeg project that are heavily optimized. Also Firefox disables VP9 on slower machines, so websites serve H.264 instead.


At least on YouTube, I use VP9 (we can check that with the "advanced stats" showed when right-clicking on the video).

My laptop is usually noisy when the CPU is in demand. I am a bit surprised because playing HD videos on YT does not make the fan too noisy (comparing to loading a website with a ton of JS,for example).

So, I concluded that some HW decoding was in use, somehow. I can, of course, be wrong.

There is no way that ffmpeg uses a HW decoding decoder under the hood? It may explain why it's so smooth. Besides, when I run VP9 video with MPV, it tells me that it is explicitly using HW decoding via vaapi. And MPV is based on ffmpeg libs for the playback, if I am not mistaken.

Thanks for your light!


I've just checked Firefox 67.0 source code and found no evidence of hw-accelerated decoding. Firefox uses part of FFmpeg source code under the name "ffvpx", for VP9. There are some remainders of such decode-and-then-download-to-CPU-memory code there, but actual part interfacing with VA-API or any other hw-accelerated API is removed.

Although it's possible to utilize hardware decoders with FFmpeg, frames need to be shown somehow. Downloading decoded frames back to CPU memory just to copy them back to GPU to display is not a good idea. Generally graphics adapters expect a lot more data coming to them, not from them. It may be so slow, that it makes the whole idea infeasible. To make hardware decoding actually useful, one needs to figure out how to combine everything together on GPU side. It's harder to do it in Firefox than in a video player, since browsers have a complex rendering model. And now even run in multiple processes.

> My laptop is usually noisy when the CPU is in demand.

Not only software codecs are highly optimized, CPUs are also power-efficient. 1080p VP9 decode on my Skylake laptop doesn't produce enough heat to start the fan.


> It's weird, my Firefox seems to use the vaapi

Out of curiosity how do you check that? I'm asking because I'd like to check it on my end.


I am checking that with the "about:support" page. My iGPU and the Intel drivers are correctly recognized so I was assuming that HW decoding was enabled. But I can certainly be wrong, good platform detection does not necessarily mean that I use HW decoding. I just assumed it was the case.


FWIW I've never had an issue with WebEx on Linux Firefox (besides general WebEx UI/UX things).


Does it work for conferencing too? I often get "low bandwidth / low CPU" warning and no video feed, despite having quite good hardware. The more people are in the room - the worse (it's as if instead of multiplexing on the backend, it tries to multiplex on the client side). Very annoying.


For me appear.in worked perfectly in conferences and AFAIK it uses plain WebRTC.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: