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.

tlv320aic3106 Linux kernel alsa soc driver

Other Parts Discussed in Thread: TLV320AIC3106

Hi All;

 

Does anybody have the driver for TLV320AIC3106 Linux kernel, compatible with ALSA ?

 

Best Regards

 

Sertac

  • Hi Sertac,

                  Linux kernel for atmel based boards, can be downloaded from this site,

    http://www.at91.com/linux4sam/bin/view/Linux4SAM/LinuxKernel

                 The driver code for TLV320AIC3106 Codec is available in Kernel_src_directory/sound/soc/codecs/tlv320aic3x.c. It can be used with ALSA library.

    Regards,

    Dhiv.

  • Hi Dhiv;

    Thank you very much for your answer. I already have the same file, but the problem is, this driver doesn't implement DIGITAL MICROPHONE function.

    To be able to add DMIC function, I followed this patch: http://www.kernelhub.org/?msg=244872&p=2

    But as you see, they have included/used some files, such as include/Linux/regmap.h and I don't have them in my kernel ( 3.0.35 );

    Do you recommend any way to merge this patch, and enable digitam microphone in my kernel?

    Best Regards

    Sertac

  • Hi, In my current driver, I have been able to capture audio by using Digital Microphone.  I did this by manually setting registers in the init() function of the tlv320aic3x.c codec driver ( I know this is not correct way to do ).

     

    However, this time, my new problem is how to adjust gain for it? PGA mixer gain is only effective when using LINE-IN; it is not effective when using digital mic? Why?

     

    Also, How to change ADC gain by registers? Which register need to be set specifically?

     

    I am using TLV320AIC3106.

     

    Waiting for helps please.

     

    Best Regards 

  • Hi again,

     

     I found this document: http://www.ti.com/corp/docs/landing/tlv320aic34-akustica/?DCMP=Audio&HQS=DataSheet+OT+AIC34converter&DCMP=hpa_audio_general&HQS=NotApplicable+PR+tlv320aic3106-pr

     

    So, On tlv320aic3106, how to increase DMic gain ? Does anybody know?

     

    Which registers need to be set for this?

     

    Really need help...

     

    Best Regards

  • Hi, Sertac,

    Did you get this figured out?

    -d2

  • Hi Don;

     

    I still couldn't figure out, I am still thinking why LADC and RADC gain doesn't effect Digital Mic gain?

     

    Currently my situation as follows:

     

    1) My embedded device is running android 4.2.2, and its Audio HAL has some kind of problem, I can't enable Sampling rates other than 8000... Still trying to find where do I need to modify to enable 44100 or 48000 ?

     

    2) I can't increase Digital Microphone gain, I couldn't understand which registers are needed to be set to let it have max gain...

    3) I am sure my hardware is ok, because I can capture sound from my digital mic at 8000, and play; but captured sound has extremely low volüme.. From Line-In, PGA mixer gain is working, I can increase / decrease Line-In's gain...

     

    Need help...

  • Hi Sertac,

             I need to confirm you about certain things,

             Is the digital MIC connected to both Left and Right Channel ? If so then both the Left and Right channel ADC to be powered up. Check whether Left and Right ADC PGA Gain are unmuted (Page 0, Register 15 and 16).

    - Enable digital microphone setting in page 0 / register 25 bits D5 - D4. If both right and left digital MIC enabled, ensure all other analog inputs (Line 1, Line 2 and Mic3) are not connected to ADC.

    - Set D5-D4 bits in Page 0 / register 107 to '00' , means Left and Right digital microphones are used.

    - Check for ADC PGA not muted Page 0 Register 15 and 16.

    WIth all the above, digital MIC , should capture sound, and increasing or decreasing ADC PGA gain should effect the volume.

    If this doesnt work for you, then would like to know if there is noise heard in your recorded sound. If so then clock configurations need to be checked.

    Lets hope for the best,

    Dhiv.

  • Hi Sertac,

    Hope you have the TLV320AIC3106 audio codec datasheet. Read to Page 42, Section "Digital Microphone Connectivity" and it explains you a lot.

    Regards,

    Dhiv

  • Dear Dhiv;

     

    Thank you very much for your answer. I am working on this TLV320AIC3106 for about 45 days. My embedded device is a IMX6 board, and running android 4.2.2 on it.

     

    Here is my basic modification on the device to enable DMIC:

     

    On kernel_source/sound/soc/codecs/tlv320aic3x.c file, in the init function, I added these:

    printk("*************************************\n");  printk("*************************************\n");

     printk("*****REG98----GPIO1: %0x \n", snd_soc_read(codec, AIC3X_GPIO1_REG));  printk("*****REG99----GPIO2: %0x \n", snd_soc_read(codec, AIC3X_GPIO2_REG));

     printk("*****REG15----LADC_VOL: %0x \n", snd_soc_read(codec, LADC_VOL));  printk("*****REG16----RADC_VOL: %0x \n", snd_soc_read(codec, RADC_VOL));

     printk("*****REG2---codec, AIC3X_SAMPLE_RATE_SEL_REG: %0x \n", snd_soc_read(codec, AIC3X_SAMPLE_RATE_SEL_REG));

     printk("*****REG17---MIC3LR_2_LADC_CTRL: %0x \n", snd_soc_read(codec, MIC3LR_2_LADC_CTRL));  printk("*****REG18---MIC3LR_2_RADC_CTRL: %0x \n", snd_soc_read(codec, MIC3LR_2_RADC_CTRL));

     printk("*****REG19---LINE1L_2_LADC_CTRL: %0x \n", snd_soc_read(codec, LINE1L_2_LADC_CTRL));  printk("*****REG20---LINE2L_2_LADC_CTRL: %0x \n", snd_soc_read(codec, LINE2L_2_LADC_CTRL));

     printk("*****REG21---LINE1R_2_LADC_CTRL: %0x \n", snd_soc_read(codec, LINE1R_2_LADC_CTRL));  printk("*****REG22---LINE1R_2_RADC_CTRL: %0x \n", snd_soc_read(codec, LINE1R_2_RADC_CTRL));

     printk("*****REG23---LINE2R_2_RADC_CTRL: %0x \n", snd_soc_read(codec, LINE2R_2_RADC_CTRL));  printk("*****REG24---LINE1L_2_RADC_CTRL: %0x \n", snd_soc_read(codec, LINE1L_2_RADC_CTRL));

     printk("*****REG7---AIC3X_CODEC_DATAPATH_REG: %0x \n", snd_soc_read(codec, AIC3X_CODEC_DATAPATH_REG));

     printk("*****Register8: %0x \n", snd_soc_read(codec, AIC3X_ASD_INTF_CTRLA));

     printk("Writing to GPIO1 register....\n");  snd_soc_write(codec, AIC3X_GPIO1_REG, 0xa0 );

     printk("Writing to GPIO2 register....\n");  snd_soc_write(codec, AIC3X_GPIO2_REG, 0x50 );

     printk("Writing to LADC_VOL register....\n");  snd_soc_write(codec, LADC_VOL, 0x00 );

     printk("Writing to RADC_VOL register....\n");  snd_soc_write(codec, RADC_VOL, 0x00 );

     printk("Writing to AIC3X_CODEC_DATAPATH_REG register....\n");  snd_soc_write(codec, AIC3X_CODEC_DATAPATH_REG, 0x7a );

     

     printk("Writing to Register8....\n");  snd_soc_write(codec, AIC3X_ASD_INTF_CTRLA, 0x02 );

     printk("*****GPIO1: %0x \n", snd_soc_read(codec, AIC3X_GPIO1_REG));  printk("*****GPIO2: %0x \n", snd_soc_read(codec, AIC3X_GPIO2_REG));

     printk("*****LADC_VOL: %0x \n", snd_soc_read(codec, LADC_VOL));  printk("*****RADC_VOL: %0x \n", snd_soc_read(codec, RADC_VOL));

     printk("*****Register8: %0x \n", snd_soc_read(codec, AIC3X_ASD_INTF_CTRLA));

     printk("*************************************\n");  printk("*************************************\n");

     

    These modifications enables DMIC on boot ( this is what I really need, because I only want DMIC input, don't want to use Line-In ).. I know, many people will say this is wrong way to do, these should be defined in the machine driver, and DMIC must be added as a widget..

     

    But just to enable it, I wanted to use this way..

     

    I am missing some basic thing, but couldn't figure it out yet.

     

    Anyway, thank you very much for your answer, I will check it one by one again, and let you know the result.

     

    Best Regards