BananaPro/Pi:Audio

From BananaPro/Pi
Jump to: navigation, search

Overview

There are two audio device HDMI and headphone in the Banana Pi/Pro.

Implementation

Step 1 :Set sound care being sunxi-CODEC modify /etc/asound.conf to turn on the headphone.

sudo nano /etc/asound.conf
pcm.!default {
type hw
card 0    //If you want to set HDMI as output ,turn 0 to 1.
device 0
}
ctl.!default {
type hw
card 0   //If you want to set HDMI as output ,turn 0 to 1.
}


Step 2 :If Plug in the headphone and type:

speaker-test -twav -c2


Step 3 :The sound "sound left,sound right,sound left" will output from headphone.

sudo apt-get install espeak
espeak "hello"            //say: hello
espeak "hello_bananapi"    //say: hello banana pi

Configuration

Run the sound volume controler,you can see

sudo alsamixer

Putty alsamixer.jpg

There are two audio devices named sunxi-sndhdmi and sunxi-CODEC in the system. The sound output is send out from HDMI by default . You can adjust volume and other configuration ,use Ctrl + z to save it.