openAVproductions / openAV-Luppp

Luppp is a live performance tool, created by OpenAV productions.
http://openavproductions.com/luppp
GNU General Public License v3.0
256 stars 43 forks source link

Jack buffersize is updated when changed after Luppp has loaded #328

Closed Spengreb closed 1 month ago

Spengreb commented 1 month ago

When using Pipewire, Luppp does not get updated when changing the Frames/Period setting in the Pipewire->Jack server. This may also be the case when using regular Jack - not sure. In fact, before this change, when using Pipewire, it would only adhere to the maximum quantum in Pipewire, and changing settings in the Pipewire->Jack server would make Luppp change the "pace" in which it goes through the BPM (e.g., 1024 frames/period results in 120 BPM but 512 frames/period feels like 240 BPM, even though Luppp reports 120 BPM).

I implemented jack_set_buffer_size_callback into Luppp so that when the buffer size is changed externally, it gets updated, and everything works as intended.

Just one thing I'm not sure about is the part in src/jacksendreturn.cxx that I have commented out. Removing this assertion had no adverse effects on me - as far as I can tell. Please let me know if this will cause more issues elsewhere, and I can see about fixing why these values differ.

harryhaaren commented 1 month ago

Hi! Thanks for the PR, generally your changes seem logical and nice. Regarding "any bad effects" of commenting that assert, I think the buffer-size change could cause issues with the resampling logic, causing a little "click" because the input samples != output samples. That said, its a whole lot better than not working as expected at all, and the resampling is bad/slightly-broken anyway (unfortnately..)

So lets merge this! Thanks again, -Harry