[pulseaudio-discuss] [PATCH] volume: 20 dB should be enough for anyone

Arun Raghavan arun.raghavan at collabora.co.uk
Sun Dec 5 06:17:11 PST 2010


This limits the maximum gain we perform in software to approximately 20
dB. There does not appear to be a good reason for greater gain, and
clipping to 20 dB can prevent accidentally setting an absurdly large
volume and potential damage to the ears.
---
 src/pulse/volume.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/pulse/volume.h b/src/pulse/volume.h
index 35128b6..d646a7b 100644
--- a/src/pulse/volume.h
+++ b/src/pulse/volume.h
@@ -113,7 +113,8 @@ typedef uint32_t pa_volume_t;
 #define PA_VOLUME_MUTED ((pa_volume_t) 0U)
 
 /** Maximum valid volume we can store. \since 0.9.15 */
-#define PA_VOLUME_MAX ((pa_volume_t) UINT32_MAX/2)
+/* This value corresponds to ~20 dB (of software amplification) */
+#define PA_VOLUME_MAX ((pa_volume_t) 141193)
 
 /** Special 'invalid' volume. \since 0.9.16 */
 #define PA_VOLUME_INVALID ((pa_volume_t) UINT32_MAX)
-- 
1.7.3.2




More information about the pulseaudio-discuss mailing list