After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 762500 - jpeg decoder: gen75_mfd.c:2203: gen75_mfd_jpeg_decode_init: Assertion `0' failed
jpeg decoder: gen75_mfd.c:2203: gen75_mfd_jpeg_decode_init: Assertion `0' failed
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 763321 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-02-22 22:41 UTC by Tim-Philipp Müller
Modified: 2018-11-03 15:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vaapi-assert.jpg (1.55 MB, image/jpeg)
2016-02-22 22:41 UTC, Tim-Philipp Müller
Details

Description Tim-Philipp Müller 2016-02-22 22:41:39 UTC
Created attachment 321907 [details]
vaapi-assert.jpg

Not sure if this is an issue with the jepg parser / vaapi or lower levels in the stack:

$ gst-play-1.0 vaapi-assert.jpg 
libva info: VA-API version 0.38.1
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_38
libva info: va_openDriver() returns 0
Redistribute latency...
lt-gst-play-1.0: gen75_mfd.c:2203: gen75_mfd_jpeg_decode_init: Assertion `0' failed.
Aborted (core dumped)
Comment 1 Víctor Manuel Jáquez Leal 2016-02-23 11:15:03 UTC
The culprit is libva-intel-driver. I hate that libva-intel-driver handles its no-valid-states with asserts: https://cgit.freedesktop.org/vaapi/intel-driver/tree/src/gen75_mfd.c#n2150

This jpeg file has 4 components and libva-intel-driver only supports 1 and 3 components for subsampling
Comment 2 Tim-Philipp Müller 2016-02-23 17:11:30 UTC
Ah I see, why do error handling if you can just assert :P

I think we need to be stricter in general about the JPEGs we pass to vaapi, I have other jpg files which will cause an error at runtime because the vaapi decoder can't handle the profile.
Comment 3 sreerenj 2016-03-10 12:34:29 UTC
Why does this stream not decodable with software decoders too?!
But ffmpeg is decoding correctly.
Comment 4 sreerenj 2016-03-10 14:15:45 UTC
This is a similar case: 
https://bugzilla.gnome.org/show_bug.cgi?id=763321
Comment 5 sreerenj 2016-03-10 14:18:24 UTC
Similar to what SiewHoon did in #763321, we can check for the number of components in gstvaapidecoder_jpeg and error out if it is greater than four to get rid of the driver assert. But this will not help to fallback to software decoder since we already reached the parsing state.
Comment 6 sreerenj 2016-03-10 14:25:23 UTC
Ideally we should have something similar to VAEncode config attribute VAConfigAttribValEncJPEG  {
....
....
  unsigned int max_num_components : 3;
...
} , and query the config attribute to check whether specific features are supported or not. But this requires change in driver and va_header :)
Comment 7 sreerenj 2016-04-14 09:32:06 UTC
I curious about few other things related with this:

In gstreamer-vaapi git master, we negotiate src caps from vaapidecode only after getting the first decoded frame ready to be pushed.

So in theory, if there is any issue in hardware decode, playbin can still fallback to software decoder (assuming we will have patch in gstreamer-vaapi to return FALSE/FLOW_ERROR before driver asserts)

I think this is beneficial for all codecs, playbin will try to autoplug the vaapidecode first, if any error occurred while doing the first frame decode (may be due to un-maintained driver), it switchback to software decoder....
Comment 8 Víctor Manuel Jáquez Leal 2018-05-04 13:42:23 UTC
*** Bug 763321 has been marked as a duplicate of this bug. ***
Comment 9 GStreamer system administrator 2018-11-03 15:47:23 UTC
-- 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/35.