Skip to content

Commit

Permalink
Set a limit of 0dB on Digital Volume Control
Browse files Browse the repository at this point in the history
The main volume control in the PCM512x DAC has a range up to
+24dB. This is dangerously loud and can potentially cause massive
clipping in the output stages. Therefore this sets a sensible
limit of 0dB for this control.
  • Loading branch information
hmbedded authored and popcornmix committed Jun 7, 2015
1 parent f5995e9 commit 5d1809b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sound/soc/bcm/iqaudio-dac.c
Expand Up @@ -25,7 +25,13 @@

static int snd_rpi_iqaudio_dac_init(struct snd_soc_pcm_runtime *rtd)
{
// NOT USED struct snd_soc_codec *codec = rtd->codec;
int ret;
struct snd_soc_card *card = rtd->card;
struct snd_soc_codec *codec = rtd->codec;

ret = snd_soc_limit_volume(codec, "Digital Playback Volume", 207);
if (ret < 0)
dev_warn(card->dev, "Failed to set volume limit: %d\n", ret);

return 0;
}
Expand Down

0 comments on commit 5d1809b

Please sign in to comment.