Wouldn't it just be cleaner to unset and the set back DISPLAY around 
where you initialize pulse? The "TLDR" in the readme will probably never 
find its way to the users who will just complain/swear (and rightfully so).

--
Tom.

On 21/10/15 22:25, Mike Blumenkrantz wrote:
> discomfitor pushed a commit to branch master.
>
> http://git.enlightenment.org/core/enlightenment.git/commit/?id=6eefae48229c76e9396602f39903ed9c396d2e3c
>
> commit 6eefae48229c76e9396602f39903ed9c396d2e3c
> Author: Mike Blumenkrantz <zm...@osg.samsung.com>
> Date:   Wed Oct 21 17:17:49 2015 -0400
>
>      add hacks to work around pulseaudio+xwayland integration deadlocks
>
>      enlightenment is (I think) the first wayland compositor to run with
>      in-process pulseaudio integration for audio playback and not just mixer
>      support. hooray.
>
>      this results in a fun issue: if DISPLAY is set, as it must be for x11
>      clients to function, pulseaudio will unconditionally attempt to use a
>      blocking socket connection to create a connection to the running xserver.
>      the only exception here is if x11 support has been compiled out of 
> pulseaudio,
>      but probably no distro will do that ever.
>
>      so, what happens when the compositor thread tries to create a socket 
> connection
>      to the xserver that the compositor thread has not yet started? 
> absolutely nothing.
>      forever.
>
>      the easiest solution which continues to provide the key press sounds 
> that everyone
>      loves is to ensure that the pulseaudio connection is created before 
> DISPLAY is ever
>      set, namely in the xwayland module init.
>
>      this will now occur automatically now in the case when the mixer module 
> detects
>      pulseaudio support.
>
>      TL;DR: don't disable mixer module if you use xwayland
> ---
>   README.wayland                    | 3 +++
>   configure.ac                      | 4 ++--
>   src/modules/xwayland/e_mod_main.c | 7 +++++++
>   3 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/README.wayland b/README.wayland
> index 53e9ee7..61e357b 100644
> --- a/README.wayland
> +++ b/README.wayland
> @@ -52,6 +52,9 @@ to try out XWayland support:
>
>     --enable-xwayland
>
> +NOTE: DO NOT DISABLE THE MIXER MODULE BUILD IF YOU ARE USING XWAYLAND.
> +You have been warned.
> +
>   At this stage, you should have EFL properly built, and Enlightenment
>   properly built. Let's move on to running it...
>
> diff --git a/configure.ac b/configure.ac
> index cbcbac1..fcfeebd 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -682,7 +682,7 @@ define([CHECK_MODULE_MIXER],
>     AC_E_CHECK_PKG(ALSA, [alsa >= 1.0.8],
>       [ ], [ ])
>    AC_E_CHECK_PKG([PULSE], [libpulse-simple libpulse],
> -    [ ], [ ])
> +    [AC_DEFINE_UNQUOTED([HAVE_PULSE], [1], [have pulseaudio])], [ ])
>   ])
>
>   SHM_OPEN_LIBS=""
> @@ -837,7 +837,7 @@ HAVE_XWAYLAND_DEPS=false
>   define([CHECK_MODULE_XWAYLAND],
>   [
>     if test "x${have_wayland}" = "xyes"; then
> -    AC_E_CHECK_PKG(XWAYLAND, [ ecore >= ${efl_version} ecore-x >= 
> ${efl_version}  ], [HAVE_XWAYLAND_DEPS=true], [HAVE_XWAYLAND_DEPS=false])
> +    AC_E_CHECK_PKG(XWAYLAND, [ ecore >= ${efl_version} ecore-x >= 
> ${efl_version} ecore-audio >= ${efl_version}  ], [HAVE_XWAYLAND_DEPS=true], 
> [HAVE_XWAYLAND_DEPS=false])
>       AC_PATH_PROG([XWAYLAND_BIN], [Xwayland], [false])
>     else
>       HAVE_XWAYLAND_DEPS=false
> diff --git a/src/modules/xwayland/e_mod_main.c 
> b/src/modules/xwayland/e_mod_main.c
> index 24fef04..e73e254 100644
> --- a/src/modules/xwayland/e_mod_main.c
> +++ b/src/modules/xwayland/e_mod_main.c
> @@ -2,6 +2,9 @@
>   #include <dlfcn.h>
>   #include <sys/socket.h>
>   #include <sys/un.h>
> +#ifdef HAVE_PULSE
> +# include <Ecore_Audio.h>
> +#endif
>
>   EINTERN void dnd_init(void);
>   EINTERN void dnd_shutdown(void);
> @@ -351,6 +354,10 @@ e_modapi_init(E_Module *m)
>      if (!(exs = calloc(1, sizeof(E_XWayland_Server))))
>        return NULL;
>
> +#ifdef HAVE_PULSE
> +   eo_del(eo_add(ECORE_AUDIO_OUT_PULSE_CLASS, NULL));
> +#endif
> +
>      /* record wayland display */
>      exs->wl_disp = e_comp_wl->wl.disp;
>
>


------------------------------------------------------------------------------
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to