Skip to content

Commit

Permalink
Debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
baranovmv committed Mar 28, 2024
1 parent fddcaa2 commit 7b49f3a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/internal_modules/roc_audio/freq_estimator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "roc_core/log.h"
#include "roc_core/panic.h"
#include "roc_core/time.h"
#include <fstream>

namespace roc {
namespace audio {
Expand Down Expand Up @@ -107,9 +108,18 @@ float FreqEstimator::freq_coeff() const {
}

void FreqEstimator::update(packet::stream_timestamp_t current) {
static std::ofstream fout("/tmp/fe.log", std::ios::out);

double filtered;

if (run_decimators_(current, filtered)) {
fout << core::timestamp(core::ClockUnix)
<< ", " << filtered
<< ", " << target_
<< ", " << (filtered - target_) * config_.P
<< ", " << accum_ * config_.I
<< std::endl;
fout.flush();
coeff_ = run_controller_(filtered);
}
}
Expand Down Expand Up @@ -214,5 +224,9 @@ static const char* fe_profile_to_str(FreqEstimatorProfile profile) {
return "<invalid>";
}

// TODO:
// * overshoot -- почему аккумулятор должен быть равен площади ошибки?
// * stable точно норм определяется аккумулятором?

} // namespace audio
} // namespace roc
4 changes: 2 additions & 2 deletions src/internal_modules/roc_rtp/link_meter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ void LinkMeter::update_jitter_(const packet::Packet& packet) {
metrics_.min_jitter = (core::nanoseconds_t)packet_jitter_stats_.mov_min();
metrics_.jitter = mean_jitter();

fout << packet.rtp()->stream_timestamp
<< ", " << packet.udp()->enqueue_ts
fout << packet.udp()->enqueue_ts
<< ", " << packet.rtp()->stream_timestamp
<< ", " << (double)std::abs(d_enq_ns - d_s_ns) / core::Millisecond
<< ", " << packet_jitter_stats_.mov_max()
<< ", " << packet_jitter_stats_.mov_min()
Expand Down

0 comments on commit 7b49f3a

Please sign in to comment.