TechNexion / tfa98xx

TFA9892 driver for TechNexion Voicehat, fork from https://source.codeaurora.org/external/mas/tfa98xx
Other
2 stars 2 forks source link

imx8mq: SPH0645 Init passes but TFA9912 init fails #1

Closed erikly01 closed 4 years ago

erikly01 commented 4 years ago

Hi,

I compiled and built Kernel 4.14 and loaded imx8mq-pico-pi-voicehat.dtb, but the TFA9912 playback device consistently fails initialization.

Did I miss something in the kernel compilation? Can you help me figure out what the problem is? Thanks!

UBOOT

U-Boot 2018.03-tn-imx_v2018.03_4.14.98_2.0.0_ga-wip+g6dd7261 (Apr 25 2019 - 10:59:23 +0000)
CPU:   Freescale i.MX8MQ rev2.0 1300 MHz (running at 800 MHz)
Model: TechNexion PICO-IMX8MQ and PI baseboard
u-boot=> fatls mmc 0
 17773056   Image
    42315   imx8mq-pico-pi.dtb
    42461   imx8mq-pico-pi-m4.dtb
    45821   imx8mq-pico-pi-voicehat.dtb
    43156   imx8mq-pico-pi-dcss-ili9881c.dtb
   586652   u-boot.img

UNAME

root@technexion:~# uname -a
Linux technexion 4.14.98-g9146d4d-dirty #11 SMP PREEMPT Sun Oct 6 01:46:47 PDT 2019 aarch64 aarch64 aarch64 GNU/Linux

DMESG

[    4.670483] Reference clock found: sai2 @ 24576000
[    4.670521] imx-tfa98xx sound-tfa9912: ASoC: CODEC DAI tfa98xx-aif-1-34 not registered
[    4.680312] imx-tfa98xx sound-tfa9912: snd_soc_register_card failed (-517)

[    4.690529] imx_sph0645_probe(): imx_sph0645_probe
[    4.690589] imx_sph0645_probe(): Found 1 codec(s)
[    4.690617] imx_sph0645_probe(): Reference clock found: sai3 @ 24576000
[    4.690725] imx_sph0645_init():
[    4.690732] imx-sph0645 sound-sph0645: imx_sph0645_init,177: dai_init
[    4.690800] imx-sph0645 sound-sph0645: sph0645 <-> 308c0000.sai mapping ok
[    4.690810] imx-sph0645 sound-sph0645: ASoC: no DMI vendor name!
[    4.691356] imx_sph0645_probe(): done

LSMOD

Module                  Size  Used by
caam_jr                40960  0
crc32_ce               16384  0
crct10dif_ce           16384  0
snd_soc_imx_tfa98xx    16384  0
snd_soc_imx_sph0645    16384  1
snd_soc_sph0645        16384  1
ov5645_camera_mipi_v2    73728  0
secvio                 16384  0
imx_sdma               36864  0
caam                   24576  2 secvio,caam_jr
ip_tables              24576  0
x_tables               40960  1 ip_tables

TESTS The LED test works

Mic test
  access       : RW_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 8192
  period_size  : 2048
  period_time  : 42666
  tstamp_mode  : NONE
  tstamp_type  : MONOTONIC
  period_step  : 1
  avail_min    : 2048
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 8192
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
  appl_ptr     : 0
  hw_ptr       : 0
arecord: pcm_read:2103: read error: Cannot allocate memory
Henriparm commented 4 years ago

Dear erikly01:

Thanks for your feedback.

From the log you provide:

Module                  Size  Used by

snd_soc_imx_tfa98xx    16384  0

It looks TFA9892 is not initialized properly. I think it is caused by lack of firmware. TFA9892 driver would look for a firmware. It should be put under: /lib/firmware/tfa98/9912/TFA9892N1A_stereo_32FS.cnt

We create a Yocto recipe to put firmware.

https://github.com/TechNexion/meta-edm-bsp-release/commit/c5108e4d56ebd542c231d4da5067473d7d2c72f7

But it seems the Yocto image (pico-imx8m_pico-pi-imx8m_yocto-2.5-qt5_QCA9377_hdmi_20190430.zip) you use is outdated and without the TFA9892 firmware.

U-Boot 2018.03-tn-imx_v2018.03_4.14.98_2.0.0_ga-wip+g6dd7261 (Apr 25 2019 - 10:59:23 +0000)

Could you try the latest release for PICO-IMX8M? ftp://ftp.technexion.net/demo_software/pico-imx8mq/pico-imx8m_pico-pi-imx8m_yocto-2.5-qt5_QCA9377_hdmi_20190821.zip

It’s the first release image that starts to support Voicehat officially.

We enhance the WIKI to add the explanation about TFA98xx firmware after getting your feedback. https://github.com/TechNexion/tfa98xx/wiki

BTW, share a tip with you. It’s convenient to specify Yocto kernel to use your local kernel repository. Add the following lines in you conf/local.conf

KERNEL_SRC_pn-linux-tn-imx = "git:///home/xxx/workspace/linux_kernel_4.14.98_2.0.0_ga/tn-kernel "
SRCBRANCH_pn-linux-tn-imx = "tn-imx_4.14.98_2.0.0_ga-wip "
SRCREV_pn-linux-tn-imx = "${AUTOREV}"

Thank you ~!!!

TechNexion support team

erikly01 commented 4 years ago

Hi Henriparm & Richard, thanks for your quick response!!

I followed your instructions and now the Voicehat is working :)

My company is developing a HiFi device that uses the i.MX8 Mini for the SOM. Everything is working, but I have a question about I2S.

Is it okay if I email you directly?

richard-hu commented 4 years ago

@erikly01

That's great ~!!! To ensure TechNexion support team can provide you the best support, could you email to: sales@technexion.com support@technexion.com john.weber@technexion.com

And add me in the loop: richard.hu@technexion.com

We have professional FAE and RD as your solid backup. Look forward to seeing your new product !!! :)

BR,

Richard