Audio out mode setting (CB for Banana Pi image)

There are two audio devices HDMI and headphone in the Banana Pi.

sudo  alsamixer

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. To set sound care being sunxi-CODEC modify /etc/asound.conf to turn on the headphone.

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.
  }

If Plug in the headphone and type:

speaker-test -twav -c2

The sound “sound left,sound right,sound left” will output from headphone.

Let bananapi speak by package named espeak :

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