Updating audio Codec for an old kernel

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

Updating audio Codec for an old kernel

1,634 Views
robert_murch
Contributor I

Hello NXP community! Well I have been struggling with a project. The old audio codec (wm8753) for one of our products has gone EOL. The replacement for the codec is the wm8750. I was tasked with attempting to get it working but I am at an impasse. I am going to go ahead and attach a few relevant files: circuit diagram (how the new codec is hooked up), codec datasheet, original and altered machine driver and a log file of the Uboot startup with the altered kernel.

Please understand that I started on this project a month ago knowing absolutely nothing about audio codecs or the ASoC system. That being said I believe I have narrowed down the problem to one of two things:

1) My altered machine-driver (glue driver) code for the wm8750 is incomplete or incorrect.

2) There is a problem with how the wm8750 has been hooked up. (probobly not the problem)

Let me address a few specifics. The kernel is 2.6.35.14 and the first thing I did was alter the Kconfig file @ sound/soc/imx so that the wm8750 would been configured:

config SND_SOC_IMX_CCWMX51_WM8750
 tristate "SoC Audio support for IMX - WM8750"
 select SND_MXC_SOC_SSI
 select SND_SOC_WM8750
 help
   Say Y if you want to add support for Soc audio on IMX CCWMX51
   with the WM8750‍‍‍‍‍‍‍

I then ran make menuconfig and turned on the wm8750:

 <*>     SoC Audio support for IMX - WM8750

1) After that I altered the machine driver which I found in sound/soc/imx. I have attached the original machine driver for the wm8753. The only code that I changed was the clocking schema:

Original clocking schema:

priv->sysclk = pll_out;
 snd_soc_dai_set_sysclk(codec_dai, WM8753_MCLK, priv->sysclk, 0);
 snd_soc_dai_set_pll(codec_dai, WM8753_PLL1 , WM8753_MCLK, 13000000, pll_out);‍‍‍

Altered clocking schema:

priv->sysclk = pll_out;
    snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, priv->sysclk, SND_SOC_CLOCK_IN);
    //snd_soc_dai_set_pll(codec_dai, WM8753_PLL1 , WM8753_MCLK, 13000000, pll_out);‍‍‍

Other than replacing all references to wm8753 with wm8750 no other changes have been made in the machine driver. Please take a look at KernelLog to see the debugging report for the bootup attempt of the altered kernel. Specifically, take a look at lines: 408-412 and 479.

2) I am no EE! So this is just a guess but it might be possible that the device was not hooked up correctly by the hardware boys. Note that in the circuit diagram ADCLRC has been driven to ground. However, in the datasheet on page 37 there is a diagram which shows all of these lines connected: BCLK, ADCLRC, DACLRC, ADCDAT,  and DACDAT. Could this be my issue?

Please, any assistance with resolving this problem would be greatly appreciated.

Labels (1)
0 Kudos
4 Replies

1,256 Views
igorpadykov
NXP Employee
NXP Employee

Hi Robert

one can check hardware with i.MX53 OBDS baremetal tests (folder /audio)

On-Board Diagnostic Suit for the i.MX53 Quick Start Board 

for software follow Chapter 20 Porting Audio Codecs to a Custom Board

i.MX53 System Development User’s Guide

https://www.nxp.com/docs/en/user-guide/MX53UG.pdf 

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

0 Kudos

1,256 Views
robert_murch
Contributor I

I am not sure how to use that diagnostic suite. Actually, I dont think it's applicable here because I am using an I.MX51 not a 53 and on top of that there is a Digi SOM in place. What would really help is if someone could tell me why the board can't detect this hardware. I get the feeling that this initialization doesn't even happen inside the machine driver... basically I need to know what this error is:

Unknown hardware: "WM8750" "" "" "" ""
Hardware is initialized using a guess method
alsactl: set_control:1255: failed to obtain info for control #2 (No such file or directory)

I can't see why I am getting this error. I have configured the kernel to use the wm8750 already, its in the .config file. How can it not be initialized? The only major difference between the wm8753 and the 50 is the loss of the PLL and I dont see how that could effect the initialization.

0 Kudos

1,256 Views
igorpadykov
NXP Employee
NXP Employee

in general you can try to debug it starting in codec probe function using Chapter 17
Advanced Linux Sound Architecture (ALSA) System on a Chip (ASoC) Sound Driver attached Linux Manual,

this may explain reason for "Unknown hardware: "WM8750"  log.

For "Digi SOM" issues suggest to apply to Digi tech support, as these modules use software which is different from NXP BSPs.

In any case i.MX53 baremetal OBDS may be useful for checking hardware, even for i.MX51 (as if has similar modules as i.MX53)

and "Digi SOM". Also for help with porting software NXP has special service

NXP Professional Services|NXP 

Best regards
igor

0 Kudos

1,256 Views
robert_murch
Contributor I

Yes well at this point I am not sure if it's my machine driver:

# cat /proc/asound/version

Advanced Linux Sound Architecture Driver Version 1.0.23

#cat /proc/asound/cards

 0 [ccwmx51js      ]: wm8750 - ccwmx51js

                                 ccwmx51js (WM8750)

Card seems to register. This might be of significance but I am not sure. I tried hooking up one of the older units with the wm8753:

# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ccwmx51js [ccwmx51js], device 0: WM8753 WM8753-0 Hi-Fi 0 []
  Subdevices: 0/1
  Subdevice #0: subdevice #0

and then ran the same command with the new codec:

# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ccwmx51js [ccwmx51js], device 0: WM8750 WM8750-0 []
  Subdevices: 0/1
  Subdevice #0: subdevice #0

as you can see the only difference is that the older one has the "Hi-Fi 0" but I am not sure what the significance of that is.

0 Kudos