Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 928630 - chrome/chromium va-api support failing
Summary: chrome/chromium va-api support failing
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Chromium Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-05 09:22 UTC by Ferry
Modified: 2024-08-14 08:08 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
dmidecode (dmidecode,28.15 KB, text/plain)
2024-04-05 09:25 UTC, Ferry
Details
lspci (lspci,2.19 KB, text/plain)
2024-04-05 09:26 UTC, Ferry
Details
vainfo (vainfo,3.52 KB, text/plain)
2024-04-05 09:26 UTC, Ferry
Details
chrome-gpu-status (Screenshot_20240405_112649.png,51.43 KB, image/png)
2024-04-05 09:28 UTC, Ferry
Details
chrome-gpu-codecs (Screenshot_20240405_112741.png,7.34 KB, image/png)
2024-04-05 09:28 UTC, Ferry
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ferry 2024-04-05 09:22:09 UTC
Hi,

I'm running KDE plasma (5) under wayland. There should be support for VA-API under wayland in chrome/chromium for a while now. This would allow me to playback HEVC as due to patent issues it's not done in software, but if the hardware supports it that should be used.

Whilst chrome://gpu shows that hardware decoding is enabled, the table that should list the codecs is empty. Can't playback HEVC either, just get audio with a black screen.

I'm using a XPS 15 9510 laptop which has an Intel GPU (in the CPU) with a nVidia card. It's fine if it just uses the Intel one.

With or without nvidia-drivers installed doesn't make a difference though.

Have posted in the forums, but no responses whatsoever and at a loss with regards to where to look next.

https://forums.gentoo.org/viewtopic-t-1167821-highlight-.html

Reproducible: Always
Comment 1 Ferry 2024-04-05 09:25:50 UTC
Created attachment 889509 [details]
dmidecode
Comment 2 Ferry 2024-04-05 09:26:01 UTC
Created attachment 889510 [details]
lspci
Comment 3 Ferry 2024-04-05 09:26:13 UTC
Created attachment 889511 [details]
vainfo
Comment 4 Ferry 2024-04-05 09:28:16 UTC
Created attachment 889512 [details]
chrome-gpu-status
Comment 5 Ferry 2024-04-05 09:28:40 UTC
Created attachment 889513 [details]
chrome-gpu-codecs
Comment 6 Matt Jolly gentoo-dev 2024-04-09 13:24:19 UTC
> I'm using a XPS 15 9510 laptop which has an Intel GPU
> (in the CPU) with a nVidia card. It's fine if it just uses the Intel one.

So VA-API works on wayland on your Intel?

If so that's not too surprising - VA-API is intel's open standard for this sort of thing.

I'm not actually sure if we expect this to work on nvidia (proprietary drivers), at least not out of the box - nvidia uses NVENC/NVDEC instead and I don't believe that they have VA-API support.
Comment 7 Ferry 2024-04-09 13:44:27 UTC
Hi,

yes va-api seems to work. The nVidia card is just supposed to offload heavy 3D to if I'm not mistaken.

Not sure how to troubleshoot this though.

Chrome should just use the Intel card. Have tried installing media-libs/nvidia-vaapi-driver, but that doesn't make a difference.

chromium didn't list any codecs either and seems firefox doesn't use hardware playback either.

No clue where it's breaking, vainfo seems fine.

There was a point, quite some time ago, it listed codecs just fine. HEVC playback was broken though (lots of green stuff and artifacts), AVC was fine. This is over a year ago though. It has been like this for quite some time now, but should be officially working now.

Might try if it works under Ubuntu live 24.04 or something.
Comment 8 Ionen Wolkens gentoo-dev 2024-04-09 14:19:57 UTC
nvidia-vaapi-driver only works with specific configurations[1] and is a bit of hack that acts as wrapper to nvdec (it's also not supported by nvidia itself) - consider yourself lucky if can get that to work at all

in general vaapi is not supported with nvidia, need to use vdpau or nvdec instead but this is typically not supported by web browsers (some media players can use them, e.g. mpv -hwdec=nvdec).

[1] https://github.com/elFarto/nvidia-vaapi-driver/blob/master/README.md
tl;dr it says that chrome is not supported, this is primarily for use with firefox
Comment 9 Ferry 2024-04-23 08:10:03 UTC
It doesn't work without nVidia drivers either. It supposed to just use the intel drivers. That's also what's in the vainfo output.
Comment 10 Matt Jolly gentoo-dev 2024-08-12 03:43:57 UTC
I don't have any vaapi-supporting hardware to play with, so I can't reproduce this issue.

I do see this in my Chromium output:

```
[2512238:2512238:0812/133057.627703:WARNING:vaapi_wrapper.cc(1523)] : Skipping nVidia device named: nvidia-drm
```

Which supports vaapi explicitly not working with nvidia.

If I look at chrome://media-internals/ while browsing a few streams I see ffmpeg in use on nvidia which I suppose is normal.

Here's my output for a definite h264 test video[1]:

```
00:00:03.358	info	"FFmpegDemuxer: created video stream, config codec: h264, profile: h264 high 4:2:2, level: not available, alpha_mode: is_opaque, coded size: [1920,1080], visible rect: [0,0,1920,1080], natural size: [1920,1080], has extra data: true, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}"
00:00:03.358	duration	10
00:00:03.358	kAudioTracks	[]
00:00:03.358	kVideoTracks	[{"alpha mode":"is_opaque","codec":"h264","coded size":"1920x1080","color space":{"matrix":"BT709","primaries":"BT709","range":"LIMITED","transfer":"BT709"},"encryption scheme":"Unencrypted","has extra data":true,"hdr metadata":"unset","natural size":"1920x1080","orientation":"0°","profile":"h264 high 4:2:2","visible rect":"0,0 1920x1080"}]
00:00:03.358	kMaxDuration	10
00:00:03.358	kStartTime	0.033008
00:00:03.358	kBitrate	15156684
00:00:03.358	info	"Cannot select DecryptingVideoDecoder for video decoding"
00:00:03.358	info	"Cannot select VaapiVideoDecoder for video decoding"
00:00:03.358	info	"Cannot select VpxVideoDecoder for video decoding"
00:00:03.358	info	"Cannot select Dav1dVideoDecoder for video decoding"
00:00:03.360	kIsVideoDecryptingDemuxerStream	false
00:00:03.360	kVideoDecoderName	"FFmpegVideoDecoder"
```

What do you currently see Ferry?

1: https://telecommunication-telemedia-assessment.github.io/AVT-VQDB-UHD-1/test_1.html
Comment 11 Ferry 2024-08-12 07:06:49 UTC
Hi,

what parameters are you using to get that output?

You might be able to use media-libs/nvidia-vaapi-driver to get va-api support.

Doesn't seem to output much by default.

 ~ $ google-chrome-unstable 
Created TensorFlow Lite XNNPACK delegate for CPU.
[10337:10337:0812/090318.297232:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
Attempting to use a delegate that only supports static-sized tensors with a graph that has dynamic-sized tensors (tensor#141 is a dynamic-sized tensor).
[10337:10337:0812/090324.184730:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[10337:10337:0812/090325.444923:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!




chrome://media-internals log

[
  {
    "properties": {
      "render_id": 20,
      "player_id": 0,
      "created": "2024-08-12 07:03:25.985115 UTC",
      "origin_url": "https://avtshare01.rz.tu-ilmenau.de/",
      "kFrameUrl": "https://avtshare01.rz.tu-ilmenau.de/avt-vqdb-uhd-1/test_1/segments/bigbuck_bunny_8bit_15000kbps_1080p_60.0fps_h264.mp4",
      "kFrameTitle": "",
      "url": "https://avtshare01.rz.tu-ilmenau.de/avt-vqdb-uhd-1/test_1/segments/bigbuck_bunny_8bit_15000kbps_1080p_60.0fps_h264.mp4",
      "kTotalBytes": "0x1211740",
      "kIsStreaming": false,
      "kIsSingleOrigin": true,
      "kIsRangeHeaderSupported": true,
      "kRendererName": "RendererImpl",
      "pipeline_state": "kPlaying",
      "info": "Effective playback rate changed from 0 to 1",
      "kAudioTracks": [],
      "kVideoTracks": [
        {
          "alpha mode": "is_opaque",
          "codec": "h264",
          "coded size": "1920x1080",
          "color space": {
            "matrix": "BT709",
            "primaries": "BT709",
            "range": "LIMITED",
            "transfer": "BT709"
          },
          "encryption scheme": "Unencrypted",
          "has extra data": true,
          "hdr metadata": "unset",
          "natural size": "1920x1080",
          "orientation": "0°",
          "profile": "h264 high 4:2:2",
          "visible rect": "0,0 1920x1080"
        }
      ],
      "kMaxDuration": 10,
      "kStartTime": 0.033008,
      "kBitrate": 15156684,
      "kIsVideoDecryptingDemuxerStream": false,
      "kVideoDecoderName": "FFmpegVideoDecoder",
      "kIsPlatformVideoDecoder": false,
      "dimensions": "1920x1080",
      "kResolution": "1920x1080",
      "event": "kPause",
      "duration": 10.016341,
      "pipeline_buffering_state": {
        "for_suspended_start": false,
        "state": "BUFFERING_HAVE_ENOUGH"
      },
      "debug": "FFmpegDemuxer: av_read_frame(): End of file"
    },
    "events": [
      {
        "time": 0,
        "key": "created",
        "value": "2024-08-12 07:03:25.985115 UTC"
      },
      {
        "time": 0.7160000000149012,
        "key": "origin_url",
        "value": "https://avtshare01.rz.tu-ilmenau.de/"
      },
      {
        "time": 0.7199999999720603,
        "key": "kFrameUrl",
        "value": "https://avtshare01.rz.tu-ilmenau.de/avt-vqdb-uhd-1/test_1/segments/bigbuck_bunny_8bit_15000kbps_1080p_60.0fps_h264.mp4"
      },
      {
        "time": 0.7219999999506399,
        "key": "kFrameTitle",
        "value": ""
      },
      {
        "time": 0.7809999999590218,
        "key": "url",
        "value": "https://avtshare01.rz.tu-ilmenau.de/avt-vqdb-uhd-1/test_1/segments/bigbuck_bunny_8bit_15000kbps_1080p_60.0fps_h264.mp4"
      },
      {
        "time": 41.48800000001211,
        "key": "kTotalBytes",
        "value": "0x1211740"
      },
      {
        "time": 41.493000000016764,
        "key": "kIsStreaming",
        "value": false
      },
      {
        "time": 41.49699999997392,
        "key": "kIsSingleOrigin",
        "value": true
      },
      {
        "time": 41.49699999997392,
        "key": "kIsRangeHeaderSupported",
        "value": true
      },
      {
        "time": 41.537000000011176,
        "key": "kRendererName",
        "value": "RendererImpl"
      },
      {
        "time": 43.555999999982305,
        "key": "pipeline_state",
        "value": "kStarting"
      },
      {
        "time": 264.7360000000335,
        "key": "info",
        "value": "FFmpegDemuxer: created video stream, config codec: h264, profile: h264 high 4:2:2, level: not available, alpha_mode: is_opaque, coded size: [1920,1080], visible rect: [0,0,1920,1080], natural size: [1920,1080], has extra data: true, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}"
      },
      {
        "time": 264.7519999999786,
        "key": "kAudioTracks",
        "value": []
      },
      {
        "time": 264.75399999995716,
        "key": "kVideoTracks",
        "value": [
          {
            "alpha mode": "is_opaque",
            "codec": "h264",
            "coded size": "1920x1080",
            "color space": {
              "matrix": "BT709",
              "primaries": "BT709",
              "range": "LIMITED",
              "transfer": "BT709"
            },
            "encryption scheme": "Unencrypted",
            "has extra data": true,
            "hdr metadata": "unset",
            "natural size": "1920x1080",
            "orientation": "0°",
            "profile": "h264 high 4:2:2",
            "visible rect": "0,0 1920x1080"
          }
        ]
      },
      {
        "time": 264.762999999919,
        "key": "kMaxDuration",
        "value": 10
      },
      {
        "time": 264.762999999919,
        "key": "kStartTime",
        "value": 0.033008
      },
      {
        "time": 264.762999999919,
        "key": "kBitrate",
        "value": 15156684
      },
      {
        "time": 264.82400000002235,
        "key": "info",
        "value": "Cannot select DecryptingVideoDecoder for video decoding"
      },
      {
        "time": 264.8299999999581,
        "key": "info",
        "value": "Cannot select VaapiVideoDecoder for video decoding"
      },
      {
        "time": 264.8399999999674,
        "key": "info",
        "value": "Cannot select VpxVideoDecoder for video decoding"
      },
      {
        "time": 264.8499999999767,
        "key": "info",
        "value": "Cannot select Dav1dVideoDecoder for video decoding"
      },
      {
        "time": 265.9889999999432,
        "key": "kIsVideoDecryptingDemuxerStream",
        "value": false
      },
      {
        "time": 265.99099999992177,
        "key": "kVideoDecoderName",
        "value": "FFmpegVideoDecoder"
      },
      {
        "time": 265.99199999996927,
        "key": "kIsPlatformVideoDecoder",
        "value": false
      },
      {
        "time": 266.0019999999786,
        "key": "info",
        "value": "Selected FFmpegVideoDecoder for video decoding, config: codec: h264, profile: h264 high 4:2:2, level: not available, alpha_mode: is_opaque, coded size: [1920,1080], visible rect: [0,0,1920,1080], natural size: [1920,1080], has extra data: true, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}"
      },
      {
        "time": 266.0239999999758,
        "key": "pipeline_state",
        "value": "kPlaying"
      },
      {
        "time": 317.89099999994505,
        "key": "dimensions",
        "value": "1920x1080"
      },
      {
        "time": 317.9079999999376,
        "key": "kResolution",
        "value": "1920x1080"
      },
      {
        "time": 330.71999999997206,
        "key": "info",
        "value": "Effective playback rate changed from 0 to 1"
      },
      {
        "time": 330.7459999999264,
        "key": "event",
        "value": "kPlay"
      },
      {
        "time": 264.7480000000214,
        "key": "duration",
        "value": 10
      },
      {
        "time": 330.6230000000214,
        "key": "pipeline_buffering_state",
        "value": {
          "for_suspended_start": false,
          "state": "BUFFERING_HAVE_ENOUGH"
        }
      },
      {
        "time": 8007.376999999979,
        "key": "duration",
        "value": 10.016341
      },
      {
        "time": 8074.574000000022,
        "key": "debug",
        "value": "FFmpegDemuxer: av_read_frame(): End of file"
      },
      {
        "time": 10307.918999999994,
        "key": "event",
        "value": "kEnded"
      },
      {
        "time": 10308.092999999993,
        "key": "event",
        "value": "kPause"
      }
    ]
  }
]
Comment 12 gentoo 2024-08-14 08:08:36 UTC
Chromium VA-API on X11 requires --enable-features=VaapiVideoDecodeLinuxGL on my systems instead of --enable-features=VaapiVideoDecode as recommended in elog. Without --enable-features=VaapiVideoDecodeLinuxGL, chrome://gpu shows the same "Video Decode: Hardware accelerated" with no accelerated codecs. Wayland, Vulkan, and other systems may require different flags, see https://wiki.archlinux.org/title/Chromium#Hardware_video_acceleration