Sound / Audio

Configuring the analog output as default

By default, if you install a Linux image, the HDMI (digital) audio output is the first audio output device. Thus, if you try to play a sound file without specifying the output device, the sound will be send to the HDMI output.

But in last Cubian,by default, the Analog stereo (jack) audio output is the first audio output device.

In order to configure the ALSA sound subsystem to use the analog (jack) audio output, add the following file /etc/asound.conf

Testing the sound

You can test the sound output by running the command

speaker-test -twav -c2

You will hear a voice saying in turns Left and Right, and the sound for each word will come from each
The default device will be selected. You can use the -D parameter to select the other sound output device.
With aplay -l you can view the available audio output devices.

Troubleshooting

Mainline kernel (4.5-rc3)/A20: if audio doesn't play remember to ENABLE both in alsamixer: "Power Amplifier DAC" and "Power Amplifier Mute".

Technical details

Works with: A10 with mainline and sunxi kernels, {more details here}.

Playback: (internal 24 bits Digital to Analog Converter)

HPL Headphone Left channel output AO

HPR Headphone Right channel output AO

HPCOM Headphone amplifier output A

HPCOM_FB Headphone amplifier Feedback A

Recorder: (internal 24 bits Analog to Digital Converter)

FMINL Audio ADC(24bit) Input for Left channel of FM radio AI

FMINR Audio ADC(24bit) Input for Right channel of FM radio AI

LINEINL Audio ADC(24bit) Input for Left channel of Line In AI

LINEINR Audio ADC(24bit) Input for Right channel of Line In AI

MICINL Audio ADC(24bit) Input for Left channel of Microphone AI

MICINR Audio ADC(24bit) Input for Right channel of Microphone AI

micin has an internal pre-amplifier.

Only one 2-channel input port can be used at the same time.

To select the intput port you have to set the mixer control called ADC Input Mux

ADC Input Mux Value:

0

1

2

3

4

5

6

7

Input Port

linein

fmin

mic1

mic2

mic1,mic2

mic1+mic2

output mixer

linein,mic1

To change the ADC muxer you have to use the amixer tool from the "alsa-utils" package:

amixer -c <"card"> cset numid=<"control#"> <"input_port">

where:

<"card"> is the card, 0 for the sunxi-codec and 1 for the hdmi audio output

<"input_port"> is the input port from the table

<"control#"> is the control # showed using: aximer contents

To install the alsa-utils from debian based distros: "apt-get install alsa-utils". Inside the package you have the aplay and arecord tools to test it.

Command example to use the linein port:

amixer -c 0 cset numid=16 0

Use "amixer contents" to get the contents and controls of your Alsa driver: