Skip to content

VAAPI invalid chip id or driver is being used. #254

Closed

Description

@Nycrera

Hey, I am trying to get gstreamer to stream an mpegts stream over udp with hardware accelerated encoding on video using VAAPI. With intel integrated GPU.
Basically I can run this command in command line to do this and it works without any problems.

gst-launch-1.0 ximagesrc ! video/x-raw,framerate=30/1 ! timeoverlay ! videoconvert ! vaapih264enc ! queue ! mpegtsmux name=m ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1234 sync=false alsasrc device=hw:0 ! audioconvert ! fdkaacenc ! m.

But when I am using gstreamer-java with a simple parselaunch test:

Gst.init(Version.BASELINE);
Pipeline pipeline = (Pipeline) Gst.parseLaunch("ximagesrc ! video/x-raw,framerate=30/1 ! timeoverlay ! videoconvert ! vaapih264enc ! queue ! mpegtsmux name=m ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1234 sync=false alsasrc device=hw:0 ! audioconvert ! fdkaacenc ! m.");
pipeline.play();

As you can see both pipelines are identical.
However I am getting an error from gstreamer:

DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0

Now my idea is that, somehow VAAPI is using the wrong driver while working in JVM but the correct one in command line.
There is this Environment variable that needs to be set for the VAAPI to tell which driver to use:
LIBVA_DRIVER_NAME, which I have set to correct value for my GPU, as, LIBVA_DRIVER_NAME=iHD.
Is there a possibility that when gstreamer is ran through this library, this environment variable is not passed to the gstreamer process?

I can see the environment variable using System.getenv("LIBVA_DRIVER_NAME")

OR Is this absolutely unrelated to this?

Activity

  1. Nycrera commented on Aug 9, 2022

    @Nycrera
    Author

    Basically what makes me paranoid is the line:
    DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
    the "I915" makes me think that the wrong driver is being used. Because the commonly used driver for Intel gpu's seems to be the I915 one. Maybe this is the default?

    I have set up my VAAPI following the https://wiki.archlinux.org/title/Hardware_video_acceleration#Intel

    But in the end why would it work on command line and not work on the library with a simple parseLaunch as this.

  2. reopened this on Aug 9, 2022
  3. Nycrera commented on Aug 9, 2022

    @Nycrera
    Author

    I have updated to Gst.init(Version.of(1,20)) No change.

  4. locked and limited conversation to collaborators on Aug 9, 2022
  5. converted this issue into a discussion #255 on Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions