Closed netmate1234 closed 3 years ago
Pls see https://github.com/drowe67/freedv-gui/issues/107 suggestions (1) and (2)
Closed as no response from OP
I removed 3 assserts in codec2. now its stable.
Removing asserts is a bad idea - they are there to trap unexpected and illegal behavior.
@tmiw :point_up: this might be related to what Kanda is reporting :thinking:
@timw I popped this into the top of freedv_rx
and the assert fired:
fprintf(stderr, "max_speech_samples: %d max_modem_samples: %d\n",
freedv_get_n_max_speech_samples(freedv), freedv_get_n_max_modem_samples(freedv));
{
int nout = 2*freedv_get_n_max_modem_samples(freedv);
assert(nout <= freedv_get_n_max_speech_samples(freedv));
}
I think I know what's going on here:
nin
might be set to max_modem_samples
on the last modem frame processed before we fall out of sync. Doesn't look like there is enough storage for that case, so the assert fires.OK by forcing nin to be the max in freedv_rx.c
:
nin = freedv_nin(freedv);
nin = freedv_get_n_max_modem_samples(freedv);
/* optionally read some stats */
I can also trigger another assert (I have seen this once before):
./src/freedv_tx 2020 ~/LPCNet/wav/all.wav - | ./src/cohpsk_ch - - -20 | ./src/freedv_rx 2020 - /dev/null -v
<snip>
freedv_rx: /home/david/codec2/src/fdmdv.c:1770: fdmdv_8_to_16: Assertion `(n % FDMDV_OS) == 0' failed.
I hit that once before.
@drowe67, I assume the PR fixes that additional assert as well?
I think this one was fixed with https://github.com/drowe67/codec2/pull/176
freedv: /home/martin/temp/freedv-gui/codec2/src/freedv_api.c:823: freedv_bits_to_speech: Assertion `nout <= freedv_get_n_max_speech_samples(f)' failed. Aborted (core dumped)
(Running 2020. It comes often, Ubuntu 20.10. FreeDV 1.5.2 dev.)