From ad55da5f87261d3e855998b02cc811581abe861c Mon Sep 17 00:00:00 2001 From: Dana Conrad Date: Thu, 25 Mar 2021 19:34:24 -0500 Subject: ErosQ: Set Line Level Output volume With a full-scale 440Hz tone, the line out voltage measured approx. 5.8Vpp at the 0 setting. WAY too hot! (9 dBV, in fact) For 0.894Vpp (-10 dBV - consumer devices), -18 appears to be about right for line level signals, but for "pro" equipment a different level may be desired. Therefore, the user to cap the line out level by re-using the global volume limit setting. Change-Id: I0d1d6482ea95537e9a2d00884eaee2713771c614 --- firmware/drivers/audio/erosqlinux_codec.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'firmware/drivers/audio/erosqlinux_codec.c') diff --git a/firmware/drivers/audio/erosqlinux_codec.c b/firmware/drivers/audio/erosqlinux_codec.c index c288c63c4f..2812960cb4 100644 --- a/firmware/drivers/audio/erosqlinux_codec.c +++ b/firmware/drivers/audio/erosqlinux_codec.c @@ -35,6 +35,8 @@ #include "pcm-alsa.h" #include "pcm_sw_volume.h" +#include "settings.h" + #include "logf.h" /* @@ -175,8 +177,12 @@ void audiohw_set_volume(int vol_l, int vol_r) vol_r_hw = vol_r; if (lineout_inserted()) { - l = 0; - r = 0; + /* On the EROS Q/K hardware, line out is _very_ hot + at ~5.8Vpp. As the hardware provides no way to reduce + output gain, we have to back off on the PCM signal + to avoid blowing out the signal. + */ + l = r = global_settings.volume_limit; } else { l = vol_l_hw; r = vol_r_hw; @@ -198,8 +204,8 @@ void audiohw_set_lineout_volume(int vol_l, int vol_r) (void)vol_r; if (lineout_inserted()) { - l = 0; - r = 0; + l = -180; + r = -180; } else { l = vol_l_hw; r = vol_r_hw; -- cgit v1.2.3