Recording an audio file using ALSA arecord

cancel
Showing results for 
Search instead for 
Did you mean: 

Recording an audio file using ALSA arecord

2,060 Views
GabrielO
Contributor I

Hi,

I'm trying to test the audio part of i.MX28 evk board.

I've build and installed ALSA-lib and ALSA-utils. After booting up the board I'm trying to record some audio from mic to a file and then play it to speakers.

For recording I'm using alsa "arecord" :
arecord -D "hw:0,0" -t wav -c 2 -r 48000 -f S16_LE foo1.wav

For playing I'm using alsa "aplay":
aplay foo1.wav

The file is created by arecord but when i try to play it I dont hear a thing.

arecord -l show me:
**** List of CAPTURE Hardware Devices ****
card 0: mxsevk [mxs-evk], device 0: SGTL5000 SGTL5000-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: mxsevk [mxs-evk], device 0: SGTL5000 SGTL5000-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: mxsevk_1 [mxs-evk], device 0: MXS SPDIF mxs spdif-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

Also amixer:

root@freescale ~$ amixer
.............................
Simple mixer control 'Capture',0
Capabilities: cvolume
Capture channels: Front Left - Front Right
Limits: Capture 0 - 15
Front Left: Capture 15 [100%]
Front Right: Capture 15 [100%]
Simple mixer control 'Capture Vol Reduction',0
Capabilities: enum
Items: 'No Change' 'Reduced by 6dB'
Item0: 'No Change'
Simple mixer control 'ADC Mux',0
Capabilities: enum
Items: 'MIC_IN' 'LINE_IN'
Item0: 'MIC_IN'
Simple mixer control 'DAC Mux',0
Capabilities: enum
Items: 'DAC' 'LINE_IN'
Item0: 'DAC'
.......
I've tried to change 'ADC mux' to LINE_IN but still no luck.

When I'm playing an external .wav all works ok and I can hear it with high quality.

Can anyone help me?

Thanks,
Gabriel Oprea

Labels (1)
0 Kudos
1 Reply

474 Views
PeterChan
NXP Employee
NXP Employee

Hello Gabriel,

On my i.MX28 EVK, I use this command to switch the MUX to LINE_IN and it works.

$ amixer cset numid=7 1

Regards,

Peter

0 Kudos