We're no longer updating This wiki!!

This is an old revision of the document!


Quick installation guide to enable the I2S audio output on Ubuntu.

HiFi-shield & HiFi-Shield+

  1. Assemble the C2 with the HiFi shield, attach a USB keyboard, USB mouse and HDMI monitor, then power up the system.
  2. Update the System: sudo apt-get update && sudo apt-get dist-upgrade
  3. To ensure that the HiFi shield kernel modules are loaded on Terminal.
    odroid@odroid64:~$ aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: ODROIDHDMI [ODROID-HDMI], device 0: I2S.27 dit-hifi-0 []
      Subdevices: 0/1
      Subdevice #0: subdevice #0
    odroid@odroid64:~$
    odroid@odroid64:~$ sudo modprobe snd-soc-pcm5102
    odroid@odroid64:~$ sudo modprobe snd-soc-odroid-dac
    odroid@odroid64:~$ aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: ODROIDHDMI [ODROID-HDMI], device 0: I2S.27 dit-hifi-0 []
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 1: ODROIDDAC [ODROID-DAC], device 0: I2S.27 pcm5102-0 []
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    odroid@odroid64:~$
  4. To test, connect an amplifier to the 3.5mm or RCA lineout jack on the HiFi Shield, and then run:
  5. Applications → Sound & Video → Sound → Hardware Tab & Output Tab select “ODROID-DAC”
  6. If you want to use the Optical output on HiFi-Shile-Plus model, select “ODROID-HDMI”.

If you have to load the driver every time whenever your ODROID-C2 starts, simply you can register the driver into /etc/modules

odroid@odroid64:~$ su
Password:  /* root password is "odroid" */
root@odroid64:/home/odroid# echo "snd-soc-pcm5102" >> /etc/modules
root@odroid64:/home/odroid# echo "snd-soc-odroid-dac" >> /etc/modules
root@odroid64:/home/odroid# exit
exit
odroid@odroid64:~$ 

This adds one line at end of the file, /etc/modules, and load the driver on boot automatically.

Create /etc/asound.conf with the following content:

pcm.!default  {
 type hw card 1
}
ctl.!default {
 type hw card 1
}

Reboot again.

Check, if the sound card is enabled with “aplay -l”:

odroid@odroid64:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ODROIDHDMI [ODROID-HDMI], device 0: I2S.27 dit-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: ODROIDDAC [ODROID-DAC], device 0: I2S.27 pcm5102-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
odroid@odroid64:~$

HiFi-shield2

  1. Assemble the C2 with the HiFi shield2, attach a USB keyboard, USB mouse and HDMI monitor, then power up the system.
  2. Update the System: sudo apt-get update && sudo apt-get dist-upgrade
  3. To ensure that the HiFi shield2 kernel modules are loaded on Terminal.
    odroid@odroid64:~$ aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: ODROIDHDMI [ODROID-HDMI], device 0: I2S dit-hifi-0 []
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    odroid@odroid64:~$ su
    Password:  /* root password is "odroid" */
    root@odroid64:/home/odroid# modprobe aml_i2c
    root@odroid64:/home/odroid# modprobe snd_soc_pcm512x
    root@odroid64:/home/odroid# modprobe snd_soc_pcm512x_i2c
    root@odroid64:/home/odroid# echo pcm5242 0x4c > /sys/class/i2c-adapter/i2c-1/new_device
    root@odroid64:/home/odroid# modprobe snd-soc-odroid-dac2
    root@odroid64:/home/odroid# aplay -l
    **** List of PLAYBACK Hardware Devices ***
    card 0: ODROIDHDMI [ODROID-HDMI], device 0: I2S dit-hifi-0 []
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 1: ODROIDDAC2 [ODROID-DAC2], device 0: I2S pcm512x-hifi-0 []
      Subdevices: 0/1
      Subdevice #0: subdevice #0
    root@odroid64:/home/odroid#
  4. To test, connect an amplifier to the RCA out jack on the HiFi Shield2, and then run:
  5. Applications → Sound & Video → Sound → Hardware Tab & Output Tab select “ODROID-DAC2”
  6. If you want to use the Optical output select “ODROID-HDMI”.

You want to add the HiFi-Shield2 sound_card on ODROID-C2 at boot by editing /etc/rc.local.

odroid@odroid64:~$ sudo nano /etc/rc.local
if [ -f /aafirstboot ]; then /aafirstboot start ; fi

echo Loading HiFi-Shield2 module
modprobe aml_i2c
modprobe snd_soc_pcm512x
modprobe snd_soc_pcm512x_i2c
echo pcm5242 0x4c > /sys/class/i2c-adapter/i2c-1/new_device
modprobe snd-soc-odroid-dac2

amixer -c 1 sset Analogue 0
amixer -c 1 sset Digital 201
amixer -c 1 sset Deemphasis on
echo Done.

exit 0

^G Get Help  ^O Write Out ^W Where Is  ^K Cut Text  ^J Justify   ^C Cur Pos
^X Exit      ^R Read File ^\ Replace   ^U Uncut Text^T To Linter ^_ Go To Line 

Add the following at the bottom of the page above exit 0. ^x exit and save the file. Reboot your ODROID-C2.

Create /etc/asound.conf with the following content:

pcm.!default  {
 type hw card 1
}
ctl.!default {
 type hw card 1
}

Reboot again.

Check, if the sound card is enabled with “aplay -l”:

odroid@odroid64:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ODROIDHDMI [ODROID-HDMI], device 0: I2S dit-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: ODROIDDAC2 [ODROID-DAC2], device 0: I2S pcm512x-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
odroid@odroid64:~$ 
en/c2_hifi_shield.1475654853.txt.gz · Last modified: 2016/10/05 16:37 by ck.kim
CC Attribution-Share Alike 3.0 Unported
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0