dagargo / overwitch

JACK client for Overbridge devices
GNU General Public License v3.0
139 stars 18 forks source link

"Invalid ratio" error from resampler.c when initialising via pw-jack #65

Closed aendra-rininsland closed 1 month ago

aendra-rininsland commented 1 month ago

Hi!

@kingajanicka and I are running into a intermittent problem with Overwitch upon initialisation, we're not entirely sure what the root cause is.

Sometimes it's fine and that error doesn't occur, other times it does. When it does, Overwitch crashes shortly afterwards without any additional output:

ERROR:jclient.c:101:(jclient_thread_xrun_cb): JACK xrun
ERROR:resampler.c:424:(ow_resampler_compute_ratios): Invalid ratio -17.419766 detected. Stopping resampler...
ERROR:resampler.c:424:(ow_resampler_compute_ratios): Invalid ratio -43.962855 detected. Stopping resampler...

We've tried changing a few latency settings and it doesn't seem to impact it. It might be a memory error because we're running in a fairly memory-constrained environment (8gb Raspberry Pi 5).

Any help or ideas very very much appreciated, it's kind of the last bug we need to squash before we ship our project.

Thank you! 💚

Full log in verbose mode below:

DEBUG:overwitch.c:314:ow_get_device_desc_from_vid_pid: Failed to open file “/home/pushpin/.config/overwitch/devices.json”: No such file or directory
DEBUG:overwitch.c:320:ow_get_device_desc_from_vid_pid: Falling back to /usr/local/share/overwitch/devices.json...
DEBUG:overwitch.c:378:ow_get_device_desc_from_vid_pid: Device with PID 16 found
DEBUG:overwitch.c:240:ow_get_usb_device_list: Found Analog Rytm MKII (bus 003, address 003, ID 1935:0010)
DEBUG:overwitch.c:314:ow_get_device_desc_from_vid_pid: Failed to open file “/home/pushpin/.config/overwitch/devices.json”: No such file or directory
DEBUG:overwitch.c:320:ow_get_device_desc_from_vid_pid: Falling back to /usr/local/share/overwitch/devices.json...
DEBUG:overwitch.c:378:ow_get_device_desc_from_vid_pid: Device with PID 16 found
DEBUG:engine.c:642:ow_engine_init: USB transfer timeout: 10
DEBUG:engine.c:542:ow_engine_init_mem: Blocks per transfer: 24
DEBUG:engine.c:1377:ow_engine_load_overbridge_name: USB control in data (32 B): Analog Rytm
DEBUG:engine.c:1397:ow_engine_load_overbridge_name: USB control in data (16 B): 0146        1.70
DEBUG:jclient.c:218:jclient_set_sample_rate_cb: JACK sample rate: 48000
DEBUG:resampler.c:615:ow_resampler_set_samplerate: Setting resampler sample rate to 48000
DEBUG:jclient.c:819:jclient_run: Using RT priority 77...
DEBUG:jclient.c:821:jclient_run: Registering ports...
DEBUG:engine.c:1203:ow_engine_start: Starting h2o MIDI thread...
DEBUG:engine.c:1216:ow_engine_start: Starting audio and o2h MIDI thread...
DEBUG:jclient.c:208:jclient_set_buffer_size_cb: JACK buffer size: 128
DEBUG:resampler.c:602:ow_resampler_set_buffer_size: Setting resampler buffer size to 128
DEBUG:jclient.c:208:jclient_set_buffer_size_cb: JACK buffer size: 1024
DEBUG:resampler.c:602:ow_resampler_set_buffer_size: Setting resampler buffer size to 1024
DEBUG:jclient.c:208:jclient_set_buffer_size_cb: JACK buffer size: 128
DEBUG:resampler.c:602:ow_resampler_set_buffer_size: Setting resampler buffer size to 128
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
DEBUG:jclient.c:208:jclient_set_buffer_size_cb: JACK buffer size: 1024
DEBUG:resampler.c:602:ow_resampler_set_buffer_size: Setting resampler buffer size to 1024
DEBUG:engine.c:1076:run_audio_o2h_midi: Clearing buffers...
DEBUG:jclient.c:193:jclient_jack_graph_order_cb: JACK calling graph order...
ERROR:resampler.c:424:(ow_resampler_compute_ratios): Invalid ratio -186.894161 detected. Stopping resampler...
DEBUG:jclient.c:208:jclient_set_buffer_size_cb: JACK buffer size: 128
DEBUG:resampler.c:602:ow_resampler_set_buffer_size: Setting resampler buffer size to 128
ERROR:jclient.c:101:(jclient_thread_xrun_cb): JACK xrun
DEBUG:jclient.c:930:jclient_run: Exiting...
DEBUG:jclient.c:200:jclient_jack_client_registration_cb: JACK client Analog Rytm is being unregistered...
failed to link ports: No such file or directory
dagargo commented 1 month ago

Generally speaking, setting up all the things to run any JACK application is quite complicated specially when taking PipeWire into consideration.

More specifically, I've found this error in the past too. Sometimes it was Overwitch but sometimes it was PipeWire. But I think it's a thing of the past now.

ERROR:resampler.c:424:(ow_resampler_compute_ratios): Invalid ratio -186.894161 detected. Stopping resampler...

In your case, I'd say 8 GB is more than enough but this depends on what other things are you running. However, let's forget about this for now and check the basics.

aendra-rininsland commented 1 month ago

Never mind, it's on our end! We thought we didn't have the pro-audio profile because we looked for it before we upgraded Pipewire; we've since switched to that as per the README and everything is working splendidly now. Sorry for the hassle!

dagargo commented 1 month ago

No worries!

I'm glad it's working now.