From 17263a813b8bd8c74b2d0b499213f8c9b7415ed6 Mon Sep 17 00:00:00 2001 From: Dana Conrad Date: Fri, 3 Sep 2021 21:56:28 -0500 Subject: ErosQ (both): avoid clipping due to DC offset bandaid Set the maximum volume on both hosted and native ports to -2 dB. Verified behavior here on native and by borkitall on irc for hosted. Change-Id: I3aebc2bb4b9294a4137a33694c83139c0d76099a --- firmware/export/eros_qn_codec.h | 10 ++++++++-- firmware/export/erosqlinux_codec.h | 9 ++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'firmware/export') diff --git a/firmware/export/eros_qn_codec.h b/firmware/export/eros_qn_codec.h index ae04c66799..851ab63362 100644 --- a/firmware/export/eros_qn_codec.h +++ b/firmware/export/eros_qn_codec.h @@ -23,10 +23,16 @@ #ifndef _EROS_QN_CODEC_H #define _EROS_QN_CODEC_H +/* + * Note: Maximum volume is set one step below unity in order to + * avoid overflowing pcm samples due to our DC Offset. + * + * The DAC's output is hot enough this should not be an issue. + */ #define PCM5102A_VOLUME_MIN -740 -#define PCM5102A_VOLUME_MAX 0 +#define PCM5102A_VOLUME_MAX -20 -/* a small DC offset appears to prevent play/pause clicking */ +/* a small DC offset prevents play/pause clicking due to the DAC auto-muting */ #define PCM_DC_OFFSET_VALUE -1 AUDIOHW_SETTING(VOLUME, "dB", 0, 2, PCM5102A_VOLUME_MIN/10, PCM5102A_VOLUME_MAX/10, 0) diff --git a/firmware/export/erosqlinux_codec.h b/firmware/export/erosqlinux_codec.h index 2ed1ae11cf..ecc10be924 100644 --- a/firmware/export/erosqlinux_codec.h +++ b/firmware/export/erosqlinux_codec.h @@ -3,9 +3,16 @@ #define AUDIOHW_CAPS (LINEOUT_CAP) +/* a small DC offset prevents play/pause clicking due to the DAC auto-muting */ #define PCM_DC_OFFSET_VALUE -1 -AUDIOHW_SETTING(VOLUME, "dB", 0, 2, -74, 0, -40) +/* + * Note: Maximum volume is set one step below unity in order to + * avoid overflowing pcm samples due to our DC Offset. + * + * The DAC's output is hot enough this should not be an issue. + */ +AUDIOHW_SETTING(VOLUME, "dB", 0, 2, -74, -2, -40) //#define AUDIOHW_NEEDS_INITIAL_UNMUTE -- cgit