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.

Is it possible to use the Linux codec for TLV320AIC32 with the TLV320ADC32?

Other Parts Discussed in Thread: AM3517, TLV320DAC32

Hi,

We have a custom board with an AM3517 processor and a TLV320DAC32 Audio DAC. We are running Linux as the OS, using the source from the AM35x-OMAP35x-PSP-04.02.00.07 support package. I haven't found a Linux driver for the TLV320DAC32, but the Linux source includes the codec driver tlv320aic3x. The tlv320aic3x is a driver for both the aic32 and aic33 for which the TLV320ADC32 is software-compatible.

So we are trying to use the tlv320aic3x driver with the TLV320ADC32, is this possible?

At the moment I have set it up and when running the ALSA speaker-test program as below. I believe the TLV320ADC32 is configured to master mode and when measuring the pins I have 26MHz on MCLK, 48kHz on WCLK and 1.5MHz on BLCK and I have data on the DIN pin. But I have no signal to the speaker. Do I need to do some modifications of the tlv320aic3x driver to make is work with the TLV320ADC32?

# speaker-test -c2

speaker-test 1.0.23
Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 640 to 32768
Period size range from 8 to 16384
Using max buffer size 32768
Periods = 4
was set period_size = 8192
was set buffer_size = 32768
 0 - Front Left
 1 - Front Right
Time per period = 5.079498
 0 - Front Left
 1 - Front Right

Regards,
Anders

  • Anders Gabert said:
    the TLV320ADC32 is software-compatible.

    I assume you mean DAC32 here.

    Anders Gabert said:
    I believe the TLV320ADC32

    and here.

    Anders Gabert said:
    configured to master mode

    Yes that's the default behavior if you have not made any changes to the davinci-evm.c

    Anders Gabert said:
    I have 26MHz on MCLK, 48kHz on WCLK and 1.5MHz on BLCK and I have data on the DIN pin

    If you have a 26MHz crystal on board this looks ok for S16_LE stereo (which the speaker-test application is using). I haven't looked at DAC32 and how generic the aic3x driver is but since the BCLK and WCLK are correct i think the driver is ok.

    So this could be as simple as the playback path being not setup properly or the volume being too low. The path needs to be setup based on the connection of the DAC to the SoC. You can use the alsamixer application to find the settings which work for you.

    Regards,

    Vaibhav

  • Thanks for the reply, yes I meant DAC32 sorry about that.

    I have now installed the alsamixer application and increased the volume to 100%. I can now hear a low voice from the speaker when running the command "speaker-test -c2 -twav".

    But the sound from the speaker is very low you need to keep your ear close to the speaker to hear it. I believe the sound should be higher than that. I will try and add some debugging so I can see the register settings sent to TLV320DAC32.

    Regards,
    Anders

     

  • Depending on the kernel version being used, you can easily take the codec register dump from sysfs or debugfs.

    Eg: cat /sys/bus/platform/devices/soc-audio.0/codec_reg or cat /debug/asoc/codec/codec_reg.

    Regards,

    Vaibhav

  • Hi

    I found a second volume controller "HP" in alsamixer which seems to set the gain in register 47 (DAC_L to HPLOUT Volume Control Register), 54 (DAC_L to HPLCOM Volume Control Register), 64 (DAC_R to HPROUT Volume Control Register) and 71 (DAC_R to HPRCOM Volume Control Register). With the "HP" volume controller I can increase the sound even more but it is still quite low.

    For HPLOUT, HPLCOM, HPROUT and HPRCOM there is an "Output Level Control" register (51, 58, 65 and 72) which has an "Output level control" parameter. This parameter is set to 0dB by default, I changed it to the maximum value 9dB but this didn't change the volume noticeably.

    Maybe the TLV320DAC32 is not sufficient for our needs?
    Our setup is one speaker connected between HPLOUT and HPLCOM.

    Maybe we need to look at other audio DACs with higher output power.

    Regards,
    Anders