Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling HW video acceleration under wayland #6

Closed
Master0ne opened this issue Nov 16, 2019 · 55 comments
Closed

Enabling HW video acceleration under wayland #6

Master0ne opened this issue Nov 16, 2019 · 55 comments

Comments

@Master0ne
Copy link

Recently I had HW video acceleration confirmed working (as per my comment here) and now it does not work anymore although I haven't changed anything.

I just upgraded to the current version 78.0.3904.97-2 from your binary repo and whatever I try chrome://media-internals/ always only says video_decoder : VpxVideoDecoder while playing a YouTube video.

I don't know what could possibly be the reason, I perform yay -Syu daily and I can't tell if this is a recent change or not because I haven't been running ungoogled-chromium for a while (I'm still in the process of deciding if I should move from Firefox to ungoogled-chromium).

I'm using GNOME on Wayland if that matters and I'm going to investigate further now.

@jstkdng Can you please check and confirm if it is working for you or not?

@Master0ne
Copy link
Author

I must have been wrong and have to assume now that HW video acceleration never worked here because of Wayland, which means it's working in a GNOME X11 Session, but not ina GNOME Wayland session. :-(

@Master0ne
Copy link
Author

I have just posted some findings of my experiments from today in the Arch Linux Forum if you may want to take a closer look.

@Master0ne
Copy link
Author

@jstkdng sorry for bothering, but maybe you could have a look here at my observations about Chromium's poor overall rendering as well.

@Master0ne
Copy link
Author

Damned, this is driving me crazy! So Chromium doesn't render poorly after all, it's GNOME on Wayland with fractional scaling since I'm using a 4k screen and scaling set to 150% which pretty much breaks rendering of apps like Chromium that are running on Xwayland in such a setup.

What I would need is an ungoogled-chromium with VAAPI and Wayland support, so an ungoogled-chromium-ozone with VAAPI patch.

Right now this is not really working for me:

  • With GNOME on Wayland and scaling set to 150% ungoogled-chromium looks terrible (as can be seen in the screenshot that I posted on Arch Linux Forum) and VAAPI doesn't work.
  • With GNOME on Xorg I could not find a proper way to make scaling fit my screen, but VAAPI works.
  • ungoogled-chromium (either on Xwayland or in an Xorg session) only looks right with a scaling of 100% (too small for 4k) or 200% (too large for 4k), but not with any fractional scaling.

No idea what to do now. :(

@jstkdng
Copy link
Owner

jstkdng commented Nov 18, 2019

Sorry for the late reply, my mail server broke with the python 3.8 update, now.
Vaapi has been broken since the beginning on wayland, can't help you on that one.
You could build chromium with ozone support, but don't count me in for that one, I'm already expending 1.5$ for each build (much cheaper than leaving my computer on for all night while compiling) and I'm not willing to expend more than the necessary.

@Master0ne
Copy link
Author

Thanks for your feedback, @jstkdng

I am now working on GNOME in Xorg session with the combined gsettings + xrandr scaling (as per HiDPI Wiki Page) and that one seems to be generally working, so I can stick with ungoogled-chromium and VAAPI support as is.

If only I had the time and knowledge to create an AUR package for Mutter with the [‘x11-randr-fractional-scaling’] patch that Ubuntu is using (I'm not done fighting with my setup yet).

@jstkdng
Copy link
Owner

jstkdng commented Nov 18, 2019

hmm, if it just one patch then it should simple to create an aur package, but taking into account that ubuntu and arch have different release schedules, it could break any time.
I'll see what I can do, no promises though, as it could break any time.
Regarding wayland, just wait until ozone is fully developed m8, also check this issue out: #724

@Master0ne
Copy link
Author

I'm not qualified to create an AUR package (yet), but there is indeed a solution coming from a Manjaro user:

mutter-x11-scaling

I have just compiled and tried it, and although I could not see any errors and the fractional scaling showed up in GNOME Settings after enabling it, it didn't work as expected (the scaling of the interface seemed to work, but not the window scaling). Either I did something wrong or something is missing. But I'm really just stumbling around here, I'm clearly lacking the knowledge for this kind of manipulation.

@jstkdng
Copy link
Owner

jstkdng commented Nov 20, 2019

you have a really weird and complex setup m8.
Only thing I could try is build this but with the ozone flags, once I finish setting up the openSUSE's OBS and see if it works.

@Master0ne
Copy link
Author

@jstkdng thanks a lot, any help from someone more seasoned than I am is highly appreciated.

I don't really think I have a weird and complicated setup. It's rather really simple:

The laptop has a 1920x1080 screen and I'm using a 4k monitor on my desk. The two screens are usually is only used alternately, so either on the move with the laptop screeen, or at my desk the 4k monitor with the laptop lid closed.

The only real issue is HiDPI scaling, because 100% is way too small and 200% way too big. With fractional scaling it gets tricky, on Wayland it generally works but not for apps like ungoogled-chromium that run on Xwayland. In Xorg it would generally work by combining scaling by gsettings and xrandr as per Arch Linux Wiki, but that setup is cumbersome to use (doesn't even survive a suspend/resume cycle without having to reapply the xrandr scaling). The mutter-x11-scaling patch may be the proper solution for fractional scaling on Xorg, but I could not get it to work properly on my setup.

OK, that sounds more complicated than it is. At least the usage case is simple to explain. All I want it so be able to use ungoogled-chromium either on Wayland or in the Xorg session with VAAPI and proper rendering with fractional scaling.

Currently there are two more things to try:

  • mutter-x11-scaling if I can find out why it wasn't working when I compiled mutter with the patch (that is obviously working just fine on Manjaro Linux and Ubuntu)

  • ungoogled-chrome-ozone if it builds and works to give it another try on Wayland (though that would mean to miss out on VAAPI video HW acceleration)

The desired solution: ungoogled-chromium-ozone with VAAPI & proper fractional scaling on Wayland

;-)

@jstkdng
Copy link
Owner

jstkdng commented Nov 20, 2019

I'll compile ozone with vaapi and no vaapi support. Up to you to test it though, since I don't use wayland. Once it's done I'll let you know. You can check out the build here: https://build.opensuse.org/package/show/home:justkidding/ungoogled-chromium
I'll add ozone later.

@jstkdng
Copy link
Owner

jstkdng commented Nov 20, 2019

update comment, tried compiling with vaapi but it fails with a linking error:
https://build.opensuse.org/package/show/home:justkidding/ungoogled-chromium-ozone
it seems vaapi wont be possible with ozone afaik

@jstkdng
Copy link
Owner

jstkdng commented Nov 21, 2019

Update comment 2:
Managed to compile it. Please test and open a new issue if anything arises. package

@jstkdng jstkdng closed this as completed Nov 21, 2019
@Master0ne
Copy link
Author

I have just taken a look at your repo at openSUSE (Looks interesting, is that easy to use? Do use it just for building or for version control as well, so as a replacement for your GitHub repo?), I'll give it a try when I get home.

Something that I was wondering about:

The PKGBUILD shows libva-intel-driver (= i965) as optdepends, but it should actually either be intel-media-driver (= iHD) or both, because libva-intel-driver the one pretty much abandoned by Intel and it's broken on Xwayland. I guess it doesn't matter concerning that PKGBUILD, I have installed both anyway, but this may be relevant for the ungoogled-chromium-ozone build.

Your ungoogled-chromium-ozone openSUSE repo says "succeeded" but no package was made ?

Clicking on Download package gives "No data", but clicking on Arch in Repositories shows ungoogled-chromium-78.0.3904.108-1-x86_64.pkg.tar.xz.

@jstkdng
Copy link
Owner

jstkdng commented Nov 21, 2019

The obs is like a build server, and it was somewhat complex as I had to learn how it works and stuff.
I wont use it as a replacement for my repo as I dont have control over the gpg keys. Just for downloading stuff.
Also, you need a recent intel cpu for intel-media-driver to work. But I guess it wont hurt to add it.

@Master0ne
Copy link
Author

Master0ne commented Nov 21, 2019

Well, on the build from your openSUSE repo (v78.0.3904.108) VAAPI still doesn't work. I have tested the following scenarios:

Chromium on GNOME in Xorg Session with intel-media-driver (= iHD) = no HW video acceleration and the following output:

$ LIBVA_DRIVER_NAME=iHD chromium
[16184:16184:1121/183624.933383:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[16184:16184:1121/183625.144425:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
Fontconfig error: Cannot load default config file

$ LIBVA_DRIVER_NAME=iHD chromium --use-gl=egl
[17368:17368:1121/184520.686933:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[17368:17368:1121/184522.292843:ERROR:texture_manager.cc(3652)] [.DisplayCompositor]GL ERROR :GL_INVALID_ENUM : glTexImage2D: <- error from previous GL command
Fontconfig error: Cannot load default config file

Chromium on GNOME in Xorg Session with libva-intel-driver (= i965) = no HW video acceleration and the following output:

$ LIBVA_DRIVER_NAME=i965 chromium
[16701:16701:1121/184333.893151:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[16701:16701:1121/184334.093480:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
Fontconfig error: Cannot load default config file

$ LIBVA_DRIVER_NAME=i965 chromium --use-gl=egl
[17721:17721:1121/184546.330397:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[17721:17721:1121/184547.877988:ERROR:texture_manager.cc(3652)] [.DisplayCompositor]GL ERROR :GL_INVALID_ENUM : glTexImage2D: <- error from previous GL command
Fontconfig error: Cannot load default config file

BTW Any idea what's with that Fontconfig error?

@jstkdng
Copy link
Owner

jstkdng commented Nov 21, 2019

have you tested on chrome://media-internals that there is no hw accel?
also, test on wayland now, that was the whole purpose of this build lol

@Master0ne
Copy link
Author

I'm using intel_gpu_top to confirm if HW video acceleration is used, that way I don't have to guess which video decoder is using it. With intel_gpu_top there is no guessing involved.

Chromium in GNOME on Wayland with intel-media-driver (= iHD) = no HW video acceleration and the following output:

$ LIBVA_DRIVER_NAME=iHD chromium
[20063:20063:1121/185147.015254:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[20063:20063:1121/185147.222188:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
[20063:20063:1121/185148.200679:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 1 times!
[20063:20063:1121/185148.206915:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 2 times!
[20063:20063:1121/185148.226190:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 3 times!
[20063:20063:1121/185148.234663:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 4 times!
[20063:20063:1121/185148.241447:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 5 times!
[20063:20063:1121/185148.257098:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 6 times!
[20063:20063:1121/185148.267747:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 7 times!
[20063:20063:1121/185148.273581:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 8 times!
[20063:20063:1121/185148.283998:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 9 times!
[20063:20063:1121/185148.291466:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 10 times!
[20063:20063:1121/185148.300575:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 11 times!
[20063:20063:1121/185148.307106:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 12 times!
[20063:20063:1121/185148.317573:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 13 times!
[20063:20063:1121/185148.325103:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 14 times!
[20063:20063:1121/185148.340169:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 15 times!
[20063:20063:1121/185148.351176:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 16 times!
[20063:20063:1121/185148.357949:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 17 times!
[20063:20063:1121/185148.367310:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 18 times!
[20063:20063:1121/185148.376396:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 19 times!
Fontconfig error: Cannot load default config file
[20063:20063:1121/185151.101248:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 256 times!
[20063:20063:1121/185153.768188:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 512 times!
[20063:20063:1121/185157.051825:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 768 times!
[20063:20063:1121/185200.635958:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 1024 times!

$ LIBVA_DRIVER_NAME=iHD chromium --use-gl=egl
[21729:21729:1121/185919.532294:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[21729:21729:1121/185921.270957:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 1 times!
Fontconfig error: Cannot load default config file
[21729:21729:1121/185925.335041:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 2 times!
[21729:21729:1121/185925.605636:ERROR:texture_manager.cc(3652)] [.DisplayCompositor]GL ERROR :GL_INVALID_ENUM : glTexImage2D: <- error from previous GL command
[21729:21729:1121/185943.056648:ERROR:sync_control_vsync_provider.cc(140)] Calculated bogus refresh interval=0.253128 s, last_timebase_=17513476730 bogo-microseconds, timebase=17513729858 bogo-microseconds, last_media_stream_counter_=984, media_stream_counter=985
[21729:21729:1121/185943.309957:ERROR:sync_control_vsync_provider.cc(140)] Calculated bogus refresh interval=0.262291 s, last_timebase_=17513729858 bogo-microseconds, timebase=17513992149 bogo-microseconds, last_media_stream_counter_=985, media_stream_counter=986
[21729:21729:1121/185944.404975:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 3 times!
[21729:21729:1121/185946.953259:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 4 times!

Chromium in GNOME on Wayland with libva-intel-driver (= i965) = no HW video acceleration and the following output:

$ LIBVA_DRIVER_NAME=i965 chromium
libva error: /usr/lib/dri/i965_drv_video.so init failed
[22112:22112:1121/190059.684603:ERROR:vaapi_wrapper.cc(399)] vaInitialize failed: unknown libva error
[22112:22112:1121/190059.729642:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[22112:22112:1121/190059.933787:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
[22112:22112:1121/190100.895327:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 1 times!
[22112:22112:1121/190100.896327:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 2 times!
[22112:22112:1121/190100.913005:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 3 times!
[22112:22112:1121/190100.930080:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 4 times!
[22112:22112:1121/190100.947427:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 5 times!
[22112:22112:1121/190100.963216:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 6 times!
[22112:22112:1121/190100.979785:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 7 times!
[22112:22112:1121/190100.998182:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 8 times!
[22112:22112:1121/190101.012522:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 9 times!
[22112:22112:1121/190101.014186:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 10 times!
[22112:22112:1121/190101.040255:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 11 times!
[22112:22112:1121/190101.046957:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 12 times!
[22112:22112:1121/190101.066060:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 13 times!
[22112:22112:1121/190101.079122:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 14 times!
[22112:22112:1121/190101.081573:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 15 times!
[22112:22112:1121/190101.099301:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 16 times!
[22112:22112:1121/190101.113373:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 17 times!
[22112:22112:1121/190101.114658:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 18 times!
[22112:22112:1121/190101.128530:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 19 times!
Fontconfig error: Cannot load default config file
[22112:22112:1121/190103.682097:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 256 times!
[22112:22112:1121/190106.315182:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 512 times!
[22112:22112:1121/190108.738537:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 768 times!
[22112:22112:1121/190111.145734:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 1024 times!

$ LIBVA_DRIVER_NAME=i965 chromium --use-gl=egl
libva error: /usr/lib/dri/i965_drv_video.so init failed
[22472:22472:1121/190144.634117:ERROR:vaapi_wrapper.cc(399)] vaInitialize failed: unknown libva error
[22472:22472:1121/190144.660503:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[22472:22472:1121/190145.733603:ERROR:texture_manager.cc(3652)] [.DisplayCompositor]GL ERROR :GL_INVALID_ENUM : glTexImage2D: <- error from previous GL command
Fontconfig error: Cannot load default config file
[22472:22472:1121/190201.644747:ERROR:gl_surface_presentation_helper.cc(259)] GetVSyncParametersIfAvailable() failed for 1 times!

The tests were done with the COSTA RICA IN 4K 60fps HDR (ULTRA HD) on YouTube, media-internals showed video_code_name : av1 and vide_decoder : Dav1dVideoDecoder.

For another video it was showing video_code_name : vp9 and vide_decoder : VpxVideoDecoder.

@Master0ne
Copy link
Author

Master0ne commented Nov 21, 2019

Damned, another line of tests with the following results:

Chromium on GNOME in Xorg Session with intel-media-driver (= iHD) = HW video acceleration working on video with video_codec_name : vp9 and video_decoder : MojoVideoDecoder and the following output:

$ LIBVA_DRIVER_NAME=iHD chromium
[24784:24784:1121/190956.896425:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[24784:24784:1121/190957.141698:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
Fontconfig error: Cannot load default config file

$ LIBVA_DRIVER_NAME=iHD chromium --use-gl=egl
[25642:25642:1121/191455.536272:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
Fontconfig error: Cannot load default config file
[25642:25642:1121/191458.660048:ERROR:texture_manager.cc(3652)] [.DisplayCompositor]GL ERROR :GL_INVALID_ENUM : glTexImage2D: <- error from previous GL command

Chromium on GNOME in Xorg Session with libva-intel-driver (= i965) = HW video acceleration working on video with video_codec_name : vp9 and video_decoder : MojoVideoDecoder and the following output:

$ LIBVA_DRIVER_NAME=i965 chromium
[26028:26028:1121/191557.583792:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[26028:26028:1121/191557.856415:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
Fontconfig error: Cannot load default config file

$ LIBVA_DRIVER_NAME=i965 chromium --use-gl=egl
[26497:26497:1121/192018.199733:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
Fontconfig error: Cannot load default config file
[26497:26497:1121/192021.874460:ERROR:texture_manager.cc(3652)] [.DisplayCompositor]GL ERROR :GL_INVALID_ENUM : glTexImage2D: <- error from previous GL command
[26497:26497:1121/192042.100723:ERROR:gles2_cmd_decoder.cc(18470)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glCreateAndConsumeTextureCHROMIUM: invalid mailbox name
[26497:26497:1121/192042.100800:ERROR:gles2_cmd_decoder.cc(10752)] [.DisplayCompositor]RENDER WARNING: texture bound to texture unit 0 is not renderable. It might be non-power-of-2 or have incompatible texture filtering (maybe)?

BTW Video doesn't run currently with --use-gl=egl (looks like frame-drops and stuttering).

@jstkdng
Copy link
Owner

jstkdng commented Nov 21, 2019

ok, dav1d has no hwaccel, so now wonder it doesnt show up on intel_gpu_top.
Good to know vaapi is working with ozone under x11.
Now, final test , run chromium with --ozone-platform=wayland and test vaapi

@Master0ne
Copy link
Author

Master0ne commented Nov 21, 2019

All these tests have been done with your ungoogled-chromium build. That one isn't compiled with the ozone flag. :-?

You didn't comment on my previous statement:

Your ungoogled-chromium-ozone openSUSE repo says "succeeded" but no package was made ?

Clicking on Download package gives "No data", but clicking on Arch in Repositories shows ungoogled-chromium-78.0.3904.108-1-x86_64.pkg.tar.xz.

I have just taken another look, and your ungoogled-chromium-ozone openSUSE repo is now showing the package ungoogled-chromium-ozone-78.0.3904.108-1-x86_64.pkg.tar.xz.

I have to abort now, I'm going to test that one tomorrow.

BTW I have updated the previous comments a few times because I was writing here from the same Chromium instance that I always killed from the console between each test. ;-)

@jstkdng
Copy link
Owner

jstkdng commented Nov 21, 2019

All these tests have been done with your ungoogled-chromium build. That one isn't compiled with the ozone flag. :-?

yes, it has ozone support, but I think it uses another platform by default, so maybe all your wayland tests were actually using the x11 platform, and not the wayland platform.

You didn't comment on my previous statement:

image

weird, I don't have that message. Probably just a temporary thing.

I have just taken another look, and your ungoogled-chromium-ozone openSUSE repo is now showing the package

That one is the same, just with another name and the optional dependencies changed

@jstkdng jstkdng reopened this Nov 21, 2019
@Master0ne
Copy link
Author

@jstkdng I just checked again, your openSUSE repo for ungoogled-chromium doesn't have the following additional flags in flags.archlinux.gn, but for ungoogled-chromium-ozone it does:

use_ozone=true
ozone_platform_wayland=true
ozone_platform_x11=true
ozone_auto_platforms=false
use_xkbcommon=true
use_system_libwayland=true
use_system_minigbm=true
use_system_libdrm=true

Since I have used your ungoogled-chromium it was without doubt always running on x11 in my previous tests.

Next I will download your ungoogled-chromium-ozone, run the tests again and report back.

@Master0ne
Copy link
Author

Master0ne commented Nov 22, 2019

Unfortunately my tests of your ungoogled-chromium-ozone showed, that VAAPI is not working on Wayland.

GNOME on Wayland - YouTube video vp9 -> VpxVideoDecoder

$ LIBVA_DRIVER_NAME=iHD chromium --ozone-platform=wayland
[28484:28484:1122/130400.000133:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[28484:28484:1122/130406.426430:ERROR:gbm_pixmap_wayland.cc(77)] Cannot create bo with format= YUV_420_BIPLANAR and usage SCANOUT_VDA_WRITE
[28484:28484:1122/130406.426471:ERROR:vaapi_picture_native_pixmap_ozone.cc(104)] Failed allocating a pixmap
[28682:19:1122/130406.426751:ERROR:batching_media_log.cc(26)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"VDA Error 4"}

$ LIBVA_DRIVER_NAME=iHD chromium --ozone-platform=wayland --use-gl=egl
[28850:28850:1122/130504.058050:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[28850:28850:1122/130506.933432:ERROR:gbm_pixmap_wayland.cc(77)] Cannot create bo with format= YUV_420_BIPLANAR and usage SCANOUT_VDA_WRITE
[28850:28850:1122/130506.933478:ERROR:vaapi_picture_native_pixmap_ozone.cc(104)] Failed allocating a pixmap
[28927:19:1122/130506.933817:ERROR:batching_media_log.cc(26)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"VDA Error 4"}

$ LIBVA_DRIVER_NAME=i965 chromium --ozone-platform=wayland
[29195:29195:1122/130605.931632:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[29195:29195:1122/130608.775419:ERROR:gbm_pixmap_wayland.cc(77)] Cannot create bo with format= YUV_420_BIPLANAR and usage SCANOUT_VDA_WRITE
[29195:29195:1122/130608.775488:ERROR:vaapi_picture_native_pixmap_ozone.cc(104)] Failed allocating a pixmap
[29273:19:1122/130608.775759:ERROR:batching_media_log.cc(26)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"VDA Error 4"}

]$ LIBVA_DRIVER_NAME=i965 chromium --ozone-platform=wayland --use-gl=egl
[29569:29569:1122/130654.835191:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[29569:29569:1122/130657.819230:ERROR:gbm_pixmap_wayland.cc(77)] Cannot create bo with format= YUV_420_BIPLANAR and usage SCANOUT_VDA_WRITE
[29569:29569:1122/130657.819319:ERROR:vaapi_picture_native_pixmap_ozone.cc(104)] Failed allocating a pixmap
[29647:19:1122/130657.819746:ERROR:batching_media_log.cc(26)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"VDA Error 4"}

The option --ozone-platform=wayland was not necessary btw, Chromium detected Wayland automatically. And man, what a difference it makes with PROPER rendering on Wayland with the same sharpness like Firefox with the Wayland option!

This also confirms that your ungoogled-chromium indeed was built without the flags from my previous comment. When I open your ungoogled-chromium on Wayland, it clearly is running on Xwayland with the nasty scaling that results in that poor rendering of everything (not only fonts, but pictures and interface as well, looks washed-out and fuzzy), however ungoogled-chromium-ozone looks superb!

So, is there anything more that we can try about VAAPI on Wayland?
Maybe file a bug upstream?

Can you please add your ungoogled-chromium-ozone build to the AUR?

If sticking to GNOME on Wayland, I don't want to miss ungoogled-chromium-ozone no more despite VAAPI not working (yet, hopefully a solution can be found), but the end goal clearly is ungoogled-chromium with HW video acceleration on Wayland.

@jstkdng
Copy link
Owner

jstkdng commented Nov 22, 2019

What we are trying to achieve could be considered an unsupported use case, but it wouldnt hurt to report it.
To submit an issue to the chromium upstream you need a google account to that is a no-no for me. Maybe submit it to the intel vaapi repo here in github as that is where the vaapi patches originally came from. There is a fedora guy called arkansha biswas, probably butchered his name, he could help you out, maybe with another patch.
Regarding the aur, I dont see why not, not right now ofc as I'm fairly busy for some days.

@Master0ne
Copy link
Author

Found Akarshan Biswas on a Fedora mailing list, but no idea how to get in touch with him (email address isn't revealed of course, and I didn't want to sign up there).

Google no-no for me as well.

Getting in touch with the Intel driver team likely is a dead end as well if the problem is to be found upstream at Chromium.

But I can't be the only one intending to use (ungoogled)-Chrom(ium) with HW video acceleration on Wayland, can I?

I'm currently torn between GNOME on Wayland and in a Xorg Session, both have their ups and downs, but currently working in a Wayland session I think I'll go back to the Xorg Session, not only because of the missing VAAPI support, but because on Wayland there are really annoying clipboard issues (no idea if that is a GNOME or Wayland problem) that make work extremely cumbersome. On the other hand it's mainly the problems with fractional scaling in the Xorg session that make we want to go back to Wayland... Argh!

@jstkdng
Copy link
Owner

jstkdng commented Nov 22, 2019

Found the guy on github. He is interested as well to have hw accel on chromium, probably under wayland too, not sure about the ungoogled part though, send him an email. @akarshanbiswas
Another thing, I'm using another vaapi patch which came from the arch forums. Not akarshanbiswas' one, maybe that could make a difference on wayland. What do you say, are you up for more testing? You should send him an email first though.
Edit: found this on the arch forums. https://bbs.archlinux.org/viewtopic.php?pid=1868252#p1868252
this guy claims to have hw accel working under wayland, but that was with the previous patch.

@Master0ne
Copy link
Author

Master0ne commented Nov 22, 2019

Email to @akarshanbiswas sent. And yes, I'm in for more testing. ;-)

found this on the arch forums. https://bbs.archlinux.org/viewtopic.php?pid=1868252#p1868252
this guy claims to have hw accel working under wayland, but that was with the previous patch.

Unfortunately that's old new, I was able to replicate that (and which is why I have also tested with the --use-gl=egl flag in my previous tests) but it's not working anymore as seen from the test above. I've posted those findings in the same thread on the Arch Linux forum here.

But --use-gl=egl wasn't an option for me, because with that flag videos didn't run smoothly here on my laptop with Intel UHD620.

@qnixsynapse
Copy link

qnixsynapse commented Nov 22, 2019

@Master0ne Hello. I got your mail. What issues you're having?

@jstkdng I just checked again, your openSUSE repo for ungoogled-chromium doesn't have the following additional flags in flags.archlinux.gn, but for ungoogled-chromium-ozone it does:

use_ozone=true
ozone_platform_wayland=true
ozone_platform_x11=true
ozone_auto_platforms=false
use_xkbcommon=true
use_system_libwayland=true
use_system_minigbm=true
use_system_libdrm=true

Since I have used your ungoogled-chromium it was without doubt always running on x11 in my previous tests.

Next I will download your ungoogled-chromium-ozone, run the tests again and report back.

It will not work. Have you issued the use_vaapi=true flag?

@jstkdng
Copy link
Owner

jstkdng commented Nov 22, 2019

@akarshanbiswas
well, that was quick. Yes, the use_vaapi flag is enabled, I had to add another patch for it to compile.

--- a/media/gpu/vaapi/BUILD.gn
+++ b/media/gpu/vaapi/BUILD.gn
@@ -128,12 +128,12 @@ source_set("vaapi") {
     ]
   }
 
-  if (ozone_platform_gbm || use_egl) {
+  if (ozone_platform_wayland || ozone_platform_gbm || use_egl) {
     sources += [
       "vaapi_picture_native_pixmap.cc",
       "vaapi_picture_native_pixmap.h",
     ]
-    if (ozone_platform_gbm) {
+    if (ozone_platform_wayland || ozone_platform_gbm) {
       sources += [
         "vaapi_picture_native_pixmap_ozone.cc",
         "vaapi_picture_native_pixmap_ozone.h",

here are all the flags used for compiling:

blink_symbol_level=0
custom_toolchain="//build/toolchain/linux/unbundle:default"
enable_ac3_eac3_audio_demuxing=true
enable_iterator_debugging=false
fatal_linker_warnings=false
ffmpeg_branding="Chrome"
gold_path=""
goma_dir=""
is_official_build=true
host_toolchain="//build/toolchain/linux/unbundle:default"
is_clang=true
jumbo_file_merge_limit=8
link_pulseaudio=true
linux_use_bundled_binutils=false
proprietary_codecs=true
symbol_level=0
use_cups=true
use_custom_libcxx=false
use_gio=true
use_gnome_keyring=false
use_jumbo_build=true
use_kerberos=false
use_libjpeg_turbo=true
use_lld=true
use_openh264=false
use_pulseaudio=true
use_sysroot=false
use_system_freetype=true
use_system_harfbuzz=true
use_system_lcms2=true
use_system_libjpeg=true
use_system_libopenjpeg2=true
use_system_zlib=true
use_vaapi=true
enable_swiftshader=false
use_ozone=true
ozone_platform_wayland=true
ozone_platform_x11=true
ozone_auto_platforms=false
use_xkbcommon=true
use_system_libwayland=true
use_system_minigbm=true
use_system_libdrm=true

@qnixsynapse
Copy link

qnixsynapse commented Nov 22, 2019

@jstkdng Join #ozone-wayland on freenode. Maybe we can request to mssisov to add support for vaapi ozone which is either currently not implemented or is broken somewhere.

Also see link

@Master0ne
Copy link
Author

@akarshanbiswas as seen from the test above, I can't get HW video acceleration to work on Wayland.

The used VAAPI patch is working with both iHD and i965 drivers on GNOME in a Xorg Session but not on Wayland.

The Arch Linux Wiki says:

Warning: Wayland support is not enabled in above packages yet. XWayland is broken on libva-intel-driver.

So we tried with the VAAPI patch added to ungoogled-chromium-ozone but it's now working either.

What everybody is trying and finding is pretty scattered right now. Something I have commented on the ungoogled-chromium-archlinux repo:

I received the following feedback from @hedgepigdaniel concerning chromium-ozone and VAAPI support in the AUR comments:

The VAAPI patches for the X11 builds are not compatible because Ozone uses a significantly different codepath for video decoding generally.

I don't believe the Igalia team working on this have made desktop VAAPI a priority, although it seems they have video acceleration via v4l2 working for embedded devices: https://github.com/OSSystems/meta-browser/tree/master/recipes-browser/chromium

I've personally tried to make it work. A minor fox is required to make it build with the use_vaapi flag, but then I couldn't find a combination of minigbm, libdrm etc that made the video acceleration actually happen.

EDIT: Well, a lot is happening here while I'm writing ;-)

@akarshanbiswas so you have not seen a working solution for Chromium on Wayland either? On my search for more info I have seen a blog posting concerning chromium-ozone on Fedora (can't find the link right now), which also confirmed the problem but didn't mention a solution.

@jstkdng
Copy link
Owner

jstkdng commented Nov 22, 2019

huh, interesting link, at least we aren't getting segfaults right now, and it seems the chromium devs aren't interested on fixing it.
On my way to freenode now.

@qnixsynapse
Copy link

On my search for more info I have seen a blog posting concerning chromium-ozone on Fedora

@Master0ne Where?

It's not ported yet. They are adding xdg-shell support and gtk file dialogs atm. Still I have asked Maxim. Let's see what he responds. I will try my best to make sure this remains the priority.
For now you need to ask intel vaapi driver devs to add support for dri3. They had a PR but it is closed due to inactivity unfortunately.

@Master0ne
Copy link
Author

Indeed, something must have changed since then that it doesn't segfault anymore. So known issue, but Chromium team not interested in fixing it because it's unsupported.

@akarshanbiswas just found it again, wasn't in a blog but on Fedora Magazine and the other way around:

Chromium on Fedora finally gets VAAPI support!

It was in the comments below the article where it was mentioned that it doesn't work on Wayland.

@qnixsynapse
Copy link

It was in the comments below the article where it was mentioned that it doesn't work on Wayland.

@Master0ne Indeed. I haven't checked the comments in a while. Also they are closed.

ChromeOs needs vaapi on Ozone. So they have this on their priority list if I'm not wrong.

Btw @jstkdng 私の名前はアカルシャンです。これからは私の名前を覚えてください。(笑) :P

@Master0ne
Copy link
Author

@akarshanbiswas said:
私の名前はアカルシャンです。これからは私の名前を覚えてください。(笑) :P

このようなメッセージの読み取り/書き込みを可能にするために、Googleサービスを使用する数少ないものの1つです。 ;-)

@qnixsynapse
Copy link

qnixsynapse commented Nov 22, 2019

@Master0ne Googleさんは彼の仕事に上手ではありません。 :P :P

@jstkdng
Copy link
Owner

jstkdng commented Nov 22, 2019

@akarshanbiswas
了解しました

Still I have asked Maxim. Let's see what he responds.

If you have asked him already then there is no point in me asking him. Hope he responds.
Edit: why intel-vaapi and not intel-media-driver? seems like intel-media-driver is intel's focus now.

@Master0ne
Copy link
Author

I'm clearly the wrong person and should not open issues that require technical knowledge... ;-)

@qnixsynapse
Copy link

qnixsynapse commented Nov 22, 2019

@akarshanbiswas

If you have asked him already then there is no point in me asking him. Hope he responds.
I'm planing on opening a new bug. It depends on what he responds.

See: intel/intel-vaapi-driver#369

Thing is I use amd GPUs across all my devices so I don't actually follow Intel media driver development.

@Master0ne
Copy link
Author

@akarshanbiswas said:
Googleさんは彼の仕事に上手ではありません。 :P :P

笑、私は常に逆翻訳とクロスチェックしますが、実際には良く見えません! :P

@qnixsynapse
Copy link

笑、私は常に逆翻訳とクロスチェックしますが、実際には良く見えません! :P

あああ、そうか? 皆さんは日本人だと思った。

@Master0ne
Copy link
Author

@akarshanbiswas said:
Thing is I use amd GPUs across all my devices so I don't actually follow Intel media driver development.

It was mentioned somewhere (but don't ask for for a reference, I have read a lot about all that stuff lately and can't recall where) that Intel has abandoned intel-vaapi-driver to the community and is concentrating development on intel-media-driver only.

If still maintained and necessary for other hardware, of course a solution for both drivers is desirable. I have both drivers installed on my laptop with Intel HD620 graphics, and both are working, but if not specifying LIBVA_DRIVER_NAME the intel-vaapi-driver is used by default.

@jstkdng
Copy link
Owner

jstkdng commented Nov 22, 2019

Now we just have to play the wait game. Thanks for helping @akarshanbiswas
感謝します

@jstkdng jstkdng changed the title HW Video Acceleration not working anymore? Enabling HW video acceleration under wayland Nov 22, 2019
@Master0ne
Copy link
Author

Master0ne commented Nov 23, 2019

@jstkdng unrelated to the VAAPI problem, I'm still running your ungoogled-chromium-ozone 78.0.3904.108-1 build and just discovered the the thumb mouse buttons for forward/back (5-buttons-mouse) are not working, neither is password import. Is it possible that something is missing in that build? Both functions are working in your ungoogled-chromium 78.0.3904.108-1.

@jstkdng
Copy link
Owner

jstkdng commented Nov 23, 2019

then that is probably just an ozone issue. Nothing I can do about it.

@Master0ne
Copy link
Author

Thought so. OK then, I'll go back to GNOME in Xorg Session now as I need to get some work done. ;)

Hopefully all these issues get solved for the ozone build at some point, it really depend on the progress made with Wayland for making it fit for daily use.

@jstkdng
Copy link
Owner

jstkdng commented Dec 3, 2019

hmmm, nice.
Hopefully that issue doesn't get stuck. Thanks for the link, too bad I don't have a google account to follow the bugtracker.

@Master0ne
Copy link
Author

That bug doesn't tell me anything, but for me it's a none-issue right now. I think I will try to move over to KDE Plasma next and maybe bspwm as an alternative session.

@jstkdng, clearly OT, but what DE/WM are you using ungoogled-chromium in?

@jstkdng
Copy link
Owner

jstkdng commented Dec 4, 2019

@Master0ne
I'm using herbstluftwm, so far the best wm I've used, and that issue is related to hardware accel.

@jstkdng
Copy link
Owner

jstkdng commented Dec 13, 2019

@Master0ne
I'm building the new chromium version 79.0.3945.79, do you mind testing again once it finishes? https://build.opensuse.org/package/show/home:justkidding/ungoogled-chromium-ozone

@Master0ne
Copy link
Author

I'm not using GNOME on Wayland anymore and I'm currently considering the move to FreeBSD, so maybe someone else want to give it a try?

@jstkdng
Copy link
Owner

jstkdng commented Dec 15, 2019

welp, guess we are done here for the moment, unless someone is willing to test, then no point on keeping this open.

@jstkdng jstkdng closed this as completed Dec 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants