Higher bitdepth software volume scaling

Operates between 0 and -74 dB (mute) without issue

Change-Id: I497e002bd8db43833a09ebbc29212fbb6cc8ebfd
This commit is contained in:
Dana Conrad 2021-08-01 21:58:33 -05:00 committed by Aidan MacDonald
parent 16b0098256
commit 56b0dde545
5 changed files with 118 additions and 32 deletions

View file

@ -70,10 +70,14 @@ void audiohw_set_volume(int vol_l, int vol_r)
}
#endif
l = l <= PCM5102A_VOLUME_MIN ? PCM_MUTE_LEVEL : l;
r = r <= PCM5102A_VOLUME_MIN ? PCM_MUTE_LEVEL : r;
pcm_set_master_volume(l, r);
if (l <= PCM5102A_VOLUME_MIN || r <= PCM5102A_VOLUME_MIN)
{
pcm_set_master_volume(PCM_MUTE_LEVEL, PCM_MUTE_LEVEL);
}
else
{
pcm_set_master_volume(l/20, r/20);
}
}
void audiohw_mute_hp(int mute)