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.

tlv320aic3262 for AM335x Android ICS

Other Parts Discussed in Thread: TLV320AIC3262

Hello

          We are designing Android custom board based on AM335x. In audio side we are migrating to tlv320aic3262 due to many numbers of audio device.

         I'm struggling on driver and Android HAL side. I got some patch from this link

http://omappedia.org/wiki/4AI.1.5_OMAP4_ICS_Blaze_AIC_AIC3262_SW_Release3c

but this patch is around 10000 lines. We can't do it manually because this patch will not work for AM335x processor.

What is the procedure to make it work with my AM335x on Android ICS. 

Is there any  SW packages for tlv320aic3262 fot android ?

Thanks is advance. 

  • Hi,

    Could you try the tinyplay/tinymix/tinycap commands listed in the above mentioned wiki page?

    -Arun

  • Hello Arun

         Sorry not yet i build the driver. I'm building the driver for AIC3262 from that patch file. Then only i can check tinyplay/tinymix?

        Or it work just connect with audio input signal.

    I'm using beaglebone there is audio output pin available. 

  • Board specific changes (We have not tested AIC3262 with AM335x).

    1. Refer the schematics
    –Locate DMIC Clock output pin
    –Locate DMIC Data input pin
    2. Update the board file to configure the GPI/O’s
    –Example arch/arm/mach-omap/board-44xx-tablet.c for Blaze tablet
    3. Update the machine driver dapm routes
    a. Add DMIC widget in machine driver

    static const struct snd_soc_dapm_widget sdp44xx_aic3262_dapm_widgets[] = {

     SND_SOC_DAPM_MIC(“DMIC")

    }

    b. Connect ‘Left DMIC’ and ‘Right DMIC’ widget of codec driver to DMIC widget in machine driver

    static const struct snd_soc_dapm_route audio_map[] = {

    {"Left DMIC", NULL, "Mic Bias Int"},

    {"Right DMIC", NULL, "Mic Bias Int"},

    {"Mic Bias Int", NULL, “DMIC"}

    }

    c. Refer http://omappedia.org/wiki/File:Aic3262_Routing.png  for visualization of above code
    Example - sound/soc/omap/sdp44xx_aic3262.c for OMAP
    4. Ensuring correct AOSR and MADC for DMIC operation - Firmware pll_<fs>.cfg for DMIC
    •Set the AOSR according the over-sampling ratio of DMIC
    •Set the MADC such that MADC * AOSR >= IADC
    •Example pll configuration for 64Fs over-sampling and 6144 IADC required for 2 MIC NC + AEC solution
    5. Using Mixer command to select DMIC while recording
    •Using tinymix: Enable DMIC
    –Tinymix ‘Left ADC Route’ ‘Digital’
    –Tinymix ‘Right ADC Route’ ‘Digital’
    •Using alsa_amixer: Enable DMIC
    –Alsa_amixer cset name=‘Left ADC Route’ 1
    –Alsa_amixer cset name=‘Right ADC Route’ 1
    •Using tinymix: Enable Analog MIC
    –Tinymix ‘Left ADC Route’ ‘Analog’
    –Tinymix ‘Right ADC Route’ ‘Analog’
    •Using alsa_amixer: Enable Analog MIC
    –Alsa_amixer cset name=‘Left ADC Route’ 0
    –Alsa_amixer cset name=‘Right ADC Route’ 0
    6. Setting the ADC Digital Volume control
    •Digital Microphone path doesn’t pass through MicPGA
    •Digital Microphone gain must be applied through ADC Digital Volume Control
    •ADC digital volume control mixer command
    –Using tinymix to set the ADC volume to 20dB

    Tinymix ‘PCM Capture Volume’ 64

    –Using alsa_amixer to set ADC volume to 20dB

    Alsa_amixer cset name=‘PCM Capture Volume’ 64

    •Note: While using Digital and analog mic in a same solution, set the ADC digital volume control to 0dB
    –Using tinymix to set the ADC volume to 0dB

    Tinymix ‘PCM Capture Volume’ 24

    –Using alsa_amixer to set ADC volume to 0dB

    Alsa_amixer cset name=‘PCM Capture Volume’ 24

    Regards,

    Arun

  • Hi, 

    Thanks for your quick response. 

    Here i've attached my modified file based on Blaze_AIC3262_SW_Release3c patch file.

    I'm getting following errors and end of building 

    sound/built-in.o: In function `omap_pcm_pointer':
    last.c:(.text+0x32434): undefined reference to `omap_get_dma_src_pos'
    sound/built-in.o: In function `omap_pcm_prepare':
    last.c:(.text+0x325c8): undefined reference to `omap_set_dma_params'
    last.c:(.text+0x325e4): undefined reference to `omap_enable_dma_irq'
    last.c:(.text+0x32648): undefined reference to `omap_disable_dma_irq'
    sound/built-in.o: In function `omap_pcm_hw_free':
    last.c:(.text+0x3267c): undefined reference to `omap_dma_unlink_lch'
    sound/built-in.o: In function `omap_pcm_hw_params':
    last.c:(.text+0x3275c): undefined reference to `omap_dma_link_lch'
    make: *** [.tmp_vmlinux1] Error 1

    reason for this error is some of the AIC3262 source need this undefined reference symbol .

    These symbols are defined in /arch/arm/plat-omap/dma.c.

    But AM335x architecture using /arch/arm/plat-omap/sdma2edma.c

    make file is :    

    ifeq ($(CONFIG_OMAP3_EDMA),y)
    obj-y += sdma2edma.o
    else
    obj-y += dma.o
    endif

    sdma2edma doesn't have omap_get_dma_src_pos,etc... symbols. 

    If i compile with dma.o instead of sdma2edma.o, my kernel not booting up and the error message is 

    omap request_dma() failed with -16

    8053.AIC3262-AM335x.zip

    Kindly help me to use AIC3262 with my device.

    Thanks.

  • You have to use sdma2edma since AM335x platform support that. You might need to modify AIC3262 code to use edma calls instead of dma. Probably you can check the default tlv codec for example.

    Regards,

    Arun

  • Hi

        Yeah, I did some modification in sdma2edma that was just copied the function into sdma2edma from dma.c which all are shown as undefined reference and exported the symbols. so successfully the driver compiled. 

    When i boot my device i'm getting this logs

    [ 1.417053] aic3262_mfd i2c_init
    [ 1.420593] aic3262_i2c_probe: allocated memory
    [ 1.425476] aic3262_device_init beginning
    [ 1.442657] tlv320aic3262 3-0018: TLV320AIC3262 revision
    [ 1.448425] aic3262_device_init TLV320AIC3262 revision
    [ 1.459625] aic3262_device_init added mfd devices
    [ 1.465850] mtdoops: mtd device (mtddev=name/number) must be supplied

    then i checked the node entry in file system

    root@android:/sys/devices/platform/soc-audio.0/subsystem/devices #

    tlv320aic3262-codec
    tlv320aic3262-gpio

    but when i see inside the there is nothing. 

    root@android:/sys/devices/platform/soc-audio.0/subsystem/devices/tlv320aic3262-codec # ls
    driver
    modalias
    power
    subsystem


    root@android:/sys/devices/platform/soc-audio.0/subsystem/devices/tlv320aic3262-codec# cat uevent

    DRIVER=tlv320aic3262-codec

    MODALIAS=platform:tlv320aic3262-codec

    But inside the entry there is two entries for tlv3262: tlv320aic3262-codec, tlv320aic3262-gpio

    My connection details between Beaglebone and AIC3262 EVM

    SCL--->  TP15

    SDA--->  TP17

    GND-->   DGND3

    no other connection i made between my device and audio evm.

    What are the other connection i need to do, because we are unable to get hardware connection details for AIC3262.

    I hope we crossed some % of works on it.

    Kindly help me.

    Thanks