dagargo / overwitch

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

latest master will stop working after a minute with Digitone #22

Closed lentferj closed 2 years ago

lentferj commented 2 years ago

I haven't tried with Digitakt,yet. But on my Digitone I get this with latest master after approx one minute

[...] DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 25; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 117; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 118; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 82; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 62; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 111; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 100; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 16; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 35; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 18; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 114; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 69; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 66; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 12; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 86; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 61; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 91; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 15; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 66; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 29; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 13; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 34; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 44; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 99; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 78; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 0; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 82; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 53; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 3; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 58; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 7; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 31; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 23; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 0; diff: 0 DEBUG:overbridge.c:815:(run_j2o_midi): Event frames: 49; diff: 0 ERROR:overbridge.c:530:(prepare_cycle_out_midi): j2o: Error when submitting USB MIDI transfer: Resource busy DEBUG:jclient.c:830:(jclient_run): Exiting... Jack: JackClient::Deactivate Jack: JackClient::ClientNotify ref = 6 name = Digitone notify = 12 Jack: JackClient::ClientNotify ref = 6 name = Digitone notify = 12 Jack: JackClient::ClientNotify ref = 6 name = Digitone notify = 12 Jack: JackClient::Deactivate res = 0 Jack: JackPosixThread::Kill Jack: jack_client_close Jack: JackClient::Close ref = 6 Jack: JackClient::Deactivate Jack: JackSocketClientChannel::Stop Jack: JackPosixThread::Kill Jack: JackClientSocket::Close Jack: JackClientSocket::Close Jack: JackLibClient::~JackLibClient Jack: JackShmReadWritePtr1::~JackShmReadWritePtr1 6 Jack: Succeeded in unlocking 426 byte memory area Jack: JackLibGlobals Destroy a402d390 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

lentferj commented 2 years ago

I reverted to 628208cd9fe2b470d0fa8b7345b9f4fce29e601b for now, which seems to be working fine.

I would assume that 1f1a69597d555b2b5007d085deb30bc5f3d30978 is maybe to strict and and needs to add some grace for transmission failures?

dagargo commented 2 years ago

Looks like it's gonna be easily fixed.

The issue is that the USB port is in use and it just exits.

ERROR:overbridge.c:530:(prepare_cycle_out_midi): j2o: Error when submitting USB MIDI transfer: Resource busy
DEBUG:jclient.c:830:(jclient_run): Exiting...

I'll try to replicate the issue and see if I could come up with a better policy.

dagargo commented 2 years ago

Under some conditions, Overwitch was creating a new USB transfer before the previous one was completed. Perhaps this was caused by a too busy USB bus.

Be that as it may, fix_usb_busy branch solves this issue by busy-waiting till the transmission is completed.

Let me know if that works for you.

Regardless of this, as you own more than one Elektron machine, could you take a look at #18?

lentferj commented 2 years ago

fix_usb_busy makes it stable for me again

dagargo commented 2 years ago

Merged into master.

Thanks for reporting and testing this.