Trace file bridge callbacks and use scoped VAD test logs
This commit is contained in:
1 parent
8435c0dc71
commit
86c23f4a62
3 files changed
+13
-5
No files matched your search
@@ -247,12 +247,13 @@ static void test_prefetch_deferred(UTUN_INSTANCE* instance) {
|
||||
|
||||
static std::vector<std::string> diagnostic_messages;
|
||||
static void capture_diagnostic(int, const char* category, const char* message) {
|
||||
if (category && !strcmp(category, "debug")) diagnostic_messages.emplace_back(message);
|
||||
if (category && (!strcmp(category, "vad") || !strcmp(category, "radio"))) diagnostic_messages.emplace_back(message);
|
||||
}
|
||||
|
||||
/* Проверяем наблюдаемые причины отказа и старта на настоящем PCM/TX-пути. */
|
||||
static void test_vad_diagnostics(UTUN_INSTANCE* instance) {
|
||||
debug_set_category_level(DEBUG_CATEGORY_DEBUG, DEBUG_LEVEL_TRACE);
|
||||
debug_set_category_level(DEBUG_CATEGORY_VAD, DEBUG_LEVEL_TRACE);
|
||||
debug_set_category_level(DEBUG_CATEGORY_RADIO, DEBUG_LEVEL_TRACE);
|
||||
debug_set_log_hook(capture_diagnostic);
|
||||
diagnostic_messages.clear(); events.clear(); packets.clear(); radio_compressor_enabled = 0;
|
||||
REQUIRE(radio_audio_start(7, 0) == 0 && radio_audio_capture_start(7, 1, 1) == 0);
|
||||
@@ -285,8 +286,9 @@ static void test_vad_diagnostics(UTUN_INSTANCE* instance) {
|
||||
"reason=silence_timeout", "reason=rx_busy", "rx_node=0000000000001234", "manual=1",
|
||||
"BEGIN dispatched", "capture discontinuity", "VAD capture stop", "model_rms="}) REQUIRE(contains(text));
|
||||
debug_set_log_hook(nullptr);
|
||||
debug_set_category_level(DEBUG_CATEGORY_DEBUG, DEBUG_LEVEL_NONE);
|
||||
puts("voice TX: VAD debug logs identify confirmation reset, speech start/stop, RX blocking and manual override PASS");
|
||||
debug_set_category_level(DEBUG_CATEGORY_VAD, DEBUG_LEVEL_NONE);
|
||||
debug_set_category_level(DEBUG_CATEGORY_RADIO, DEBUG_LEVEL_NONE);
|
||||
puts("voice TX: VAD/radio logs identify confirmation reset, speech start/stop, RX blocking and manual override PASS");
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
@@ -12,6 +12,7 @@ extern "C" {
|
||||
#include "../../../lib/debug_config.h"
|
||||
#include "../../../src/routing_layer/topo_node.h"
|
||||
#include "../../../src/routing_layer/topo_group.h"
|
||||
#include "../../../src/member_files/protocol.h"
|
||||
}
|
||||
|
||||
/* ── Внутренний объект-приёмник в GUI-потоке ── */
|
||||
@@ -82,9 +83,14 @@ void GuiBridgeReceiver::processPost(int eventType, QByteArray data) {
|
||||
g_network_changed_cb(eventType);
|
||||
switch (eventType) {
|
||||
case CHAT_EVT_MEMBER_FILES_RESPONSE:
|
||||
if (dlen >= 16 + MF_WIRE_HEADER) DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG,
|
||||
"member_files: bridge response id=%llu cmd=%s bytes=%d callback=%d",
|
||||
(unsigned long long)mf_get64(d + 21), mf_command_text(d[18]), dlen, g_member_files_response_cb != nullptr);
|
||||
if (g_member_files_response_cb) g_member_files_response_cb(d, dlen);
|
||||
break;
|
||||
case CHAT_EVT_MEMBER_FILES_TRANSFER:
|
||||
if (dlen == 51) DEBUG_TRACE(DEBUG_CATEGORY_DEBUG, "member_files: bridge progress id=%llu state=%u callback=%d",
|
||||
(unsigned long long)mf_get64(d), d[50], g_member_files_transfer_cb != nullptr);
|
||||
if (g_member_files_transfer_cb) g_member_files_transfer_cb(d, dlen);
|
||||
break;
|
||||
case CHAT_EVT_DM_INVITE_RESULT:
|
||||
|
||||
@@ -161,7 +161,7 @@ void UtunNode::runLoop() {
|
||||
debug_level_t lvl = debug_level_from_name(lvl_name);
|
||||
if (cat != DEBUG_CATEGORY_NONE && lvl != DEBUG_LEVEL_NONE) {
|
||||
g_debug_config.category_levels[cat] = lvl;
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "debug category: %s=%s",
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_CONFIG, "debug category: %s=%s",
|
||||
debug_get_category_name(cat),
|
||||
lvl_name);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user