This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problem with TLV320AIC23 (i2c) audio codec

Hello,

I am using Compulab-CM510 SoM (armada 510 processor), and I am trying to set the sound system, using Device Tree, Simple-Audio-Card, and of course TLV320AIC23 audio codec (included in the SoM), in 3.19 kernel version.

The driver for the TLV320AIC23 is located in ./KERNEL/soc/codecs/tlv320aic23.c

This is my boot trace regarding to audio:

...
asoc-simple-card sound: tlv320aic23-hifi <-> i2s mapping ok
...

...
ALSA device list:
  #0: OnboardTLV320AIC23B
...


In reference to the card, I get the following info:

root@192:~#cat /proc/asound/cards
 0 [OnboardTLV320AI]: OnboardTLV320AI - OnboardTLV320AIC23B
                      OnboardTLV320AIC23B

root@192:~# tree /proc/asound/card0/
/proc/asound/card0/
|-- id
|-- pcm0c
|   |-- info
|   `-- sub0
|       |-- hw_params
|       |-- info
|       |-- status
|       `-- sw_params
`-- pcm0p
    |-- info
    `-- sub0
        |-- hw_params
        |-- info
        |-- status
        `-- sw_params

4 directories, 11 files


But, if I try to reproduce some noise:

root@192:~#  cat /dev/urandom | aplay
Playing raw data 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
set_sample_rate_control:Invalid rate 48000,48000 requested
tlv320aic23-codec 1-001a: ASoC: can't set tlv320aic23-hifi hw params: -22
aplay: set_params:1145: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  U8
SUBFORMAT:  STD
SAMPLE_BITS: 8
FRAME_BITS: 8
CHANNELS: 1
RATE: 8000
PERIOD_TIME: (125333 125334)
PERIOD_SIZE: (1002 1003)
PERIOD_BYTES: (1002 1003)
PERIODS: (3 4)
BUFFER_TIME: 500000
BUFFER_SIZE: 4000
BUFFER_BYTES: 4000
TICK_TIME: 0


It seems to be there is some kind of problem with audio codec driver:

set_sample_rate_control:Invalid rate 48000,48000 requested 
tlv320aic23-codec 1-001a: ASoC: can't set tlv320aic23-hifi hw params: -22 


I would really appreciate some kind of help

Thank you

  • Hello Gabriel,

    Looks like the problem is related to an invalid match in the sampling selection. Could you provide the register dump of the device so we can check deeply the problem?

    Thanks and Best Regards,

      -Diego Meléndez López
       Audio Applications Engineer

  • Hello Diego,

    Thank you very much for your answer.

    It seems to be that the problem was in the audio-card node of my Device Tree file. Now it works right.

    Anyway, I think that in the tlv320aic23.c file there is a structure with some kind of errors. I have submitted a patch (kernel mainline list) that seems to solve them:

    From: dobatog <dobatog@gmail.com>
    
    The following patch, based on stable v3.19,  corrects the errors that are reported in the boot trace in reference to the Input Signals of the audio codec TLV320AIC23:
    
    tlv320aic23-codec 1-001a: Control not supported for path LLINEIN -> [NULL] -> Line Input
    tlv320aic23-codec 1-001a: ASoC: no dapm match for LLINEIN --> NULL --> Line Input
    tlv320aic23-codec 1-001a: ASoC: Failed to add route LLINEIN -> NULL -> Line Input
    tlv320aic23-codec 1-001a: Control not supported for path RLINEIN -> [NULL] -> Line Input
    tlv320aic23-codec 1-001a: ASoC: no dapm match for RLINEIN --> NULL --> Line Input
    tlv320aic23-codec 1-001a: ASoC: Failed to add route RLINEIN -> NULL -> Line Input
    tlv320aic23-codec 1-001a: Control not supported for path MICIN -> [NULL] -> Mic Input
    tlv320aic23-codec 1-001a: ASoC: no dapm match for MICIN --> NULL --> Mic Input
    tlv320aic23-codec 1-001a: ASoC: Failed to add route MICIN -> NULL -> Mic Input
    
    I am trying to set the sound system in a CM-510 (Compulab - SoM) based board with DT, using Simple-Card-Audio and  the TLV320AIC23 audio codec included in the SoM . I faced this problem and thanks to the help of Sebastian Hesselbarth who noticed the possible error located in the structure snd_soc_dapm_route tlv320aic23_intercon[] , now errors are not reported.
    
    Tested on CM-510 (Compulab SoM Board).
    
    Signed-off-by: dobatog <dobatog@gmail.com>---
     sound/soc/codecs/tlv320aic23.c | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c
    index cc17e7e..891f3aa 100644
    --- a/sound/soc/codecs/tlv320aic23.c
    +++ b/sound/soc/codecs/tlv320aic23.c
    @@ -174,10 +174,10 @@ static const struct snd_soc_dapm_route tlv320aic23_intercon[] = {
     	{"ROUT", NULL, "Output Mixer"},
     
     	/* Inputs */
    -	{"Line Input", "NULL", "LLINEIN"},
    -	{"Line Input", "NULL", "RLINEIN"},
    +	{"Line Input", NULL, "LLINEIN"},
    +	{"Line Input", NULL, "RLINEIN"},
     
    -	{"Mic Input", "NULL", "MICIN"},
    +	{"Mic Input", NULL, "MICIN"},
     
     	/* input mux */
     	{"Capture Source", "Line", "Line Input"},
    --
    Gabriel