Need audio support for i.MX6UltraLite Eval kit

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need audio support for i.MX6UltraLite Eval kit

1,666 Views
ashishpandit
Contributor I

We are using MCIMX6UL-EVK: i.MX6UltraLite Evaluation Kit and trying to make Audio work for our system that is operating BSP from Freescale (root@OpenWrt:/usr/media# cat /proc/version

Linux version 4.1.15-224177-gdeb84cd-dirty (ubuntu@ubuntu) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r49363) ) #59 Wed Jul 26 12:08:44 EEST 2017

root@OpenWrt:/usr/media#).

Linux core on our controller board can detect the IC correctly and create a sound.

[    1.911691] imx-wm8960 sound: wm8960-hifi <-> 202c000.sai mapping ok

[    1.921954] imx-wm8960 sound: snd-soc-dummy-dai <-> 2034000.asrc mapping ok

[    1.929720] imx-wm8960 sound: wm8960-hifi <-> 202c000.sai mapping ok

[    2.266162]   #0: wm8960-audio

 

Then we installed the necessary ALSA utils to test the sound.

ALSAMIXER allows us to adjust the volume.

However, we can't play the sound. It fails

 

aplay piano2.wav

Playing WAVE 'piano2.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo

aplay: pcm_write:1939: write error: Input/output error

 

any ideas?

0 Kudos
6 Replies

1,183 Views
igorpadykov
NXP Employee
NXP Employee

Hi Ashish

please check with oscilloscope clock on codec. One can try with nxp bsps described on

i.MX 6 / i.MX 7 Series Software and Development Tool|NXP 

To check hardware one also can use wm8960 examples in

Board Support Packages (7)
SDK2.2_iMX6UL_WIN(REV SDK2.2)
http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/i.mx-processors/i.mx-6-pr...

or use imx-test (mxc_sound_test)
www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-test-5.7.tar.gz

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,183 Views
vitaliyavramenk
Contributor III

Hi Igor,

we  have checked all the signals with a digital scope.

1. SAI2_MCLK.
We can see a valid 12288000 Hz clock signal as soon as we execute "aplay piano2.wav".
See the attached picture

mclk.JPG

When the player stops the clock disappears. So far so good.

2. SAI2_BCLK, SAI2_SYNC, SAI2_TXD.
We can see problems with all these signals trying to play any sound.
All these signals are "1" initially.
As soon as we execute "aplay piano2.wav" all the lines are changed to "0".
When the player stops ( in exact 10 seconds) they change back to "1".

In other words, we can see some activity. It looks like the sound device is opened 

successfully in the player ( so all pins are initialized properly). However, the audio data stream

is not  applied.

The same 10-sec behavior we can see with a "speaker-test" command.

It is interesting.  When we execute "arecord someFile" all  these signals are getting valid.

For example, we can see 250KHz on SAI2_BCLK.

Also, we can see activities/pulses on other SAI lines. IMHO, the SAI2 works.

3. 

It seems the ALSA framework  stops the stream and returns the error code EIO
if  there is no interrupt for ten seconds.

Probably the interrupts do not work for some reason in our system.

cat /proc/interrupts
CPU0
16: 7709 GPC 55 Level i.MX Timer Tick
19: 1412 GPC 26 Level 2020000.serial
20: 0 GPC 98 Level sai

...

Do you have any extra ideas ?

Thanks in advance

Vitaliy, Ashish

0 Kudos

1,183 Views
igorpadykov
NXP Employee
NXP Employee

Hi Vitaliy

probably alsa was not properly installed, one can try to rebuild whole image

YOCTO project clean 

Best regards
igor

0 Kudos

1,183 Views
vitaliyavramenk
Contributor III

Igor,

here is a list of all installed packages related to ALSA

opkg list-installed | grep alsa


alsa-lib - 1.0.28-1
alsa-utils - 1.0.28-2
alsa-utils-seq - 1.0.28-2
alsa-utils-tests - 1.0.28-2
baresip-mod-alsa - 0.4.14-1
gst1-mod-alsa - 1.4.5-1
yate-mod-alsachan - 5.5.0-1-1

Also, I have attached  my current Linux .config file.

Do you see any  potential problems with Linux configuration ?

Thanks

Vitaliy

0 Kudos

1,183 Views
vitaliyavramenk
Contributor III

Igor,

finally I  could find and install fsl-image-gui-x11-imx6ulevk.sdcard image.

Everything started to work. This image provides Linux core, device tree 

and Freescale i.MX Release Distro 4.1.15-1.1.0  roofs.

I have replaced Linux core and device tree . Everything worked again.

It means I don't have problems with hardware, Linux core and device tree.

And the problem comes from OpenWRT distro rootfs.

When the system boots I can see only one different message that appears in the Freescale log

ALSA: Restoring mixer settings...

Do you have any experience with ALSA on openWRT systems?

Thanks

Vitaliy

0 Kudos

1,183 Views
vitaliyavramenk
Contributor III

Igor,

finally I could solve the issue. I have copied asound.state file from Freescale distro.

Then, in OpenWRT I executed

 alsactl --file asound.state restore

Finally, I can play the sound in OpenWRT system.

Thanks for your help

Vitaliy

0 Kudos