nikp123 / xava

X11 Audio Visualizer for ALSA
http://nikp123.github.io/xava
Other
134 stars 15 forks source link

Disable support for Wayland #53

Closed sabrehagen closed 11 months ago

sabrehagen commented 1 year ago

I know when building from source "you're on your own", but hopefully this is an acceptable question.

I'm building from source for use with X11. Which flag(s) can be supplied to make to disable support for Wayland?

Encountering error:

[ 32%] Built target cairo_bars
[ 32%] Building C object CMakeFiles/out_wayland_cairo.dir/src/output/graphical_wayland/main.c.o
In file included from /home/jackson/repositories/tmp/xava/src/output/graphical_wayland/main.c:13:
/home/jackson/repositories/tmp/xava/src/output/graphical_wayland/wl_output.h:4:10: fatal error: gen/xdg-output-unstable-v1-client-protocol.h: No such file or directory
    4 | #include "gen/xdg-output-unstable-v1-client-protocol.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/out_wayland_cairo.dir/build.make:79: CMakeFiles/out_wayland_cairo.dir/src/output/graphical_wayland/main.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:270: CMakeFiles/out_wayland_cairo.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
nikp123 commented 1 year ago

Should be as simple as adding -DWAYLAND=OFF to cmake args (not make). I should document these at some point, whoops.

PS: The gen files being missing is also a bug, that has to be fixed.

sabrehagen commented 1 year ago

Progress made, but out_x11.so is not produced in the build output.

▶ make
[  7%] Built target iniparser
[ 26%] Built target xava-shared
[ 30%] Built target cairo_kinetic
[ 35%] Built target cairo_stars
[ 40%] Built target in_alsa
[ 45%] Built target filter_default
[ 47%] Building C object CMakeFiles/out_x11_egl.dir/src/output/graphical_x11/main.c.o
[ 50%] Building C object CMakeFiles/out_x11_egl.dir/src/output/shared/graphical.c.o
[ 52%] Building C object CMakeFiles/out_x11_egl.dir/src/output/shared/gl/egl.c.o
[ 54%] Building C object CMakeFiles/out_x11_egl.dir/src/output/shared/gl/main.c.o
[ 57%] Linking C shared library out_x11_egl.so
[ 57%] Built target out_x11_egl
Scanning dependencies of target out_x11_cairo
[ 59%] Building C object CMakeFiles/out_x11_cairo.dir/src/output/graphical_x11/main.c.o
[ 61%] Building C object CMakeFiles/out_x11_cairo.dir/src/output/shared/graphical.c.o
[ 64%] Building C object CMakeFiles/out_x11_cairo.dir/src/output/shared/cairo/main.c.o
[ 66%] Building C object CMakeFiles/out_x11_cairo.dir/src/output/shared/cairo/util/module.c.o
/home/jackson/repositories/tmp/xava/src/output/shared/cairo/util/module.c: In function ‘xava_cairo_module_check_compatibility’:
/home/jackson/repositories/tmp/xava/src/output/shared/cairo/util/module.c:37:10: warning: variable ‘pass’ set but not used [-Wunused-but-set-variable]
   37 |     bool pass = true;
      |          ^~~~
[ 69%] Building C object CMakeFiles/out_x11_cairo.dir/src/output/shared/cairo/util/feature_compat.c.o
[ 71%] Building C object CMakeFiles/out_x11_cairo.dir/src/output/shared/cairo/util/region.c.o
[ 73%] Linking C shared library out_x11_cairo.so
[ 73%] Built target out_x11_cairo
Scanning dependencies of target cairo_bars
[ 76%] Building C object CMakeFiles/cairo_bars.dir/src/output/shared/cairo/modules/bars/main.c.o
[ 78%] Linking C shared library cairo/module/bars/module.so
[ 78%] Built target cairo_bars
Scanning dependencies of target in_fifo
[ 80%] Building C object CMakeFiles/in_fifo.dir/src/input/fifo/main.c.o
[ 83%] Linking C shared library in_fifo.so
[ 83%] Built target in_fifo
Scanning dependencies of target in_sndio
[ 85%] Building C object CMakeFiles/in_sndio.dir/src/input/sndio/main.c.o
[ 88%] Linking C shared library in_sndio.so
[ 88%] Built target in_sndio
Scanning dependencies of target in_pulseaudio
[ 90%] Building C object CMakeFiles/in_pulseaudio.dir/src/input/pulseaudio/main.c.o
[ 92%] Linking C shared library in_pulseaudio.so
[ 92%] Built target in_pulseaudio
Scanning dependencies of target xava
[ 95%] Building C object CMakeFiles/xava.dir/src/config.c.o
[ 97%] Building C object CMakeFiles/xava.dir/src/xava.c.o
[100%] Linking C executable xava
[100%] Built target xava

▶ sudo make install
[  7%] Built target iniparser
[ 26%] Built target xava-shared
[ 30%] Built target cairo_kinetic
[ 35%] Built target cairo_stars
[ 40%] Built target in_alsa
[ 45%] Built target filter_default
[ 57%] Built target out_x11_egl
[ 73%] Built target out_x11_cairo
[ 78%] Built target cairo_bars
[ 83%] Built target in_fifo
[ 88%] Built target in_sndio
[ 92%] Built target in_pulseaudio
[100%] Built target xava
Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/share/xava/cairo/module/bars/module.so
-- Installing: /usr/share/xava/cairo/module/kinetic/module.so
-- Installing: /usr/share/xava/cairo/module/stars/module.so
-- Installing: /usr/lib/xava/filter_default.so
-- Set runtime path of "/usr/lib/xava/filter_default.so" to ""
-- Installing: /usr/lib/xava/out_x11_egl.so
-- Set runtime path of "/usr/lib/xava/out_x11_egl.so" to ""
-- Installing: /usr/lib/xava/out_x11_cairo.so
-- Set runtime path of "/usr/lib/xava/out_x11_cairo.so" to ""
-- Installing: /usr/lib/xava/in_alsa.so
-- Set runtime path of "/usr/lib/xava/in_alsa.so" to ""
-- Installing: /usr/lib/xava/in_fifo.so
-- Set runtime path of "/usr/lib/xava/in_fifo.so" to ""
-- Installing: /usr/lib/xava/in_pulseaudio.so
-- Set runtime path of "/usr/lib/xava/in_pulseaudio.so" to ""
-- Installing: /usr/lib/xava/in_sndio.so
-- Set runtime path of "/usr/lib/xava/in_sndio.so" to ""
-- Installing: /usr/lib/libxava-shared.so
-- Installing: /usr/bin/xava
-- Set runtime path of "/usr/bin/xava" to ""
-- Installing: /usr/share/licenses/xava/final-LICENSE.txt
-- Installing: /usr/share/xava/config.example
-- Installing: /usr/share/xava/gl/shaders/default/vertex.glsl.example
-- Installing: /usr/share/xava/gl/shaders/kinetic/vertex.glsl.example
-- Installing: /usr/share/xava/gl/shaders/shadow/vertex.glsl.example
-- Installing: /usr/share/xava/gl/shaders/default/fragment.glsl.example
-- Installing: /usr/share/xava/gl/shaders/kinetic/fragment.glsl.example
-- Installing: /usr/share/xava/gl/shaders/shadow/fragment.glsl.example
-- Installing: /usr/share/xava/gl/shaders/default/config.ini.example
-- Installing: /usr/share/xava/gl/shaders/kinetic/config.ini.example
-- Installing: /usr/share/applications/xava.desktop
-- Installing: /usr/share/icons/hicolor/scalable/apps/xava.svg
▶ xava
[WARN] xavaFindAndCheckFile at /home/jackson/repositories/tmp/xava/src/shared/io.c:202 - The current system does not support XDG_CONFIG_HOME.
There is a high likelyhood that something may be broken
at /lib/libxava-shared.so(xavaFindAndCheckFile+0xe2) [0x7f25c97d9e6d]
at xava(+0x316e) [0x562b4b12d16e]
at xava(+0x3e41) [0x562b4b12de41]
at /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f25c9494083]
at xava(+0x260e) [0x562b4b12c60e]
[INFO] xava_module_load at /home/jackson/repositories/tmp/xava/src/shared/module/unix.c:64 - Module loaded 'in_pulseaudio' loaded at 0x562b4c624af0
[INFO] xava_module_load at /home/jackson/repositories/tmp/xava/src/shared/module/unix.c:64 - Module loaded 'out_x11' loaded at (nil)
[ERROR] validate_config at /home/jackson/repositories/tmp/xava/src/config.c:79 - Output method 'x11' could not load.
Reason: /usr/lib/xava/out_x11.so: cannot open shared object file: No such file or directory
at xava(+0x2ac6) [0x562b4b12cac6]
at xava(+0x399b) [0x562b4b12d99b]
at xava(+0x3e41) [0x562b4b12de41]
at /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f25c9494083]
at xava(+0x260e) [0x562b4b12c60e]
▶ ls -l /usr/lib/xava
.rw-r--r--  38k root 16 May 12:37 filter_default.so
.rw-r--r--  28k root 16 May 12:37 in_alsa.so
.rw-r--r--  22k root 16 May 12:37 in_fifo.so
.rw-r--r--  30k root 16 May 12:37 in_pulseaudio.so
.rw-r--r--  23k root 16 May 12:37 in_sndio.so
.rw-r--r--  93k root 16 May 12:37 out_x11_cairo.so
.rw-r--r-- 589k root 16 May 12:37 out_x11_egl.so
nikp123 commented 1 year ago

Oh, whoops. That's a change I made a while ago, the output modules aren't per platform anymore, but by graphical API. Select either cairo or opengl.

Platform detection is done automatically.

nikp123 commented 1 year ago

(bump) Have you been able to test this?

sabrehagen commented 1 year ago

I was able to test it by manually symlinking out_x11_cairo.so to out_x11.so, which worked. I didn't know how to "Select either cairo or opengl" as recommended by your comment.

nikp123 commented 1 year ago

Oh, sorry, what I meant by that is that you just select the graphics API to use. The windowing stuff is done automatically. I'm leaving this up when i get to clean up the README.

sabrehagen commented 1 year ago

How does one just select the graphics API to use?

nikp123 commented 1 year ago

Ok sorry for being short on information, but what I meant was that XAVA uses a slightly altered way of choosing graphics options than regular CAVA (which this was originally a fork of). Sorry if I made this too descriptive, I just wanted to avoid further confusion.

Before I start, there's a difference between graphics API and window API.

Window APIs are responsible for setting up the window in the context of the operating system. You probably use X11 and that's what all apps use to talk to the system when wanting to display a user interface.

Graphics API on the other hand is what the application uses to talk to your graphics hardware in order to not rely on the CPU for the graphics.

The original system chose directly what windowing backend you'll use, lets say ncurses, win32 or x11. However I wanted to experiment with graphics APIs be it opengl, cairo or even vulkan (maybe not, but who knows). But in order to do that I had to wrap the original wayland, x11 and win32 window APIs with the proper setup functions for each of the "graphics APIs". This increased maintenance burden SIGNIFICANTLY and as such I've decided that a single "module" (thats what I call a single code-path responsible for either graphics, audio or audio processing) should NOT have to bare the responsibility of managing all the graphics API "quirkiness". So I've decided that from the end-users perspective, what windowing API they use shouldn't really matter and just focus on providing them the ability to chose what "graphics API" they want (because they offer differing feature sets).

So in order for someone to use a graphics API, they just set:

[output]
method = cairo # to use cairo graphics

or method = opengl to use OpenGL graphics.

The window API stuff is done automatically, aka. you should not care whether or not the system supports X11/wayland. It will always chose what it thinks is the best.

PS: I should really clean up README for this to make it more clear.

tl;dr: XAVA isn't really intended to chose what window API specifically you want, it does that automatically, you just have to set whether or not to use OpenGL or Cairo. The windowing stuff is done automatically.

nikp123 commented 1 year ago

Of course, since I've done this change there is a lot of leftovers and hence wasn't making release builds because I knew that would confuse people about how they configure the visualizer.

Ranguvar commented 11 months ago

I tried latest git with latest Arch running sway (wlroots compositor). XDG_CURRENT_DESKTOP=sway

Even built with -DWAYLAND=OFF, by default there's no terminal output and no window. If I configure output method to opengl, cairo, wayland_opengl, or wayland_cairo, same issue. If I use x11_opengl or x11_cairo, I get an empty transparent window that does nothing and no terminal output. If I use sdl2_opengl, I get a blank white window (SDL_VIDEODRIVER=wayland).

nikp123 commented 11 months ago

I tried latest git with latest Arch running sway (wlroots compositor). XDG_CURRENT_DESKTOP=sway

Even built with -DWAYLAND=OFF, by default there's no terminal output and no window. If I configure output method to opengl, cairo, wayland_opengl, or wayland_cairo, same issue. If I use x11_opengl or x11_cairo, I get an empty transparent window that does nothing and no terminal output. If I use sdl2_opengl, I get a blank white window (SDL_VIDEODRIVER=wayland).

That seems to be a default configuration issue on my part, sorry. Should be fixing that soon.