Settings for piMusicBox 0.6 and HifiBerry Dac +?

I have a RPi2b with Musicbox 0.6 - it runs sweetly through the headphone jack. I recently I got a HiFiBerry Dac+ to push this through an amp to some good speakers. Sounds awful - distortion and clipping.

Would anyone have a settings.ini which works in this scenario they could share? I tired a couple of settings I found on forums but still distortion. Also are there any mixer or other settings which need attention which I may I have missed?

Thanks in advance.

I have HiFiBerryDAC+. In Musicbox there are two files to change:

  1. Config .txt uncommment hiberry-dacplus

# Uncomment one of these lines to enable an audio interface

#dtoverlay=hifiberry-amp

#dtoverlay=hifiberry-dac

dtoverlay=hifiberry-dacplus

#dtoverlay=hifiberry-digi

dtdebug=1

#dtoverlay=iqaudio-dac

#dtoverlay=iqaudio-dacplus

  1. Settings.ini

In the part Audio Settings, put

output = hifiberry_dacplus
mixer_volume = 90

Save files, reboot, enjoy!

Number one should not be necessary. That card should follow the exact same procedure as the others I.e put output = hifiberry_dacplus in settings.ini. If any other steps are required then that is a bug.

Thank you for the replies. I had the output = hifiberry_dacplus set already. My guess is that the mixer settings are wrong or outputting too high a volume. The settings.ini has

mixer = alsamixer

[alsamixer]
card = 0
control = digital

My guess reading around is that my mixer output settings may be too high. I’m kind of confused between Alsamixer and Amixer and how to set the output volume correctly.

I’ve tried setting Alsamixer digital to lower than 50. I’d understood that changes there would be reflected in Amixer, but that’s not happening - Amixer digital is up at 86% and a reboot destroys any changes and sets the Alsamixer level back where they were anyway. Really confused…

An update:
I think my guess was correct. The Amixer output was way high creating distortion. There’s a Github post here https://github.com/pimusicbox/pimusicbox/pull/309/files in which jcass77 suggests changes for the file /opt/musicbox/setsound.sh. It was this file which was resetting the volume level on the Amixer on each reboot. I’ve set the DAC+ line 128 to VOLUME=70 and this is producing sound with no distortion.

Despite being told by the folks at HiFIBerry that these settings are wrong, Bram_Maes posted these Attached New HiFiBerry Dac+ but now MusicBox.local stopped working! which work as far as being able to use the musicbox.local interface - which doesn’t work if you start changing things.

Having been given a RPI2b and having lost my old 30 pin Ipod, I thought this might be a good project, but I feel the sound I had from the Ipod / Pure i-20 Dac was far superior.

Hi there,

I had the same sound distortion issues at first.
The solution to my problem was to get rid of the hardware mixer control in pimusicbox.
Not only has this solved the distortion issue for me it also made the volume adjustment linear.
I’ve set “mixer = software” in the settings.ini and commented out the alsamixer section.
Now, to adjust the base volume level I used “amixer sset Digital 0dB”.
In order to make this permanent I have added that amixer line right after the startup.sh call in /etc/rc.local
In case you need a lower volume level I suggest to replace the 0dB with absolute numbers. For instance “amixer sset Digital 170” would give you -18.5dB or 67% of output volume.

I’m no audiophile, but am quite pleased with the sound quality on my HiFiBerry DAC+ setup (no distortion or clipping).

You have to use the mixer = software in settings.ini though and get amixer to 0dB for the best results. In my case this was achieved at a volume level of 81 in setsound.sh:

hifiberry_dacplus)
    modprobe snd_soc_hifiberry_dacplus
    enumerate_alsa_cards $OUTPUT
    CARD=$I2S_CARD
    VOLUME=81

…and then reference this value further down the file in:

# Set initial hardware volume
amixer set -c $CARD "$CTL" ${VOLUME}% unmute > /dev/null 2>&1 || true

Thanks both, that pretty much confirms the steps I’d taken on my last post which had stopped the distortion problems. My comments on the Dac quality were just general - I found the bass frequencies lacking any punch or presence and the more parts to the track the more the sound turns to mush.

I turned up the bass just a tad on one of my small-speaker setups. Have a look at https://github.com/pimusicbox/pimusicbox/pull/307 if you would like to give it a shot. Apart from the presets you can also use alsaeq on its own to fine tune.

Thanks John. I’ll take a look at that.