Building a Logitech Media Server using a Raspberry Pi and HifiBerry DAC

Recipe for building a high-end media server using Logitech Media Server and a HifiBerry DAC+ Pro, Spotify, using a USB CD/DVD player.

Note that the HifiBerry DAC+ DSP allows you to do room correction. When it works, it is really great! I had one board failed but got a new one returned.
And there is still an issue: when music is very soft (e.g. speech or meditative music), the output is muted shortly, which is very annoying.
No real solution has been published yet. See also: https://support.hifiberry.com/hc/en-us/community/posts/360004296978-No-audio-output-from-RCA-with-DAC-DSP
I
t seems as if the guy with the DSP knowledge has left the company?

Hardware:

  • Raspberry PI (I prefer model 3B+ above model 4 because of lower power consumption and less heat production)
  • Micro SD card (buy a fast and reliable one). For programming you need a USB (micro) card reader and SD adapter
  • HifiBerry DAC+ PRO card of HifiBerry DAC+ DSP
  • Cabinet suitable for Raspberry Pi and HifiBerry DAC.
  • To improve the audio quality dramatically: add some filtering in the power supply (resistor + capacitor); see pictures below
  • External USB CD/DVD player with own power supply

 

How does the HifiBerry DAC+ Pro sound?

After the modification (see below), it sounds fabulous!
At first, I compared the HifiBerry DAC+ Pro against my other media player with a high-end DAC ("B-DAC", 1200 euro).
Unfortunately, the difference was rather big: the stereo image was not very detailed and it sounded a bit dull.
I think the reason for this is the noisy power supply of the Raspberry Pi.
Although the board has a buit-in voltage regulator, this does not work well for high frequency noise that comes from the power supply.
So adding a passive filter before the voltage regulator assures that the noise from the Raspberry doesn't reach the DAC.
Adding this filter improved the audio quality a lot! I cannot tell the difference with the high-end DAC anymore!

So how do you do this for the DAC+ Pro?
First you have to remove R14 (0 Ohm) SMD resistor.
The filter consists of an inductor of 100 uH (Conrad art.number 1406004), two ceramic capacitors of 22 nF, a resistor of 22 Ohm and two capacitors of 4700 uF/10V (Conrad art.number 422027).
The inductor and resistor are placed in series and replace R14.
The ceramic capacitor is connected between the connection of inductor and resistor and ground.
The two capacitors of 4700 uF are placed in parallel after the resistor and connected to ground.
Check that the electrotrolytic capacitors are mounted with the right polarity!

Do not place the capacitor at the right hand side above de DAC chip!
The capacitor might become too hot and start leaking and thus damaging the print.

  

Which storage devices can I use?

Probably the best and cheapest way is to use an USB SSD drive.
SSD drives are much faster, more reliable when powering off and have a longer lifetime.
Booting from SSD is supported by Raspberry Pi models 3B and 4.
Probably it is wise to make two partitions. One for the OS and one for the music.
In this way it is easy to make a backup of the OS partition.

Currently, I use a small (8Gb) SD card for the OS and applications only.
Two 256 Gb SD cards in the USB slots are used to store the music files (but you could use one 512 Gb SD card as well).
Also it is possible to use one big internal SD card.

Although it didn't happen to me, SD cards can get corrupt when the power is disconnected.
Therefore I make a backup image of the small SD card.

 

How to install the Operating System

  • Install the latest Raspbian OS (this comes with the HifiBerry driver installed).
  • You can install the image on a micro SD card using Win32DiskImager or Raspberry Pi Imager.
  • Connect a monitor, keyboard and mouse (or see solution below if you don't have these devices at hand).
  • Configure: Menu --> Preferences --> Raspiberry Pi Configuration:
    • Interfaces: VNC
    • Localization: set locale, set timezone, set keyboard (US International), set wifi country
    • The default username is: "pi" and the default password is "raspberry"
  • Expand file system: sudo raspi-config --expand-rootfs
  • Adjust monitor resolution: menu --> Preferences --> Raspberry Pi Configuration --> Display --> Set Resolution
  • Configure Wifi (optionally): click on wifi icon on the top bar at the righthand side.
  • After configuring Wifi, you can access the desktop using Real VNC Viewer instead of the attached keyboard and mouse.
  • Upgrade the OS to the latest version:
    • sudo apt-get update
      sudo apt-get upgrade     (this might take a while)
  • Download a VNC client for your computer (e.g. RealVNC) and connect (e.g. 192.168.2.17) remotely if you wish.
  • I personally like editor leafpad: sudo apt-get install leafpad
  • Turn off Bluetooth because it is not needed.
  • Once connected via VNC: turn off SHH and optionally enable I2C in Raspberry Pi Configuration

 

  • Alternative, if you don't have a monitor, keyboard and mouse at hand:
    • After copying the image to the SD card, create and empty file on the SD card, named "ssh" (this enables ssh)
    • Connect an ethernet cable to your Raspberry
    • Boot the Raspberry with the SD card
    • Find the IP adddress of your Raspberry (e.g. on Windows or Mac with Advanced IP Scanner or on Android with Fing)
    • Start the program PuTTY in order to start an ssh session
    • login with user: pi and password: raspberry
    • Type: sudo raspi-config
    • Select: 5 Interfacing options
    • Select: P3 VNC
    • Select: yes
    • From now on, you can use VNC (e.g. RealVNCto communicate remotely

 

How to install Logitech Media Server

Install Media Server (see this link):

  • sudo apt-get install -y libsox-fmt-all libflac-dev libfaad2 libmad0 libio-socket-ssl-perl
  • wget -O logitechmediaserver_arm.deb $(wget -q -O - "http://www.mysqueezebox.com/update/?version=7.9.4&revision=1&geturl=1&os=debarm")
  • sudo dpkg -i logitechmediaserver_arm.deb
  • sudo chown -R squeezeboxserver:nogroup /usr/share/squeezeboxserver/


You can uninstall as follows: sudo apt-get purge logitechmediaserver

To install an older version:

 

How to install the SqueezeLite music player

Install Squeeze Lite (see this link).
Alternatively (I did not yet tried out): enable the "Local player" plugin.

mkdir squeezelite
cd squeezelite
sudo wget -O squeezelite-armv6hf http://ralph_irving.users.sourceforge.net/pico/squeezelite-armv6hf-noffmpeg
sudo mv squeezelite-armv6hf /usr/bin
sudo chmod a+x /usr/bin/squeezelite-armv6hf
cd /home/pi/squeezelite
sudo wget http://www.gerrelt.nl/RaspberryPi/squeezelite_settings.sh
sudo mv squeezelite_settings.sh /usr/local/bin
sudo chmod a+x /usr/local/bin/squeezelite_settings.sh
sudo wget http://www.gerrelt.nl/RaspberryPi/squeezelitehf.sh
sudo mv squeezelitehf.sh /etc/init.d/squeezelite
sudo chmod a+x /etc/init.d/squeezelite
sudo wget http://www.gerrelt.nl/RaspberryPi/squeezelite.service
sudo mv squeezelite.service /etc/systemd/system
sudo systemctl enable squeezelite.service
cd /home/pi

Find your USB card name: sudo /usr/bin/squeezelite-armv6hf -l
For the HifiBerry DAC+ Pro you should see "sndrpihifiberry" listed. For HifiBerry DAC+ DSP it is not yet listed.
If not (e.g. with older HifiBerry cards, hardware version 2.2), then (see: https://support.hifiberry.com/hc/en-us/articles/205377651-Configuring-Linux-4-x-or-higher)

Edit the script: sudo leafpad /usr/local/bin/squeezelite_settings.sh

  •  modify: SL_SOUNDCARD="sysdefault:CARD=ALSA" to: SL_SOUNDCARD="sysdefault:CARD=sndrpihifiberry"
  • (For SoundBlaster USB device change to: SL_SOUNDCARD="sysdefault:CARD=U0x41e0x30d3")
  • uncomment line: SB_SERVER="127.0.0.1"

You might need to disable the driver for the build-in audio:

  • sudo leafpad /boot/config.txt
  • Remove line: dtparam=audio=on

CONFIGURE DEVICE TREE OVERLAY FILE:

- FOR DAC FOR RASPBERRY PI 1/DAC+ LIGHT/DAC ZERO/MINIAMP/BEOCREATE/DAC+ DSP:

  • sudo leafpad /boot/config.txt
  • Add line: dtoverlay=hifiberry-dac

- FOR DAC+ STANDARD/PRO/AMP2DAC+ STANDARD/PRO/AMP2

  • sudo leafpad /boot/config.txt
  • Add line: dtoverlay=hifiberry-dacplus

 

  • Reboot the system

 

How to install Samba (file sharing)

Install and configure Samba using this link or this link:

  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get install samba samba-common-bin
  • sudo smbpasswd -a pi
  • (you are asked to type a password twice. I use the same password as for the pi)
  • Reboot the system.

 

How to automatically reboot the system every night

Rebooting the system at night (e.g. at 5 am) can improve stability:

  • Enter command: crontab -e
    Add as the last line:
    0 5 * * * sudo /sbin/shutdown -r now

 

How to prepare a large (256Gb) intern SD  card

Instead of a small (8Gb) SD card and an external disk you can use a large internal SD card.
Even 512 Gb SD cards are cheap enough to buy now.
Suppose a configured image file of 8 Gb is available on your Windows PC.
With Win32 Disk Imager, the image is copied to the SD disk.
With Windows Disk Management you can now see a FAT boot partition of 42 Mb.
Next to that you will see a 7.4 Gb partition (containing the Raspbian OS).
And next to that you will see an unallocated partition of 231 Gb.
The unallocated partition must be formatted, preferably with NTFS on Windows, otherwise with exFAT on a Mac.
When formatted, put the SD card in the Raspberry.
You can find the name of the disk/device using the "df" command.
Create folder for mount point on the :
sudo mkdir /media/internaldisk
sudo chmod 777 /media/internaldisk
sudo mkdir /media/internaldisk/Music
sudo chmod 777 /media/internaldisk/Music
sudo leafpad /etc/fstab

Add line:
/dev/mmcblk0p3 /media/internaldisk ntfs-3g defaults,nofail 0 0

if the partition was formatted with exFAT, then add the following line instead:
/dev/mmcblk0p3 /media/internaldisk vfat defaults,nofail 0 0

Add section for network share:

sudo leafpad /etc/samba/smb.conf
Add section:
-----------------------------------------------
[InternalDisk]
comment=Raspberry Pi Media Share
path=/media/internaldisk/Music
browseable=Yes
writeable=Yes
only guest=no
create mask=0777
directory mask=0777
public=yes
-----------------------------------------------
After Logitech Media Server has started, you can configure the new media folder ("media/internaldisk").

 

My basic setting page looks like this (support internal dis and external USB disk):

 

How to prepare for an external USB disk/Memory stick

    • For attaching an SSD disk you need a conversion cable SATA to USB. The SSD might take too much current from the Raspberry, so a powered HUB might be needed. The cheapest way is to use a memory stick (fast enough).
    •  Install NTFS support:
      • sudo apt-get install ntfs-3g

 

  • Prepare the SSD/USB disk e.g. on Windows:
    • Format the disk with NTFS
    •  Note: a FAT formatted disk does not support permissions.
    • Attach a SSD/USB disk to the USB port
  •  If you do not have a Windows PC, you can format the disk with NTFS on the Raspberry Pi as follows:
    • sudo mkfs.ntfs /dev/sda1 -L usbdisk -f
  • Start the system
  • The disk is automatically mounted under: /media/pi/Media. Unfortunately, the permission cannot be changed this way.
  • sudo umount /media/pi/Media
  • Disable auto mounting in the File Manager:
  • Edit --> Preferences --> Volume Management
    Uncheck:
    - Mount mountable Volume ...
    - Mount removable media ..
  • Create a mount point:
  • sudo mkdir /media/usbdisk
  • sudo chmod 777 /media/usbdisk
  • sudo mkdir /media/usbdisk/Music
  • sudo chmod 777 /media/usbdisk/Music
  • Edit fstab: sudo leafpad /etc/fstab
  • Add line (the nofail option means that you can boot when the USB drive is not attached):
    /dev/sda1 /media/usbdisk ntfs-3g defaults,nofail 0 0
  • If you did not format with NTFS, but with exFAT, you have to change "ntfs-3g" to "vfat".
  • Reboot the system. Now the SSD disk is mounted with the right permission.
  • Add some music from your PC to the SSD/USB disk using the share "Media".
  • Find the IP address of your system: ifconfig
  • Now start any browser on any PC at home and type as URL (use the correct IP address): http://192.168.2.xxx:9000
  • You can now configure Logitech Media Server with the location of the music (/media/pi) 

I found, that when having two USB memory sticks, one was not always mounted.
A solution may be, is to add the line boot_delay=3 to /boot/config.txt

Add section for network share:
sudo leafpad /etc/samba/smb.conf
Add section:
-----------------------------------------------
[UsbDisk]
comment=Raspberry Pi Media Share
path=/media/usbdisk/Music
browseable=Yes
writeable=Yes
only guest=no
create mask=0777
directory mask=0777
public=yes
-----------------------------------------------

If you have a second USB stick, you can create folders and a share in the same way (e.g. /media/usbdisk2).

  • sudo mkdir /media/usbdisk2
  • sudo chmod 777 /media/usbdisk2
  • sudo mkdir /media/usbdisk2/Music
  • sudo chmod 777 /media/usbdisk2/Music
  • Add line to /etc/fstab:
    /dev/sdb1 /media/usbdisk2 ntfs-3g defaults,nofail 0 0

 

How to add a new USB memory stick

If you want to add or replace the USB disk/memory stick, while the software on Raspberry already has been configured:

  • Format the disk with NTFS on Windows. Otherwise format with exFAT (e.g. on a Mac).
  • Create folder "Music" on this disk

If the disk was formatted with exFAT, you have to modify file "/etc/fstab":

  • sudo leafpad /etc/fstab
  • Modify line: 
    /dev/sda1 /media/usbdisk ntfs-3g defaults,nofail 0 0
  • to:
    /dev/sda1 /media/usbdisk vfat defaults,nofail 0 0

 

How to use a NAS for storage

Instead of using local storage for the music, you could use an existing NAS.
Suppose the location of the NAS is: //192.168.2.8/Music
Preferrably you should use a name instead of the IP number.
Now enter the following commands to test the connection:

  • sudo mkdir /media/nas
  • sudo chmod 777 /media/nas
  • sudo mount -t cifs -o user=guest,password=guest  //192.168.2.8/Music /media/nas

You can now configure Logitech Media Server with the location of the music (/media/nas)

To mount the NAS automatically at boot time do:

  • sudo leafpad /etc/fstab
    Add line:
    //192.168.2.8/Music /media/nas cifs defaults,nofail,user=guest,password=guest,uid=pi,gid=pi,x-systemd.automount 0 0

 

How to configure Spotty plugin

You need Spotify Premium account to get this working.
With the latest version of Logitech Media server, the Triode Spotify plugin is not supported anymore.
Instead , you can install the Spotty plugin.

But first you have to install (may be not necessary anymore):

  • sudo apt-get install libnet-ssleay-perl
  • sudo apt-get install libio-socket-ssl-perl

How to control Spotify

After installing the Spotty plugin, there are two ways to use Spotify:

  • From your app (e.g. iPeng, SqueezeControl) that you use to control Logitech Media Server.
  • From your Spotify app on your tablet or mobile phone.
    The Spotify app offers more functions.
    It allows you to stream the music to your Logitech Media player.
    You can configure this as follows:
    From any browser: use the IP address of the raspberry followed by ":9000". E.g.: 192.168.2.18:9000
    Click on Settings button (bottom right).
    Select second tab (Music System)
    In the second dropdown box, select: Spotty Spotify for Squeezebox
    Enable the checkbox.

 

How to configure a CD player

You can attach a USB DVD player/burner to play audio CD's.
The advantage is that you do not need a preamplifier to switch between the Raspberry and CD player.
We found however that such a PC DVD player is a bit noisy sometimes and not always reliable. But you can give it a try.
The Raspberry is not capable of supplying enough current via the USB port.
So either use an external drive with own power supply (there are a lot of secondhand available) or use a powered USB hub.
Be sure to disable the power connector pin in the USB connector (e.g. by using tape).
I prefer the old drives because they are heavy. Modern lightweight drives have to be operated with two hands.

Before you can use the CDPlayer plugin, you must run the following commands to install the cdda2wav tool in this way:

  • sudo apt-get install icedax
  • sudo ln -s /usr/bin/icedax /usr/bin/cdda2wav
  • sudo adduser squeezeboxserver cdrom
  • File Manager --> Edit --> Preferences --> Volume Management --> uncheck: "Show available options for removable media"

Next you must enable the CDPlayer plugin:
From any browser: use the IP address of the raspberry followed by ":9000". E.g.: 192.168.2.18:9000

  • In the lower right corner you will see the Settting icon.
  • Open the Plugins tab.
  • Check "CDPlayer"

In Settings, you must select the database to use: "Lookup CDs on MusicBrainz".

I found out that the Raspberry did not boot in combination with a Soundblaster USB dongle when the CD drive was powered on.
It did boot when the CD drive was powered off during booting however.

 

How to set the volume to maximum?

* sudo apt-get install pimixer

Run pimixer (or alsamixer)

Use arrow up/down or PgUp/PgDn keys to adjust the volume

 

How to control the Logitech Media Server

From your smartphone or tablet: use various apps. Search in the store for "SqueezeBox".
I personally like: Squeeze Control (for Android) and IPeng (for iPhone/iPad).
From any browser. Use the IP address followed by ":9000". E.g.: 192.168.2.18:9000

 

Use ethernet cable or Wifi?

Using a network cable is highly preferable above a wifi connection:

  • Uploading music is much faster.
  • More reliable connection (especially important for radio).
  • No network configuration needed (but indeed: you only have to do this once).

 

Slow Wifi?

The internal Wifi of a Raspberry Pi is slow.
The best alternative is to buy an fast (300 Mbps) external USB Wifi dongle.

How to configure the Wifi connection?

You can configure the Wifi connection by attaching a keyboard, mouse and HDMI monitor.
In the upper right corner you will see the Wifi icon which allows you to configure the Wifi connection.
But your monitor might not have a HDMI connection. So here is an alternative using a PC or tablet.

  • Connect the Raspberry Pi to a the network using a network cable. Now the Raspberry automatically receives an IP number.
  • Find out what the IP number is (e.g. 192.168.2.18). E.g. you can use an IP scanner app (e.g. IPScan on Windows or Android Fing). Or you can find out on the web interface of your router.
  • Install "VNC Viewer" on your tablet or PC.
  • Start the VNC Viewer and enter the IP address. E.g.: 192.168.2.18
  • Now you can connect to the Raspberry and configure the Wifi connection.

 

How to put your music on the server 

On a Windows PC: 

 

How to synchronize with the music collection on a PC

For reliability reasons it is important to have a copy of your music collection somewhere else.
Suppose you have your master collection on a Windows PC in folder "c:\MyMusic".
And the music on the Rasperry is accessible via share \\RaspberryPi\InternalDisk\Music.
Then you can use the following batch file to make a copy (mirror) of the files from the PC on the Raspberry:

robocopy.exe "c:\MyMusic" "\\RaspberryPi\InternalDisk\Music" /MIR

 

Help: the radio does not work

Sometimes no music is heard when a radio channel is selected (e.g. NPO radio 4).
The reason is that the default format of the stream for the selected radio is not supported by Logitech Media Server.
The solution is to select another stream format. This is how:

  • First, find an URL that works. Search in Google for example for "npo radio 4 url". I found: http://icecast.omroep.nl/radio4-bb-mp3
  • See also: https://www.mp3streams.nl
  • Or look at this nice overview: http://www.hendrikjansen.nl/henk/streaming.html
  • From any browser: use the IP address of the raspberry followed by ":9000". E.g.: 192.168.2.38:9000
  • Goto menu: Radio -> URL
  • Now enter the URL found and press the button next to it.
  • If this URL works, the next step is to add this to the favourites.
  • You can do this by clicking on the M (more) button on the right hand side of the screen (only visible when you hover the mouse over the music item on the right hand side).
  • Now more information for the stream is shown on the left hand side of the screen.
  • Here you can click on the first item: Save to favorites. Nice user interface!
  • Unfortunately, the added title is sometimes cryptic and cannot be changed easily.
  • If you really want to change the title, you can change this with a text editor (as super user) on the server in: /var/lib/squeezeboxserver/prefs/favorites.opml

 This is the list I added for my music server:

  

How to remote shutdown the Raspberry from your smartphone

It is always safer to shutdown the Raspberry Pi than removing the power directly.
This reduces the risk of damaging the SD card.
This can be easily accomplished by installing Node-RED and creating a simple program to shutdown the Raspberry.
With Node-RED it is simple to create a web page with just a shutdown button.
Using the browser on your smartphone you can pin this application to the start screen.

See section: HifiBerry DAC+ DSP filter selection

 

Backup the image

Creating the image will take some time.
Therefore it is important to backup the image of the SD card to file.
On Windows you can use "Win32DiskImager".
You can also use the exisiting "SD card copier" application (in Accessories) on the Raspberry Pi.

I found that after putting in a copy of the SD card, Logitech Media Server only worked well after rebooting once.

 

Room correction

Better than doing room correction by software is to treat the room. For instance with an acoustic ceiling (e.g. stosilent).

The HifiBerry DAC+ DSP allows you to do room correction.

When it works, it is great! I had one board failed but got a new one returned.
So I have questions about the reliability.
I got error message: 
"10 filters given, but filter bank has only 0.0 slots." The Hifiberry forum shows that that many people have encountered the same issue.

For configuration see the next chapter.

 

The Inguz plugin does not work any more because it relies upon an old version of Mono.
Also it works only for FLAC files of your own music collection.
So, it does not work for the other sources (Spotify, radio, CD).
Still you could install it because of the test signals it supplies (see below).

An alternative plugin for Room Correction is: http://drc-fir.sourceforge.net
See also: http://archimago.blogspot.com/2016/03/howto-logitech-media-server-brutefirdrc.html
I
t is faster than Inguz plugin but it is complicated to configure. 

 

HifiBerry DAC+ DSP configuration

For making a DSP profile file I ordered the following hardware for my laptop:
* USB-C DAC Toslink Optical AUX Audio Adapter 192kHz 24bit Headset Amplifier USB Sound Card

* 2M Mini 3.5mm Plug Digital Optical Audio Cable SPDIF Optical Fiber Line To Round Mouth TOSLINK Optical Audio Connector Dropship
* miniDSP UMIK-1 Omni-Directional USB Measurement Calibrated Microphone or Dayton Audio UMM-6 measuring microphone UMM-6

I found some issues during installation and configuration. Answers can be found on the Community pages (strangely enough not in the documentation).


After mounting the board, checkout: https://www.hifiberry.com/docs/data-sheets/datasheet-dac-dsp/

It says that you must modify /boot/config.txt:
* sudo leafpad /boot/config.txt
* add line: 
dtoverlay=hifiberry-dac

The next step is to follow the installation instructions in: https://www.hifiberry.com/docs/software/implementing-room-acoustics-correction-using-rew/
or, on Github: https://github.com/hifiberry/hifiberry-dsp/blob/master/doc/rew-basics.md
Currently there are small differences between these two documents.

Install the dsptoolkit:

* bash <(curl https://raw.githubusercontent.com/hifiberry/hifiberry-dsp/master/install-dsptoolkit)
You will see that the last command fails: mv: failed to preserve ownership for '/boot/config.txt': Operation not permitted
This error message can be ignored and is due to the fact that the boot folder is on a FAT partition.
Check:
* sudo leafpad /boot/config.txt
* Assure that the following line exists: dtparam=spi=on

Reboot the Raspberry Pi.

The DSP is loaded with some profile in the factory.
When you would install a filter right now, you get error message: "15 filters given, but filter bank has only 0 slots".
Therefore you have to install the default profile first: 
* dsptoolkit install-profile https://raw.githubusercontent.com/hifiberry/hifiberry-dsp/master/sample_files/xml/dacdsp-default.xml

I found that sometimes after a power down, I cannot load filters any more. I had to reinstall the profile and reboot the Raspberry Pi!
This command seems to help: dsptoolkit store
The documentation of the dsptoolkit is not very clear about this: 
https://pypi.org/project/hifiberrydsp/0.10/


Note that the colors of the output connectors (red, white) on the DAC board are wrong. They should be reversed. So red is left!

 
This profile has an automute function. This gives a problem if you play the music (or radio) very softly.
This is very annoying. In the Community pages of Hifiberry.com this issue is mentioned and it is advised to load profile dspdac-noautomute.xml.
However, this profile creates a DC offset of 1V at the output. No idea why. This gave me a problem with my amplifier. The profile also does not work.
I made an issue for this. This is there answer: "
We don't work on this profile anymore. The profile is provided as-is. There won't be any further updated from us on this profile."

The next thing to do is to download the program REW and create your profile as described in this documentation.
Note that the DSP supports 16 filters at maximum.
You might prevent REW creating more filters by disabling 5 filters in the Settings menu.
The nice thing is that you can modify the desired curve. You can filters with different slopes and try out what sounds best for you.

For creating your own profile, see this documentation.
Sample profiles can be found here.
Sample profiles projects can be found here.

 

 

And the result in one word: fabulous!

 

HifiBerry DAC+ DSP filter selection

Once you have created one or more room correction filters, you want to be able to select them from your phone or tablet.
This can be easily accomplished by a simple program in Node-RED.

You can follow these steps:

Create a folder for the filter files and export this folder via Samba:

* sudo mkdir /media/internaldisk/roomcorrection
* sudo chmod 777 /media/internaldisk/roomcorrection
* sudo leafpad /etc/samba/smb.conf

Add following section and reboot afterwards:
[RoomCorrection]
 comment=Room correction files
 path=/media/internaldisk/roomcorrection
 browseable=Yes
 writeable=Yes
 only guest=no
 create mask=0777
 directory mask=0777
 public=yes


Install Node-RED:

* sudo apt-get update
* sudo apt-get upgrade
* bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
* sudo systemctl enable nodered.service
* reboot

By adding a setting in settings.js, flow variables are saved automatically every 30 seconds:
* leafpad .node-red/settings.js
Add setting:
    contextStorage: { default: { module:"localfilesystem" }, },

Now it is time to reboot the Raspberry.

Show the editor: launch a web browser and type in the address bar: <ip address raspberry>:1880


Install "Dashboard" plugin: click on the menu button (three horizontal line in upper right corner) and Manage Palette.
Click on "Install" and type "dashboard" in the search bar. Install: node-red-dashboard

Import the program: click on the menu button (three horizontal line in upper right corner), Import and paste the code from this file.

Install the program: click on the Deploy button in the upper right corner.

Show user interface in your browser: launch a web browser and type in the address bar: <ip address raspberry>:1880/ui
Your browser on your phone and tablet has an option to add this page to your start screen. 
Now it behaves as an app. It has three tabs (or pages). One allows you to shutdown/reboot the Raspberry.

Example screenshot

 

HifiBerry DAC+ DSP power supply modification

3D printed case for Raspberry Pi 3B and HifiBerry DAC+ DSP, designed by Alfred Homsma. You can download the 3D files here.

 

 

This DAC supports room correction.


Although the board has a voltage regulator, this does not work well for higher frequencies.
So adding a passive filter before the voltage regulator assures that the noise from the Raspberry doesn't reach the DAC.

Due to the DSP, the power consumption of this model is higher than the DAC+ Pro.
Therefore the resistor of 22 Ohm is not possible here.
The 3.3V input regulator on the board requires an input voltage of at least 4.2 V.
The Raspberry Pi voltage is at least 5.1V.
Therefor the voltage drop over the inductor is about 0.9V.
With an average current consumption of 0.2A, the resistance of the inductor should be no more than 4.5 Ohm.
The pin layout of the Raspberry Pi can be found here.
Do not place the capacitors above the hot electronic devices (voltage regulators)!

First cut the +5V track.
The filter consists of two inductors of 470 uH and two capacitors of 4700 uF/10V (Conrad art.number 422027).

 

 

 

How to configure the Inguz EQ plugin

Currently, I cannot get it working. An older version of Mono is required!

I tried with the following instructions, but without succes:
https://blog.rubenwardy.com/2016/07/20/rimworld-install-monodevelop-with-dot-net-3.5/

I think that it is only useful for the test signals. The room correction can be done better with the Hifiberry DAC+ DSP.

Inguz EQ is a plugin for supplying equalizer functionality and DRC (Digital Room Correction).
It also supplies test signals like left/right identifier, noise, etc. Very nice!
Those test signals are a good reason to install this plugin anyway!
Once installed, you can find them in menu: Extras --> EQ --> Settings --> Test Signals

You can find the software here: https://github.com/hughpyle/inguz-InguzDSP

There is no support any more for this plugin unfortunately.
Note that a small change in the file Plugin.pm is required for LMS version 7.9.1.

How to install the Inguz EQ plugin:

First, update the OS:
sudo apt-get update
sudo apt-get upgrade
Now get Mono (this supplies .NET functionallity):

TODO we need an older version of mono. The next line will install the latest mono version!
sudo apt-get install mono-complete

 

 

Download two zip files: EQ processor and DSP processor from: http://inguzaudio.com/EQ
After downloading you will find the downloads in: /home/pi/Downloads
In File Manager right click on the InguzEQ.zip file and do: Extract here (extracts a folder).
In File Manager right click on the InguzDSP.zip file and do: Extract here (extracts 3 files).

sudo mv /home/pi/Downloads/InguzEQ /usr/share/squeezeboxserver/Plugins
sudo chown squeezeboxserver /usr/share/squeezeboxserver/Plugins/InguzEQ
sudo mv /home/pi/Downloads/InguzDSP.exe /usr/sbin
sudo mv /home/pi/Downloads/InguzDSP.exe.config /usr/sbin
sudo mv /home/pi/Downloads/DSPUtil.dll /usr/sbin
cd /usr/sbin
sudo chmod +x DSPUtil.dll
sudo chmod +x InguzDSP.exe
sudo mkdir /usr/share/squeezeboxserver/.wapi
sudo chown squeezeboxserver /usr/share/squeezeboxserver/.wapi

Now create the file /usr/sbin/InguzDSP:
sudo leafpad /usr/sbin/InguzDSP
Enter contents:
#! /bin/sh
mono /usr/sbin/InguzDSP.exe $* 2>/usr/share/InguzEQ/error

Next:
sudo chmod +x /usr/sbin/InguzDSP
sudo chmod 777 InguzDSP

There is some deprecated code in Plugin.pm that prevents the plugin from starting.

sudo leafpad /usr/share/squeezeboxserver/Plugins/InguzEQ/Plugin.pm
Change line 3138 to ("%h->" change to "$h"):

         $request->addResultLoop( 'Points_loop', $cnt, $ff, $h{$ff} );

In Settings of LMS enable the EQ plugin.
Note that the user interface is crippled because no Silverlight can be installed (not a real issue).

Multiple reboots might be needed in order to get it working (it did not the first time with me).
Configuration and log files are created in: /usr/share/InguzEQ

The equalizer settings files are created in:
/usr/share/InguzEQ/Settings

To restart the Logitech Media Server:
sudo service logitechmediaserver stop
sudo service logitechmediaserver start

You cannot configure the plugin from the browser anymore because this requires SilverLight (which is deprecated).
But you can configure the plugin (equalizer, room correction) from your app on your phone or tablet.

Create a folder for the room correction files:
sudo mkdir /usr/share/InguzEQ
sudo chmod 777 InguzEQ
sudo mkdir /usr/share/InguzEQ/Impulses

When sharing this folder for everyone, also change the folder permission:
sudo chmod 777 /usr/share/InguzEQ/Impulses

Make a share for the room correction Impulses folder:
sudo leafpad /etc/samba/smb.conf
Add section:
[Impulses]
 comment=Room correction files
 path=/usr/share/InguzEQ/Impulses
 browseable=Yes
 writeable=Yes
 only guest=no
 create mask=0777
 directory mask=0777
 public=yes

 

How to create a DRC correction file for InguzEQ

This can be done using one of the following tools:

  • DrcDesigner: http://www.alanjordan.org/DRCDesigner/DrcDesignerHelp.html
    This tool works nicely.
    One quirk: on the tab "Generate Standard Filters", the button "Generate Selected Filters" becomes active only after reselecting the Sampling Rate.
    The generated correction files can be found in: c:\DRCDesigner\ConvolverFilters

For Inguz EQ plugin, room correction files (44100 hz) must be saved to: /usr/share/InguzEQ/Impulses