TLV320AIC34: Runtime sampling rate change issue

Part Number: TLV320AIC34

Tool/software:

Hello team,

  We are using TLV320AIC34: codec in one of our embedded device, which runs yocto linux. Now we are facing an issue related to run time sample rate changing.

ex. suppose the codec is running with 48k sampling rate, then my application needs at that moment tries to configure to 8k sample rate that time errors are coming.

so like this on run time we want to configure codec to 48k to 8k or vice versa .. is it possible?

we have tried to give soft reset using reg no 0 and reg 1 but it is not happeneing .

presently codec running in 48k sample rate and i want to change it to 8k I use

arecord -D hw:1,0 -c 1 -r 8000 -f S16_LE | aplay -D hw:1,0 -c 1 -r 8000 -f S16_LE

 

Error : unmatched rate symmetry soc_pcm_params_symmetry :8000

ASOC soc_pcm_hw_params() failed (-22)

read write error

To change the sampling rate we need to reboot the device that time it will take. but we want runtime change of sampling rate frequency.

is there any way to reset the codec? or can we change like this runtime is it allowed? kindly guide us

  • Hi,

    Are you able to run I2C commands in your system? I2C commands can be sent during runtime. If you want to only change between 48k and 8k, you could use page 0 register 2, which divides the current reference sample rate by up to 6 to get a new ADC or DAC sample rate. You could divide 48k by 6 to give a new sample rate of 8k before you record at 8k. 

    Let me know if this doesn't help, we can try other methods.

    Best,
    Mir