Should I always add wl_display_sync() before wl_display_dispatch_queue()?

Zhao, Halley halley.zhao at intel.com
Tue Oct 29 03:39:16 CET 2013


Video player use frame callback on an event queue, sometimes there is synchronization issue.
After looked at other usage of event queue, I found:
In order to avoid blocking by wl_display_dispatch_queue(), a padding callback of wl_display_sync is added on purpose.
Is my understanding correct?
Here is the changes:
https://gitorious.org/halley-test/gstreamer-vaapi/commit/9846c75e7a2bb223900457beffc3384c77cc5075


however, with or without the above change, I found there is still hangs in my player (efl based) :
https://gitorious.org/gst-plugins-vaapi/simple-player/source/87837fc1b4c11d7a33142c7d4fac1225d8973b80:
it seems to be ECore issue during wl_display_dispatch_pending():

Rafael:
Do you think it is an ECore issue?

// wl_display_sync callback with wl_display_dispatch_pending()
(gdb) bt
#0  0xb7c4ddd0 in _ecore_wl_input_cb_keyboard_enter () from /lib/libecore_wayland.so.1
#1  0xb6f16666 in ffi_call_SYSV () from /lib/libffi.so.6
#2  0xb6f163eb in ffi_call () from /lib/libffi.so.6
#3  0xb79a9ae5 in wl_closure_invoke () from /lib/libwayland-client.so.0
#4  0xb79a74c2 in dispatch_queue () from /lib/libwayland-client.so.0
#5  0xb79a803e in wl_display_dispatch_queue_pending () from /lib/libwayland-client.so.0
#6  0xb79a8162 in wl_display_dispatch_pending () from /lib/libwayland-client.so.0
#7  0xb3ca72a6 in gst_vaapi_window_wayland_sync (window=0x87d2d50) at gstvaapiwindow_wayland.c:162
#8  gst_vaapi_window_wayland_render (window=0x87d2d50, surface=0xb0a02860, src_rect=0xb017dbd0, dst_rect=0x88bdbe0, flags=0) at gstvaapiwindow_wayland.c:514
#9  0xb3c5a2fb in gst_vaapi_window_put_surface (window=0x87d2d50, surface=surface at entry=0xb0a02860, src_rect=0xb017dbd0, src_rect at entry=0x0, dst_rect=<optimized out>, dst_rect at entry=0x88bdbe0,
    flags=flags at entry=0) at gstvaapiwindow.c:435
#10 0xb3ccc1e1 in gst_vaapisink_put_surface (flags=0, surface_rect=<optimized out>, surface=0xb0a02860, sink=0x88bd958) at gstvaapisink.c:1150

If I remove wl_display_dispatch_pending in frame callback sync:
There is backtrace,
// wl_display_sync callback with wl_display_dispatch_pending()
(gdb) bt
#0  0xb7c4ddd0 in _ecore_wl_input_cb_keyboard_enter () from /lib/libecore_wayland.so.1
#1  0xb6f16666 in ffi_call_SYSV () from /lib/libffi.so.6
#2  0xb6f163eb in ffi_call () from /lib/libffi.so.6
#3  0xb79a9ae5 in wl_closure_invoke () from /lib/libwayland-client.so.0
#4  0xb79a74c2 in dispatch_queue () from /lib/libwayland-client.so.0
#5  0xb79a803e in wl_display_dispatch_queue_pending () from /lib/libwayland-client.so.0
#6  0xb79a8162 in wl_display_dispatch_pending () from /lib/libwayland-client.so.0
#7  0xb3ca72a6 in gst_vaapi_window_wayland_sync (window=0x87d2d50) at gstvaapiwindow_wayland.c:162
#8  gst_vaapi_window_wayland_render (window=0x87d2d50, surface=0xb0a02860, src_rect=0xb017dbd0, dst_rect=0x88bdbe0, flags=0) at gstvaapiwindow_wayland.c:514
#9  0xb3c5a2fb in gst_vaapi_window_put_surface (window=0x87d2d50, surface=surface at entry=0xb0a02860, src_rect=0xb017dbd0, src_rect at entry=0x0, dst_rect=<optimized out>, dst_rect at entry=0x88bdbe0,
    flags=flags at entry=0) at gstvaapiwindow.c:435
#10 0xb3ccc1e1 in gst_vaapisink_put_surface (flags=0, surface_rect=<optimized out>, surface=0xb0a02860, sink=0x88bd958) at gstvaapisink.c:1150

// no wl_display_sync callback witt wl_display_displatch_pending
#0  0xb7c4ddd0 in _ecore_wl_input_cb_keyboard_enter () from /lib/libecore_wayland.so.1
#1  0xb6f16666 in ffi_call_SYSV () from /lib/libffi.so.6
#2  0xb6f163eb in ffi_call () from /lib/libffi.so.6
#3  0xb79a9ae5 in wl_closure_invoke () from /lib/libwayland-client.so.0
#4  0xb79a74c2 in dispatch_queue () from /lib/libwayland-client.so.0
#5  0xb79a803e in wl_display_dispatch_queue_pending () from /lib/libwayland-client.so.0
#6  0xb79a8162 in wl_display_dispatch_pending () from /lib/libwayland-client.so.0
#7  0xb3ca72a6 in gst_vaapi_window_wayland_sync (window=0x87d2950) at gstvaapiwindow_wayland.c:162
#8  gst_vaapi_window_wayland_render (window=0x87d2950, surface=0xb0a02860, src_rect=0xb017dbd0, dst_rect=0x88bd850, flags=0) at gstvaapiwindow_wayland.c:514
#9  0xb3c5a2fb in gst_vaapi_window_put_surface (window=0x87d2950, surface=surface at entry=0xb0a02860, src_rect=0xb017dbd0, src_rect at entry=0x0, dst_rect=<optimized out>, dst_rect at entry=0x88bd850,
    flags=flags at entry=0) at gstvaapiwindow.c:435
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20131029/abe97d65/attachment.html>


More information about the wayland-devel mailing list