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
This commit is contained in:
Dana Conrad 2021-03-25 19:34:24 -05:00 committed by Solomon Peachy
parent c77cd7027f
commit ad55da5f87

View file

@ -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;