Audio Buffer for DSP: ALSA?

Hi All!

Anyone knows how to buffer the Audio Data captured from the Audio
Input Stream?
I need to process each Buffered Audio Data Stream by using the DSP.
Can we do this by using the ALSA Driver?
Any help, suggestions and comments shall be very helpful.

Thanks

Dieng

Hi,

Are you capturing the audio stream as a raw-int 16 bit PCM or is the
input stream an encoded bitstream?

ALSA cannot be used at the encoded stream. To decode an encoded audio
stream you may need the audio decoder corresponding to the stream.

ALSA is used at the renderer.

Your decoded data should be available for the ARM who needs to again
send the data to the renderer and ALSA may help you with playing the
data on the audio device on the board. You can store the decoded data
to a .wav or a raw-int 16 / 24 bit format and use the 'aplay' command
on the console to play the wav or pcm file

aplay <wav_file>
ex: aplay test.wav
or

aplay <pcm_file> [options]
ex:
aplay test.pcm -f S16_LE -r 44100 -c 2

If you intend to stream the decoded data, you need to use any ALSA
based player on the board to stream out the data for you. For Ex:
mplayer decodes the stream for you and plays through the device on the
board. But the whole processing may use only ARM since the decoder
may not run on the DSP but on the ARM.

Regards,
Prem

Hello Everyone,

Can the BB capture 1.5 sec of 16 bit audio data at 44.1 KHz? If so, what research would be suggested to do this?

Thank you,

Todd

If you will look at the validation tests, audio is recorded and played back as part of the test. It is at 44.1KHZ. This is covered in the System Reference Manual for both Rev B and Rev C boards. It will record until you tell it to stop by sending a Ctrl-C.

http://code.google.com/p/beagleboard/wiki/BeagleboardRevCValidation

Gerald

Hello Mr. Coley,

Does this allow me access to the 16 bit numeric data in an array format so I can do math on that data?

Thank you,

Todd

This should indeed be possible. Reference the TPS65950 information. http://focus.ti.com/docs/prod/folders/print/tps65950.html

This is the audio CODEC that is used on the Beagle and is located in the Power Managment IC. If this CODEC is not exactly what you need, you can also add a CODEC to the board via the expansion connector.

Gerald

Dear Mr. Coley,

aplay command as I said in my previous reply can do this for you.

Its simple.

Connect your board to your PC. Take a high definition card installed
on windows machine. Connect stereo - out jack of board to stereo - in
jack of PC using two way stereo connector. Dont keep any electronic
devices near PC or the board for the sake of any interference. Get
the Cooledit or Adobe audition installed on your PC. Open a new file
and select 44100 HZ with 16 bit mode and press record. Now run the
aplay command with options

aplay -f S16_LE -c 2 -r 44100 test.pcm (Remember that this test.pcm
should be available on the target.)

for required time. Once the required time is over stop the Cooledit /
Adobe audition record and store the file in a PCM format. In case if
you want to really process or do some math on the data itself you can
use cooledit or adobe audition to do processing like filtering / freq
analysis etc on the signal directly Otherwise write a simple program
in C on any C compiler to read this raw PCM and store in an array /
dump in an array.

Regards,
Prem

Hello Mr. Mannava,

Thank you for you input!

Todd

Hei Prem!

for required time. Once the required time is over stop the Cooledit /
Adobe audition record and store the file in a PCM format. In case if
you want to really process or do some math on the data itself you can
use cooledit or adobe audition to do processing like filtering / freq
analysis etc on the signal directly Otherwise write a simple program
in C on any C compiler to read this raw PCM and store in an array /
dump in an array.

I'm interested to do math to the data on the board itself. Hence, I
will capture the audio data from the audio input (that already
installed on beagleboard -- can I use arec in here? or I have to
manually capture the audio (in .pcm format?) data by myself? Or Is
there any well tested library that can be used to help this process?
ALSA? -- I'm sorry if I could not understand your previous
explanation).

Furthermore, I need to do the math in DSP. So, I have to throw the
data (in .pcm format -- but already buffered in array?) to DSP and
take the processed data back; and then throw it to the audio output;
Can I do these in the real-time?

Thanks!

Best,

Dieng