Skip to content

Instantly share code, notes, and snippets.

@pamaury
Created April 30, 2013 10:53
Show Gist options
  • Save pamaury/5487990 to your computer and use it in GitHub Desktop.
Save pamaury/5487990 to your computer and use it in GitHub Desktop.
diff --git a/firmware/target/arm/imx233/audioout-imx233.c b/firmware/target/arm/imx233/audioout-imx233.c
index e9b368c..c25a7ec 100644
--- a/firmware/target/arm/imx233/audioout-imx233.c
+++ b/firmware/target/arm/imx233/audioout-imx233.c
@@ -152,9 +152,12 @@ static void apply_volume(void)
else
{
/* In DAC mode we can use both the HP and the DAC volume.
- * Use the DAC for volume <0 and HP for volume >0 */
+ * Always use the lowest possible HP volume to minimise noise:
+ * minimum is -57.5dB */
+ set_hp_vol(MAX(-115, hp_vol_l), MAX(-115, hp_vol_r));
+ hp_vol_l -= MAX(-115, hp_vol_l);
+ hp_vol_r -= MAX(-115, hp_vol_r);
set_dac_vol(MIN(0, hp_vol_l), MIN(0, hp_vol_r));
- set_hp_vol(MAX(0, hp_vol_l), MAX(0, hp_vol_r));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment