summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/pcm-alsa.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2021-04-08 23:58:49 -0400
committerSolomon Peachy <pizza@shaftnet.org>2021-04-08 23:58:49 -0400
commit1e2a9a651c26b7526530428b248132e02624bb84 (patch)
tree190d6e83db300c43481c62b94d2ff7d4cc59db08 /firmware/target/hosted/pcm-alsa.c
parente86d90905be290ff24a774e9687eca3236953490 (diff)
downloadrockbox-1e2a9a651c26b7526530428b248132e02624bb84.tar.gz
rockbox-1e2a9a651c26b7526530428b248132e02624bb84.zip
erosq: Switch to 32-bit PCM output, and do volume scaling in driver
Should improve audio output quality, especially at lower volumes. Change-Id: I31c38f05fe4b554b092511f0fe7aaad9f346f6c5
Diffstat (limited to 'firmware/target/hosted/pcm-alsa.c')
-rw-r--r--firmware/target/hosted/pcm-alsa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/firmware/target/hosted/pcm-alsa.c b/firmware/target/hosted/pcm-alsa.c
index 16f82bad5c..81c0a19a45 100644
--- a/firmware/target/hosted/pcm-alsa.c
+++ b/firmware/target/hosted/pcm-alsa.c
@@ -277,7 +277,7 @@ static int dig_vol_mult_r = 2 << 16; /* multiplicative factor to apply to each s
277void pcm_set_mixer_volume(int vol_db_l, int vol_db_r) 277void pcm_set_mixer_volume(int vol_db_l, int vol_db_r)
278{ 278{
279 if(vol_db_l > 0 || vol_db_r > 0 || vol_db_l < -43 || vol_db_r < -43) 279 if(vol_db_l > 0 || vol_db_r > 0 || vol_db_l < -43 || vol_db_r < -43)
280 panicf("invalid pcm alsa volume"); 280 panicf("invalid pcm alsa volume %d %d", vol_db_l, vol_db_r);
281 if(format != SND_PCM_FORMAT_S32_LE) 281 if(format != SND_PCM_FORMAT_S32_LE)
282 panicf("this function assumes 32-bit sample size"); 282 panicf("this function assumes 32-bit sample size");
283 vol_db_l += 48; /* -42dB .. 0dB => 5dB .. 48dB */ 283 vol_db_l += 48; /* -42dB .. 0dB => 5dB .. 48dB */