summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDana Conrad <dconrad@fastmail.com>2021-03-25 19:34:24 -0500
committerSolomon Peachy <pizza@shaftnet.org>2021-04-08 14:37:14 -0400
commitad55da5f87261d3e855998b02cc811581abe861c (patch)
tree04d7a6c53325174440b5d4865ecd1ec4d06de423
parentc77cd7027f3597384f4474c049b28014027845b6 (diff)
downloadrockbox-ad55da5f87.tar.gz
rockbox-ad55da5f87.zip
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
-rw-r--r--firmware/drivers/audio/erosqlinux_codec.c14
1 files changed, 10 insertions, 4 deletions
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;