LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Updating a codec? (https://www.linuxquestions.org/questions/linux-hardware-18/updating-a-codec-4175640047/)

vysero 10-09-2018 04:38 PM

Updating a codec?
 
I need to update a codec for an old kernel; specifically, updating the WM8753 to the WM8750 on kernel-2.6.35.14. The CODEC itself exists in the kernel. Other than adding the new codec into the .config file s/t:

CONFIG_SND_SOC_IMX_CCWMX51_WM8750=y
and
CONFIG_SND_SOC_WM8750=y

what does it take?

The documentation found in the kernel/documentation/sound/alsa/soc directory mentions a: codec, platform and machine driver. However, a simple grep search for "wm8753" reveals that there is more than just 3 .c files referencing the codec. Granted, many of these files will be for different boards mine is an imx51 so I can eliminate most of them. I believe I have found the machine driver: sound/soc/imx/imx-ccwmx51-wm8753.c the rest of the files referencing "wm8753" are located @ arch/arm/mach-mx5 and so I am assuming these are the platform drivers?

What I was hoping was that I could simply change any reference of the wm8753 to wm8750 but most of my experience with hardware was in college on DOS systems using programs like Quartus and languages like VHDL. Actually writing drivers is something I have never done before and I am new to the Linux world as well.

That being said if anyone has any experience with this sort of thing I am all ears and I would be interested to know what you have to say or any advice you might be able to give me!

AwesomeMachine 10-10-2018 11:30 AM

Where is the new module coming from? Do you simply want to reconfigure the kernel? Do you have the kernel sources installed? This might help, depending on what exactly you're trying to accomplish. https://kerneltweaks.wordpress.com/2...l-source-code/

If you just want to reconfigure the existing kernel to include different parts, switch to the kernel source directory and run 'make menuconfig' as root.

vysero 10-10-2018 11:50 AM

Quote:

Originally Posted by AwesomeMachine (Post 5913271)
If you just want to reconfigure the existing kernel to include different parts, switch to the kernel source directory and run 'make menuconfig' as root.

This is how I went about getting the new codec to show up in the .config file in the main kernel directory. What I am attempting to do now is make all the necessary changes in the drivers so that this codec can be used.

Maybe I should have mentioned. There was an update in the actual physical codec on the board, along with a new amplifier. I am attempting to get that new hardware working.

EDIT: Essentially, I believe what this boils down to is being able to adapt the old machine driver for the wm8753 to work with the wm8750 but there is no documentation on how to right machine drivers for specific codecs that i can find. So if anyone has ever written a machine driver for a codec then feel free to comment.

vysero 10-16-2018 03:03 PM

Here is the error I am receiving when I boot the kernel:

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)
alsactl: set_control:1255: failed to obtain info for control #6 (No such file or directory)
alsactl: set_control:1255: failed to obtain info for control #7 (No such file or directory)
alsactl: set_control:1255: failed to obtain info for control #8 (No such file or directory)...

Anyone have an idea of how I am supposed to initialize this hardware? I figure that is the machine drivers job but I think I have that built correctly so maybe not?

AwesomeMachine 10-17-2018 01:07 AM

Does it boot all the way? Or does that error stop the process? Maybe the module isn't loading.

vysero 10-17-2018 10:09 AM

It does boot all the way. I am under the assumption that it may not actually be loading in my edited version of the kernel:

Code:

** Invalid boot device **

Booting partition 'Kernel0'

## Booting kernel from Legacy Image at 90007fc0 ...

  Image Name:  Linux-2.6.35.14-tjerbmx51_0005+

  Created:      2018-10-16  21:35:37 UTC

  Image Type:  ARM Linux Kernel Image (uncompressed)

  Data Size:    2533296 Bytes =  2.4 MB

  Load Address: 90008000

  Entry Point:  90008000

  Loading Kernel Image ... OK

OK

I will try booting again with a versioned kernel.

vysero 10-19-2018 11:55 AM

After versioning my kernel I could tell it was actually using my altered kernel. So I feel like my machine driver is correct and should work. However, I am getting an error in the boot process:

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)
alsactl: set_control:1255: failed to obtain info for control #6 (No such file or directory)
alsactl: set_control:1255: failed to obtain info for control #7 (No such file or directory)

I have looked online and have gotten mixed information on how to deal with this error. It was sugjested that I turn off debugging in alsa config:

│ │ [ ] Verbose procfs contents │ │
│ │ [ ] Verbose printk │ │
│ │ [ ] Debug │ │
│ │ [ ] Generic sound devices --->

I did that. It was also suggested that I look for and delete a .state file but my system does not seem to have any .state files in it.

vysero 11-01-2018 03:32 PM

Still failing to get this working. Some of my debugging output:

Code:

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

So it would seem my card is registering correctly. However, if I plug in one of the devices with the older codec I get:

Code:

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

I am not sure what the significance of missing the "HiFi-0" is.

Code:

# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=ccwmx51js
    ccwmx51js,
    Default Audio Device

# alsactl restore
alsactl: load_state:1571: Cannot open /etc/asound.state for reading: no such file or directory
Unknown hardware "WM8750" "" "" ""  ""
Hardware is initialized using a guess method

If I run this same command with an older codec (working hardware) I get the same error:

Code:

# alsactl restore
alsactl: load_state:1571: Cannot open /etc/asound.state for reading: no such file or directory
Unknown hardware "WM8753" "" "" ""  ""
Hardware is initialized using a guess method

I am lost :(

ondoho 11-02-2018 02:32 AM

Quote:

Originally Posted by vysero (Post 5921795)
I am lost :(

maybe you need to re-evaluate your original assumption:
Quote:

Originally Posted by vysero (Post 5912958)
I need to update a codec for an old kernel

why do you need an old kernel?
why do you need a new codec?

vysero 11-02-2018 10:18 AM

The old kernel was customized by Digi for their SOM which was built on top of the i.MX51 board. The old codec is no longer being produced (EOL) so the new codec is replacing that hardware.

vysero 11-26-2018 12:34 PM

An update:

I have managed to get the error to change (somewhat). I changed the naming convention in the mach-mx5 directory and the sound/soc/imx directory. Now instead of saying:

Code:

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)
alsactl: set_control:1255: failed to obtain info for control #6 (No such file or directory)
alsactl: set_control:1255: failed to obtain info for control #7 (No such file or directory)
alsactl: set_control:1255: failed to obtain info for control #8 (No such file or directory)... (repeats a few more times)

it simply says:

Code:

No state is present for card ccwmx51p51
Unknown hardware: "WM8750" "" "" "" ""
Hardware is initialized using a guess method
No state is present for card ccwmx51p51

Here is some extra info:

Code:

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

Code:

# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=ccwmx51p51
    ccwmx51p51,
    Default Audio Device

Code:

# speaker-test

speaker-test 1.0.23

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Playback open error: -16,Device or resource busy
Playback open error: -16,Device or resource busy
Playback open error: -16,Device or resource busy
Playback open error: -16,Device or resource busy
Playback open error: -16,Device or resource busy
Playback open error: -16,Device or resource busy
Playback open error: -16,Device or resource busy..(will continue if not stopped)



All times are GMT -5. The time now is 03:37 AM.