Create this file: .config/modules-load.d/hifiberry.conf
And make its contents:
snd_soc_bcm2708_i2s
bcm2708_dmaengine
snd_soc_hifiberry_dacplus
Create or edit this file: /storage/.xbmc/userdata/advancedsettings.xml
And make it include this:
<advancedsettings> <video> <defaultplayer>dvdplayer</defaultplayer> <defaultdvdplayer>dvdplayer</defaultdvdplayer> </video> </advancedsettings>
Create this file: /storage/.config/modprobe.d/disable-lirc.conf
And make its contents:
blacklist lirc_rpi
Now a change that isn't in the hifiberry.com instructions. You need to edit the /boot/config.txt file. To do this the RPi needs to be shutdown, pull the SD card out and mount it on another computer. Add to the end of config.txt the following:
dtoverlay=hifiberry-dacplus
Save the file, start up OpenELEC and select HiFiBerry in OpenELEC's audio settings.