IMX6 audio recording and playing solution

Here described IMX6 audio recording and playing out-of-box solution using linux arecord and aplay utilities. IMX6ULL to be precise. Based on NetSoM development board.

Hardware requirements.

You have to stick WM8960 audio module to NetSoM development board. Then plug some audio speakers or headphones to audio module.  That audio module has onboard microphones so no need to use headphones with microphone. Then just power up development board and connect via SSH. Here SAI protocol used to communicate processor and audio codec IC.

Software requirements.

You have to use audio_stream_ethernet or audio_stream_wifi images. Steps to update NetSoM firmware described here.

During initialization:

# amixer set ‘Capture’ 100%
# amixer set ‘ADC PCM’ 100%
# amixer set ‘Left Input Boost Mixer LINPUT1’ 100%
# amixer set ‘Right Input Boost Mixer RINPUT1’ 100%
# amixer set ‘Left Input Mixer Boost’ on
# amixer set ‘Right Input Mixer Boost’ on

and:

# i2cset -f -y 0 0x1a 0x01 0x0f
# i2cset -f -y 0 0x1a 0x03 0x0f
# i2cset -f -y 0 0x1a 0x12 0x40
# i2cset -f -y 0 0x1a 0x30 0x04

WM8960 configured to use following paths for audio signals.

For speaker:

imx6 audio wm8960 speaker path

For microphones:

imx6 audio wm8960 microphone path

imx6 audio wm8960 microphone path

Here is merge request that implements support of WM8960 codec.

Audio recording.

Audio file might be recorded using arecord utility:

# arecord -f S32_LE -r 48000 -c2 -D hw:0,0 -d 20 /tmp/record.wav

Audio playing.

To play previously recorded audio file use aplay utility:

# aplay /tmp/record.wav

 

That is it. pretty simple:

Here you can find guide to implement audio streaming using SIP protocol.

Keep following as here at our telegram channel!