From ab8eeff9da2f2499cc04cf51a6e9d068c3d1e5d6 Mon Sep 17 00:00:00 2001 From: guoyao Date: Tue, 3 Dec 2024 09:43:42 +0800 Subject: [PATCH 1/3] =?UTF-8?q?3s=20=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=9B=B4=E6=96=B0=E7=BA=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: guoyao --- src/modules/module-suspend-on-idle.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/modules/module-suspend-on-idle.c b/src/modules/module-suspend-on-idle.c index 498b09449..93bf192e3 100644 --- a/src/modules/module-suspend-on-idle.c +++ b/src/modules/module-suspend-on-idle.c @@ -31,6 +31,7 @@ #include #include #include +#include "log/audio_log.h" PA_MODULE_AUTHOR("Lennart Poettering"); PA_MODULE_DESCRIPTION("When a sink/source is idle for too long, suspend it"); @@ -66,13 +67,13 @@ static void timeout_cb(pa_mainloop_api*a, pa_time_event* e, const struct timeval d->userdata->core->mainloop->time_restart(d->time_event, NULL); if (d->sink && pa_sink_check_suspend(d->sink, NULL, NULL) <= 0 && !(d->sink->suspend_cause & PA_SUSPEND_IDLE)) { - pa_log_info("Sink %s idle for too long, suspending ...", d->sink->name); + AUDIO_INFO_LOG("Sink %{public}s idle for too long, suspending ...", d->sink->name); pa_sink_suspend(d->sink, true, PA_SUSPEND_IDLE); pa_core_maybe_vacuum(d->userdata->core); } if (d->source && pa_source_check_suspend(d->source, NULL) <= 0 && !(d->source->suspend_cause & PA_SUSPEND_IDLE)) { - pa_log_info("Source %s idle for too long, suspending ...", d->source->name); + AUDIO_INFO_LOG("Source %{public}s idle for too long, suspending ...", d->source->name); pa_source_suspend(d->source, true, PA_SUSPEND_IDLE); pa_core_maybe_vacuum(d->userdata->core); } @@ -87,10 +88,14 @@ static void restart(struct device_info *d) { d->last_use = now = pa_rtclock_now(); pa_core_rttime_restart(d->userdata->core, d->time_event, now + d->timeout); - if (d->sink) - pa_log_debug("Sink %s becomes idle, timeout in %" PRIu64 " seconds.", d->sink->name, d->timeout / PA_USEC_PER_SEC); - if (d->source) - pa_log_debug("Source %s becomes idle, timeout in %" PRIu64 " seconds.", d->source->name, d->timeout / PA_USEC_PER_SEC); + if (d->sink) { + AUDIO_INFO_LOG("Sink %{public}s becomes idle, timeout in %{public}" PRIu64 " seconds.", + d->sink->name, d->timeout / PA_USEC_PER_SEC); + } + if (d->source) { + AUDIO_INFO_LOG("Source %{public}s becomes idle, timeout in %{public}" PRIu64 " seconds.", + d->source->name, d->timeout / PA_USEC_PER_SEC); + } } static void resume(struct device_info *d) { -- Gitee From eabe494789263a1d397e86135ac6b9efa6df4a43 Mon Sep 17 00:00:00 2001 From: guoyao Date: Tue, 3 Dec 2024 11:51:45 +0800 Subject: [PATCH 2/3] =?UTF-8?q?3s=20=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=9B=B4=E6=96=B0=E7=BA=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: guoyao --- src/modules/module-suspend-on-idle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/module-suspend-on-idle.c b/src/modules/module-suspend-on-idle.c index 93bf192e3..1cb699df9 100644 --- a/src/modules/module-suspend-on-idle.c +++ b/src/modules/module-suspend-on-idle.c @@ -89,11 +89,11 @@ static void restart(struct device_info *d) { pa_core_rttime_restart(d->userdata->core, d->time_event, now + d->timeout); if (d->sink) { - AUDIO_INFO_LOG("Sink %{public}s becomes idle, timeout in %{public}" PRIu64 " seconds.", + AUDIO_DEBUG_LOG("Sink %{public}s becomes idle, timeout in %{public}" PRIu64 " seconds.", d->sink->name, d->timeout / PA_USEC_PER_SEC); } if (d->source) { - AUDIO_INFO_LOG("Source %{public}s becomes idle, timeout in %{public}" PRIu64 " seconds.", + AUDIO_DEBUG_LOG("Source %{public}s becomes idle, timeout in %{public}" PRIu64 " seconds.", d->source->name, d->timeout / PA_USEC_PER_SEC); } } -- Gitee From 3454cc1cfeff1ef86f1b20ad4d450b2be8ca3d8a Mon Sep 17 00:00:00 2001 From: guoyao Date: Tue, 3 Dec 2024 14:31:21 +0800 Subject: [PATCH 3/3] =?UTF-8?q?3s=20=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=9B=B4=E6=96=B0=E7=BA=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: guoyao --- src/pulse/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pulse/internal.h b/src/pulse/internal.h index 5c9fe83fd..047877d30 100644 --- a/src/pulse/internal.h +++ b/src/pulse/internal.h @@ -53,7 +53,7 @@ #include "client-conf.h" -#define DEFAULT_TIMEOUT (9) +#define DEFAULT_TIMEOUT (13) #define PA_PROTOCOL_FLAG_MASK 0xFFFF0000U #define PA_PROTOCOL_VERSION_MASK 0x0000FFFFU -- Gitee