Skip to content

bluez5: don't use spa_invoke from data loop to main loop

P V requested to merge pvir/pipewire:no-data-invoke into master

spa_loop_invoke from data loop to main loop is not OK, as Wireplumber currently runs its main loop with "pw_loop_enter(); pw_loop_iterate(); pw_loop_leave();" which causes the loop to be entered only when it is processing an event.

In this case, part of the time the loop impl->thread==0, and calling spa_loop_invoke() at such time causes the callback to be run from the current thread, ie. in this case data loop which must not happen here.

Fix this by using eventfd instead, which is safe as the callback always runs from the main loop.

Eventfd is also slightly more natural here, as multiple events will group to the same mainloop cycle.

Edited by P V

Merge request reports