I2S is a digital audio bus that is commonly used. The Raspberry Pi B+ and Raspberry Pi 2 both now have an I2S audio driver. This page is a reference for when I was making my own DAC boards using some of TI's DAC IC's. Check out my I2S Audio Amp.
I2S requires 3 digital pins: the bit clock (BCK), the word clock or left/right clock (LRCK), and the data line (DOUT). All 3 of these pins are located on the main I/O header, J8. (note that the Raspberry Pi model B has these pins on a different header)
sudo nano /etc/modules
# snd_bcm2835 # comment out this line to disable onboard audio
sudo nano /boot/config.txt
Add one of the following lines to the end of the config file.
dtoverlay=hifiberry-dac
sudo nano /etc/asound.conf
pcm.!default {
type hw card 0
}
ctl.!default {
type hw card 0
}
sudo nano /boot/config.txt
dtoverlay=i2s-mmap # for mixing
sudo nano /etc/asound.conf
pcm.i2s_dac {
type hw card 0
}
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm "i2s_dac"
channels 2
}
}
ctl.dmixer {
type hw
card 0
}
sudo reboot
Raspberry Pi 2 Model B
Linux raspberrypi 3.18.11-v7+ #777 SMP PREEMPT Sat Apr 11 17:30:37 BST 2015 armv7l GNU/Linux