ECE497 Lab11 Using ALSA

From eLinux.org
Revision as of 09:27, 12 May 2011 by Yoder (talk | contribs) (Setup)
Jump to: navigation, search


Be sure you have done Lab 10 before this lab so all your software is set up.

Lab 11/6 - Using ALSA

This is a placeholder...

There are ALSA examples here that are built on DMAI.

Problems and Solutions

Setup

There are a couple of things you need to after booting up before running the ALSA stuff.

  • Run $ killall -9 pulseaudio to stop pulseaudio.
  • Run alsamixer and turn up DAC2 Analog and turn down Left Dig and Right Dig. Do this by using the right arrow key to move to the slider you want to adjust and use the up and down keys to adjust. It's a lot of right arrows before you see DAC2 Analog; I count 14. Don't stop at DAC Voice or DAC1 Analog. It's then another 20 to Left Dig.

The Left and Right Dig's control the audio pass through. By default, whatever comes in the Line In, goes out to the speakers. Turning down Left and Right Dig prevents this.

Keeping DAC2 Analog up allows the output of the ALSA program to be heard.

Some notes on ALSA

I've gotten this example working. I'm also looking here.

On the Beagle you need to:

# opkg install alsa-dev

On the host:

$ sudo apt-get install libasound2-dev

Go to the class dfs site and get alsaWrite.c. Compile it with

# gcc -lasound alsaWrite.c
# ./a.out

It runs on the Beagle and desktop and produces a sound.

It's shouldn't be hard to convert alsaWrite.c to alsaRead.c. See the sites above for hints.