HiFiBerry AMP+ Hardware Volume Control

Raspberry Pi related support

Re: HiFiBerry AMP+ Hardware Volume Control

Postby boydwilluk » 12 Feb 2016, 11:09

Good Morning Frank

Success! Hardware Volume Control enabled and working properly - no messing about with mpd.conf

Is it OK if I post the full set of instructions on the HiFiBerry forum?

Thanks for your patience and help,

Boyd.
boydwilluk
 
Posts: 15
Joined: 09 Feb 2016, 20:11

Re: HiFiBerry AMP+ Hardware Volume Control

Postby hondagx35 » 12 Feb 2016, 13:57

User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: HiFiBerry AMP+ Hardware Volume Control

Postby boydwilluk » 12 Feb 2016, 14:59

Hello Frank,

I tried this put a few times (using different cards) just to check that all was well.

I found that I had to follow the procedure twice, from after the config.txt edit onwards to get it to work. BUt it did work every time on the second attempt.

Perhaps I am missing a reboot somewhere in the process. Here are my revised instructions (for others to follow.) Can you please verify they are OK, and if so I will post them on the HiFiBerry website.

Regards,

Boyd.


How to enable Hardware Volume Control (for best sound quality) on RuneAudio
with Raspberry Pi2 and HiFiBerry AMP+

These instructions are for use with a Windows PC. Follow these steps carefully - do not change the order!
1. Download an image of Runeaudio from: http://www.runeaudio.com/download/
(make sure that you pick the version for Raspberry Pi2
2. Write the image to an SDHC card (using Win32 DiskImager)
https://www.raspberrypi.org/documentati ... windows.md
3. Insert the SDHC card into the Raspberry PI, and power it up, with an Ethernet cable connected to your LAN. Wait till it has booted up.
4. From an Internet browser, go to Runeaudio/local
5. When the Runeaudio GUI appears, go to the Menu (top right), click on network, and make a note of the LAN IP address. DO NOT MAKE ANY CHANGES AT THIS POINT!
6. Launch PuTTY - (you can download a copy from here: http://www.putty.org/)
Type the IP address of the Pi2 into the “Host Name (or IPaddress)” box in PuTTY
and click Open - click Yes when the PuTTY security alert appears.
7. Log in to the Raspberry Pi. The user name is root, the password is rune.
8. Edit Rune’s configuration file (config.txt) to enable HiFiBerry AMP+
type this command in PuTTY
nano /boot/config.txt

then use the ↓ (down) button on your keyboard to scroll down the listing, until you reach the section which reads

# Uncomment one of these lines to enable an audio interface
#device_tree_overlay=hifiberry-dac
#device_tree_overlay=hifiberry-dacplus
#device_tree_overlay=hifiberry-digi
#device_tree_overlay=hifiberry-amp
#device_tree_overlay=iqaudio-dac
#device_tree_overlay=iqaudio-dacplus
Scroll to the line #device_tree_overlay=hifiberry-amp, and click the delete key, to remove the # symbol, so that the line reads: device_tree_overlay=hifiberry-amp
Do NOT make any other changes to config.txt
Click Ctrl-x to exit the nano editor, and type Y to make the change, then hit Enter to write the change to the config.txt file.
9. The next stage is to download some updates to the Rune audio software. Don’t panic, just follow the instructions, and do NOT reboot the Pi until you have completed this section.
Type these commands in PuTTY
cd /srv/http
git stash
git pull
(after typing the first line, PuTTY will show: [root@runeaudio ~]# cd /srv/http)
(after typing the second line, PuTTY will show:
Saved working directory and index state WIP on dev: 35c5cba Fix mpd global random
HEAD is now at 35c5cba Fix mpd global random
[root@runeaudio http]#)
(after typing the third line, lots of lines of stuff will appear!
Wait till all this activity has stopped, and PuTTy shows [root@runeaudio http]# )
Type exit to leave the PuTTy session.
From the browser, click Menu, Power Off, and select reboot.
Launch PuTTy and log-in again once the reboot is complete
Then type each of these lines:
redis-cli del acards
/var/www/db/redis_acards_details
/var/www/command/refresh_ao
(You will see warnings/errors after typing this third line, just ignore them!)
Then type each of these lines:
sync
reboot
You can now close PuTTy


10 Now return to the web browser, and verify that all the changes have been successful.
Click on Menu, then click Debug.
Scroll down (about two pages) until you find the section with this heading
###### mpd.conf ######
###################################
# Auto generated mpd.conf file
# please DO NOT edit it manually!
# Use RuneUI MPD config section
###################################

About 40 lines below this, you will find this section. It should look exactly like this:
audio_output {
name "snd_rpi_hifiberry_amp"
type "alsa"
device "hw:1,0"
mixer_control "Master"
mixer_type "hardware"
mixer_device "hw:1"
auto_resample "no"
auto_format "no"
enabled "yes"

If it doesn’t look exactly like this, then go back and try everything again.
(If you proceed with the following sections, Hardware Volume control will NOT be enabled, and HiFiBerry AMP+ will play at full volume - deafening!)
11. If the changes have been successful, you can now complete the setup of Rune Audio.
Click on MPD, and set up the following parameters:
Audio Output Interface: HiFiBerry Amp+(I2S)
Volume control: enabled - hardware
Start volume: (I set this to 35, so that the audio is just audible when playback starts)
Volume knob: (your choice of real-time or on-release)
Then click on Save and Apply
12. You can now set up time zone, sources, network etc etc., and enjoy playing your music.
boydwilluk
 
Posts: 15
Joined: 09 Feb 2016, 20:11

Re: HiFiBerry AMP+ Hardware Volume Control

Postby PeteB » 12 Feb 2016, 20:06

Hi Boyd,

Great set of instructions for the Amp+. You may want to make a note that the HiFiBerry DAC+ and DAC+PRO have a different chip set/dac, so things don't work out quite the same. I don't mean that your directions are bad, but the outcome is different (I tried it to see what the results were)

For anyone who wants to try this method, when done the audio output section will read like the one below, but the output will still be distorted at the higher hardware volume settings, compared to leaving volume control disabled.

audio_output {
name "snd_rpi_hifiberry_dacplus"
type "alsa"
device "hw:1,0"
mixer_control "Digital"
mixer_type "hardware"
mixer_device "hw:1"
auto_resample "no"
auto_format "no"
enabled "yes"
}

At least in the case of the HiFiBerry DAC+, when volume control is left disabled, the volume control in the GUI will read 100, BUT the output at that setting is usable (probably ~0db or ~2V RMS at the line out).

When hardware volume control is enabled using this method, the output is seriously distorted at the same settings. So in this case hardware volume control is definitely not better than software control.

It occurred to me that my DAC+ might be damaged or not working correctly, but when I test volume control using amixer and amixer sset commands, it works as described on the HiFiBerry web site, with no distortion.
PeteB
 
Posts: 421
Joined: 06 Feb 2016, 05:07

Re: HiFiBerry AMP+ Hardware Volume Control

Postby hondagx35 » 12 Feb 2016, 21:36

Hi all,

distortion with hardware volume on Hifiberry DAC+ is a known issue (see )
A hardware volume setting of 81 equals 0dB and should be same as 100 with software or disabled.

We have to find a solution for this.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: HiFiBerry AMP+ Hardware Volume Control

Postby PeteB » 12 Feb 2016, 22:12

Frank: I have seen that post you linked above, and forgive me if I am speaking out of turn here, but are you sure that the current setting is 100 ~ +4db? Seems a bit more than that.

I agree that somewhere around 80~85 seems to correspond to 0 db but cannot confirm this without access to better gear.

The other issue is that from ~80 down to inaudible, there is not enough useful range.

Down volume below 80, the sound quickly gets worse. I mean not just lower volume, but worse. This did not seem the case when I tested with the directions for amixer posted on HiFiBerry web site. I am not in possession of a "golden ear" or audio gear to match, but with even mid-price headphones/headphone amplifier it is obvious that turning on hardware volume control is not an improvement on any other options.

Having said that, I am perfectly happy with Rune Audio and leaving volume control disabled!

(The analog volume control knob on my headphone amp or receiver works just fine... :D)

Edit/Note for other DAC+ owners:

Amixer also allows another control parameter for -6db attenuation, which is can actually be the sweet spot, either because it avoids coming too close to the max input range for some gear, or some reason related to how the dac works.
PeteB
 
Posts: 421
Joined: 06 Feb 2016, 05:07

Re: HiFiBerry AMP+ Hardware Volume Control

Postby aceofdaves » 15 Feb 2016, 05:32

This issue also exists using an ODAC (rev A) and a Raspberry Pi 2 running the latest beta. Above ~80 on the hardware volume and the signal starts to clip.

When just using alsamixer, you can also produce clipping at the higher volume settings. This seems odd since the information available via alsamixer suggests that 'max' is 0.0 dB.

Edit: looks like this was a known problem with the ODAC rev A itself. The use of a USB power injector completely solved the problem. Hardware volume works great. System sounds awesome!
Last edited by aceofdaves on 29 Feb 2016, 06:14, edited 1 time in total.
aceofdaves
 
Posts: 2
Joined: 13 Feb 2016, 01:43

Re: HiFiBerry AMP+ Hardware Volume Control

Postby PeteB » 15 Feb 2016, 18:11

PeteB
 
Posts: 421
Joined: 06 Feb 2016, 05:07

Re: HiFiBerry AMP+ Hardware Volume Control

Postby deenski » 24 Jul 2016, 19:23

Question: Is the process the same for the Raspberry Pi 3?
deenski
 
Posts: 10
Joined: 23 Jul 2016, 16:47

Re: HiFiBerry AMP+ Hardware Volume Control

Postby hondagx35 » 24 Jul 2016, 23:19

User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

support RuneAudio Donate with PayPal

PreviousNext

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 33 guests
cron