From 72bee99f872b1996786d62b4af6a28a037b2906c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 14 Dec 2022 16:40:58 +0100 Subject: [PATCH] pulse-server: add category for connection debug Use a new conn. topic to debug the messages. These are disabled by default. --- src/modules/module-protocol-pulse.c | 2 ++ src/modules/module-protocol-pulse/message.c | 4 +++- src/modules/module-protocol-pulse/pulse-server.c | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/modules/module-protocol-pulse.c b/src/modules/module-protocol-pulse.c index 29ba0c092..eaf4c2f0e 100644 --- a/src/modules/module-protocol-pulse.c +++ b/src/modules/module-protocol-pulse.c @@ -305,6 +305,7 @@ PW_LOG_TOPIC(mod_topic, "mod." NAME); #define PW_LOG_TOPIC_DEFAULT mod_topic +PW_LOG_TOPIC(pulse_conn, "conn." NAME); PW_LOG_TOPIC(pulse_ext_dev_restore, "mod." NAME ".device-restore"); PW_LOG_TOPIC(pulse_ext_stream_restore, "mod." NAME ".stream-restore"); @@ -354,6 +355,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args) int res; PW_LOG_TOPIC_INIT(mod_topic); + PW_LOG_TOPIC_INIT(pulse_conn); /* it's easier to init these here than adding an init() call to the * extensions */ PW_LOG_TOPIC_INIT(pulse_ext_dev_restore); diff --git a/src/modules/module-protocol-pulse/message.c b/src/modules/module-protocol-pulse/message.c index e70b03a2b..daf4d2e95 100644 --- a/src/modules/module-protocol-pulse/message.c +++ b/src/modules/module-protocol-pulse/message.c @@ -33,7 +33,6 @@ #include "defs.h" #include "format.h" #include "internal.h" -#include "log.h" #include "message.h" #include "remap.h" #include "volume.h" @@ -47,6 +46,9 @@ #define PA_CHANNELS_MAX (32u) +PW_LOG_TOPIC_EXTERN(pulse_conn); +#define PW_LOG_TOPIC_DEFAULT pulse_conn + static inline uint32_t volume_from_linear(float vol) { uint32_t v; diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index eb09d9d3b..97405e039 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -95,6 +95,8 @@ #define TEMPORARY_MOVE_TIMEOUT (SPA_NSEC_PER_SEC) +PW_LOG_TOPIC_EXTERN(pulse_conn); + bool debug_messages = false; struct latency_offset_data { @@ -5626,7 +5628,7 @@ struct pw_protocol_pulse *pw_protocol_pulse_new(struct pw_context *context, load_defaults(&impl->defs, props); - debug_messages = pw_debug_is_category_enabled("connection"); + debug_messages = pw_log_topic_enabled(SPA_LOG_LEVEL_INFO, pulse_conn); impl->context = context; impl->loop = pw_context_get_main_loop(context);