From 5391daf8dfcae45c6abb74c0a5ff9b7c50e3c000 Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Fri, 15 Oct 2010 13:05:14 +0300 Subject: core: Add infrastructure for synchronizing HW and SW volume changes To make concurrent use of SW and HW volume glitchles their application needs to be synchronized. For accurate synchronization the HW volume needs to be applied in IO thread. This patch adds infrastructure to delay the applying of HW volume to match with SW volume timing. To avoid synchronization problems this patch moves many of the volume and mute related functions from main thread to IO thread. All these changes become active only if the sync volume flag for a sink has been set. So, for this patch to have any effect it needs to be taken into use by sink implementor. Signed-off-by: Jyri Sarha Reviewed-by: Tanu Kaskinen Reviewd-by: Colin Guthrie --- src/pulse/def.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/pulse/def.h') diff --git a/src/pulse/def.h b/src/pulse/def.h index 80d2a508..a73e93e0 100644 --- a/src/pulse/def.h +++ b/src/pulse/def.h @@ -740,11 +740,15 @@ typedef enum pa_sink_flags { /**< The latency can be adjusted dynamically depending on the * needs of the connected streams. \since 0.9.15 */ - PA_SINK_PASSTHROUGH = 0x0100U + PA_SINK_PASSTHROUGH = 0x0100U, /**< This sink has support for passthrough mode. The data will be left * as is and not reformatted, resampled, mixed. * \since 0.9.22*/ + PA_SINK_SYNC_VOLUME = 0x0200U, + /**< The HW volume changes are syncronized with SW volume. + * \since 0.9.22 */ + } pa_sink_flags_t; /** \cond fulldocs */ @@ -757,6 +761,7 @@ typedef enum pa_sink_flags { #define PA_SINK_FLAT_VOLUME PA_SINK_FLAT_VOLUME #define PA_SINK_DYNAMIC_LATENCY PA_SINK_DYNAMIC_LATENCY #define PA_SINK_PASSTHROUGH PA_SINK_PASSTHROUGH +#define PA_SINK_SYNC_VOLUME PA_SINK_SYNC_VOLUME /** \endcond */ -- cgit