dagargo / overwitch

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

Can't get any sound from Digitakt - Unexpected frames with ratio #59

Closed spectromas closed 3 months ago

spectromas commented 4 months ago

I have previous used overwitch with my digitakt (mk1) on this system so I'm not sure what's changed but I cannot get any sound from it now. Running from the GUI, the status says 'Tuning' and the Overbridge to Jack Ratio grows and grows.

When I run from a terminal I get this, with the last message repeating constantly with the number getting larger each time:

overwitch-cli -vvvvv -d Digitakt                                                                                                                                                                    ✘ 127 master
DEBUG:overwitch.c:314:(ow_get_device_desc_from_vid_pid): Failed to open file “/home/alex/.config/overwitch/devices.json”: No such file or directory
DEBUG:overwitch.c:320:(ow_get_device_desc_from_vid_pid): Falling back to /usr/share/overwitch/devices.json...
DEBUG:overwitch.c:379:(ow_get_device_desc_from_vid_pid): Device with PID 12 found
DEBUG:overwitch.c:240:(ow_get_usb_device_list): Found Digitakt (bus 001, address 007, ID 1935:000c)
DEBUG:overwitch.c:314:(ow_get_device_desc_from_vid_pid): Failed to open file “/home/alex/.config/overwitch/devices.json”: No such file or directory
DEBUG:overwitch.c:320:(ow_get_device_desc_from_vid_pid): Falling back to /usr/share/overwitch/devices.json...
DEBUG:overwitch.c:379:(ow_get_device_desc_from_vid_pid): Device with PID 12 found
DEBUG:engine.c:619:(ow_engine_init): USB transfer timeout: 10
DEBUG:engine.c:526:(ow_engine_init_mem): Blocks per transfer: 24
DEBUG:engine.c:539:(ow_engine_init_mem): o2p: USB in frame size: 48 B
DEBUG:engine.c:540:(ow_engine_init_mem): p2o: USB out frame size: 8 B
DEBUG:engine.c:549:(ow_engine_init_mem): o2p: USB in block size: 368 B
DEBUG:engine.c:551:(ow_engine_init_mem): p2o: USB out block size: 88 B
DEBUG:engine.c:559:(ow_engine_init_mem): o2p: audio transfer size: 8064 B
DEBUG:engine.c:561:(ow_engine_init_mem): p2o: audio transfer size: 1344 B
DEBUG:engine.c:1305:(ow_engine_load_overbridge_name): USB control in data (32 B): Digitakt
DEBUG:engine.c:1325:(ow_engine_load_overbridge_name): USB control in data (16 B): 0084        1.50
DEBUG:jclient.c:178:(jclient_set_buffer_size_cb): JACK buffer size: 256
DEBUG:resampler.c:560:(ow_resampler_set_buffer_size): Setting resampler buffer size to 256
DEBUG:resampler.c:129:(ow_resampler_reset_buffers): Resetting buffers...
DEBUG:resampler.c:110:(ow_resampler_clear_buffers): Clearing buffers...
DEBUG:resampler.c:178:(ow_resampler_reset_dll): Resetting the DLL...
DEBUG:dll.c:114:(ow_dll_primary_reset): Target delay: 15.0 ms (720 frames)
DEBUG:jclient.c:188:(jclient_set_sample_rate_cb): JACK sample rate: 48000
DEBUG:resampler.c:573:(ow_resampler_set_samplerate): Setting resampler sample rate to 48000
DEBUG:resampler.c:178:(ow_resampler_reset_dll): Resetting the DLL...
DEBUG:dll.c:114:(ow_dll_primary_reset): Target delay: 15.0 ms (720 frames)
DEBUG:jclient.c:188:(jclient_set_sample_rate_cb): JACK sample rate: 48000
DEBUG:jclient.c:616:(jclient_run): Using RT priority 77...
DEBUG:jclient.c:618:(jclient_run): Registering ports...
DEBUG:jclient.c:623:(jclient_run): Registering output port Main L...
DEBUG:jclient.c:623:(jclient_run): Registering output port Main R...
DEBUG:jclient.c:623:(jclient_run): Registering output port Track 1...
DEBUG:jclient.c:623:(jclient_run): Registering output port Track 2...
DEBUG:jclient.c:623:(jclient_run): Registering output port Track 3...
DEBUG:jclient.c:623:(jclient_run): Registering output port Track 4...
DEBUG:jclient.c:623:(jclient_run): Registering output port Track 5...
DEBUG:jclient.c:623:(jclient_run): Registering output port Track 6...
DEBUG:jclient.c:623:(jclient_run): Registering output port Track 7...
DEBUG:jclient.c:623:(jclient_run): Registering output port Track 8...
DEBUG:jclient.c:623:(jclient_run): Registering output port Input L...
DEBUG:jclient.c:623:(jclient_run): Registering output port Input R...
DEBUG:jclient.c:641:(jclient_run): Registering input port Main L Input...
DEBUG:jclient.c:641:(jclient_run): Registering input port Main R Input...
DEBUG:engine.c:1130:(ow_engine_start): Starting p2o MIDI thread...
DEBUG:engine.c:1143:(ow_engine_start): Starting audio and o2p MIDI thread...
DEBUG:jclient.c:178:(jclient_set_buffer_size_cb): JACK buffer size: 256
DEBUG:jclient.c:79:(jclient_thread_latency_cb): JACK latency request
DEBUG:jclient.c:97:(jclient_thread_latency_cb): Recalculating output to input latency...
DEBUG:jclient.c:79:(jclient_thread_latency_cb): JACK latency request
DEBUG:jclient.c:83:(jclient_thread_latency_cb): Recalculating input to output latency...
DEBUG:resampler.c:366:(ow_resampler_compute_ratios): Booting Overbridge side...
DEBUG:resampler.c:377:(ow_resampler_compute_ratios): Starting up resampler...
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 417634.792292 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 780205.533474 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 973312.758509 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 1059515.028991 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 1072587.668099 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 1057403.781710 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 1026928.123666 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 997546.392047 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 969481.759538 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 947930.699854 (output 0, expected 256)
DEBUG:resampler.c:110:(ow_resampler_clear_buffers): Clearing buffers...
DEBUG:jclient.c:79:(jclient_thread_latency_cb): JACK latency request
DEBUG:jclient.c:97:(jclient_thread_latency_cb): Recalculating output to input latency...
DEBUG:jclient.c:79:(jclient_thread_latency_cb): JACK latency request
DEBUG:jclient.c:83:(jclient_thread_latency_cb): Recalculating input to output latency...
DEBUG:jclient.c:163:(jclient_jack_graph_order_cb): JACK calling graph order...
DEBUG:jclient.c:79:(jclient_thread_latency_cb): JACK latency request
DEBUG:jclient.c:97:(jclient_thread_latency_cb): Recalculating output to input latency...
DEBUG:jclient.c:79:(jclient_thread_latency_cb): JACK latency request
DEBUG:jclient.c:83:(jclient_thread_latency_cb): Recalculating input to output latency...
DEBUG:jclient.c:163:(jclient_jack_graph_order_cb): JACK calling graph order...
DEBUG:jclient.c:79:(jclient_thread_latency_cb): JACK latency request
DEBUG:jclient.c:97:(jclient_thread_latency_cb): Recalculating output to input latency...
DEBUG:jclient.c:79:(jclient_thread_latency_cb): JACK latency request
DEBUG:jclient.c:83:(jclient_thread_latency_cb): Recalculating input to output latency...
DEBUG:jclient.c:163:(jclient_jack_graph_order_cb): JACK calling graph order...
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 933354.271139 (output 0, expected 256)
DEBUG:jclient.c:79:(jclient_thread_latency_cb): JACK latency request
DEBUG:jclient.c:97:(jclient_thread_latency_cb): Recalculating output to input latency...
DEBUG:jclient.c:79:(jclient_thread_latency_cb): JACK latency request
DEBUG:jclient.c:83:(jclient_thread_latency_cb): Recalculating input to output latency...
DEBUG:jclient.c:163:(jclient_jack_graph_order_cb): JACK calling graph order...
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 879183.077572 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 829938.543941 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 796031.710575 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 776601.504630 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 767895.689956 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 766444.703018 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 769544.870615 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 775466.268822 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 783026.394202 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 791578.071028 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 800660.516099 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 810082.554637 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 819658.841872 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 829308.378739 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 839039.250321 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 848785.559243 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 858575.937678 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 868408.363440 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 878223.405630 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 888010.359659 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 897818.540084 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 907614.235239 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 917430.666681 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 927230.584334 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 937052.571829 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 946855.217509 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 956676.070266 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 966479.682951 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 976300.321260 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 986107.063626 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 995928.216668 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 1005732.721740 (output 0, expected 256)
ERROR:resampler.c:282:(ow_resampler_read_audio): o2p: Unexpected frames with ratio 1015553.861184 (output 0, expected 256)

I am on Arch Linux with pipewire. I have tried using "PIPEWIRE_PROPS='{ node.group = hardware_node_group }'" but this didn't make any difference. I am currently using the AUR package for overwitch but I have also tried building from the master branch and the same thing happens in both cases.

Do you have any idea why this might be happening?

dagargo commented 4 months ago

I'll take a deeper look later. Same thing is happening to me but a couple of weeks ago this was working well.

However, there is something bad when setting that property. hardware_node_group is not a value. It is meant to be replaced by users with the actual value in their systems. I use pro-audio-0. This value is the node.group PipeWire property of the main audio interface you're using.

I'll check the documentation because this is probably not clear enough. Even I made the same mistake once. :disappointed:

Where the value is set depends on your system but his command could help you. Search for you main audio interface.

$ pw-cli info all | grep -i node.group

BTW, I don't seem to find the pro-audio-0 group any more. Perhaps this has changed in the last PipeWire releases or my config files are obsolete now.

Have you found the value of this property? Have you managed to make it work?

spectromas commented 4 months ago

Ah that makes sense about hardware_node_group! I did find pro-audio-2 with that command but doesn't appear to make any difference unfortunately and the log looks to be the same as far as I can tell. I think pipewire recently updated to 1.2 so might be something to do with that?

dagargo commented 4 months ago

I think pipewire recently updated to 1.2 so might be something to do with that?

In Debian testing, PipeWire was updated to version 1.2 very recently so it's probably this.

I'm checking all this right now.

dagargo commented 4 months ago

To me, there is something going on with PipeWire 1.2.0. Function jack_get_cycle_times returns wrong values occasionally. I haven't reported anything as I'm still investigating this.

spectromas commented 4 months ago

Thanks for the update @dagargo. I've seen a few different issues popping about this version of pipewire in various places so it does seem that something odd might be happening.

dagargo commented 4 months ago

I believe there's a bug in PipeWire since 1.1.83 which makes Overwitch to not work at all due to internal timing issues. I'm still investigating this but I'm pretty sure 1.1.82 woks nicely. I haven't reported anything yet.

I pushed a few commits to address this kind of errors in a better way but I've just realized it crashes when devices are unplugged. I'll take a look at this later.

dagargo commented 4 months ago

I pushed a few commits to address this kind of errors in a better way but I've just realized it crashes when devices are unplugged. I'll take a look at this later.

Fixed and pushed.

dagargo commented 4 months ago

I found the bug and reported it to the PipeWire team here. It has already been solved. :rocket:

We can leave this open until next version goes out but I've already tested it and works pretty well.

spectromas commented 4 months ago

Amazing, thank you! I'll keep an eye out for a pipewire update coming through.

Zolani13 commented 4 months ago

Hi There,

I'm having the same issue; my version of overwitch is through the AUR that was last updated in January. Do I have to build this package from the git repository to get these fixes, or do I have to wait for an update to Pipewire? Thanks.

dagargo commented 4 months ago

@Zolani13, you'll definitely need a new PipeWire version. From version 1.1.83 to 1.2.1, all suffer from a bug that produced bat time measurements, which is absolutely needed by Overwitch. The bug is already fixed in its master branch.

Overwitch 1.1 should work. Version 1.2 will only be a refined version with better MIDI timing and support for SysEx.

spectromas commented 3 months ago

Just got the pipewire update and I can confirm that overwitch is working again! Thanks again for the help/fixes/investigation.

dagargo commented 3 months ago

Thanks for trying this out and reporting.

I'm leaving this open for a few days until PipeWire 1.2.2 reaches Debian testing.

I'll report back against the official release and close this if nothing goes wrong.

Zolani13 commented 3 months ago

Just here to confirm that overwitch is now working with my Digitone, also in EndeavourOS (Arch). Thanks again for the updates

dagargo commented 3 months ago

PipeWire 1.2.2 is in Debian testing and is Overwitch is working pretty well.

Thanks for testing this.

This can be closed.