TAS2563: Issue with Volume Control on TAS2563 Using QCS8550

Part Number: TAS2563
Other Parts Discussed in Thread: TAS2562, TAS2781

We are working with a system using the QCS8550 chipset and TAS2563 amplifier, connected as shown in the attached schematic. I2S has been used for audio data transfer and I2C for the amplifier control.

image2.png

 

Note:

 

  • Vdd and IO supply = 1.8V

  • VBat supply = 3.3V

We have pulled up the I2C, interrupt, and shutdown lines at the processor side.

Currently, we are using the Linux driver for TAS2562, with the compatible string set to TAS2563. The sound card is up, I2C is detected, and the interface is working. On trying to play a .wav file using agmplay utility, we observe some vibrations and slight noise in the output sound. We are checking to see if we can get the correct volume and output.

We tried to control the Amp gain using the tinymix command, by setting the "Amp gain amplifier" to its maximum value (0x1c), but did not notice any significant changes in the output volume.

Upon analyzing the TAS2562 driver, we found that the registers DVC_CFG1 to DVC_CFG4 are being controlled to adjust volume. However, in the TAS2563 datasheet (www.ti.com/.../tas2563),  DVC_CFG1 and related registers could not be found.

So we wonder if, the TAS2563 use different registers or mechanisms for volume control, or is there an equivalent to DVC_CFG1 in the TAS2563? If so, can you provide the correct references for the same?

Any links to relevant drivers, or clarification on the correct register usage or other configuration settings that could be adjusted for proper volume control on the TAS2563 would be much appreciated.

Thanks and regards,

Kavita R.

  • Hi Kavita,

    I checked on the TAS2563 EVM and when I adjust the digital volume control it writes to the same DVC_CFG1-DVC_CFG4 registers in the TAS2562 register map.

    These registers are on page 2 of the TAS2562 datasheet and the TAS2563 datasheet only has register maps for page 0. 

    There are several application notes from the product page that would be helpful for setting the right registers such as the device features and controls overview. 

     

    I would highly recommend using the PPC3 TAS2563-SW to help you set the proper register settings. This is also available on the product page. 

    You can then export your settings from PPC3 into a header file which you can use with the linux driver.

    Regards,

    Sebastian 

  • Hi Sebastian,

    Thank you for the suggestion.

    We tried setting AMP_LEVEL to 0x1C and digital volume to 0 (unity gain, using DVC_CFG1-DVC_CFG4), but the output sound is still quite feeble.

    From the TAS2562 datasheet, AMP_LEVEL is part of the PB_CFG1 register (Page 0, address 0x03), specifically bits [5:1]. As said in the datasheet, this field controls the analog gain of the amplifier and ranges from 0x00 to 0x1F. Setting it to 0x1C should give us around 20.5 dBV, which is near the upper end of the analog gain range.

    Given that, we expected a stronger output, especially with digital volume at unity. But the sound remains weak.

    Could there be other settings affecting the signal path or output strength?

  • Hi Kavita,

    It is possible other features could be attenuating your signal, however I would like to know if you're getting the expected output amplitude for a certain input.  

    What is your load impedance? What is your output amplitude and THD+N when setting the max gain and setting a certain input level such as 0dBFS? 

    Regards,

    Sebastian 

  • Hi Sebastian,

    We are using the CDS-40288 speaker, with load impedance 8 Ohm (CDS-40288 Same Sky (Formerly CUI Devices) | Audio Products | DigiKey). 

    We have captured the output waveforms as show below. The amplifier settings followed were:

    1. We generated Sine wave of 48kHz using the audacity tool, and provided that as the input file for the amplifier.

    2. We have set the AMP_LEVEL value to 0x10 (from datasheet, 10h = 16.0 dBV (8.92 Vpk))

    3. We have set the Volume registers DVC_CFG1-4 to 0x40000000 (corresponding to 0dB unity gain).

    The above image was taken, when the audio file for the Sine wave was playing. As observed, the output, is not a clear sine wave. The zoomed version of the same is given below. The output amplitude is coming around 7V peak-peak.

    The above image is taken when the audio is about to be stopped.

    The schematics of the amplifier was already shared. Also sharing the speaker connection diagram.

    Please let us know if any other information is needed from our side.

  • Hi Kavita,

    Have you used PPC3 at all for the configuration script?
    There could be some registers that haven't been set properly if you're writing direct I2C based off the datasheet.

    PPC3 will write to all the necessary registers when intializing and turning on features. You can output the header file to use as your I2C script. 

    Regards,

    Sebastian 

  • Hi Sebastian,

    We have directly connected the TAS2563 module directly to our chipset. We unfortunately don't have the EVM board to connect to PPC3. But meanwhile, we are checking by directly connecting the module with the chipset.

    Hope you can help us out with any registers or HW connection points that we can check out.

  • Hi Kavita,

    Can you share your I2S signal clock frequencies (FCLK/LRCLK and SBCLK) and your slot/word length? 

    I want to make sure these are in supported format. Can you also share your I2C script? 

    If the audio data is in a supported format, a sine wave output should not be this distorted. 

    Also I assume there is no filter on the output?

    I woud recommend using one to remove the switching component from the PWM output of a Class-D amplifier and get a clean output waveform. 

    RC Filter Box For Class-D Output Power and THD+N Measurement 

    Regards,

    Sebastian 

  • Hi Sebastian, 

    We will check and provide the information requested shortly. 

    But I have one more observation to make here.

    When we run the following tinymix command to control the volume registers (DVC_CFG1-4)

    tinymix "Digital Volume Control" 60
    

    We observe the following kernel logs:

    Volume Value : 60, reg_val = 0033cf8d
    tas2562 4-0048: regmap_i2c_write: count = 2, data =
    tas2562 4-0048: 00
    tas2562 4-0048: 02
    ...
    tas2562 4-0048: 0f
    tas2562 4-0048: 8d
    ...
    tas2562 4-0048: 0e
    tas2562 4-0048: cf
    ...
    tas2562 4-0048: 0d
    tas2562 4-0048: 33
    ...
    tas2562 4-0048: 0c
    tas2562 4-0048: 00

    This suggests that the tinymix command is triggering the expected regmap_write() calls, and regmap_i2c_write() is being invoked with the correct data. To cross-verify, we manually probed the SDA lines and confirmed that the I²C communication is functioning correctly.

    However, when we read back the written registers using the i2cget commands, the values are different, as seen below.

    console:/ # i2cset -y -f 4 0x48 0x00 0x02 b; sleep 0.5;

    console:/ # i2cget -y -f 4 0x48 0x0C; sleep 0.5;

    0x0b

    console:/ # i2cget -y -f 4 0x48 0x0D; sleep 0.5;

    0x00

    console:/ # i2cget -y -f 4 0x48 0x0E; sleep 0.5;

    0x00

    console:/ # i2cget -y -f 4 0x48 0x0F; sleep 0.5;

    0x8d

    Additionally, we used i2cset to manually set these registers and i2cget to read them back. Here, the values read back using i2cget are correct and match the expected register values.

    The issue here, looks like the tinymix command seems to fail to update the registers correctly, even though the logs indicate that the writes are being attempted.

    Please let us know if you have any insights into what might be causing this discrepancy or if there are any additional debug steps we can try.

  • Hi Kavita, 

    Let me loop in our teams driver expert,   .

    Shengao, 

    They're having issues with the tinymix command not updating registers properly. Do you have any thoughts here?

    Regards,

    Sebastian 

  • Hi Guy

    Where did you get the code? Let me the kernel version. Our driver has been upstream the Linux mainline.

    tas2781-i2c.c « codecs « soc « sound - kernel/git/torvalds/linux.git - Linux kernel source tree

    In that code, we defined

    static const struct snd_kcontrol_new tas2563_snd_controls[] = {
    	SOC_SINGLE_RANGE_EXT_TLV("Speaker Digital Volume", TAS2563_DVC_LVL, 0,
    		0, ARRAY_SIZE(tas2563_dvc_table) - 1, 0,
    		tasdevice_digital_gain_get, tasdevice_digital_gain_put,
    		tas2563_dvc_tlv),
    };
  • Hi Shenghao,

    We use the kernel version 5.15. In this, the 2563 is added as part of 2562 driver code (linux/sound/soc/codecs/tas2562.c at v5.15 · torvalds/linux · GitHub)


    Additionally, some information,  had requested earlier: SBCLK frequency ~1.5MHz, Word Clock: 48KHz, our word length is 16 bits and slot length is 32 (as per the values read from register TDM_CFG2).

    SBCLK capture:

    Word Clock:

    Also adding the register dumps before and while playing a .wav file for pages 0, 1 and 2.

    Before playing:

    # i2cset -y -f 4 0x48 0x00 0x00 b
    # i2cdump -y -f 4 0x48
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f 0123456789abcdef
    00: 00 00 0e 38 c6 22 09 02 42 10 13 02 00 04 05 06 ..?8?"??B???.???
    10: 07 7f 12 76 01 2e 60 0e 0c 00 fc a6 df ff ff 00 ???v?.`??.?????.
    20: 00 00 80 00 04 00 11 80 00 d0 32 b0 76 87 00 a1 ..?.?.??.?2?v?.?
    30: 19 40 81 34 4b 74 00 00 0d 0c be 58 68 08 10 00 ?@?4Kt..???Xh??.
    40: 76 41 00 c0 10 21 00 32 2c 32 50 00 00 00 00 00 vA.??!.2,2P.....
    50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    70: 00 00 00 f0 00 0f 00 00 80 00 00 00 00 10 ef 00 ...?.?..?....??.
    80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

    # i2cset -y -f 4 0x48 0x00 0x01 b
    # i2cdump -y -f 4 0x48
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f 0123456789abcdef
    00: 01 00 00 44 80 42 01 20 40 00 50 10 48 02 68 00 ?..D?B? @.P?H?h.
    10: 40 10 00 00 00 00 40 00 00 01 00 01 08 00 00 60 @?....@..?.??..`
    20: 03 00 01 00 00 00 00 00 10 10 02 00 20 01 09 01 ?.?.....???. ???
    30: 30 00 80 00 00 00 00 00 00 00 00 12 48 10 10 01 0.?........?H???
    40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

    # i2cset -y -f 4 0x48 0x00 0x02 b
    # i2cdump -y -f 4 0x48
             0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f 0123456789abcdef
    00: 02 00 00 00 00 00 00 00 7f b2 60 b5 40 00 00 00 ?.......??`?@...
    10: 03 4a 51 6c 2d 6a 86 6f 47 5c 28 f6 16 66 66 66 ?JQl-j?oG\(??fff
    20: 1a 66 66 66 10 00 00 00 17 33 33 33 15 99 99 9a ?fff?...?333????
    30: 06 5f c7 b7 06 5f c7 b7 73 40 70 92 06 5f c7 b7 ?_???_??s@p??_??
    40: 06 5f c7 b7 73 40 70 92 40 00 b6 c1 40 00 b6 c1 ?_??s@p?@.??@.??
    50: 00 00 00 00 00 00 00 00 00 30 03 00 00 20 c4 9c .........0?.. ??
    60: 02 46 b4 e4 00 00 4b 00 7f fb b6 14 80 04 49 ec ?F??..K.??????I?
    70: 7f f7 6c 28 f7 ae 97 8e f7 47 36 1e ef 5d 5e 9d ??l(?????G6??]^?
    80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

    While playing:


    # i2cset -y -f 4 0x48 0x00 0x00 b
    # i2cdump -y -f 4 0x48
             0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f 0123456789abcdef
    00: 00 00 0c 38 c6 22 09 02 42 10 13 02 00 04 05 06 ..?8?"??B???.???
    10: 07 14 12 76 01 2e 60 0e 0c 00 fc a6 df ff ff 00 ???v?.`??.?????.
    20: 00 11 00 00 04 00 11 80 00 d0 32 b0 76 85 c0 a1 .?..?.??.?2?v???
    30: 19 40 81 34 4b 74 01 00 0d 0c be 58 68 08 10 00 ?@?4Kt?.???Xh??.
    40: 76 41 00 c0 10 21 00 31 ac 32 40 00 00 00 00 00 vA.??!.1?2@.....
    50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    70: 00 00 00 f0 00 0f 00 00 cc 00 00 00 00 10 a7 00 ...?.?..?....??.
    80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................


     # i2cset -y -f 4 0x48 0x00 0x01 b
     # i2cdump -y -f 4 0x48
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f 0123456789abcdef
    00: 01 00 00 44 80 42 01 20 40 00 50 10 48 02 68 00 ?..D?B? @.P?H?h.
    10: 40 10 00 00 00 00 40 00 00 01 00 01 08 00 00 60 @?....@..?.??..`
    20: 03 00 01 00 00 00 00 00 10 10 02 00 20 01 09 01 ?.?.....???. ???
    30: 30 00 80 00 00 00 00 00 00 00 00 12 48 10 10 01 0.?........?H???
    40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

     # i2cset -y -f 4 0x48 0x00 0x02 b
     # i2cdump -y -f 4 0x48
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f 0123456789abcdef
    00: 02 00 00 00 00 00 00 00 7f b2 60 b5 40 00 00 00 ?.......??`?@...
    10: 03 4a 51 6c 2d 6a 86 6f 47 5c 28 f6 16 66 66 66 ?JQl-j?oG\(??fff
    20: 1a 66 66 66 10 00 00 00 17 33 33 33 15 99 99 9a ?fff?...?333????
    30: 06 5f c7 b7 06 5f c7 b7 73 40 70 92 06 5f c7 b7 ?_???_??s@p??_??
    40: 06 5f c7 b7 73 40 70 92 40 00 b6 c1 40 00 b6 c1 ?_??s@p?@.??@.??
    50: 00 00 00 00 00 00 00 00 00 30 03 00 00 20 c4 9c .........0?.. ??
    60: 02 46 b4 e4 00 00 4b 00 7f fb b6 14 80 04 49 ec ?F??..K.??????I?
    70: 7f f7 6c 28 f7 ae 97 8e f7 47 36 1e ef 5d 5e 9d ??l(?????G6??]^?
    80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

  • Do not use that code? Since 6.6, tas2563 has been move into tas2781 driver.

    tidrive.ext.ti.com/.../44a3f155-a8d4-46c0-9cb0-73aa25487dc3

    access code: 2uV3S,be

    It will be expired in 7 days.

  • When I try to access the link, it asks to login using TI enterprise or ENT.TI.COM. When i try to login to both using my mail id and password, its not happening.

    Could you please advise on the correct login method or account requirements for accessing the link?

  • https://tidrive.ext.ti.com/u/xqN6rpMjevvUo3qi/44a3f155-a8d4-46c0-9cb0-73aa25487dc3?l

    access code: 2uV3S,be

  • Hi Shenghao,

    Thank you sharing the driver. We used the drivers for 5.15.148. However we are facing some issues:

    When calling the main i2c probe, the following error is coming:

     tasdev_codec 4-0048: tasdevice_change_chn_book, E=-107
     tasdev_codec 4-0048: dev 0 swreset fail, -107

    And, on calling the codec_probe, it tries to load the tas2563RCA4.bin file. (This file was already present in the folder shared. I had to rename this file to tas2563RCA1.bin, for it to attempt loading). The errors coming are:

    tasdev_codec 4-0048: ndev(4) in rcabin mismatch ndev(1) in DTS
    ueventd: firmware: could not find firmware for tas2563_coef.bin
    ueventd: firmware: attempted /etc/firmware/tas2563_coef.bin, open failed: No such file or directory
    ueventd: firmware: attempted /odm/firmware/tas2563_coef.bin, open failed: No such file or directory
    ueventd: firmware: attempted /vendor/firmware/tas2563_coef.bin, open failed: No such file or directory
    ueventd: firmware: attempted /firmware/image/tas2563_coef.bin, open failed: No such file or directory
    ueventd: firmware: attempted /vendor/firmware_mnt/image/tas2563_coef.bin, open failed: No such file or directory
    ueventd: firmware: attempted /vendor/vm-system/tas2563_coef.bin, open failed: No such file or directory
    tasdev_codec 4-0048: tasdevice_dsp_parser: load tas2563_coef.bin error
    tasdev_codec 4-0048: dspfw load tas2563_coef.bin error

    The file tas2563_coef.bin is not available with us. When we try to perform normal i2c get/set functions, its not working too in this case. 

    (Note : i2c is working, because when we load the earlier tas2562 driver, the registers are accessible)

    Our device tree entry under i2c node:

    tasdev_codec: tasdev_codec@48 {
    status = "ok";
    compatible = "ti,tas2563";
    reg = <0x48>;
    shutdown-gpios = <&tlmm 157 0x00>;
    };

    Sound card is getting registered, and tinymix utility registers the commands too. But the commands fail on evoking them.

    Please let us know how to proceed from here.

  • Hi Kavita

    You may as well study the guideline (“Guideline for Audio AMP Linux driver porting.pdf”, RCA/“Regbin Tool User Guideline.pdf” and "clock issues_en.pdf") carefully.

    Because there's only one piece of tas2563 in your device, tas2563RCA4.bin doesn't match your case. Pls download RCA/jsn file/tas2563/tas2563-1amp-reg.json, and make it to tas2563RCA1.bin with regbin tool(RCA/toolset/regbin tool/Non_Integrated_Bin_Tool_v1.4.1.zip)

     tasdev_codec 4-0048: tasdevice_change_chn_book, E=-107
     tasdev_codec 4-0048: dev 0 swreset fail, -107

    This means the i2s bus is not ready during i2c_probe.

    Regarding to tas2563_coef.bin is the dsp firmware, kindly apply for the PPC3 tool first. PUREPATHCONSOLE Application software & framework | TI.com. in the guideline also mentions it in P17.

    One more thing, let me know the sound architecture in your device, alsa or tinyalsa?

  • First, make sure RCA bin can work well, then add coef.bin to enable dsp mode.

  • Hi Shenghao,

    I generated the bin file as specified. Based on the dmesg logs, it seems to be loading properly.

    [ 19.093628] tasdev_codec 4-0048: Direct firmware load for tas2563RCA1.bin failed with error -2
    [ 19.093633] tasdev_codec 4-0048: Falling back to sysfs fallback for: tas2563RCA1.bin
    [ 19.096922] ueventd: firmware: loading 'tas2563RCA1.bin' for '/devices/platform/soc/ac0000.qcom,qupv3_1_geni_se/a80000.i2c/i2c-4/4
    -0048/firmware/tas2563RCA1.bin'
    [ 19.097693] ueventd: loading /devices/platform/soc/ac0000.qcom,qupv3_1_geni_se/a80000.i2c/i2c-4/4-0048/firmware/tas2563RCA1.bin to
    ok 0ms
    [ 19.120467] tasdev_codec 4-0048: Direct firmware load for tas2563_coef.bin failed with error -2
    [ 19.120471] tasdev_codec 4-0048: Falling back to sysfs fallback for: tas2563_coef.bin

    I2C probe is also working fine now. i2c get/set commands are functional. Tinymix command to control volume is working well - the values written to the registers are the same when we read it back via i2cget.

    Without changing any register configurations and using the default values: 0x20 for AMP LEVEL (0x03) register value, and 0dB (0x40000000), for the DVC_CFG1-4 registers. We tried playing a .wav file, but no sound is coming on the speakers.

    Observations:

    • BCLK: 1.5 MHz
    • Word clock: 48 kHz
    • I²S SD0: Data present during playback
    • Speaker output: No activity

    Logs on using the agmplay utility:

    #agmplay sine_wave_440hz_48khzRate.wav -D 100 -d 100 -i MI2S-LPAIF-RX-SECONDARY <
    mixer_plugin_open - agm_mixer_plugin_open
    mixer_plugin_open: card = 100
    mixer_plug_get_card_info: card = 100
    Backend MI2S-LPAIF-RX-SECONDARY rate ch bit : 48000, 2, 16
    Instance key is added
    pcm_plug_open: dlopen successful for libagm_pcm_plugin.so
    pcm_plug_open - agm_pcm_plugin_open
    Playing sample: 1 ch, 48000 hz, 16 bit
    [ 924.491142][ T4187] tasdev_codec 4-0048: regmap_i2c_write: count = 2, ret = 2, data =
    [ 924.499223][ T4187] tasdev_codec 4-0048: 00
    [ 924.503675][ T4187] tasdev_codec 4-0048: 01
    [ 924.509604][ T4187] tasdev_codec 4-0048: regmap_i2c_write: count = 2, ret = 2, data =
    [ 924.517681][ T4187] tasdev_codec 4-0048: 00
    [ 924.522099][ T4187] tasdev_codec 4-0048: 00
    [ 924.526866][ T4187] tasdev_codec 4-0048: regmap_i2c_write: count = 2, ret = 2, data =
    [ 924.534938][ T4187] tasdev_codec 4-0048: 06
    [ 924.539355][ T4187] tasdev_codec 4-0048: 13
    [ 924.544582][ T4187] tasdev_codec 4-0048: regmap_i2c_write: count = 2, ret = 2, data =
    [ 924.552686][ T4187] tasdev_codec 4-0048: 08
    [ 924.557092][ T4187] tasdev_codec 4-0048: 00
    [ 924.562517][ T4187] tasdev_codec 4-0048: regmap_i2c_write: count = 2, ret = 2, data =
    [ 924.570596][ T4187] tasdev_codec 4-0048: 0c
    [ 924.575018][ T4187] tasdev_codec 4-0048: 44
    [ 924.580372][ T4187] tasdev_codec 4-0048: regmap_i2c_write: count = 2, ret = 2, data =
    [ 924.588437][ T4187] tasdev_codec 4-0048: 0b
    [ 924.592844][ T4187] tasdev_codec 4-0048: 46
    [ 924.598109][ T4187] tasdev_codec 4-0048: regmap_i2c_write: count = 2, ret = 2, data =
    [ 924.606163][ T4187] tasdev_codec 4-0048: 0d
    [ 924.610571][ T4187] tasdev_codec 4-0048: 04
    [ 924.616032][ T4187] tasdev_codec 4-0048: regmap_i2c_write: count = 2, ret = 2, data =
    [ 924.624137][ T4187] tasdev_codec 4-0048: 30
    [ 924.628579][ T4187] tasdev_codec 4-0048: 99
    [ 924.633885][ T4187] tasdev_codec 4-0048: regmap_i2c_write: count = 2, ret = 2, data =
    [ 924.641959][ T4187] tasdev_codec 4-0048: 0a
    [ 924.646385][ T4187] tasdev_codec 4-0048: f1
    [ 924.652042][ T4187] tasdev_codec 4-0048: regmap_i2c_write: count = 2, ret = 2, data =
    [ 924.660149][ T4187] tasdev_codec 4-0048: 41
    [ 924.664618][ T4187] tasdev_codec 4-0048: 41
    [ 924.670445][ T4187] tasdev_codec 4-0048: regmap_i2c_write: count = 2, ret = 2, data =
    [ 924.678573][ T4187] tasdev_codec 4-0048: 42
    [ 924.683057][ T4187] tasdev_codec 4-0048: f8
    [ 924.688703][ T4187] tasdev_codec 4-0048: regmap_i2c_write: count = 2, ret = 2, data =
    [ 924.696840][ T4187] tasdev_codec 4-0048: 07
    [ 924.701249][ T4187] tasdev_codec 4-0048: 02
    [ 924.706510][ T4187] tasdev_codec 4-0048: regmap_i2c_write: count = 2, ret = 2, data =
    [ 924.714578][ T4187] tasdev_codec 4-0048: 02
    [ 924.718988][ T4187] tasdev_codec 4-0048: 00

    Please help us understand what is going wrong.

    One more question we have is, is enabling DSP a mandatory step, or will the device work in bypass mode just by loading the RCA bin file? We dont have the EVK kit for tas2563, and also no access to PPC3. Hence building the dsp firmware tas2563_coef.bin will not be possible for us.

    Note : Sound architecture is tinyalsa

  • Hi Kavita

    You have done a good job to integrate the driver into your platform.

    In the code, the default profile id is 0, while the 0 profile only support 16kHz sample rate, and 4-slot TDM, 16bit.

    Pls switch profile id to 1, proifle 1 support auto-detect sample rate and 16bit, i2s.

    The command is like following

    tinymix"Speaker Profile id" 1

    You can check the profile feature with regbin tool.

  • Hi Shenghao,

    Thank you for the help. On playing the .wav files, it is audible over the speakers.

    However, we find that even on setting the max gain (value 0x1C in the AMP_LEVEL bits) and setting the highest volume possible via the tinymix command, we feel that the speaker output does not reach its expected maximum loudness.

    Speakers that we have tried:

    CDS-40288 Same Sky (Formerly CUI Devices) | Audio Products | DigiKey

    CMS-151125-18S-X8 Same Sky (Formerly CUI Devices) | Audio Products | DigiKey

    Speaker connection:

    Any idea what could be the issue?

  • Hi Guy,

    Kindly trying "Speaker Digital Volume", and let me know the result.

  • We have tried the same. We have tried setting it to its max possible value, and the result is the same. The speaker output does not reach its expected maximum loudness.

  • Let me transfer your question to our hardware expert. Pls share the book0page0 register dump during playback before our hardware expert support you.

  • Hi Shenghao,

    I2C dump for book0 page0 for "Speaker Profile Id" 1, during playback:


        0  1 2  3  4  5  6  7  8  9  a   b  c  d  e f  0123456789abcdef
    00: 00 00 00 13 c6 22 09 02 00 10 f1 46 44 04 05 06 ...??"??.??FD???
    10: 07 14 12 76 01 2e 60 0e 0c 00 fc a6 df ff ff 00 ???v?.`??.?????.
    20: 00 11 00 00 04 00 11 80 00 c8 32 a0 76 87 00 a1 .?..?.??.?2?v?.?
    30: 99 40 81 34 4b 74 0d 00 0d 0c be 58 68 08 10 00 ?@?4Kt?.???Xh??.
    40: 76 41 d8 c0 10 21 00 32 2c 32 60 00 00 00 00 00 vA???!.2,2`.....
    50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    70: 00 00 00 f0 00 0f 00 00 cf 00 00 00 00 10 23 00 ...?.?..?....?#.
    80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

    I2C dump for book0 page0 for "Speaker Profile Id" 5, during playback and after setting AMP_LEVEL to 0x1c


         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f 0123456789abcdef
    00: 00 00 00 38 c6 22 09 02 70 10 13 40 42 04 05 06 ...8?"??p??@B???
    10: 07 14 12 76 01 2e 60 0e 0c 00 fc a6 df ff ff 00 ???v?.`??.?????.
    20: 00 11 00 00 04 00 11 80 00 dc 32 e0 77 85 80 a1 .?..?.??.?2?w???
    30: 99 40 81 34 4b 74 0c 00 0d 0c be 58 68 08 10 00 ?@?4Kt?.???Xh??.
    40: 76 41 d8 c0 10 21 00 32 ac 32 70 00 00 00 00 00 vA???!.2?2p.....
    50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    70: 00 00 00 f0 00 0f 00 00 cf 00 00 00 00 10 8f 00 ...?.?..?....??.
    80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

  • Hi Kavita,

    I'll review this thread and come back with further comments by tomorrow.

    Best regards.
    -Ivan Salazar
    Applications Engineer

  • Hi Ivan,
    Any updates on this?