Closed zploskey closed 6 years ago
Can you share the generated sdl2.pc file? And run echo $WAYLAND_DISPLAY
maybe.. we might be getting a false positive on that detection.
If you get a non-empty value for WAYLAND_DISPLAY, you could try launching without it with WAYLAND_DISPLAY= ./lib/bs/native/index.native
or something like that
$WAYLAND_DISPLAY
is not set, as it's running under X11.
sdl2.pc:
# sdl pkg-config source file
prefix=/home/zach/src/reprocessing-example/node_modules/sdl2
exec_prefix=${prefix}
libdir=/home/zach/src/reprocessing-example/node_modules/sdl2
includedir=${prefix}/include
Name: sdl2
Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
Version: 2.0.5
Requires:
Conflicts:
Libs: -L${libdir} -Wl,-rpath,${libdir} -Wl,--enable-new-dtags -lSDL2
Libs.private: -lSDL2 -Wl,--no-undefined -lm -ldl -lpthread -lrt
Cflags: -I${includedir}/SDL2 -D_REENTRANT
Anything here help? https://wiki.libsdl.org/FAQLinux#I_get_the_error:_.22no_video_devices_available.22
DISPLAY=:0 ; export DISPLAY
I've also seen people talking about needing to install xorg-dev
but maybe that's a worst-case scenario :/
Display is already set to :0
so adding that made no difference. I tried installing xorg-dev
as well as libsdl2-dev fcitx-libs-dev libibus-1.0-dev
as is done on Travis. No dice, it still can't find the video device.
Ohh! I just noticed that SDL is failing to build but npm install
happily continues. I removed the sdl2 directory from node_modules and tried again. I'll see if I can recover the build failure.
$ npm install
> sdl2@2.0.5 postinstall /home/zach/src/reprocessing-example/node_modules/sdl2
> node postinstall.js
No pre-built binaries for linux, downloading source
Unzip successful.
Building from source, will take a minute or two.
Failure while building SDL2, error: Error: stderr maxBuffer exceeded
reprocessing-example@ /home/zach/src/reprocessing-example
└─┬ Reprocessing@0.1.0 (git://github.com/schmavery/reprocessing.git#adf4abc8c75711567d5992caaaa44ea400324ec3)
└─┬ Reasongl@0.2.0 (git://github.com/bsansouci/reasongl.git#e664d18961a49960fbedb8fcaa941a7b45276fe3)
└─┬ Tsdl@0.9.1 (git://github.com/bsansouci/tsdl.git#197cb1337397035d7a24190c52f3b4549a4a17da)
└── sdl2@2.0.5 (git://github.com/bsansouci/SDL-mirror.git#6b82b8c64064dfa1c389001156b2cfddc0635a20)
Crazy that it's even able to give that error without building correctly o.O Mhh... npm bug? https://github.com/nodegit/nodegit/issues/1103#issuecomment-240591421 :/
Maybe there's a better way, but I just went into node_modules/sdl2
directory and ran ./configure
and make
. Here's the tail end of the make command.
...
CC build/SDL_udev.lo
CC build/SDL_evdev.lo
LTLINK build/libSDL2.la
build/.libs/SDL_mirvideo.o: In function `MIR_InitDisplayFromOutput':
/home/zach/src/reprocessing-example/node_modules/sdl2/src/video/mir/SDL_mirvideo.c:258: undefined reference to `mir_output_get_current_mode'
collect2: error: ld returned 1 exit status
Makefile:147: recipe for target 'build/libSDL2.la' failed
make: *** [build/libSDL2.la] Error 1
I don't think they still use Mir in Ubuntu 18.04, since they switched from Unity to Gnome as the default desktop and it uses either X11 (default in Ubuntu) or Wayland. Maybe this is addressed in a more recent SDL2?
By the way, I upgraded to npm 4 and it still doesn't consider the failure while building SDL2 to be reason enough to error out.
Mhh, maybe you're right, I wonder if this is related https://hg.libsdl.org/SDL/rev/cd67e676bca7
It seems to just swap the default in the configure script, can we try --disable-video-mir
or --enable-video-mir=no
when running configure or something?
Hey alright, adding --disable-video-mir
to the ./configure
command in the postinstall script allowed it to build successfully.
Woo progress! thanks for troubleshooting. If you don't beat me to it, I'll update sdl-mirror#fast later today
:tada:
still having this issue on 20.04
This is a fresh install of Ubuntu 18.04 as of yesterday, running Gnome on X11, which is the default.