Posts

RuneAudio working with HifiBerry Amp+ on RaspberryPi

Raspberrypi with hififiberry Amp+ and runeaudio hifi

This is a record of how I managed to the RuneAudio v0.3-beta software working with the excellent Hifiberry Amp+. The lads at runeaudio say that software release v0.4 will support Amp+ ‘out of the box’ but v0.3-beta doesn’t and they won’t/can’t say when v0.4 of the software will be released, however with some messing it can be made to work – which is great.

I really like runeaudio, and the sound quality with Hifiberry Amp+ and 2 venerable Monitor Audio speakers is really very good!

Anyway, all of the information required to setup runeaudio to work with the Amp+ can be found in bits and pieces on the runeaudio forum thatnks to everybody there! These steps worked for me during April 2015.

I found I had to add or modify a few steps so I will detail this here. These steps worked for me, but please backup before you proceed in case something goes wrong! To get going first install the runeaudio software for the raspberry pi.

The main set of steps to get Amp+ working can be found in this post by d2000:

http://www.runeaudio.com/forum/hifiberry-amp-t545.html

I just had to add a step or two as follows:

a.) Perform step 1.

b.) Execute:

pacman-db-upgrade

to update the database, this is a new step. Without this I got an error message when I tried to run step 2.

c.) Perform Steps 2 to 13

d.) Edit /boot/config.txt again and place the following line at the end of the file:

dtoverlay=hifiberry-amp

If you reboot at this stage you may find that browsing to runeaudio’s home page produces a 404 error (I did), we fix this in the next step as detailed in this post.

e.) Edit /usr/lib/systemd/system/redis.service and replace its contents with:

[Unit]
Description=Advanced key-value store
After=network.target
[Service]
#Type=forking
User=redis
PIDFile=/run/redis/redis.pid
ExecStartPre=/bin/mkdir -p /var/lib/redis
ExecStart=/usr/bin/redis-server /etc/redis.conf
ExecStop=/usr/bin/redis-cli shutdown
Restart=always
RestartSec=1
StartLimitInterval=30
StartLimitBurst=20
[Install]
WantedBy=multi-user.target

f.) Reboot

g.) Visit runeaudio, go to the Settings page and choose ‘HiFiBerry Amp’ in the ‘I²S kernel modules’ drop-down and click apply settings.

h.) Go to the runeaudio’s MPD page and choose ‘snd_rpi_hifiberry_amp’ in the ‘Audio output Interface’ drop-down.

i.) Check that ‘Volume Control’ setting is ‘Enabled – Software’

j.) Reboot

When the system restarts you should be able to play music with software volume control, you will find that hardware volume control won’t work with this set-up, the volume keeps popping back to 100 when you try to set it!

Hardware Volume Control

To get hardware volume control working I did the following, based on the advice in this post:

a.) Execute the following to list the configured sound devices:

aplay -l

The output will look something like this:

**** List of PLAYBACK Hardware Devices ****
card 0: sndrpihifiberry [snd_rpi_hifiberry_amp], device 0: HifiBerry AMP HiFi tas5713-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Try to figure out which is yours, you can see from the output above that mine is device 0, sub-device 0.

b.) Edit /etc/mpd.conf and replace the ‘audio_output’ section at the end with the following, changing the values for ‘device’ and ‘mixer_device’ to match yours:

audio_output {
        name            "snd_rpi_hifiberry_amp"
        type            "alsa"
        device          "hw:0,0"
        mixer_type      "hardware"
        mixer_control   "Master"
        mixer_device    "hw:0"
        mixer_index     "0"
        auto_resample   "no"
        auto_format     "no"
        enabled         "yes"
}

d.) When runeaudio reboots it will revert the changes in mpd.conf so you have to prevent it by making the file read-only, do this at your own peril!

chattr +i /etc/mpd.conf

Then reboot, when the system restarts you should have hardware volume control and nicer sound, you will have to turn the volume up above 20 to hear it.

Links:
Thanks to all at the runeaudio forum!

http://www.runeaudio.com/forum/hifiberry-amp-t545.html
http://www.runeaudio.com/forum/getting-404-not-found-nginx-1-4-7-t909.html
http://www.runeaudio.com/forum/hifiberry-amp-volume-t1078.html

RaspberryPi media player rune aduio, hifiberry amp+

Raspberry Pi – Neewer HDMI To VGA Adapter Setup

The Neewer HDMI Input To VGA Adapter allows you to hook your Pi up a venerable VGA display via the HDMI port, this is handy if you have an old VGA only screen hanging around doing nothing.

 

It is very neat adaptor and I found that it works well with good video quality, but it requires a little bit of set-up to get it working with audio being output via the headphone jack.

 

It took me quite a while to figure out the settings to change in /boot/config.txt to get it to work (it was a a fairly random process… ;-) ), but in the end it was simple enough – here’s what worked for me:

 

In /boot/config.txt, set the value of hdmi_drive to 2, like this:
[code]
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
hdmi_drive=2
[/code]
But how do you make these changes to config.txt if the screen isn’t working? well you have two options here:

 

1.) SSH into your pi (if it’s connected to your network), or

 

2.) Power it down and pop out the SD card, place the SD card into your laptop or whatever and edit the file there, put the SD card back into your Pi to test.

 

This should be enough to get the display working, now to get the sound to come out of the headphone socket I had to run the following commands from terminal:
[code]
sudo amixer cset numid=1 — 90%
sudo amixer cset numid=3 1
[/code]
The first sets the volume to 90% (it was at 0?). The second sets the headphone jack as the output port for sound, I test if the audio setting are working by running:
[code]
sudo aplay /usr/share/sounds/alsa/Front_Center.wav
[/code]
When you run this you should hear somebody muttering about something to do with front and centres!

 

I think that there are versions of these HDMI to VGA adaptors with sound built in, so if audio is important to you this adaptor may be a better buy than this one…

 

RaspberryPi & Lego ‘super-computing’ cluster!

Fantastic! The University of Southampton have created a ‘supercomputer’ cluster from a load of RaspberrryPis and some Lego, The Register writes about it here:

 

I think it’s the Lego that makes it!

 

#Drupal 7 on #RaspberryPi

Class, just found this post that makes mention of Drupal 7 successfully hosted on a Raspberry PI!

 

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=9&t=5199

 

Brilliant, it’s like chocolate and mint, my two favourite things brought together, I have have just found myself a new hobby!