pulse-server: add category for connection debug

Use a new conn. topic to debug the messages. These are disabled by
default.
This commit is contained in:
Wim Taymans 2022-12-14 16:40:58 +01:00
parent 34973eac89
commit 72bee99f87
3 changed files with 8 additions and 2 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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);