dagargo / overwitch

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

Buffer overflow with Digitakt #8

Closed lentferj closed 11 months ago

lentferj commented 2 years ago

Hi there, first off - thank you so much for this great piece of software and all the effort you put into this and the other stuff. Highly appreciated.

So, I just today got my Digitakt and naturally I needed to try overwitch out. It detects my DT and I can easily connect it with carla to my soundcard. Unfortunately I do have a lot of crackling. I tried different buffer and resample quality settings and even increased my jack buffer settings to up to 4096. But I never really managed to get rid of them. My system is a 12 core Xeon Box (a bit older, but still ...) that is able to run Bitwig and dozens of u-he plugins at 256 buffer size without any crackling. I am a bit at a loss on what to try more... System is running in performance mode, etc, etc. The box is already highly optimized for audio, as I also run Bitwig, Ardour, Mibus32C,...

Would be really grateful for any hints.

$ chrt -f 35 overwitch -b 24 -q 2 -d Digitakt -v -v DEBUG:overbridge.c:527:(overbridge_init_priv): Checking for Digitakt... Device: Digitakt (outputs: 12, inputs: 2) Jack: JackClient::SetupDriverSync driver sem in flush mode Jack: JackLinuxFutex::Connect name = jack_sem.1002_default_Digitakt Jack: Clock source : system clock via clock_gettime Jack: JackLibClient::Open name = Digitakt refnum = 13 JACK sample rate: 48000 JACK buffer size: 256 DEBUG:jclient.c:83:(jclient_init_buffer_size): Target delay: 11.5 ms (552 frames) Jack: JackClient::PortRegister ref = 13 name = Digitakt:Main L type = 32 bit float mono audio port_index = 71 Jack: JackClient::PortRegister ref = 13 name = Digitakt:Main R type = 32 bit float mono audio port_index = 72 Jack: JackClient::PortRegister ref = 13 name = Digitakt:Track 1 type = 32 bit float mono audio port_index = 73 Jack: JackClient::PortRegister ref = 13 name = Digitakt:Track 2 type = 32 bit float mono audio port_index = 74 Jack: JackClient::PortRegister ref = 13 name = Digitakt:Track 3 type = 32 bit float mono audio port_index = 75 Jack: JackClient::PortRegister ref = 13 name = Digitakt:Track 4 type = 32 bit float mono audio port_index = 76 Jack: JackClient::PortRegister ref = 13 name = Digitakt:Track 5 type = 32 bit float mono audio port_index = 77 Jack: JackClient::PortRegister ref = 13 name = Digitakt:Track 6 type = 32 bit float mono audio port_index = 78 Jack: JackClient::PortRegister ref = 13 name = Digitakt:Track 7 type = 32 bit float mono audio port_index = 79 Jack: JackClient::PortRegister ref = 13 name = Digitakt:Track 8 type = 32 bit float mono audio port_index = 80 Jack: JackClient::PortRegister ref = 13 name = Digitakt:Input L type = 32 bit float mono audio port_index = 81 Jack: JackClient::PortRegister ref = 13 name = Digitakt:Input R type = 32 bit float mono audio port_index = 82 Jack: JackClient::PortRegister ref = 13 name = Digitakt:Main L Input type = 32 bit float mono audio port_index = 83 Jack: JackClient::PortRegister ref = 13 name = Digitakt:Main R Input type = 32 bit float mono audio port_index = 84 Jack: JackClient::PortRegister ref = 13 name = Digitakt:MIDI out type = 8 bit raw midi port_index = 85 Jack: JackClient::PortRegister ref = 13 name = Digitakt:MIDI in type = 8 bit raw midi port_index = 86 DEBUG:overbridge.c:759:(overbridge_run): Starting MIDI thread... DEBUG:overbridge.c:767:(overbridge_run): Starting device thread... Jack: JackClient::Activate Jack: JackPosixThread::StartImp : create non RT thread Jack: JackPosixThread::ThreadHandler : start Jack: JackClient::kBufferSizeCallback buffer_size = 256 Jack: JackClient::Init : period = 5333 computation = 100 constraint = 5333 Jack: JackPosixThread::AcquireRealTimeImp priority = 5 DEBUG:jclient.c:109:(jclient_j2o_reader): j2o: Can not read data from queue Jack: JackClient::ClientNotify ref = 13 name = Digitakt notify = 2 Jack: JackClient::kActivateClient name = Digitakt ref = 13 DEBUG:jclient.c:307:(jclient_compute_ratios): Starting up... Jack: JackClient::ClientNotify ref = 13 name = Digitakt notify = 18 Jack: JackClient::ClientNotify ref = 13 name = Digitakt notify = 18 Jack: JackClient::ClientNotify ref = 13 name = Digitakt notify = 18 Jack: JackClient::ClientNotify ref = 13 name = Digitakt notify = 18 DEBUG:jclient.c:347:(jclient_compute_ratios): Max. latencies (ms): 0.0, 0.0; avg. ratios: 1.000079, 0.999921; curr. ratios: 0.999953, 1.000047 DEBUG:jclient.c:355:(jclient_compute_ratios): Tunning... DEBUG:jclient.c:347:(jclient_compute_ratios): Max. latencies (ms): 0.0, 0.0; avg. ratios: 1.000026, 0.999974; curr. ratios: 0.999997, 1.000003 DEBUG:jclient.c:347:(jclient_compute_ratios): Max. latencies (ms): 0.0, 0.0; avg. ratios: 0.999966, 1.000034; curr. ratios: 0.999947, 1.000053 DEBUG:jclient.c:347:(jclient_compute_ratios): Max. latencies (ms): 0.0, 0.0; avg. ratios: 0.999944, 1.000056; curr. ratios: 0.999956, 1.000044 DEBUG:jclient.c:347:(jclient_compute_ratios): Max. latencies (ms): 0.0, 0.0; avg. ratios: 0.999969, 1.000031; curr. ratios: 0.999970, 1.000030 DEBUG:jclient.c:347:(jclient_compute_ratios): Max. latencies (ms): 0.0, 0.0; avg. ratios: 0.999969, 1.000031; curr. ratios: 0.999977, 1.000023 DEBUG:jclient.c:370:(jclient_compute_ratios): Running... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:overbridge.c:296:(set_usb_output_data_blks): j2o: Can not read enough data from ring buffer (0 < 1344). Resampling... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:overbridge.c:308:(set_usb_output_data_blks): j2o: Error while resampling: SRC ratio outside [1/256, 256] range. DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:347:(jclient_compute_ratios): Max. latencies (ms): 10.7, 15.5; avg. ratios: 0.999980, 1.000020; curr. ratios: 0.999980, 1.000020 ERROR:jclient.c:244:(jclient_j2o): j2o: Buffer overflow. Discarding data... DEBUG:jclient.c:347:(jclient_compute_ratios): Max. latencies (ms): 10.7, 20.2; avg. ratios: 0.999984, 1.000016; curr. ratios: 0.999985, 1.000015 DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... ERROR:jclient.c:244:(jclient_j2o): j2o: Buffer overflow. Discarding data... DEBUG:jclient.c:347:(jclient_compute_ratios): Max. latencies (ms): 10.9, 20.4; avg. ratios: 0.999986, 1.000014; curr. ratios: 0.999998, 1.000002 ERROR:jclient.c:244:(jclient_j2o): j2o: Buffer overflow. Discarding data... ERROR:jclient.c:244:(jclient_j2o): j2o: Buffer overflow. Discarding data... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:347:(jclient_compute_ratios): Max. latencies (ms): 10.9, 20.4; avg. ratios: 1.000032, 0.999968; curr. ratios: 1.000056, 0.999944 ERROR:jclient.c:244:(jclient_j2o): j2o: Buffer overflow. Discarding data... DEBUG:jclient.c:347:(jclient_compute_ratios): Max. latencies (ms): 11.1, 21.0; avg. ratios: 1.000051, 0.999949; curr. ratios: 1.000036, 0.999964 ERROR:jclient.c:244:(jclient_j2o): j2o: Buffer overflow. Discarding data... ^CMax. latencies (ms): 11.3, 21.0 DEBUG:jclient.c:748:(jclient_run): Exiting... Jack: JackClient::Deactivate DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... DEBUG:jclient.c:152:(jclient_o2j_reader): o2j: Can not read data from ring buffer. Replicating last sample... Jack: JackClient::Deactivate res = 0 Jack: JackPosixThread::Kill Jack: jack_client_close Jack: JackClient::Close ref = 13 Jack: JackClient::Deactivate Jack: JackSocketClientChannel::Stop Jack: JackPosixThread::Kill Jack: JackClientSocket::Close Jack: JackClientSocket::Close Jack: JackLibClient::~JackLibClient Jack: JackShmReadWritePtr1::~JackShmReadWritePtr1 13 Jack: Succeeded in unlocking 426 byte memory area Jack: JackLibGlobals Destroy 35c96bb0 Jack: ~JackLibGlobals Jack: no message buffer overruns Jack: JackPosixThread::Stop Jack: JackPosixThread::ThreadHandler : exit Jack: JackShmReadWritePtr::~JackShmReadWritePtr 1 Jack: Succeeded in unlocking 1187 byte memory area Jack: JackShmReadWritePtr::~JackShmReadWritePtr 0 Jack: Succeeded in unlocking 107341338 byte memory area Jack: jack_client_close res = 0

dagargo commented 2 years ago

Based on your trace, it looks like a new JACK server is being started by Overwitch. Probably you do not want this.

Start JACK and whatever other software you want to run (Ardour, Bitwig...) first and then run Overwitch with chrt -f 35 overwitch -b 8 -q 2 -d Digitakt.

I guess you've done this already but I'm asking because I'm not sure.

lentferj commented 2 years ago

Thanks for the fast feedback. Yes, I start jack using qjackctl. Then I start overwitch and then I connect DTs Main L/R to system playback 1/2 using audio connections panel in qjackctl. That's the most minimal setup I tried. Still I get the crackling. I also tried different USB ports and cables on my computer... :/ I don't see a second jackd instance running... what makes you think so?

dagargo commented 2 years ago

I don't see a second jackd instance running... what makes you think so?

I didn't remember seeing so much output except when Overwitch was launched while no JACK instance was running, which makes the client to create a server to connect to. I was wrong and the log is just additional JACK output. Sorry for the added confusion. (Perhaps JACK is compiled in your system with more verbosisity. I use Debian stable BTW.)

In case you're using the verbose option, do not use that as it causes a lot of unnecessary blocks, which might be the issue. However, I suspect that is not your case.

An idea that I'd like you to try is to use a 128 samples JACK buffer with the same minimal configuration you mentioned. Tell me if this improves anything.

As a side note, this is something I had never seen before.

DEBUG:overbridge.c:308:(set_usb_output_data_blks): j2o: Error while resampling: SRC ratio outside [1/256, 256] range.

The ratio used there is wrong for whatever reason. I should print it as an error.

Seriously, I'll have to take a deep look and test this properly because it's quite buggy but I'm working on Elektroid right now.

lentferj commented 2 years ago

I tried buffer size of 128 and even 64 and all types of other setting and left the verbose mode off. Didn't really help unfortunately.

I am already using Elektroid. Works a charm for me, great work!

dagargo commented 2 years ago

Could you try with the master branch again?

Notice that I've changed how the priorities are set and chrt is no longer needed as the default JACK RT priority for plugins is used. Besides, it's not needed to run jackd with this either because it runs with RT priorities by default too.

lentferj commented 2 years ago

Unfortunately no improvement and I still see... ERROR:jclient.c:232:(jclient_j2o): j2o: Audio ring buffer overflow. Discarding data... quite a lot.

dagargo commented 2 years ago

Overwitch's been running without issues for almost 3 hours but just now I've just face the same issue as you. :disappointed:

Do you see a message like this after the first overflow message?

ERROR:overbridge.c:364:(cb_xfr_out): j2o: Error on USB audio transfer: Other error
lentferj commented 2 years ago

no, not seen that one yet

lentferj commented 2 years ago

I am also trying to dig through the code currently, but I need some time to catch up.

lentferj commented 2 years ago

I think I fixed the crackling audio issue (at least for me :) ). It's actually caused by prepare_cycle_in_midi(). I need to clean up my patches, do a bit more testing and then send a PR.

lentferj commented 2 years ago

Fixed with the last commits. Thanks for the good conversation.

sa3m commented 1 year ago

Hello there,

Thanks for the soft, it's really nice.

I'm trying to work with overbridge and midi, I get this error:

ERROR:engine.c:397:(cb_xfr_midi_in): o2p: MIDI ring buffer overflow. Discarding data...

This message appears multiple times. It seems like it appears after an increase in latency:

DEBUG:overwitch.c:302:(ow_get_device_desc_from_vid_pid): Failed to open file “/home/samuelpiquet/.config/overwitch/devices.json”: Aucun fichier ou dossier de ce type DEBUG:overwitch.c:308:(ow_get_device_desc_from_vid_pid): Falling back to /usr/local/share/overwitch/devices.json... DEBUG:overwitch.c:367:(ow_get_device_desc_from_vid_pid): Device with PID 12 found DEBUG:overwitch.c:228:(ow_get_usb_device_list): Found Digitakt (bus 003, address 009, ID 1935:000c) DEBUG:overwitch.c:302:(ow_get_device_desc_from_vid_pid): Failed to open file “/home/samuelpiquet/.config/overwitch/devices.json”: Aucun fichier ou dossier de ce type DEBUG:overwitch.c:308:(ow_get_device_desc_from_vid_pid): Falling back to /usr/local/share/overwitch/devices.json... DEBUG:overwitch.c:367:(ow_get_device_desc_from_vid_pid): Device with PID 12 found DEBUG:engine.c:1277:(ow_engine_load_overbridge_name): USB control in data (32 B): Digitakt DEBUG:engine.c:1297:(ow_engine_load_overbridge_name): USB control in data (16 B): 0077 1.40B DEBUG:main.c:631:(refresh_devices): Adding Digitakt... DEBUG:main.c:121:(start_instance): Starting Digitakt... DEBUG:resampler.c:539:(ow_resampler_set_buffer_size): resampler buffer size: 1024 DEBUG:resampler.c:552:(ow_resampler_set_samplerate): resampler sample rate: 48000 DEBUG:jclient.c:502:(jclient_run): Using RT priority 82... DEBUG:engine.c:1102:(ow_engine_start): Starting p2o MIDI thread... DEBUG:engine.c:1115:(ow_engine_start): Starting audio and o2p MIDI thread... DEBUG:engine.c:1216:(ow_engine_set_option): Setting option 2 to 1... Digitakt@003,009: o2p latency: -1,0 ms, max. -1,0 ms; p2o latency: -1,0 ms, max. -1,0 ms, o2p ratio: 0,999530, avg. 1,000081 Digitakt@003,009: o2p latency: -1,0 ms, max. -1,0 ms; p2o latency: -1,0 ms, max. -1,0 ms, o2p ratio: 0,999969, avg. 0,999838 Digitakt@003,009: o2p latency: -1,0 ms, max. -1,0 ms; p2o latency: -1,0 ms, max. -1,0 ms, o2p ratio: 1,000074, avg. 1,000040 Digitakt@003,009: o2p latency: -1,0 ms, max. -1,0 ms; p2o latency: -1,0 ms, max. -1,0 ms, o2p ratio: 1,000053, avg. 1,000060 Digitakt@003,009: o2p latency: -1,0 ms, max. -1,0 ms; p2o latency: -1,0 ms, max. -1,0 ms, o2p ratio: 1,000047, avg. 1,000053 Digitakt@003,009: o2p latency: 18,1 ms, max. 42,0 ms; p2o latency: 9,3 ms, max. 25,5 ms, o2p ratio: 0,999993, avg. 1,000024 Digitakt@003,009: o2p latency: 18,7 ms, max. 42,0 ms; p2o latency: 9,5 ms, max. 26,7 ms, o2p ratio: 0,999974, avg. 0,999991 ERROR:engine.c:397:(cb_xfr_midi_in): o2p: MIDI ring buffer overflow. Discarding data... ERROR:engine.c:397:(cb_xfr_midi_in): o2p: MIDI ring buffer overflow. Discarding data... ERROR:engine.c:397:(cb_xfr_midi_in): o2p: MIDI ring buffer overflow. Discarding data... ERROR:engine.c:397:(cb_xfr_midi_in): o2p: MIDI ring buffer overflow. Discarding data... ERROR:engine.c:397:(cb_xfr_midi_in): o2p: MIDI ring buffer overflow. Discarding data... ERROR:engine.c:397:(cb_xfr_midi_in): o2p: MIDI ring buffer overflow. Discarding data... ERROR:engine.c:397:(cb_xfr_midi_in): o2p: MIDI ring buffer overflow. Discarding data... ERROR:engine.c:397:(cb_xfr_midi_in): o2p: MIDI ring buffer overflow. Discarding data... ERROR:engine.c:397:(cb_xfr_midi_in): o2p: MIDI ring buffer overflow. Discarding data... ERROR:engine.c:397:(cb_xfr_midi_in): o2p: MIDI ring buffer overflow. Discarding data... ERROR:engine.c:397:(cb_xfr_midi_in): o2p: MIDI ring buffer overflow. Discarding data...

It might make sense to open a new issue but since it's the same type of issue, I start it here. My laptop runs Pop OS with pipewire. Overbridge works normally but I can't get the digitakt to be recognised as a midi controller. It may be a problem with jack and pipewire running alongside but I'm not that into linux debugging to know what to do with it.

dagargo commented 11 months ago

@sa3m, sorry for taking this long to reply.

I upgraded Debian and move to PipeWire recently and I couldn't check this until now.

Overbridge works normally but I can't get the digitakt to be recognised as a midi controller.

Before PipeWire, you needed to run a2jmidid but now you can just making your connections with qpwgraph or Ardour and just works as the MIDI ports are already there.

Your issue is unrelated to the original one so I'm gonna close this. Feel free to open a new issue if your problem persists.

sa3m commented 11 months ago

No worries. I'll give it another try. Thanks for your time.