Install C1+ Hifi shield with Ubuntu

Post Reply
culler
Posts: 3
Joined: Thu Sep 17, 2015 12:01 am
languages_spoken: english
ODROIDs: U3, C1, C1+ Hifi shield
Location: Chicago
Has thanked: 0
Been thanked: 0
Contact:

Install C1+ Hifi shield with Ubuntu

Post by culler »

I just bought a C1+ with the HiFi shield. I was rather surprised that I could not find any explicit instructions for how to get the HiFi shield working. So here are the steps, starting from a brand new C1+ with mmc ubuntu image and a HiFi shield. [Note: this is a revision of my first post, adding a pulseaudio command to suspend the HiFi shield when the daemon starts up. Also, I changed the pulseaudio commands to use the full name for the device, rather than index 1. This may be safer, although using the index seems to work fine.]

0. Assemble the C1+ with the HiFi shield, attach a USB keyboard, USB mouse and hdmi monitor, then power up the system.

1. Use the ODROID utility to resize the eMMC or SD disk partition

2. Use the ODROID utility to update the kernel. I got version 3.10.80-125 when I did this.

3. To ensure that the HiFi shield kernel modules are loaded on boot, edit the file /media/boot/boot.ini by uncommenting the line:

Code: Select all

setenv enabledac "enabledac"
4. To ensure that the HiFi shield becomes the default "sink" for the pulseaudio daemon, edit the file /etc/pulse/default.pa by adding this line at the end:

Code: Select all

set-default-sink alsa_output.platform-odroid_sound_card.5.analog-stereo
5. To enable applications such as mpg321 to use the HiFi shield even when no pulseaudio daemon is running (e.g. from a cron job), add one more line to the end of the file /etc/pulse/default.pa:

Code: Select all

suspend-sink alsa_output.platform-odroid_sound_card.5.analog-stereo 1
(Applications like mpg321 will start a pulseaudio daemon if there isn't one running already. However, the HiFi shield cannot be opened until the pulseaudio suspend-on-idle timeout expires. This causes the application to exit with an error message reporting that the HiFi shield is busy.)

6. To test, connect an amplifier to the 3.5mm headphone jack or the RCA jacks on the hifi shield, reboot the C1+, and then run:

Code: Select all

 aplay /usr/share/sounds/alsa/Front_Center.wav
Last edited by culler on Tue Sep 29, 2015 4:12 am, edited 1 time in total.

User avatar
odroid
Site Admin
Posts: 37371
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1785 times
Been thanked: 1139 times
Contact:

Re: Install C1+ Hifi shield with Ubuntu

Post by odroid »

Nice Guide!
I have copied this instruction to our WiKi with a credit note.
http://odroid.com/dokuwiki/doku.php?id= ... ifi_shield

Thank you for your sharing.

culler
Posts: 3
Joined: Thu Sep 17, 2015 12:01 am
languages_spoken: english
ODROIDs: U3, C1, C1+ Hifi shield
Location: Chicago
Has thanked: 0
Been thanked: 0
Contact:

Re: Install C1+ Hifi shield with Ubuntu

Post by culler »

Please see the revised version of my post, which adds a command to default.pa which suspends the HiFi shield as soon as the pulseaudio daemon starts up.

User avatar
odroid
Site Admin
Posts: 37371
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1785 times
Been thanked: 1139 times
Contact:

Re: Install C1+ Hifi shield with Ubuntu

Post by odroid »

I've updated the WiKi. Thank you.
Great to know that suspend-sink can solve the mpg321 related issue. :)

Respectech
Posts: 279
Joined: Wed Nov 13, 2013 9:20 am
languages_spoken: English, German, some Ukrainian, some Spanish
ODROIDs: All the ODROIDs!!

Well, the ones released since the U2.
Location: California
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Install C1+ Hifi shield with Ubuntu

Post by Respectech »

I followed all the steps with a fresh install of Ubuntu for the C1+.

After reboot and when trying to test using the aplay command, I get the following error:

Code: Select all

odroid@odroid:/usr/share/sounds/alsa$ ls
Front_Center.wav  Noise.wav        Rear_Right.wav
Front_Left.wav    Rear_Center.wav  Side_Left.wav
Front_Right.wav   Rear_Left.wav    Side_Right.wav
odroid@odroid:/usr/share/sounds/alsa$ aplay Front_Center.wav 
aplay: main:722: audio open error: No such file or directory
If I try to start the PulseAudio Volume Control from the start menu, I get this message:

Code: Select all

Connection to PulseAudio failed. Automatic retry in 5s

In this case this is likely because PULSE_SERVER in the Environment/X11 Root Window Properties of default-server in client.conf is misconfigured.
This situation can also arrise when PulseAudio crashed and left stale details in the X11 Root Window. If this is the case, then PulseAudio should autospawn again, or if this is not configured you should run start-pulseaudio-x11 manually.
So I tried to do the following:

Code: Select all

odroid@odroid:/etc/pulse$ start-pulseaudio-x11
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
I then edited client.conf and added the following line:

Code: Select all

default-sink = alsa_output.platform-odroid_sound_card.5.analog-stereo
Trying to start-pulseaudio-x11 again had the same effect as above.

Any ideas?

culler
Posts: 3
Joined: Thu Sep 17, 2015 12:01 am
languages_spoken: english
ODROIDs: U3, C1, C1+ Hifi shield
Location: Chicago
Has thanked: 0
Been thanked: 0
Contact:

Re: Install C1+ Hifi shield with Ubuntu

Post by culler »

I think the "no such file or directory" refers to the alsa device (as opposed to the sound file). It looks like the hifi-shield audio device may have been given a different name on your system. To find out the names of the audio devices that the pulseaudio daemon recognizes you could run this command:

Code: Select all

pacmd list-sinks | grep name:
When I run that on my C1+ system, the result is:
name: <alsa_output.platform-aml_m8_sound_card.4.analog-stereo>
name: <alsa_output.platform-odroid_sound_card.5.analog-stereo>

Post Reply

Return to “I2S Devices (HiFi Shield DAC and Stereo Boom Bonnet Kit)”

Who is online

Users browsing this forum: No registered users and 0 guests