1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-07-13 14:25:24 -04:00

DATV: LDPC tool: start index at the next after full worker. Avoids hitting always the busy worker. Removed now useless pipe pointer reset.

This commit is contained in:
f4exb 2021-03-13 18:14:41 +01:00
parent d73f093dab
commit e79171c728

View File

@ -486,7 +486,10 @@ struct s2_frame_receiver : runnable
meas_decimation(1048576), meas_decimation(1048576),
Ftune(0), Fm(0), Ftune(0), Fm(0),
strongpls(false), strongpls(false),
in_power(0), ev_power(0), agc_gain(1), agc_bw(1e-3), in_power(0),
ev_power(0),
agc_gain(1),
agc_bw(1e-3),
nsyncs(0), nsyncs(0),
cstln(nullptr), cstln(nullptr),
in(_in), out(_out, 1 + modcod_info::MAX_SLOTS_PER_FRAME), in(_in), out(_out, 1 + modcod_info::MAX_SLOTS_PER_FRAME),
@ -985,7 +988,7 @@ struct s2_frame_receiver : runnable
opt_write(ss_out, in_power); opt_write(ss_out, in_power);
// TBD Adjust if cfg.strongpls // TBD Adjust if cfg.strongpls
float mer = ev_power ? (float)cstln_amp * cstln_amp / ev_power : 1; float mer = ev_power ? (float)cstln_amp * cstln_amp / ev_power : 1;
opt_write(mer_out, 10 * logf(mer) / logf(10)); opt_write(mer_out, 10 * log10f(mer));
meas_count -= meas_decimation; meas_count -= meas_decimation;
} }
@ -1000,7 +1003,7 @@ struct s2_frame_receiver : runnable
pls_errors, pilot_errors, sof_errors, all_errors, max_errors); pls_errors, pilot_errors, sof_errors, all_errors, max_errors);
pl_errors += all_errors; pl_errors += all_errors;
pl_symbols += max_errors; pl_symbols += max_errors;
} } // run_frame_locked
void shutdown() void shutdown()
{ {
@ -2463,6 +2466,7 @@ struct s2_fecdec_helper : runnable
{ {
helper_instance *procs; // nullptr or [nprocs] helper_instance *procs; // nullptr or [nprocs]
int nprocs; int nprocs;
int shift;
} pools[32][2]; // [modcod][sf] } pools[32][2]; // [modcod][sf]
struct helper_job struct helper_job
{ {
@ -2477,8 +2481,9 @@ struct s2_fecdec_helper : runnable
{ {
pool *p = get_pool(&pin->pls); pool *p = get_pool(&pin->pls);
for (int i = 0; i < p->nprocs; ++i) for (int j = 0; j < p->nprocs; ++j)
{ {
int i = (p->shift + j) % p->nprocs;
helper_instance *h = &p->procs[i]; helper_instance *h = &p->procs[i];
int iosize = (pin->pls.framebits() / 8) * sizeof(SOFTBYTE); int iosize = (pin->pls.framebits() / 8) * sizeof(SOFTBYTE);
// fprintf(stderr, "Writing %lu to fd %d\n", iosize, h->fd_tx); // fprintf(stderr, "Writing %lu to fd %d\n", iosize, h->fd_tx);
@ -2486,7 +2491,8 @@ struct s2_fecdec_helper : runnable
if (nw < 0 && errno == EWOULDBLOCK) if (nw < 0 && errno == EWOULDBLOCK)
{ {
lseek(h->fd_tx, 0, SEEK_SET); // allow new writes on this worker //lseek(h->fd_tx, 0, SEEK_SET); // allow new writes on this worker
//fprintf(stderr, "s2_fecdec_helper::send_frame: %d worker is busy\n", h->pid);
continue; // next worker continue; // next worker
} }
@ -2495,6 +2501,7 @@ struct s2_fecdec_helper : runnable
else if (nw != iosize) else if (nw != iosize)
fatal("partial write(LDPC helper)"); fatal("partial write(LDPC helper)");
p->shift = i;
helper_job *job = jobs.put(); helper_job *job = jobs.put();
job->pls = pin->pls; job->pls = pin->pls;
job->h = h; job->h = h;
@ -2527,6 +2534,7 @@ struct s2_fecdec_helper : runnable
for (int i = 0; i < nhelpers; ++i) for (int i = 0; i < nhelpers; ++i)
spawn_helper(&p->procs[i], pls); spawn_helper(&p->procs[i], pls);
p->nprocs = nhelpers; p->nprocs = nhelpers;
p->shift = 0;
} }
return p; return p;