OSMC is the successor of Raspbmc, a music player made for the Raspberry Pi. Normally, audio will be output on the Pi’s ’phone jack, which gives only poor-quality audio. Here’s how to get the Pi to output OSMC audio through the HiFiBerry boards.
Get one of the latest available releases
XBMC on the Raspberry Pi was not working correctly with 24bit sound cards. While there is now a fix to this problem, it has not yet been included in all versions.
Update system, install some tools
ssh -l pi ip-of-your-raspberrypi $ sudo apt-get -y update && sudo apt-get -y upgrade $ sudo apt-get install -y curl wget binutils alsa-utils $ sudo reboot
ssh -l pi ip-of-your-raspberrypi $ sudo bash # cat >/etc/modules <<EOT snd_soc_hifiberry_dacplus EOT # reboot
If you’re using another card than the HiFiBerry DAC+, use the appropriate module instead:
snd_soc_hifiberry_dac snd_soc_hifiberry_digi snd_soc_hifiberry_amp
Check the sound card is configured correctly
ssh -l pi ip-of-your-raspberrypi $ aplay -l card 0: sndrpihifiberry [snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ HiFi pcm512x-hifi-0  Subdevices: 0/1 Subdevice #0: subdevice #0
Enable HiFiBerry output in the menu
Go to System/Settings/System/Audio output and select the ALSA output device. Sound output will now go to the HiFiBerry sound card.