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

driver/usbvideodriver: use playbin3 element #1336

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

KarlK90
Copy link
Contributor

@KarlK90 KarlK90 commented Mar 4, 2024

Description

Decoding via VA-API fails for the C920 model and the playbin element on AMD graphic cards, playbin3 has no problems though - so lets switch to that.

Tested on Fedora 39 running GStreamer 1.22.9.

Current Debian stable ships with GStreamer 1.22.0 which supports playbin3.

Error log

The error output with a failed VA-API pipeline:

labgrid-client video
> labgrid-client video
(gst-launch-1.0:17414): GStreamer-Base-CRITICAL **: 16:15:20.192: basetransform: second attempt to fixate caps returned invalid (NULL) caps on pad vaapipostproc0:sink

(gst-launch-1.0:17414): GStreamer-Base-CRITICAL **: 16:15:20.193: basetransform: second attempt to fixate caps returned invalid (NULL) caps on pad vaapipostproc0:sink

(gst-launch-1.0:17414): GStreamer-Base-CRITICAL **: 16:15:20.193: basetransform: second attempt to fixate caps returned invalid (NULL) caps on pad vaapipostproc0:sink

(gst-launch-1.0:17414): GStreamer-Base-CRITICAL **: 16:15:20.193: basetransform: second attempt to fixate caps returned invalid (NULL) caps on pad vaapipostproc0:sink

(gst-launch-1.0:17414): GStreamer-Base-CRITICAL **: 16:15:20.193: basetransform: second attempt to fixate caps returned invalid (NULL) caps on pad vaapipostproc0:sink

(gst-launch-1.0:17414): GStreamer-Base-CRITICAL **: 16:15:20.193: basetransform: second attempt to fixate caps returned invalid (NULL) caps on pad vaapipostproc0:sink

(gst-launch-1.0:17414): GStreamer-Base-CRITICAL **: 16:15:20.193: basetransform: second attempt to fixate caps returned invalid (NULL) caps on pad vaapipostproc0:sink

(gst-launch-1.0:17414): GStreamer-Base-CRITICAL **: 16:15:20.193: basetransform: second attempt to fixate caps returned invalid (NULL) caps on pad vaapipostproc0:sink
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstFdSrc:source: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3132): gst_base_src_loop (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstFdSrc:source:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.

This is the output of vainfo:

vainfo -a
❯ vainfo -a
Trying display: wayland
Trying display: x11
libva info: VA-API version 1.20.0
libva info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_20
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.20 (libva 2.20.1)
vainfo: Driver version: Mesa Gallium driver 23.3.6 for AMD Radeon RX 6900 XT (radeonsi, navi21, LLVM 17.0.6, DRM 3.57, 6.7.6-200.fc39.x86_64)
vainfo: Supported config attributes per profile/entrypoint pair
VAProfileMPEG2Simple/VAEntrypointVLD
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
    VAConfigAttribMaxPictureWidth          : 4096
    VAConfigAttribMaxPictureHeight         : 4096

VAProfileMPEG2Main/VAEntrypointVLD
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
    VAConfigAttribMaxPictureWidth          : 4096
    VAConfigAttribMaxPictureHeight         : 4096

VAProfileVC1Simple/VAEntrypointVLD
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
    VAConfigAttribMaxPictureWidth          : 4096
    VAConfigAttribMaxPictureHeight         : 4096

VAProfileVC1Main/VAEntrypointVLD
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
    VAConfigAttribMaxPictureWidth          : 4096
    VAConfigAttribMaxPictureHeight         : 4096

VAProfileVC1Advanced/VAEntrypointVLD
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
    VAConfigAttribMaxPictureWidth          : 4096
    VAConfigAttribMaxPictureHeight         : 4096

VAProfileH264ConstrainedBaseline/VAEntrypointVLD
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
    VAConfigAttribMaxPictureWidth          : 4096
    VAConfigAttribMaxPictureHeight         : 4096

VAProfileH264ConstrainedBaseline/VAEntrypointEncSlice
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
    VAConfigAttribRateControl              : VA_RC_CBR
                                             VA_RC_VBR
                                             VA_RC_CQP
    VAConfigAttribEncPackedHeaders         : VA_ENC_PACKED_HEADER_SEQUENCE
    VAConfigAttribEncMaxRefFrames          : l0=1
                                             l1=1
    VAConfigAttribEncMaxSlices             : 128
    VAConfigAttribEncSliceStructure        : VA_ENC_SLICE_STRUCTURE_POWER_OF_TWO_ROWS
                                             VA_ENC_SLICE_STRUCTURE_EQUAL_ROWS
    VAConfigAttribMaxPictureWidth          : 4096
    VAConfigAttribMaxPictureHeight         : 2160
    VAConfigAttribEncQualityRange          : number of supported quality levels is 32
    VAConfigAttribEncRateControlExt        : max_num_temporal_layers_minus1=3 temporal_layer_bitrate_control_flag=1
    VAConfigAttribMaxFrameSize             : max_frame_size=1
                                             multiple_pass=0

VAProfileH264Main/VAEntrypointVLD
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
    VAConfigAttribMaxPictureWidth          : 4096
    VAConfigAttribMaxPictureHeight         : 4096

VAProfileH264Main/VAEntrypointEncSlice
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
    VAConfigAttribRateControl              : VA_RC_CBR
                                             VA_RC_VBR
                                             VA_RC_CQP
    VAConfigAttribEncPackedHeaders         : VA_ENC_PACKED_HEADER_SEQUENCE
    VAConfigAttribEncMaxRefFrames          : l0=1
                                             l1=1
    VAConfigAttribEncMaxSlices             : 128
    VAConfigAttribEncSliceStructure        : VA_ENC_SLICE_STRUCTURE_POWER_OF_TWO_ROWS
                                             VA_ENC_SLICE_STRUCTURE_EQUAL_ROWS
    VAConfigAttribMaxPictureWidth          : 4096
    VAConfigAttribMaxPictureHeight         : 2160
    VAConfigAttribEncQualityRange          : number of supported quality levels is 32
    VAConfigAttribEncRateControlExt        : max_num_temporal_layers_minus1=3 temporal_layer_bitrate_control_flag=1
    VAConfigAttribMaxFrameSize             : max_frame_size=1
                                             multiple_pass=0

VAProfileH264High/VAEntrypointVLD
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
    VAConfigAttribMaxPictureWidth          : 4096
    VAConfigAttribMaxPictureHeight         : 4096

VAProfileH264High/VAEntrypointEncSlice
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
                                             VA_RT_FORMAT_YUV420_10
                                             VA_RT_FORMAT_YUV420_10BPP
    VAConfigAttribRateControl              : VA_RC_CBR
                                             VA_RC_VBR
                                             VA_RC_CQP
    VAConfigAttribEncPackedHeaders         : VA_ENC_PACKED_HEADER_SEQUENCE
    VAConfigAttribEncMaxRefFrames          : l0=1
                                             l1=1
    VAConfigAttribEncMaxSlices             : 128
    VAConfigAttribEncSliceStructure        : VA_ENC_SLICE_STRUCTURE_POWER_OF_TWO_ROWS
                                             VA_ENC_SLICE_STRUCTURE_EQUAL_ROWS
    VAConfigAttribMaxPictureWidth          : 4096
    VAConfigAttribMaxPictureHeight         : 2160
    VAConfigAttribEncQualityRange          : number of supported quality levels is 32
    VAConfigAttribEncRateControlExt        : max_num_temporal_layers_minus1=3 temporal_layer_bitrate_control_flag=1
    VAConfigAttribMaxFrameSize             : max_frame_size=1
                                             multiple_pass=0

VAProfileHEVCMain/VAEntrypointVLD
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
    VAConfigAttribMaxPictureWidth          : 8192
    VAConfigAttribMaxPictureHeight         : 4352

VAProfileHEVCMain/VAEntrypointEncSlice
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
    VAConfigAttribRateControl              : VA_RC_CBR
                                             VA_RC_VBR
                                             VA_RC_CQP
    VAConfigAttribEncPackedHeaders         : VA_ENC_PACKED_HEADER_SEQUENCE
    VAConfigAttribEncMaxRefFrames          : l0=1
                                             l1=0
    VAConfigAttribEncMaxSlices             : 128
    VAConfigAttribEncSliceStructure        : VA_ENC_SLICE_STRUCTURE_POWER_OF_TWO_ROWS
                                             VA_ENC_SLICE_STRUCTURE_EQUAL_ROWS
    VAConfigAttribMaxPictureWidth          : 7680
    VAConfigAttribMaxPictureHeight         : 4352
    VAConfigAttribEncQualityRange          : number of supported quality levels is 32
    VAConfigAttribMaxFrameSize             : max_frame_size=1
                                             multiple_pass=0

VAProfileHEVCMain10/VAEntrypointVLD
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
                                             VA_RT_FORMAT_YUV420_10
                                             VA_RT_FORMAT_YUV420_10BPP
    VAConfigAttribMaxPictureWidth          : 8192
    VAConfigAttribMaxPictureHeight         : 4352

VAProfileHEVCMain10/VAEntrypointEncSlice
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
                                             VA_RT_FORMAT_YUV420_10
                                             VA_RT_FORMAT_YUV420_10BPP
    VAConfigAttribRateControl              : VA_RC_CBR
                                             VA_RC_VBR
                                             VA_RC_CQP
    VAConfigAttribEncPackedHeaders         : VA_ENC_PACKED_HEADER_SEQUENCE
    VAConfigAttribEncMaxRefFrames          : l0=1
                                             l1=0
    VAConfigAttribEncMaxSlices             : 128
    VAConfigAttribEncSliceStructure        : VA_ENC_SLICE_STRUCTURE_POWER_OF_TWO_ROWS
                                             VA_ENC_SLICE_STRUCTURE_EQUAL_ROWS
    VAConfigAttribMaxPictureWidth          : 7680
    VAConfigAttribMaxPictureHeight         : 4352
    VAConfigAttribEncQualityRange          : number of supported quality levels is 32
    VAConfigAttribMaxFrameSize             : max_frame_size=1
                                             multiple_pass=0

VAProfileJPEGBaseline/VAEntrypointVLD
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
                                             VA_RT_FORMAT_YUV422
                                             VA_RT_FORMAT_YUV444
                                             VA_RT_FORMAT_YUV400
    VAConfigAttribMaxPictureWidth          : 4096
    VAConfigAttribMaxPictureHeight         : 4096

VAProfileVP9Profile0/VAEntrypointVLD
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
    VAConfigAttribMaxPictureWidth          : 8192
    VAConfigAttribMaxPictureHeight         : 4352

VAProfileVP9Profile2/VAEntrypointVLD
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420_10
                                             VA_RT_FORMAT_YUV420_10BPP
    VAConfigAttribMaxPictureWidth          : 8192
    VAConfigAttribMaxPictureHeight         : 4352

VAProfileAV1Profile0/VAEntrypointVLD
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
                                             VA_RT_FORMAT_YUV420_10
                                             VA_RT_FORMAT_YUV420_10BPP
    VAConfigAttribMaxPictureWidth          : 8192
    VAConfigAttribMaxPictureHeight         : 4352

VAProfileNone/VAEntrypointVideoProc
    VAConfigAttribRTFormat                 : VA_RT_FORMAT_YUV420
                                             VA_RT_FORMAT_YUV422
                                             VA_RT_FORMAT_YUV444
                                             VA_RT_FORMAT_YUV400
                                             VA_RT_FORMAT_YUV420_10
                                             VA_RT_FORMAT_RGB32
                                             VA_RT_FORMAT_RGBP
                                             VA_RT_FORMAT_YUV420_10BPP

Checklist

  • Documentation for the feature
  • Tests for the feature
  • The arguments and description in doc/configuration.rst have been updated
  • Add a section on how to use the feature to doc/usage.rst
  • Add a section on how to use the feature to doc/development.rst
  • PR has been tested
  • Man pages have been regenerated

Decoding via VA-API fails for the C920 model and the playbin element on
AMD graphic cards, playbin3 has no problems though - so lets switch to
that.

Signed-off-by: Stefan Kerkmann <[email protected]>
@KarlK90 KarlK90 force-pushed the fix/h264-software-decoding branch from 0a6bc53 to 65998f6 Compare March 5, 2024 13:39
@KarlK90 KarlK90 changed the title RFC: driver/usbvideodriver: force software decoding driver/usbvideodriver: switch to playbin3 Mar 5, 2024
@KarlK90 KarlK90 changed the title driver/usbvideodriver: switch to playbin3 driver/usbvideodriver: use playbin3 element Mar 5, 2024
@KarlK90 KarlK90 marked this pull request as ready for review March 5, 2024 13:54
Copy link
Member

@Emantor Emantor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

playbin3 is available in debian stable, so this should be good to go.

Copy link

codecov bot commented Mar 5, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 62.8%. Comparing base (f432076) to head (65998f6).

Files Patch % Lines
labgrid/driver/usbvideodriver.py 0.0% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master   #1336   +/-   ##
======================================
  Coverage    62.8%   62.8%           
======================================
  Files         163     163           
  Lines       12019   12019           
======================================
  Hits         7550    7550           
  Misses       4469    4469           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jluebbe jluebbe merged commit 510b70b into labgrid-project:master Mar 6, 2024
10 of 11 checks passed
@KarlK90 KarlK90 deleted the fix/h264-software-decoding branch March 6, 2024 08:43
@Bastian-Krause Bastian-Krause added fix Pick to stable Needs a pick to the stable branch labels Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pick to stable Needs a pick to the stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants