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.

TAC5111: record have no sound data if power up ADC channel and MICBIAS when playing sound

Part Number: TAC5111

Tool/software:

hi

record have no sound data if power up ADC channel and MICBIAS when playing sound for tac5111, below is the reproduce step

1、

i2cset -f -y 4 0x50 0x76 0x00
i2cset -f -y 4 0x50 0x78 0x00

i2cset -f -y 4 0x50 0x76 0x08

i2cset -f -y 4 0x50 0x78 0x40

aplay play.wav &  // aplay is ok and can listen to the sound

2、

i2cset -f -y 4 0x50 0x76 0x88

i2cset -f -y 4 0x50 0x78 0xe0

arecord -c 1 -f S16_LE -r 8000 -d 30 --device="hw:0,0" -t wav record.wav    

aplay record.wav  // can not  listen to the record sound data

  • but only record is ok ,below record step can work normal

    i2cset -f -y 4 0x50 0x76 0x00
    i2cset -f -y 4 0x50 0x78 0x00

    i2cset -f -y 4 0x50 0x76 0x80

    i2cset -f -y 4 0x50 0x78 0xa0

    arecord -c 1 -f S16_LE -r 8000 -d 30 --device="hw:0,0" -t wav record.wav    

    i2cset -f -y 4 0x50 0x76 0x88

    i2cset -f -y 4 0x50 0x78 0xe0

    aplay record.wav  // can  listen to the record sound data

  • Hi,

    Have you tried running your script that you run to record while playing, before playing? I think if you enable and power up the ADC and DAC before you record or play, then it should be able to record and play simultaneously. This would just be these lines:

    i2cset -f -y 4 0x50 0x76 0x88 #input ch1 and output ch1 enabled
    i2cset -f -y 4 0x50 0x78 0xe0 #power up adc, dac, and micbias
    Let me know if this works.
    Best,
    Mir
  • hi Jeffres 

         yes,  it is ok to enable and power up the ADC and DAC before record and play,  but I want to know the reason why can not record if power up ADC and  MICBIAS when playing sound, because we want use  Linux ALSA DAPM route function for play and record voice

  • Hi,

    I would think that while the device is playing, writing over the current powered up/down states of the DAC and ADC does not work. I think you should be able to use ALSA without this problem, as it will handle it for you. If the DAC and ADC are both connected to something in your ALSA config, the driver will power up the ADC and DAC in the first place before you reach this in-between state. Let me know if you need more help.

    Best,
    Mir

  • hi Jeffres

        Actually, it have same issue when use ALSA DAPM route function,  I also create a e2e thread before but no response,

    and the link is  e2e.ti.com/.../5900744

    I use the codec driver which is TI provided and the link is  https://git.ti.com/cgit/lpaa-android-drivers/tac5x1x-linux-driver/tree/ .

       in the driver, DAC and ADC channel and power is controlled by DAPM independent  ,  below is the code 

    SND_SOC_DAPM_PGA("Left DAC Power", TAC5X1X_PWR_CFG, 6, 0, NULL, 0),

    SND_SOC_DAPM_ADC("CH1_ADC_EN", "CH1 Capture", TAC5X1X_CH_EN, 7, 0),

    SND_SOC_DAPM_MICBIAS("Mic Bias", TAC5X1X_PWR_CFG, 5, 0),

  • Hi,

    I see, I can reach out to the Linux engineer directly to see if we can resolve this in the code. For now, maybe you can enable and power up all channels input and output that you might potentially use during operation, on power up or in the default parameters in the driver. This will help avoid your issue here, and be more similar to a typical end use case.

    Best,
    Mir

  • hi Jeffres 

       ok, wait your response for the driver

  • Hi Bert,

    Could you please try using "dev" branch and see if the issue is solved ? 

    https://git.ti.com/cgit/lpaa-android-drivers/tac5x1x-linux-driver/log/?h=dev

    -Niranjan