From 1fa0d99a5e572f7cd6d00ae07b87ba3f79dc2de4 Mon Sep 17 00:00:00 2001 From: marcu5h <12570144-Marcu5H@users.noreply.gitlab.com> Date: Sat, 22 Jul 2023 15:41:51 +0200 Subject: [PATCH 01/14] Fetch all available SDL events when drawn --- output/sdl_cava.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/output/sdl_cava.c b/output/sdl_cava.c index 831bcc6c..6273993c 100644 --- a/output/sdl_cava.c +++ b/output/sdl_cava.c @@ -178,15 +178,16 @@ int draw_sdl(int bars_count, int bar_width, int bar_spacing, int remainder, int SDL_Delay(frame_time); - SDL_PollEvent(&e); - if (e.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) { - rc = -1; - if (gradient) { - free(gradient_colors_sdl); + while (SDL_PollEvent(&e)) { + if (e.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) { + rc = -1; + if (gradient) { + free(gradient_colors_sdl); + } } + if (e.type == SDL_QUIT) + rc = -2; } - if (e.type == SDL_QUIT) - rc = -2; return rc; } From 522063d19283862e7d486e75d753edb5bccf329b Mon Sep 17 00:00:00 2001 From: karl Date: Mon, 31 Jul 2023 11:51:21 +0200 Subject: [PATCH 02/14] Update README.md add note about konsole not supporting gradient #515 --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 2946d424..51c6139b 100644 --- a/README.md +++ b/README.md @@ -403,6 +403,9 @@ So in `cava.psf`, the characters 1-7 are actually replaced by Unicode characters Actually, `setfont` is supposed to return the default font, but this usually isn't set. I haven't found another way to get the current font. So cava sets the font to "Lat2-Fixed16" when interrupted. All major distros should have it. It will revert to your default font at reboot. +### Gradient not working in Konsole + +Konsole simply does not support this. #194 Usage ----- From 83b4cda8177c780c7895ae67384c2679e84cc0d9 Mon Sep 17 00:00:00 2001 From: karl Date: Sun, 6 Aug 2023 20:46:00 +0200 Subject: [PATCH 03/14] bump hardcoded version to 0.9.0 --- autogen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh index bb14b92d..658c8e3f 100755 --- a/autogen.sh +++ b/autogen.sh @@ -3,7 +3,7 @@ if [ -d .git ]; then git describe --always --tags --dirty > version # get version from git else - echo 0.8.3 > version # hard coded versions + echo 0.9.0 > version # hard coded versions fi libtoolize From b05f8290f65ac62b38c7a7d8395f00b032597f3b Mon Sep 17 00:00:00 2001 From: karl Date: Thu, 10 Aug 2023 23:22:36 +0200 Subject: [PATCH 04/14] fix bug in default input mechanism #518 --- config.c | 6 +++--- example_files/config | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config.c b/config.c index 410b449a..d002ccae 100644 --- a/config.c +++ b/config.c @@ -45,7 +45,7 @@ const char *default_shader_name[NUMBER_OF_SHADERS] = {"northern_lights.frag", "p double smoothDef[5] = {1, 1, 1, 1, 1}; enum input_method default_methods[] = { - INPUT_FIFO, INPUT_PORTAUDIO, INPUT_ALSA, INPUT_PULSE, INPUT_WINSCAP, + INPUT_FIFO, INPUT_PORTAUDIO, INPUT_ALSA, INPUT_PIPEWIRE, INPUT_PULSE, INPUT_WINSCAP, }; char *outputMethod, *orientation, *channels, *xaxisScale, *monoOption, *fragmentShader, @@ -674,11 +674,11 @@ bool load_config(char configPath[PATH_MAX], struct config_params *p, bool colors free(p->audio_source); - int default_input = -1; + enum input_method default_input = INPUT_FIFO; for (size_t i = 0; i < ARRAY_SIZE(default_methods); i++) { enum input_method method = default_methods[i]; if (has_input_method[method]) { - default_input++; + default_input = default_methods[i]; } } char *input_method_name = diff --git a/example_files/config b/example_files/config index 89b7710e..92fb76f1 100644 --- a/example_files/config +++ b/example_files/config @@ -54,6 +54,7 @@ # Audio capturing method. Possible methods are: 'pulse', 'alsa', 'fifo', 'sndio' or 'shmem' # Defaults to 'pulse', 'pipewire', 'alsa' or 'fifo', in that order, dependent on what support cava was built with. +# On Mac it defaults to 'portaudio' or 'fifo' # On windows this is automatic and no input settings are needed. # # All input methods uses the same config variable 'source' From 4529de0cc9d5bd5afe3cf383bdee9a9b623c6136 Mon Sep 17 00:00:00 2001 From: karl Date: Fri, 11 Aug 2023 19:42:57 +0200 Subject: [PATCH 05/14] use pkgconf to get pipewire c flags #519 --- README.md | 9 +++++---- configure.ac | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 51c6139b..5da7cf6c 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ Required components: * libtool * automake * autoconf-archive (needed for setting up OpenGL) +* pkgconf * build-essentials * [iniparser](https://github.com/ndevilla/iniparser) @@ -86,22 +87,22 @@ All the requirements can be installed easily in all major distros: Debian/Ubuntu: - sudo apt install build-essential libfftw3-dev libasound2-dev libncursesw5-dev libpulse-dev libtool automake autoconf-archive libiniparser-dev libsdl2-2.0-0 libsdl2-dev libpipewire-0.3-dev + sudo apt install build-essential libfftw3-dev libasound2-dev libncursesw5-dev libpulse-dev libtool automake autoconf-archive libiniparser-dev libsdl2-2.0-0 libsdl2-dev libpipewire-0.3-dev pkgconf ArchLinux: - pacman -S base-devel fftw ncurses alsa-lib iniparser pulseaudio autoconf-archive + pacman -S base-devel fftw ncurses alsa-lib iniparser pulseaudio autoconf-archive pkgconf openSUSE: - zypper install alsa-devel ncurses-devel fftw3-devel libpulse-devel libtool autoconf-archive + zypper install alsa-devel ncurses-devel fftw3-devel libpulse-devel libtool autoconf-archive pkgconf Fedora: - dnf install alsa-lib-devel ncurses-devel fftw3-devel pulseaudio-libs-devel libtool autoconf-archive iniparser-devel + dnf install alsa-lib-devel ncurses-devel fftw3-devel pulseaudio-libs-devel libtool autoconf-archive iniparser-devel pkgconf macOS: diff --git a/configure.ac b/configure.ac index ca608b96..35b49c54 100644 --- a/configure.ac +++ b/configure.ac @@ -105,10 +105,10 @@ AC_ARG_ENABLE([input_pipewire], ) AS_IF([test "x$enable_input_pipewire" != "xno"], [ - AC_CHECK_LIB(pipewire-0.3, pw_stream_connect, have_pipewire=yes, have_pipewire=no) + PKG_CHECK_MODULES(PIPEWIRE, libpipewire-0.3, have_pipewire=yes, have_pipewire=no) if [[ $have_pipewire = "yes" ]] ; then - LIBS="$LIBS -lpipewire-0.3" - CPPFLAGS="$CPPFLAGS -DPIPEWIRE -D_REENTRANT -I/usr/include/pipewire-0.3 -I/usr/include/spa-0.2" + LIBS="$LIBS $PIPEWIRE_LIBS" + CPPFLAGS="$CPPFLAGS -DPIPEWIRE $PIPEWIRE_CFLAGS" fi if [[ $have_pipewire = "no" ]] ; then From 81211e9e16302312ee4322a99840c110bce0e13d Mon Sep 17 00:00:00 2001 From: karl Date: Sat, 12 Aug 2023 17:47:21 +0200 Subject: [PATCH 06/14] bump hardcoded version to 0.9.1 --- autogen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh index 658c8e3f..161b26d1 100755 --- a/autogen.sh +++ b/autogen.sh @@ -3,7 +3,7 @@ if [ -d .git ]; then git describe --always --tags --dirty > version # get version from git else - echo 0.9.0 > version # hard coded versions + echo 0.9.1 > version # hard coded versions fi libtoolize From eb74b75dc98dce7b2fbd4faff83f788ec8665b30 Mon Sep 17 00:00:00 2001 From: karl Date: Sun, 3 Sep 2023 16:43:17 +0200 Subject: [PATCH 07/14] #521: add guard against setting sensitivity to zero --- config.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config.c b/config.c index d002ccae..1658449e 100644 --- a/config.c +++ b/config.c @@ -384,6 +384,10 @@ bool validate_config(struct config_params *p, struct error_s *error) { } // setting sens + if (p->sens < 1) { + write_errorf(error, "Sensitivity needs to be at least 1%%\n"); + return false; + } p->sens = p->sens / 100; return validate_colors(p, error); From fe95b754de07dc829c9e7d5f357218d048ead353 Mon Sep 17 00:00:00 2001 From: karl Date: Sun, 3 Sep 2023 19:51:44 +0200 Subject: [PATCH 08/14] pipewire: add better latency for input --- input/pipewire.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/input/pipewire.c b/input/pipewire.c index d9a109db..80919d7f 100644 --- a/input/pipewire.c +++ b/input/pipewire.c @@ -1,7 +1,9 @@ #include "input/pipewire.h" #include "input/common.h" +#include #include +#include #include @@ -73,6 +75,8 @@ void *input_pipewire(void *audiodata) { struct pw_properties *props; struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer)); char **argv; + uint32_t nom; + nom = nearbyint((10000 * data.cava_audio->rate) / 1000000.0); pw_init(0, &argv); @@ -83,13 +87,14 @@ void *input_pipewire(void *audiodata) { pw_properties_set(props, PW_KEY_TARGET_OBJECT, data.cava_audio->source); pw_properties_set(props, PW_KEY_STREAM_CAPTURE_SINK, "true"); + pw_properties_setf(props, PW_KEY_NODE_LATENCY, "%u/%u", nom, data.cava_audio->rate); data.stream = pw_stream_new_simple(pw_main_loop_get_loop(data.loop), "cava", props, &stream_events, &data); params[0] = spa_format_audio_raw_build( &b, SPA_PARAM_EnumFormat, - &SPA_AUDIO_INFO_RAW_INIT(.format = SPA_AUDIO_FORMAT_S16, .rate = 44100)); + &SPA_AUDIO_INFO_RAW_INIT(.format = SPA_AUDIO_FORMAT_S16, .rate = data.cava_audio->rate)); pw_stream_connect(data.stream, PW_DIRECTION_INPUT, PW_ID_ANY, PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_MAP_BUFFERS | From c3b2d664235df364797a70e67b631400901f8c69 Mon Sep 17 00:00:00 2001 From: karl Date: Sun, 3 Sep 2023 20:01:09 +0200 Subject: [PATCH 09/14] fix typo in error message about sdl_glsl support --- config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.c b/config.c index 1658449e..6f2f0fd2 100644 --- a/config.c +++ b/config.c @@ -220,7 +220,7 @@ bool validate_config(struct config_params *p, struct error_s *error) { if (strcmp(outputMethod, "sdl_glsl") == 0) { p->output = OUTPUT_SDL_GLSL; #ifndef SDL_GLSL - write_errorf(error, "cava was built without sdl support, install sdl dev files " + write_errorf(error, "cava was built without opengl support, install opengl dev files " "and run make clean && ./configure && make again\n"); return false; #endif From 6b66424431138181c18931c388fab33fc89f79b2 Mon Sep 17 00:00:00 2001 From: karl Date: Mon, 4 Sep 2023 18:42:55 +0200 Subject: [PATCH 10/14] core: remove bad overshoot protection code was not very usefull, only made visualization poorer --- cavacore.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cavacore.c b/cavacore.c index a261391b..84cc0d31 100644 --- a/cavacore.c +++ b/cavacore.c @@ -494,12 +494,6 @@ void cava_execute(double *cava_in, int new_samples, double *cava_out, struct cav cava_out[n] = p->cava_mem[n] * p->noise_reduction + cava_out[n]; p->cava_mem[n] = cava_out[n]; if (p->autosens) { - double diff = 1 - cava_out[n]; - if (diff < 0) - diff = 0; - double div = 1 / (diff + 1); - p->cava_mem[n] = p->cava_mem[n] * (1 - div / 20); - // check if we overshoot target height if (cava_out[n] > 1.0) { overshoot = 1; From e5149fea4e87a1ce560eb9c7540a07107f64323c Mon Sep 17 00:00:00 2001 From: karl Date: Mon, 4 Sep 2023 18:53:54 +0200 Subject: [PATCH 11/14] new cavacore test blueprint after last change --- cavacore_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cavacore_test.c b/cavacore_test.c index 69cade92..709b9e7d 100644 --- a/cavacore_test.c +++ b/cavacore_test.c @@ -20,8 +20,8 @@ void main() { double noise_reduction = 0.77; int low_cut_off = 50; int high_cut_off = 10000; - double blueprint_2000MHz[10] = {0, 0, 0, 0, 0, 0, 0.494, 0.449, 0, 0}; - double blueprint_200MHz[10] = {0, 0, 0.939, 0.008, 0, 0.001, 0, 0, 0, 0}; + double blueprint_2000MHz[10] = {0, 0, 0, 0, 0, 0, 0.493, 0.446, 0, 0}; + double blueprint_200MHz[10] = {0, 0, 0.978, 0.008, 0, 0.001, 0, 0, 0, 0}; printf("planning visualization with %d bars per channel, %d rate, %d channels, autosens, " "%.2f noise reduction, %d - %d MHz bandwith.\n", From e8fe9183109f40a6917d6da2fbe84caeea36c4ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Mom=C4=8Dilovi=C4=87?= Date: Wed, 13 Sep 2023 21:30:46 +0200 Subject: [PATCH 12/14] Fix spelling in windows README.md --- cava_win/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cava_win/README.md b/cava_win/README.md index 677ebc0e..94b3e593 100644 --- a/cava_win/README.md +++ b/cava_win/README.md @@ -1,11 +1,11 @@ # cava on windows -All dependencies should install themselves via the nuget thing: +All dependencies should install themselves via the NuGet thing: * SDL2 * FFTW * pthreads * glew -include paths are configure relativly to the project so linking and inlcuding should work autmatically with the nugets, but might stop workiong at some point. +include paths are configured relatively to the project so linking and including should work automatically with the nugets, but might stop working at some point. The Visual C++ Redistributable for Visual Studio 2012 (maybe also a newer one) was needed when I first ran it. From 01233e28c933fa1a19d2435c1c55fec32f6d3450 Mon Sep 17 00:00:00 2001 From: MrPenguin07 <127086564+MrPenguin07@users.noreply.github.com> Date: Mon, 18 Sep 2023 03:58:20 +0000 Subject: [PATCH 13/14] Minor spelling correction --- example_files/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example_files/config b/example_files/config index 92fb76f1..45c5e149 100644 --- a/example_files/config +++ b/example_files/config @@ -63,7 +63,7 @@ # For pulseaudio and pipewire 'source' will be the source. Default: 'auto', which uses the monitor source of the default sink # (all pulseaudio sinks(outputs) have 'monitor' sources(inputs) associated with them). # -# For piepwire 'source' will be the object name or object.serial of the device to capture from. +# For pipewire 'source' will be the object name or object.serial of the device to capture from. # Both input and output devices are supported. # # For alsa 'source' will be the capture device. From 5747f16ec457222874b40661f2adf7eaa1165633 Mon Sep 17 00:00:00 2001 From: karl Date: Thu, 28 Sep 2023 19:52:26 +0200 Subject: [PATCH 14/14] Update bug_report template --- .github/ISSUE_TEMPLATE/bug_report.md | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 10869f6a..4e14fa26 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,29 +7,42 @@ assignees: '' --- -**When/where was the bug introduced?** -- Are you using cava from a package repository, like AUR? -- If so, check out the master branch here, is your issue already resolved? -- Don't know how to clone, compile source code? File report to package maintainer instead. -- try using git bisect to find out where the bug was introduced. +**READ THIS BEFORE CREATING NEW ISSUE** + +Are you using cava from a package repository, like AUR? + +If so, clone the master branch from here, build and run. Is your issue already resolved? + +Don't know how to clone or compile source code? File report to package maintainer instead! + + **Describe the bug** + A clear and concise description of what the bug is. + **To Reproduce** + Steps to reproduce the behavior: 1. Set config parameter to 2. run 3. do something 4. See error + **Expected behavior** + A clear and concise description of what you expected to happen. + **Screenshots** + If applicable, add screenshots to help explain your problem. + **Desktop (please complete the following information):** + - OS: [e.g. macOS, Ubuntu] - Version [e.g. 22]