Discussion:
[Bug 797308] New: vaapiencoder: Surface concurrency issues, failed to encode frame due to 'surface in use'
"GStreamer" (GNOME Bugzilla)
2018-10-19 13:21:51 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=797308

Bug ID: 797308
Summary: vaapiencoder: Surface concurrency issues, failed to
encode frame due to 'surface in use'
Classification: Platform
Product: GStreamer
Version: 1.12.2
OS: Linux
Status: NEW
Severity: normal
Priority: Normal
Component: gstreamer-vaapi
Assignee: gstreamer-***@lists.freedesktop.org
Reporter: ***@vcatechnology.com
QA Contact: gstreamer-***@lists.freedesktop.org
CC: ***@gmail.com, ***@igalia.com
GNOME version: ---

Created attachment 373971
--> https://bugzilla.gnome.org/attachment.cgi?id=373971&action=edit
Add lock to gstvaapisurface patch

It seems that gstreamer-vaapi currently does not synchronise access to the
vaapi surfaces correctly.

Attempting to use a VASurface while it is mapped (with vaMapBuffer) results in
a surface is in use error from vaapi. This was causing an issue for us where
one branch of the pipeline would map a GstBuffer and another branch of the
pipeline would attempt to encode the buffer with the vaapiencoder while it is
mapped. The result is that gstvaapiencoder fails to encode the buffer, and the
whole pipeline is stopped.

I've attached the patch we have used to fix the issue. This adds a mutex to
gstvaapisurface that is used to correctly synchronise access.

We're using a slightly older version of gstreamer but it doesn't seem like this
has changed in the latest master.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-10-19 13:43:59 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=797308

--- Comment #1 from Víctor Manuel Jáquez Leal <***@igalia.com> ---
Hi,

Thanks for the patch.

Do you have any pipeline/program that shows the problem?
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-10-30 16:36:43 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=797308

Víctor Manuel Jáquez Leal <***@igalia.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-10-31 16:01:03 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=797308

--- Comment #2 from Myles Inglis <***@vcatechnology.com> ---
Hi,

Sorry for the delayed response.

The problem is that we have quite a complex pipeline with many custom elements.
I've tried to find a pipeline with standard gstreamer elements that
demonstrates this but most of my attempts have just resulted in a deadlock...

In theory you should see the problem if a GstBuffer is mapped in one thread
while another tries to encode it. I tried to write a small program to prove
this but again I only saw deadlocks.

I'll get back to you if I find a reliable way to reproduce the issue.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-11-03 15:56:05 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=797308

GStreamer system administrator <***@gstreamer.net> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |RESOLVED
Resolution|--- |OBSOLETE

--- Comment #3 from GStreamer system administrator <***@gstreamer.net> ---
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been
closed from further activity.

You can subscribe and participate further through the new bug through this link
to our GitLab instance:
https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/109.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
Loading...