Commit b50e103c authored by Joanne Hugé's avatar Joanne Hugé

wip: fix counters and encode thread

parent 8eec87e8
......@@ -295,18 +295,18 @@ static void print_stats(FILE * f, int print_header) {
"%" STAT_INT_LEN "" PRIi64 "pps "
"%" STAT_INT_LEN "" PRIi64 "pps "
"\n",
N_SAMPLES * sizeof(float) * 2 * rx_drop_counter.counter / IQ_PAYLOAD,
N_SAMPLES * sizeof(float) * 2 * tx_drop_counter.counter / IQ_PAYLOAD,
(N_SAMPLES * sizeof(float) * 2 * rx_drop_counter.counter) / IQ_PAYLOAD,
(N_SAMPLES * sizeof(float) * 2 * tx_drop_counter.counter) / IQ_PAYLOAD,
recv_counter.counter,
decode_counter.counter,
N_SAMPLES * sizeof(float) * 2 * read_counter.counter / IQ_PAYLOAD,
N_SAMPLES * sizeof(float) * 2 * write_counter.counter / IQ_PAYLOAD,
(N_SAMPLES * sizeof(float) * 2 * read_counter.counter) / IQ_PAYLOAD,
(N_SAMPLES * sizeof(float) * 2 * write_counter.counter) / IQ_PAYLOAD,
encode_counter.counter,
sent_counter.counter,
recv_counter.pps,
decode_counter.pps,
read_counter.pps,
write_counter.pps,
(N_SAMPLES * sizeof(float) * 2 * read_counter.pps) / IQ_PAYLOAD,
(N_SAMPLES * sizeof(float) * 2 * write_counter.pps) / IQ_PAYLOAD,
encode_counter.pps,
sent_counter.pps);
}
......@@ -510,8 +510,11 @@ static void *encode_thread(void *p) {
// If we have frames to encode (is there space in TX buffer)
// And if there are frames from trx_write callback to encode
to_write = rbuf_write_amount(&tx_rbuf) / tx_rbuf.block_len;
to_read = rbuf_read_amount(&trxw_rbuf[0]) / trxw_rbuf[0].block_len;
to_write = rbuf_write_amount(&tx_rbuf) / (PACKET_SIZE * 4);
to_read = 1;
for(int k = 0; k < s->tx_n_channel; k++)
if(rbuf_read_amount(&trxw_rbuf[k]) < IQ_PAYLOAD)
to_read = 0;
usleep(1);
if(!to_write || !to_read)
continue;
......@@ -962,7 +965,7 @@ static void trx_ecpri_write(TRXState *s1, trx_timestamp_t timestamp, const void
count_left -= nc / sizeof(Complex);
offset += nc;
}
update_counter(&write_counter, count / N_SAMPLES);
update_counter(&write_counter, (s->tx_n_channel * count) / N_SAMPLES);
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment