Introduction: Create a Video Player With Dolby Digital/DTS Output

About: We're a small firm that brings high-quality audio to small devices.

You have an older home theater receiver with an S/PDIF input (optical or RCA) and want to play movies with DTS or Dolby Digital soundtracks? This guide shows how you can get 5.1 sound output from a Raspberry Pi even if your AV receiver does not feature an DTS/AC3 capable HDMI input.

Step 1: What You Need

  • A home theater receiver or amplifier with an SPDIF input.
  • A Raspberry Pi 2 including a power supply
  • A HiFiBerry Digi+ add-on card
  • optional: enclosure

Note that you can also use an older Raspberry Pi 1. The GUI performance is not as good as on the RPI2, but it might be ok for many people. However module configuration for the Raspberry Pi 1 is a bit different as the current version of OpenElec for the Raspberry Pi 1 does not support device tree overlays.

Step 2: Connect the Hardware

First you need to put the HiFiBerry Digi board onto the Raspberry Pi. This is easy, no soldering is needed. Then connect the optical or electrical output to the SPDIF input of your home theater system.

Step 3: Download and Install OpenElec

Download and install the latest version of OpenElec from the OpenElec web site. Note that there are different versions for the Raspberry Pi 1 and 2. You need to download the Raspberry Pi 2 version!

Step 4: Configure the HiFiBerry Drivers

Firs you need to activate the drivers for the HiFiBerry Digi+ sound card.

Login to your OpenElec system using ssh
On first boot you should enable SSH, otherwise you can still do it later in the OpenElec settings. Find the IP address in

ssh -l root 192.168.x.x

Default password is openelec.

Make /flash writable

Type the following command:

mount -o remount,rw /flash

Edit config.txt

Use your favourite editor (nano and vi should be available) and add the lines

dtoverlay=hifiberry-digi<br>dtdebug=1

to /flash/config.txt. If you do not want to use an editor, you can also use the following code:

cat <<EOT >>/flash/config.txt<br>dtoverlay=hifiberry-digi<br>dtdebug=1
EOT

Alternatively you can also edit the config.txt file directly on your PC or Mac with an editor of your choice.

Reboot and check driver

If you login after the reboot, the HiFiBerry Digi+ should be listed as a sound card:

<p># aplay -l<br>**** List of PLAYBACK Hardware Devices ****<br>card 0: sndrpihifiberry [snd_rpi_hifiberry_digi], device 0: HifiBerry Digi HiFi wm8804-spdif-0 []<br>  Subdevices: 1/1<br>  Subdevice #0: subdevice #0</p>

Step 5: Enable HiFiBerry Digi Sound Output

Now you should be able to select the HiFiBerry Digi as audio output. To do this, go to Settings/System/Audio output and select the HiFiBerry Digi as the audio output device.

Step 6: Enable Dolby Digital/DTS Passthrough

With the standard settings Kodi will only output stereo sound. You need to enable AC3/DTS passthrough now. To do this, enable the Expert settings first. After switching to expert mode you have much more options that you can configure. You now need to enable passthrough and also enable "Dolby Digital capable receiver " and "DTS capable receiver".

Step 7: Put It in a Nice Enclosure

While it is not needed for the operation, putting your Raspberry Pi and HiFiBerry Digi+ is a nice enclosure protects the boards. It will also look more attractive. There are many different cases available on the market from different supplier. Choose whatever you like.