Page MenuHomePhabricator

Video issues.
Closed, ResolvedPublic

Description

Testing with files from https://download.blender.org/durian/trailer/ and http://bbb3d.renderfarming.net/download.html

With Vaapi enabled no thumbnails are generated.
Some resolutions (tested 480p sintel) don't play at all neither in previews nor in terminology.
Previews sometimes freeze the whole desktop.
On cards that don't support 4k the whole thing needs to fail somehow more gracefully. :/

ApB created this task.Oct 3 2017, 12:03 PM
zmike updated the task description. (Show Details)Oct 3 2017, 12:07 PM
zmike added subscribers: raster, cedric, jpeg.
zmike triaged this task as Pending on user input priority.Oct 6 2017, 9:01 AM

kill -SIGSEGV when it freezes

dont install vaapi support. some codecs and hw units dont allow mapping of video data and this leads to that.

ApB added a comment.Oct 16 2017, 12:05 AM

dont install vaapi support. some codecs and hw units dont allow mapping of video data and this leads to that.

I know that but nearly anything i throw at it is problematic. Doesn't this mean that it should t least work for some formats.

The preview freeze is probably T6049. Thumbnailing is pretty bad. It tries, fails and makes the desktop pause for a few seconds. I even saw a enlightenment_t crash.

480p used to work and works with gst-play so its probably E that regressed somewhere.

ApB raised the priority of this task from Pending on user input to Incoming Queue.Oct 24 2017, 2:04 AM

No need for this to be in pending user input. Those are legit issues.

ApB added a comment.Oct 26 2017, 6:06 AM

This is a bt (taken with kill -sigsegv) from a freeze i see on the test laptop (no fancy HW accel stuff there). Can anyone see anything of interest in it??

0  0xb7fb7cd9 in __kernel_vsyscall ()
#1  0xb71d1dc3 in poll () at /usr/lib/libc.so.6
#2  0xb60b70eb in  () at /usr/lib/libxcb.so.1
#3  0xb60b4757 in xcb_connect_to_fd () at /usr/lib/libxcb.so.1
#4  0xb60b8e3b in xcb_connect_to_display_with_auth_info () at /usr/lib/libxcb.so.1
#5  0xb60b8f5e in xcb_connect () at /usr/lib/libxcb.so.1
#6  0xaa30c9a3 in pa_client_conf_from_x11 () at /usr/lib/pulseaudio/libpulsecommon-11.1.so
#7  0xaa2cba32 in pa_client_conf_load () at /usr/lib/pulseaudio/libpulsecommon-11.1.so
#8  0xac2242be in pa_context_new_with_proplist () at /usr/lib/libpulse.so.0
#9  0xac22443d in pa_context_new () at /usr/lib/libpulse.so.0
#10 0xb0f588a4 in  () at /usr/lib/gstreamer-1.0/libgstpulseaudio.so
#11 0xb15fdc41 in gst_audio_ring_buffer_open_device () at /usr/lib/libgstaudio-1.0.so.0
#12 0xb1621630 in  () at /usr/lib/libgstaudio-1.0.so.0
#13 0xb0f5c25b in  () at /usr/lib/gstreamer-1.0/libgstpulseaudio.so
#14 0xb11d7cad in gst_element_change_state () at /usr/lib/libgstreamer-1.0.so.0
#15 0xb11d83fe in  () at /usr/lib/libgstreamer-1.0.so.0
#16 0xb101b3b3 in  () at /usr/lib/gstreamer-1.0/libgstplayback.so
#17 0xb101c13c in  () at /usr/lib/gstreamer-1.0/libgstplayback.so
#18 0xb6329f4a in ffi_call_SYSV () at /usr/lib/libffi.so.6
#19 0xb6329bbc in ffi_call () at /usr/lib/libffi.so.6
#20 0xb6016bcb in g_cclosure_marshal_generic () at /usr/lib/libgobject-2.0.so.0
#21 0xb600dc76 in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#22 0xb60213ce in  () at /usr/lib/libgobject-2.0.so.0
#23 0xb602511d in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#24 0xb60269b5 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#25 0xb0ffc8e0 in  () at /usr/lib/gstreamer-1.0/libgstplayback.so
#26 0xb6329f4a in ffi_call_SYSV () at /usr/lib/libffi.so.6
#27 0xb6329bbc in ffi_call () at /usr/lib/libffi.so.6
#28 0xb6016bcb in g_cclosure_marshal_generic () at /usr/lib/libgobject-2.0.so.0
#29 0xb600dc76 in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#30 0xb60213ce in  () at /usr/lib/libgobject-2.0.so.0
#31 0xb602511d in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#32 0xb60269b5 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#33 0xb0fe70aa in  () at /usr/lib/gstreamer-1.0/libgstplayback.so
#34 0xb0ff3006 in  () at /usr/lib/gstreamer-1.0/libgstplayback.so
#35 0xb0ff3996 in  () at /usr/lib/gstreamer-1.0/libgstplayback.so
#36 0xb0ff3bee in  () at /usr/lib/gstreamer-1.0/libgstplayback.so
#37 0xb600dc76 in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#38 0xb60213ce in  () at /usr/lib/libgobject-2.0.so.0
#39 0xb6025977 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#40 0xb60269b5 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#41 0xb6013d91 in  () at /usr/lib/libgobject-2.0.so.0
#42 0xb11a9676 in  () at /usr/lib/libgstreamer-1.0.so.0
#43 0xb600fab8 in g_object_notify_by_pspec () at /usr/lib/libgobject-2.0.so.0
#44 0xb11ee506 in  () at /usr/lib/libgstreamer-1.0.so.0
#45 0xb11fa6fb in gst_pad_push_event () at /usr/lib/libgstreamer-1.0.so.0
#46 0x841a4d8b in  () at /usr/lib/gstreamer-1.0/libgstaudioparsers.so
#47 0x841a8062 in  () at /usr/lib/gstreamer-1.0/libgstaudioparsers.so
#48 0xb1373071 in  () at /usr/lib/libgstbase-1.0.so.0
#49 0xb11ef979 in  () at /usr/lib/libgstreamer-1.0.so.0
#50 0xb11faa5d in gst_pad_send_event () at /usr/lib/libgstreamer-1.0.so.0
#51 0xb0fea4fc in  () at /usr/lib/gstreamer-1.0/libgstplayback.so
#52 0xb11ee663 in  () at /usr/lib/libgstreamer-1.0.so.0
#53 0xb11eddc3 in  () at /usr/lib/libgstreamer-1.0.so.0
#54 0xb11fb5ea in gst_pad_sticky_events_foreach () at /usr/lib/libgstreamer-1.0.so.0
#55 0xb0fe8163 in  () at /usr/lib/gstreamer-1.0/libgstplayback.so
#56 0xb0ff3006 in  () at /usr/lib/gstreamer-1.0/libgstplayback.so
#57 0xb0ff3996 in  () at /usr/lib/gstreamer-1.0/libgstplayback.so
#58 0xb6329f4a in ffi_call_SYSV () at /usr/lib/libffi.so.6
#59 0xb6329bbc in ffi_call () at /usr/lib/libffi.so.6
#60 0xb6016bcb in g_cclosure_marshal_generic () at /usr/lib/libgobject-2.0.so.0
#61 0xb600dc76 in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#62 0xb60213ce in  () at /usr/lib/libgobject-2.0.so.0
#63 0xb6025977 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#64 0xb60269b5 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#65 0xb11d48f9 in gst_element_add_pad () at /usr/lib/libgstreamer-1.0.so.0
#66 0xaa52040d in  () at /usr/lib/gstreamer-1.0/libgstisomp4.so
#67 0xaa53ffec in  () at /usr/lib/gstreamer-1.0/libgstisomp4.so
#68 0xaa541f29 in  () at /usr/lib/gstreamer-1.0/libgstisomp4.so
#69 0xb1225f64 in  () at /usr/lib/libgstreamer-1.0.so.0
#70 0xb6aecfe5 in  () at /usr/lib/libglib-2.0.so.0
#71 0xb6af1a26 in  () at /usr/lib/libglib-2.0.so.0
#72 0xb7dcee56 in start_thread () at /usr/lib/libpthread.so.0
#73 0xb71dc3b6 in clone () at /usr/lib/libc.so.6
zmike added a comment.Oct 26 2017, 7:27 AM

I think you're just screwed in this case. gstreamer is triggering a pulseaudio call which is trying to create an internal X11 connection in a thread inside its own lib. This is a pulseaudio issue which I've worked around for all cases that are possible, but until either there is no more video pipeline creation inside the compositor process (e.g., efm removal) or all libraries in possible video pipeline creation are reviewed and verified to have no possibility of creating X11 connections under Wayland, this will continue to remain an unfixable issue.

ApB added a comment.Oct 26 2017, 7:47 AM

Seems to not affect my fast machine where previews work (mostly). Anyway.

zmike added a comment.Oct 26 2017, 9:08 AM
In T6134#102993, @ApB wrote:

Seems to not affect my fast machine where previews work (mostly). Anyway.

That's great. I'm glad to hear it!

BTW. Why is xwayland not answering such a request ?
It could at least sent back a error ...

that pulse trying to connect to x... i swear i did a workaround for that in emotion that unsets DISPLAY ... or something.

hmmm there's d79232d605433374b898b7d1462608e595112170 for ecore audio.

now i remember. i could do this for ecore audio (this was causing hangs every time in any app we tried to use ecore audio), but i couldn't find a "point" in gst/emotion to do this (it was being independently connected to from a thread like above).

we could just forcibly remove DISPLAY env var in e entirely and set it only for launching of apps (in ecore_exe with new features to provide an env for forked+exec'd processes). so e itself will just have no DISPLAY set in wl mode (except for apps it launches).

zmike closed this task as Resolved.Jan 22 2018, 10:56 AM

There's nothing further that can be done on our end.

ApB added a comment.Jan 22 2018, 12:19 PM
In T6134#109724, @zmike wrote:

There's nothing further that can be done on our end.

do you have HW acceleration turned on?

this conflates 2 issues. one is pulseaudio connecting to x on its own from a gst thread. this ends up deadlocking e. if we could control that behavior then that would be able to be avoided. the only way i see is to permanently unset DISPLAY and only set it temporarily when launching an executable. this is also a race condition because global vars are ... global, if a thread in gst happens to be connecting to pulse at the time we set then unset display for an exe launch... it may lock up again. we need to add the ability to define specific env vars inside the forked child before exec() and we don't have that in efl atm. i actually was planning it out for the efl eo/interfaces api.

vaapi is something else entirely. i've filed a bug somewhere with gst about some of it being broken. i don't know if those fixes have made their way to distros yet. i just avoid vaapi for now. some vaapi codecs disallow mapping of the video memory which causes issues. to make that work we have to implement our own buffer allocation pool and implement zero copy texture/pixmap/dmabuf support for gl engine and we'd need a custom buffer allocator class to disable vaapi when in software so buffers can be mapped. the end result at this stage is that vaapi needs disabling anyway so buffers can be mapped. at least when the mappings fail and that's where issues turn up. gst-play implements its own buffer allocator class and uses xv for output where it has a specific vo for this to do zero copy. there is a gl one for gst for this but that requires access to our gl context from memory and that's a problem as evas hides it's internals so these 2 just don't get along. would have to write a vo specifically for evas sw and for ev as gl engines and that's a chunk of work and i have enough things to do atm. for now the simple solution is "no vaapi - don't use it". :(