TAS2563: Device tree configuration for Microphone

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

Tool/software:

Hi, 

I'm using TAS2563 codec for audio, I'm using TAS2562 driver. I have added device tree configuration to use the codec for speaker and can utilize "aplay". However, I'm trying to configure the codec for microphone use, but I'm unable to determine how to set the route property for microphone, I couldn't see a value in the tas2562 driver.

Could you guide me on how to update the device tree to enable microphone support.

Below is the device tree configuration I'm using.

       sound {
                compatible = "simple-audio-card";
                simple-audio-card,name = "AM62x-SKEVM";
                simple-audio-card,widgets =
                        "Speaker",      "Internal Speaker",
                simple-audio-card,routing =
                        "Internal Speaker",     "OUT",
                simple-audio-card,format = "i2s";
                simple-audio-card,bitclock-master = <&sound_master>;
                simple-audio-card,frame-master = <&sound_master>;
                simple-audio-card,mclk-fs = <256>;
                simple-audio-card,bitclock-inversion;

                sound_master: simple-audio-card,cpu {
                        sound-dai = <&mcasp2>;
                        dai-tdm-slot-num = <2>;
                        dai-tdm-slot-width = <32>;
                };

                simple-audio-card,codec {
                        sound-dai = <&tas2563>;
                };
        };
        tas2563: tas2563@4c{
                status = "okay";
                reg = <0x4c>;
                compatible = "ti,tas2563";
                #sound-dai-cells = <0>;
                ti,imon-slot-no = <0>;
                ti,vmon-slot-no = <0>;
                ti,asi-format = <0>;
        };

  • Hi Sakshi,

    For TAS2563 I think you'll have to use this driver instead of TAS2562: lpaa-android-drivers/tasdevice-linux-driver - Unnamed repository; edit this file 'description' to name the repository.

    I'm copying SW experts in this same for any further comments.

    Best regards,
    -Ivan Salazar
    Applications Engineer

  • Kindly tell me which kernel version you use? 

    Kindly use git pull the tas2781 driver from latest kernel mainline. that code support tas2563. tas2781-i2c.c « codecs « soc « sound - kernel/git/torvalds/linux.git - Linux kernel source tree

    Or

    you can also use  CGit @ Texas Instruments - Open Source Git Repositories - git.TI.com/cgit, this code also support factory calibration. We will upstream factory code to kernel.org soon. In this branch is the guideline, which teaches you how to register sound card. 

  • Hi, I'm using kernel version 6.6

  • We'll get back to you soon if needed.

    Best regards,
    -Ivan Salazar
    Applications Engineer

  • Hi, I tried integrating this tas2781-i2c.c « codecs « soc « sound - kernel/git/torvalds/linux.git - Linux kernel source tree driver to our kernel for tas2563 support, but I get a lot of errors compiling the driver.

  • Why not share the compiling error log here? One more thing, would you be so kind and describe how you compile the driver in detail. I think there is something wrong with you compiling method. This driver code has been compiled by many Linux developers.

  • Hi,

    I found I had not updated some header files, because of which I was not able to compile the driver. able to compile and load it now. Trying to test it further with tas2563.

  • Hi Guy

    Kindly describe your question in detail. What are the header files you can't update? And kindly describe how you compile your kernel. What's your compiler and what the platform your kernel will run on? So far, I have not got them. Here is the guideline on how to compile the driver and kernel for BBB and respberry paltforms. Hope this can help you.

  • Hi,

    sorry for the delay. I had missed updating header files (tas2781.h and tas2781-tlv.h) included by tas2781-i2c driver, I updated those files and with that I was able to compile it properly. I’m using gcc arm compiler. I'm using AM623 platform, and kernel version 6.6.15.

    I’m able to load the driver, but it shows error loading tas2563RCA1 firmware, how can I add tas2563RCA1, I could not find it on linux-firmware. where can I get this?

    $ sudo dmesg | grep tasdev
    [    7.303297] tasdev-codec 3-004c: Looking up irq-gpio property failed -22
    [    7.333458] tasdev-codec 3-004c: firmware: failed to load tas2563RCA1.bin (-2)
    [    7.341315] tasdev-codec 3-004c: firmware: failed to load tas2563RCA1.bin (-2)
    [    7.348965] tasdev-codec 3-004c: Direct firmware load for tas2563RCA1.bin failed with error -2
    [    7.349004] tasdev-codec 3-004c: Failed to read tas2563RCA1.bin
    

    and while playing sound:

    $ sudo aplay sample.wav
    [  368.949242] tasdev-codec 3-004c: ASoC: error at snd_soc_dai_startup on tas2781_codec: -22
    aplay: main:831: audio open error: Invalid argument
    
    
    $ sudo aplay -L
    null
        Discard all samples (playback) or generate zero samples (capture)
    hw:CARD=AM623GTC650C,DEV=0
        AM623-GTC650C, 2b20000.audio-controller-tas2781_codec tas2781_codec-0
        Direct hardware device without any conversions
    plughw:CARD=AM623GTC650C,DEV=0
        AM623-GTC650C, 2b20000.audio-controller-tas2781_codec tas2781_codec-0
        Hardware device with all software conversions
    default:CARD=AM623GTC650C
        AM623-GTC650C, 2b20000.audio-controller-tas2781_codec tas2781_codec-0
        Default Audio Device
    sysdefault:CARD=AM623GTC650C
        AM623-GTC650C, 2b20000.audio-controller-tas2781_codec tas2781_codec-0
        Default Audio Device
    dmix:CARD=AM623GTC650C,DEV=0
        AM623-GTC650C, 2b20000.audio-controller-tas2781_codec tas2781_codec-0
        Direct sample mixing device
    
    $ sudo arecord -L
    null
        Discard all samples (playback) or generate zero samples (capture)
    hw:CARD=AM623GTC650C,DEV=0
        AM623-GTC650C, 2b20000.audio-controller-tas2781_codec tas2781_codec-0
        Direct hardware device without any conversions
    plughw:CARD=AM623GTC650C,DEV=0
        AM623-GTC650C, 2b20000.audio-controller-tas2781_codec tas2781_codec-0
        Hardware device with all software conversions
    default:CARD=AM623GTC650C
        AM623-GTC650C, 2b20000.audio-controller-tas2781_codec tas2781_codec-0
        Default Audio Device
    sysdefault:CARD=AM623GTC650C
        AM623-GTC650C, 2b20000.audio-controller-tas2781_codec tas2781_codec-0
        Default Audio Device
    dsnoop:CARD=AM623GTC650C,DEV=0
        AM623-GTC650C, 2b20000.audio-controller-tas2781_codec tas2781_codec-0
        Direct sample snooping device
    
    $ sudo lsmod | grep snd
    snd_soc_simple_card    20480  0
    snd_soc_simple_card_utils    24576  1 snd_soc_simple_card
    snd_soc_tas2781_i2c    24576  1
    snd_soc_davinci_mcasp    40960  2
    snd_soc_ti_udma        12288  1 snd_soc_davinci_mcasp
    snd_soc_ti_edma        12288  1 snd_soc_davinci_mcasp
    snd_soc_tas2781_fmwlib    32768  1 snd_soc_tas2781_i2c
    snd_soc_ti_sdma        12288  1 snd_soc_davinci_mcasp
    snd_soc_tas2781_comlib    16384  2 snd_soc_tas2781_i2c,snd_soc_tas2781_fmwlib
    snd_soc_core          221184  7 snd_soc_tas2781_i2c,snd_soc_davinci_mcasp,snd_soc_ti_sdma,snd_soc_ti_edma,snd_soc_ti_udma,snd_soc_simple_card_utils,snd_soc_simple_card
    snd_pcm_dmaengine      12288  1 snd_soc_core
    snd_pcm               118784  5 snd_soc_tas2781_i2c,snd_soc_davinci_mcasp,snd_soc_simple_card_utils,snd_soc_core,snd_pcm_dmaengine
    snd_timer              40960  1 snd_pcm
    snd                    90112  4 snd_soc_tas2781_i2c,snd_timer,snd_soc_core,snd_pcm
    soundcore              12288  1 snd
    

  • Hi Sakshi,

    Our team in Shanghai is currently on holiday, we'll get back to you soon after that.

    Best regards,
    -Ivan Salazar
    Applications Engineer

  • I generated tas2563RCA1.bin from  tas2563-1amp-reg.json usinf the regbin tool as mentioned in the guide.

    It loads now. It further checks for tas2563_coef.bin, but i think it should not cause any issues .

    $ sudo dmesg | grep tasdev
    [    7.334910] tasdev-codec 3-004c: Looking up irq-gpio property failed -22
    [    7.371598] tasdev-codec 3-004c: firmware: direct-loading firmware tas2563RCA1.bin
    [    7.372429] tasdev-codec 3-004c: firmware: failed to load tas2563_coef.bin (-2)
    [    7.381370] tasdev-codec 3-004c: firmware: failed to load tas2563_coef.bin (-2)
    [    7.389178] tasdev-codec 3-004c: Direct firmware load for tas2563_coef.bin failed with error -2
    [    7.389230] tasdev-codec 3-004c: tasdevice_dsp_parser: load tas2563_coef.bin error
    [    7.397334] tasdev-codec 3-004c: dspfw load tas2563_coef.bin error

    But when i try to play or record any sound, it shows kernel panic.

    user@prometheus:~$ sudo amixer
    Simple mixer control 'Speaker Digital',0
      Capabilities: volume volume-joined
      Playback channels: Mono
      Capture channels: Mono
      Limits: 0 - 255
      Mono: 243 [95%] [0.00dB]
    Simple mixer control 'Speaker Force Firmware Load',0
      Capabilities: pswitch pswitch-joined
      Playback channels: Mono
      Mono: Playback [off]
    Simple mixer control 'Speaker Profile Id',0
      Capabilities: volume volume-joined
      Playback channels: Mono
      Capture channels: Mono
      Limits: 0 - 7
      Mono: 0 [0%]
    
    user@prometheus:~$ sudo aplay -L
    null
        Discard all samples (playback) or generate zero samples (capture)
    hw:CARD=AM623GTC650C,DEV=0
        AM623-GTC650C, 2b20000.audio-controller-tas2781_codec tas2781_codec-0
        Direct hardware device without any conversions
    plughw:CARD=AM623GTC650C,DEV=0
        AM623-GTC650C, 2b20000.audio-controller-tas2781_codec tas2781_codec-0
        Hardware device with all software conversions
    default:CARD=AM623GTC650C
        AM623-GTC650C, 2b20000.audio-controller-tas2781_codec tas2781_codec-0
        Default Audio Device
    sysdefault:CARD=AM623GTC650C
        AM623-GTC650C, 2b20000.audio-controller-tas2781_codec tas2781_codec-0
        Default Audio Device
    dmix:CARD=AM623GTC650C,DEV=0
        AM623-GTC650C, 2b20000.audio-controller-tas2781_codec tas2781_codec-0
        Direct sample mixing device
    
    user@prometheus:~$ sudo aplay sample.wav
    Playing WAVE 'sample.wav' : Signed 16 bit Little Endian, Rate 44[  120.130578] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000014
    100 Hz, Stereo
    [  120.141461] Mem abort info:
    [  120.145414]   ESR = 0x0000000096000004
    [  120.149367]   EC = 0x25: DABT (current EL), IL = 32 bits
    [  120.154838]   SET = 0, FnV = 0
    [  120.158005]   EA = 0, S1PTW = 0
    [  120.161206]   FSC = 0x04: level 0 translation fault
    [  120.166282] Data abort info:
    [  120.169275]   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
    [  120.174914]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
    [  120.180076]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
    [  120.185562] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000084f8d000
    [  120.192152] [0000000000000014] pgd=0000000000000000, p4d=0000000000000000
    [  120.199164] Internal error: Oops: 0000000096000004 [#1] SMP
    [  120.204845] Modules linked in: usb_f_acm u_serial usb_f_rndis u_ether ip6t_REJECT nf_reject_ipv6 ipt_REJECT nf_reject_ipv4 xt_tcpudp xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nft_compat nf_tables libcrc32c nfnetlink cc33xx cdns_csi2rx v4l2_fwnode aes_ce_blk aes_ce_cipher crct10dif_ce crct10dif_common polyval_ce polyval_generic ghash_ce sha2_ce sha256_arm64 snd_soc_simple_card sha1_ce j721e_csi2rx optee snd_soc_davinci_mcasp snd_soc_simple_card_utils snd_soc_tas2781_i2c videobuf2_dma_contig snd_soc_ti_udma cc33xx_sdio snd_soc_tas2781_fmwlib snd_soc_ti_edma videobuf2_memops tee snd_soc_tas2781_comlib snd_soc_ti_sdma videobuf2_v4l2 leds_gpio snd_soc_core videobuf2_common v4l2_async snd_pcm_dmaengine k3_j72xx_bandgap snd_pcm videodev ina2xx_adc ti_ads1118 ti_tla2518 snd_timer kfifo_buf mc snd industrialio ina2xx soundcore st1232 evdev libcomposite dm_mod configfs ip_tables x_tables autofs4 ext4 crc16 mbcache jbd2 crc32c_generic panfrost drm_shmem_helper gpu_sched governor_simpleondemand cls_cgroup
    [  120.205216]  xhci_plat_hcd xhci_hcd usbcore dwc3 ulpi udc_core roles usb_common gpio_regulator fixed sdhci_am654 sdhci_pltfm cqhci dwc3_am62 sdhci rtc_ti_k3 ti_am65_cpsw_nuss phylink k3_cppi_desc_pool libphy cdns_dphy_rx phy_gmii_sel spi_omap2_mcspi
    [  120.330790] CPU: 2 PID: 416 Comm: aplay Tainted: G        W          6.6+unreleased-gtc650c-arm64 #1  Apertispro 6.6.15-2+apertis2+prometheus9~~+1+g793f2c502
    [  120.350628] Hardware name: TI AM6234 BOSCH Prometheus GTC650C (DT)
    [  120.359554] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    [  120.369334] pc : tasdevice_tuning_switch+0x34/0x630 [snd_soc_tas2781_fmwlib]
    [  120.379259] lr : tasdevice_dapm_event+0x48/0x70 [snd_soc_tas2781_i2c]
    [  120.388492] sp : ffff8000822fb710
    [  120.394582] x29: ffff8000822fb710 x28: 000000000000000d x27: 00000000ffffffff
    [  120.404519] x26: 0000000000000000 x25: 0000000000000000 x24: ffff80007a2279f8
    [  120.414475] x23: ffff000004f3e140 x22: 00000000ffffffff x21: ffff000000c30080
    [  120.424435] x20: 0000000000000000 x19: ffff000000c30080 x18: 0000000000000000
    [  120.434384] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
    [  120.444306] x14: 0000000000000000 x13: 0000000000000000 x12: ffff800081aeeb98
    [  120.454144] x11: 0000000000000001 x10: 0000000000000ba0 x9 : ffff80007a1a7660
    [  120.464021] x8 : ffff00000f90b000 x7 : 0000000000000000 x6 : 0000000000000000
    [  120.473898] x5 : ffff000006179080 x4 : ffff80007a227978 x3 : 0000000000000000
    [  120.483697] x2 : 0000000000000002 x1 : 0000000000000000 x0 : ffff000000c30080
    [  120.493430] Call trace:
    [  120.498377]  tasdevice_tuning_switch+0x34/0x630 [snd_soc_tas2781_fmwlib]
    [  120.507578]  tasdevice_dapm_event+0x48/0x70 [snd_soc_tas2781_i2c]
    [  120.516126]  dapm_seq_check_event+0x124/0x210 [snd_soc_core]
    [  120.524236]  dapm_seq_run_coalesced+0x138/0x1d8 [snd_soc_core]
    [  120.532401]  dapm_seq_run+0xc0/0x3b8 [snd_soc_core]
    [  120.539505]  dapm_power_widgets+0x5a4/0x930 [snd_soc_core]
    [  120.547192]  snd_soc_dapm_stream_event+0x104/0x1a0 [snd_soc_core]
    [  120.555412]  __soc_pcm_prepare+0x68/0x178 [snd_soc_core]
    [  120.562823]  soc_pcm_prepare+0x38/0x68 [snd_soc_core]
    [  120.569914]  snd_pcm_do_prepare+0x38/0x60 [snd_pcm]
    [  120.576791]  snd_pcm_action_single+0x50/0xb8 [snd_pcm]
    [  120.583825]  snd_pcm_action_nonatomic+0xa8/0xb8 [snd_pcm]
    [  120.591070]  snd_pcm_prepare+0x90/0xd8 [snd_pcm]
    [  120.597482]  snd_pcm_common_ioctl+0xf5c/0x1820 [snd_pcm]
    [  120.604534]  snd_pcm_ioctl+0x38/0x58 [snd_pcm]
    [  120.610692]  __arm64_sys_ioctl+0xb4/0x100
    [  120.616364]  invoke_syscall+0x78/0x108
    [  120.621734]  el0_svc_common.constprop.0+0x48/0xf0
    [  120.628086]  do_el0_svc+0x24/0x38
    [  120.632978]  el0_svc+0x48/0x138
    [  120.637690]  el0t_64_sync_handler+0x100/0x130
    [  120.643620]  el0t_64_sync+0x190/0x198
    [  120.648851] Code: b941f814 7100045f 54000320 350001a1 (79402862)
    [  120.656507] ---[ end trace 0000000000000000 ]---

  • Would you be so kind offer me the whole kernel log?

    Have you used the latest code in Linux Community?

    The code can be downloaded in this branch kernel/git/broonie/sound.git - ASoC.

    Let's test aplay first. before playback, have you selected profile id in the tas2563RCA1.bin?

    like following command

    # amixer cset numid=2,iface=MIXER,name='TASDEVICE Profile id' 0

    # aplay --device="hw:0,0" test.wav

  • Okay, some good news! By using driver from here (https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/tree/) i'm able to use arecord and aplay now. Thankyou.

    user@prometheus:/$ sudo arecord -f S16_LE -d 10 -r 44100 --device="hw:0,0" /home/user/record1.wav
    Recording WAVE '/home/user/record1.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
    user@prometheus:/$ ls -l /home/user/*.wav
    -rw-r--r-- 1 user user 882044 Jul  4 05:02 /home/user/output.wav
    -rw-r--r-- 1 root root 882044 Jul  4 05:05 /home/user/record1.wav
    user@prometheus:/$ sudo aplay --device="hw:0,0" /home/user/record1.wav
    Playing WAVE '/home/user/record1.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
    user@prometheus:/$ sudo aplay --device="hw:0,0" /home/user/record2.wav
    /home/user/record2.wav: No such file or directory
    user@prometheus:/$ sudo arecord -f S16_LE -d 10 -r 44100 --device="hw:0,0" /home/user/record2.wav
    Recording WAVE '/home/user/record2.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
    user@prometheus:/$ sudo arecord -f S16_LE -d 10 -r 44100 --device="hw:0,0" /home/user/record3.wav
    Recording WAVE '/home/user/record3.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
    user@prometheus:/$ sudo arecord -f S16_LE -d 10 -r 44100 --device="hw:0,0" /home/user/record4.wav
    Recording WAVE '/home/user/record4.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
    user@prometheus:/$ sudo arecord -f S16_LE -d 10 -r 44100 --device="hw:0,0" /home/user/record5.wav
    Recording WAVE '/home/user/record5.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
    user@prometheus:/$ ls -l /home/user/*.wav
    -rw-r--r-- 1 user user 882044 Jul  4 05:02 /home/user/output.wav
    -rw-r--r-- 1 root root 882044 Jul  4 05:05 /home/user/record1.wav
    -rw-r--r-- 1 root root 882044 Jul  4 05:08 /home/user/record2.wav
    -rw-r--r-- 1 root root 882044 Jul  4 05:08 /home/user/record3.wav
    -rw-r--r-- 1 root root 882044 Jul  4 05:08 /home/user/record4.wav
    -rw-r--r-- 1 root root 882044 Jul  4 05:08 /home/user/record5.wav
    user@prometheus:/$ sudo aplay /home/user/record5.wav
    Playing WAVE '/home/user/record5.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
    

    but some of the times, i get overrun issues.

    user@prometheus:/$ sudo arecord -f S16_LE -d 10 -r 44100 --device="hw:0,0" /tmp/sam3.wav
    Recording WAVE '/tmp/sam3.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
    overrun!!! (at least 0.065 ms long)
    overrun!!! (at least 0.128 ms long)
    overrun!!! (at least 0.063 ms long)
    overrun!!! (at least 0.054 ms long)
    overrun!!! (at least 0.058 ms long)
    overrun!!! (at least 0.069 ms long)
    overrun!!! (at least 0.052 ms long)
    overrun!!! (at least 0.054 ms long)
    overrun!!! (at least 0.048 ms long)
    

  • Can you share the wav file here? I will check the audio format. Thanks.

  • Hi,

    Earlier I was not having the speaker hardware so, I could not test the sound. I connected the speaker and microphone today and tried playing a sample audio file. It plays the file and records the file as well, but, I could not hear any sound. 

    Checking the logs it shows "ti-udma 485c0100.dma-controller: chan- teardown timeout!". How i can resolve this?

    Attaching the logs below:

    user@prometheus:/$ sudo aplay -D hw:0,0 sample.wav
    Playing WAVE 'sample.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
    
    user@prometheus:/$ sudo dmesg | grep ti-udma
    [    1.511399] ti-udma 485c0100.dma-controller: Number of rings: 82
    [    1.514769] ti-udma 485c0100.dma-controller: Channels: 48 (bchan: 18, tchan: 12, rchan: 18)
    [    1.518677] ti-udma 485c0000.dma-controller: Number of rings: 150
    [    1.524806] ti-udma 485c0000.dma-controller: Channels: 35 (tchan: 20, rchan: 15)
    [   59.165912] ti-udma 485c0100.dma-controller: chan0 teardown timeout!
    [  109.149924] ti-udma 485c0100.dma-controller: chan0 teardown timeout!
    [  112.989891] ti-udma 485c0100.dma-controller: chan0 teardown timeout!
    
    user@prometheus:/$ sudo aplay -D hw:0,0 sample.wav
    Playing WAVE 'sample.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
    user@prometheus:/$ sudo dmesg | grep ti-udma
    [    1.511399] ti-udma 485c0100.dma-controller: Number of rings: 82
    [    1.514769] ti-udma 485c0100.dma-controller: Channels: 48 (bchan: 18, tchan: 12, rchan: 18)
    [    1.518677] ti-udma 485c0000.dma-controller: Number of rings: 150
    [    1.524806] ti-udma 485c0000.dma-controller: Channels: 35 (tchan: 20, rchan: 15)
    [   59.165912] ti-udma 485c0100.dma-controller: chan0 teardown timeout!
    [  109.149924] ti-udma 485c0100.dma-controller: chan0 teardown timeout!
    [  112.989891] ti-udma 485c0100.dma-controller: chan0 teardown timeout!
    [  141.981890] ti-udma 485c0100.dma-controller: chan0 teardown timeout!
    
    user@prometheus:/$ amixer
    Simple mixer control 'Speaker Digital',0
      Capabilities: volume volume-joined
      Playback channels: Mono
      Capture channels: Mono
      Limits: 0 - 255
      Mono: 247 [97%] [2.00dB]
    Simple mixer control 'Speaker Force Firmware Load',0
      Capabilities: pswitch pswitch-joined
      Playback channels: Mono
      Mono: Playback [on]
    Simple mixer control 'Speaker Profile Id',0
      Capabilities: volume volume-joined
      Playback channels: Mono
      Capture channels: Mono
      Limits: 0 - 7
      Mono: 5 [71%]
    user@prometheus:/$
    

    This is my sound-card configuration:

           codec_audio: sound {
                    compatible = "simple-audio-card";
                    simple-audio-card,name = "AM623-GTC650C";
                    simple-audio-card,widgets =
                            "Speaker",      "Internal Speaker",
                            "Microphone",   "Internal Mic";
                    simple-audio-card,routing =
                            "Internal Speaker",     "OUT",
                            "DMIC",                 "Internal Mic";
                    simple-audio-card,format = "i2s";
                    simple-audio-card,bitclock-master = <&sound_master>;
                    simple-audio-card,frame-master = <&sound_master>;
                    simple-audio-card,mclk-fs = <256>;
                    simple-audio-card,bitclock-inversion;
    
                    sound_master: simple-audio-card,cpu {
                            sound-dai = <&mcasp2>;
                            dai-tdm-slot-num = <2>;
                            dai-tdm-slot-width = <32>;
                    };
    
                    simple-audio-card,codec {
                            sound-dai = <&tas2563>;
                    };
            };
            
            
    &mcasp2 {
            status = "okay";
            #sound-dai-cells = <0>;
    
            pinctrl-names = "default";
            pinctrl-0 = <&main_mcasp2_pins_default>;
    
            op-mode = <0>;          /* MCASP_IIS_MODE */
            tdm-slots = <2>;
    
            serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
                   1 0 2 0
                   0 0 0 0
                   0 0 0 0
                   0 0 0 0
            >;
            tx-num-evt = <32>;
            rx-num-evt = <32>;
    };
    

  • During playback, kindly measure and capture the i2S bitclk and WS clk with scope and upload the waveform. Thanks.

  • Adding bclk and wclk waveforms while playing audio:

    bclk:

    wclk:

    also FYI, I had previously enabled tas2562.c driver for speaker, with that too when i try playing sound, it plays from command line but i could not hear sound, and it shows "ti-udma 485c0100.dma-controller: chan- teardown timeout!". Not sure, is this something with the configuration?

  • Hi Guy

    Would you be so kind and let me know what the freq of both clks?

    One more thing, kindly dump the registers during playback. commands as following

    i2cset -y -f 0 4c 0 0
    i2cset -y -f 0 4c 7f 0
    i2cset -y -f 0 4c 0 0
    i2cdump -y -f 0 4c
  • Output:

    user@prometheus:~$ i2cset -y -f 3 0x4c 0 0
    user@prometheus:~$ i2cset -y -f 3 0x4c 0x7f 0
    user@prometheus:~$ i2cset -y -f 3 0x4c 0 0
    user@prometheus:~$ sudo aplay -D hw:0,0 sample.wav 
    Playing WAVE 'sample.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
    user@prometheus:~$ i2cdump -y -f 3 0x4c
    No size specified (using byte-data access)
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
    00: 00 00 0e 20 c6 22 09 02 7e 10 13 42 40 44 05 06    ..? ?"??~??B@D??
    10: 07 27 12 76 01 2e 60 0e 0c 00 fc a6 df ff ff 04    ?'?v?.`??.???..?
    20: 00 00 80 00 04 00 00 80 00 80 00 00 00 8d 00 a8    ..?.?..?.?...?.?
    30: 99 40 81 34 4b 74 0d 00 0d 0c be 58 68 08 10 00    ?@?4Kt?.???Xh??.
    40: 76 06 18 c0 10 21 00 b4 ac 00 00 00 00 00 00 00    v????!.??.......
    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 ba 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    ................
    user@prometheus:~$ 
    
    

  • Hi team,

    Is there any update? I'm still struggling with this issue.

  • Hi Team,

    I even tried changing amixer controls and volume settings, this didn't help either. From codec pins, i can see signals on bclk, wclk while playing audio. Could you kindly let me know if there’s anything I might be missing or if you could offer any additional suggestions?

  • Hi Guy

    b0p0r2 is 0xe, which meant that you dump the register while the tas2563 is in shutdown mode.

    Kindly dump the register during playback.

  • Hi,

    output during playback:

    user@prometheus:~$ i2cdump -y -f 3 0x4c
    No size specified (using byte-data access)
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
    00: 00 00 00 20 c6 22 13 02 00 10 f1 46 44 04 05 06    ... ?"??.??FD???
    10: 07 27 12 76 01 2e 60 0e 0c 00 fc a6 df ff ff 04    ?'?v?.`??.???..?
    20: 00 00 80 00 04 00 00 80 00 80 00 00 00 8c c0 a6    ..?.?..?.?...???
    30: 99 40 81 34 4b 74 09 00 0d 0c be 58 68 08 10 00    ?@?4Kt?.???Xh??.
    40: 76 41 d8 c0 10 21 00 4f 6c 00 00 00 00 00 00 00    vA???!.Ol.......
    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 e4 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    ................
    

    I'm still not able to hear anything from speaker while playback.

    I was getting ""ti-udma 485c0100.dma-controller: chan- teardown timeout!" while playing any audio from command line. I found a patch available to fix this error: https://lore.kernel.org/lkml/20230821104003.3001021-1-vigneshr@ti.com/ I added these changes, with this I'm not getting teardown timeout error while aplay, and it's playing normally from command line but no sound could be heard.

    Could you please guide me what could be the issue?

  • Pls take care b0p0r0x11=0x27

    It disclosed that audio clk error, see following illustration, excerpted from the datasheet

    tas2563 did not detect the sample rate from the platform.

    Last time you have captured the audio clk waveform but I have no idea of what on earth their freqs are.

    Would you be so kind and use the scope to get their freq like following pic captured by other engineer? I wonder not only its freq, but also its duty cycle. Thanks.