From f02508ca9834a954704637d288b15901f3c626a2 Mon Sep 17 00:00:00 2001 From: Tinghan Shen Date: Fri, 18 Feb 2022 11:43:24 +0800 Subject: [PATCH 001/161] docker_build: Add support for mt8195 and mt8186 Add support for building mt8186 and mt8195 toolchain in docker image. Signed-off-by: Tinghan Shen --- scripts/docker_build/sof_builder/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/docker_build/sof_builder/Dockerfile b/scripts/docker_build/sof_builder/Dockerfile index c181d919feee..abdaaafc0337 100644 --- a/scripts/docker_build/sof_builder/Dockerfile +++ b/scripts/docker_build/sof_builder/Dockerfile @@ -89,7 +89,7 @@ RUN cd /home/sof && \ mkdir -p /home/sof/work/ && \ cd crosstool-ng && \ ./bootstrap && ./configure --prefix=`pwd` && make && make install && \ - for arch in byt hsw apl cnl imx imx8m imx8ulp rn; do \ + for arch in byt hsw apl cnl imx imx8m imx8ulp rn mt8186 mt8195; do \ cp config-${arch}-gcc10.2-gdb9 .config && \ # replace the build dist to save space sed -i 's#${CT_TOP_DIR}\/builds#\/home\/sof\/work#g' .config && \ @@ -107,12 +107,14 @@ ENV PATH="/home/sof/work/xtensa-rn-elf/bin:${PATH}" ENV PATH="/home/sof/work/xtensa-imx-elf/bin:${PATH}" ENV PATH="/home/sof/work/xtensa-imx8m-elf/bin:${PATH}" ENV PATH="/home/sof/work/xtensa-imx8ulp-elf/bin:${PATH}" +ENV PATH="/home/sof/work/xtensa-mt8186-elf/bin:${PATH}" +ENV PATH="/home/sof/work/xtensa-mt8195-elf/bin:${PATH}" ARG NEWLIB_REPO=https://github.com/jcmvbkbc/newlib-xtensa.git RUN cd /home/sof && \ git clone $CLONE_DEFAULTS --branch xtensa $NEWLIB_REPO && \ cd newlib-xtensa && \ - for arch in byt hsw apl cnl imx imx8m imx8ulp rn; do \ + for arch in byt hsw apl cnl imx imx8m imx8ulp rn mt8186 mt8195; do \ ./configure --target=xtensa-${arch}-elf \ --prefix=/home/sof/work/xtensa-root && \ make && \ From 05f5efb93edc1639f320668cbc2c77729c6df447 Mon Sep 17 00:00:00 2001 From: Tinghan Shen Date: Wed, 18 May 2022 10:45:56 +0800 Subject: [PATCH 002/161] .github: Add a TODO for mt81xx gcc build to pull request tests Add masked mt81xx gcc build to pull request tests. Unmask mt81xx after docker image updated with mt81xx toolchain. Signed-off-by: Tinghan Shen --- .github/workflows/pull-request.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 32c0d36630e0..01639e699845 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -95,6 +95,8 @@ jobs: platform: [imx8ulp, sue jsl tgl, rn, + # TODO: enable mt81xx after docker image udpated + # mt8186, mt8195, ] steps: From 872b0f43e59fb9c6cca93bc170f760eb65b294e5 Mon Sep 17 00:00:00 2001 From: Rander Wang Date: Mon, 23 May 2022 09:09:51 +0800 Subject: [PATCH 003/161] ipc4: use buffer_free to free buffer Fix memory leak in stress test. Buffer_release is for cache operation not for memory free. And buffer_free can free memory and also release buffer. Signed-off-by: Rander Wang --- src/audio/copier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/copier.c b/src/audio/copier.c index 4e639bcc0d01..2d3aa6e8863d 100644 --- a/src/audio/copier.c +++ b/src/audio/copier.c @@ -525,7 +525,7 @@ static void copier_free(struct comp_dev *dev) for (i = 0; i < cd->endpoint_num; i++) { cd->endpoint[i]->drv->ops.free(cd->endpoint[i]); - buffer_release(cd->endpoint_buffer[i]); + buffer_free(cd->endpoint_buffer[i]); } rfree(cd); From 32fd195af52562171d021cb2b83355a04b92538c Mon Sep 17 00:00:00 2001 From: Pin-chih Lin Date: Tue, 24 May 2022 15:12:51 +0800 Subject: [PATCH 004/161] topology1: rtnr: set bytes control to read-only Due to security requirement, the config bytes control is set to read-only for RTNR with hard-coded the config blob in the topology. It's WA until the security approval is obtained. Signed-off-by: Pin-chih Lin --- .../sof/pipe-google-rtc-audio-processing-rtnr-capture.m4 | 6 +++--- tools/topology/topology1/sof/pipe-rtnr-capture.m4 | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/topology/topology1/sof/pipe-google-rtc-audio-processing-rtnr-capture.m4 b/tools/topology/topology1/sof/pipe-google-rtc-audio-processing-rtnr-capture.m4 index c4deb6ff2606..96b62685a53b 100644 --- a/tools/topology/topology1/sof/pipe-google-rtc-audio-processing-rtnr-capture.m4 +++ b/tools/topology/topology1/sof/pipe-google-rtc-audio-processing-rtnr-capture.m4 @@ -47,9 +47,9 @@ CONTROLBYTES_PRIV(DEF_RTNR_PRIV, ) # RTNR Bytes control with max value of 255 -C_CONTROLBYTES(DEF_RTNR_BYTES, PIPELINE_ID, - CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258, 258), - CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258), +C_CONTROLBYTES_READONLY(DEF_RTNR_BYTES, PIPELINE_ID, + CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get handlers, 258), + CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get handlers, 258), , , , CONTROLBYTES_MAX(, 256), , diff --git a/tools/topology/topology1/sof/pipe-rtnr-capture.m4 b/tools/topology/topology1/sof/pipe-rtnr-capture.m4 index cffa27c82833..5a4b6650cfd1 100644 --- a/tools/topology/topology1/sof/pipe-rtnr-capture.m4 +++ b/tools/topology/topology1/sof/pipe-rtnr-capture.m4 @@ -38,9 +38,9 @@ CONTROLBYTES_PRIV(DEF_RTNR_PRIV, ) # RTNR Bytes control with max value of 255 -C_CONTROLBYTES(DEF_RTNR_BYTES, PIPELINE_ID, - CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258, 258), - CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258), +C_CONTROLBYTES_READONLY(DEF_RTNR_BYTES, PIPELINE_ID, + CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get handlers, 258), + CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get handlers, 258), , , , CONTROLBYTES_MAX(, 256), , From a0b22445f273ce54caa8a5612029b05bef97f515 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Tue, 24 May 2022 14:14:52 +0300 Subject: [PATCH 005/161] ipc4: cavs: power_down: Send SET_DX reply on power down Skip sending reply message to a SET_DX if pm_prepare_D3 is set and do it in power down time in a same way as it is done with IPC3. Signed-off-by: Peter Ujfalusi --- src/ipc/ipc4/handler.c | 10 +++++++++- src/platform/intel/cavs/lib/power_down.S | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/ipc/ipc4/handler.c b/src/ipc/ipc4/handler.c index d66544c8b888..74beac658ef6 100644 --- a/src/ipc/ipc4/handler.c +++ b/src/ipc/ipc4/handler.c @@ -999,11 +999,19 @@ void ipc_cmd(struct ipc_cmd_hdr *_hdr) if (err) tr_err(&ipc_tr, "ipc4: %d failed err %d", target, err); - /* FW sends a ipc message to host if request bit is set*/ + /* FW sends an ipc message to host if request bit is clear */ if (in->primary.r.rsp == SOF_IPC4_MESSAGE_DIR_MSG_REQUEST) { char *data = ipc_get()->comp_data; struct ipc4_message_reply reply; + /* Do not send reply for SET_DX if we are going to enter D3 + * The reply is going to be sent as part of the power down + * sequence + */ + if (in->primary.r.type == SOF_IPC4_MOD_SET_DX && + ipc_get()->pm_prepare_D3) + return; + if (ipc_wait_for_compound_msg() != 0) { tr_err(&ipc_tr, "ipc4: failed to send delayed reply"); err = IPC4_FAILURE; diff --git a/src/platform/intel/cavs/lib/power_down.S b/src/platform/intel/cavs/lib/power_down.S index 9422e8770de0..8bdd01e842fc 100644 --- a/src/platform/intel/cavs/lib/power_down.S +++ b/src/platform/intel/cavs/lib/power_down.S @@ -26,8 +26,15 @@ .align 64 power_down_literals: .literal_position +#if CONFIG_IPC_MAJOR_3 ipc_flag: .word IPC_DIPCTDR_BUSY +#elif CONFIG_IPC_MAJOR_4 +set_dx_reply: + /* BUSY (bit31), MODULE_MSG (bit30), reply (bit29), SET_DX (bit 24-28: 7) */ + .word 0xE7000000 + +#endif sram_dis_loop_cnt: .word 4096 @@ -137,6 +144,7 @@ _PD_DISABLE_HPSRAM: m_cavs_set_hpldo_state temp_reg0, temp_reg1, temp_reg2 _PD_SEND_IPC: +#if CONFIG_IPC_MAJOR_3 /* Send IPC to host informing of PD completion - Clear BUSY * bit by writing IPC_DIPCTDR_BUSY to IPC_DIPCTDR * and writing IPC_DIPCTDA_DONE to IPC_DIPCTDA @@ -150,6 +158,17 @@ _PD_SEND_IPC: l32i temp_reg1, host_base, IPC_DIPCTDA or temp_reg1, temp_reg1, temp_reg2 s32i temp_reg1, host_base, IPC_DIPCTDA +#elif CONFIG_IPC_MAJOR_4 +/* Send IPC reply for SET_DX message */ + movi temp_reg1, 0 + s32i temp_reg1, host_base, IPC_DIPCIDD + + movi temp_reg1, set_dx_reply + l32i temp_reg1, temp_reg1, 0 + s32i temp_reg1, host_base, IPC_DIPCIDR +#else +#error "Support for this IPC version is not implemented" +#endif _PD_SLEEP: /* effecfively executes: From 4259b26602d63705b072f33d999c8f5cbd985893 Mon Sep 17 00:00:00 2001 From: Andrula Song Date: Thu, 26 May 2022 09:37:12 +0800 Subject: [PATCH 006/161] audio: fix ipc tx timed out for 0x60060000 Add local veriables to fix bug of ipc tx timed out for 0x60060000 (TRIG_PAUSE) when testing multiple-pause-resume on ADLP Chrome device. Release the buffer locks symmetrically. Signed-off-by: Andrula Song --- src/include/sof/audio/component.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index 24a8cb826fc6..a9b9c245e1ea 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -862,13 +862,15 @@ void comp_get_copy_limits_with_lock_frame_aligned(struct comp_buffer *source, struct comp_buffer *sink, struct comp_copy_limits *cl) { - source = buffer_acquire(source); - sink = buffer_acquire(sink); + struct comp_buffer __sparse_cache *source_c, *sink_c; + + source_c = buffer_acquire(source); + sink_c = buffer_acquire(sink); - comp_get_copy_limits_frame_aligned(source, sink, cl); + comp_get_copy_limits_frame_aligned(source_c, sink_c, cl); - buffer_release(source); - buffer_release(sink); + buffer_release(sink_c); + buffer_release(source_c); } /** From 93f0f75c15c28cab8fdafe37b0deb17a380b16b0 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Fri, 27 May 2022 08:36:19 +0200 Subject: [PATCH 007/161] dai: fix potential NULL dereference This never happens in practice, but statis analysis tools are right complaining about potential NULL dereference here. Signed-off-by: Guennadi Liakhovetski --- src/platform/intel/cavs/lib/dai.c | 98 ++++++++++++++++--------------- 1 file changed, 52 insertions(+), 46 deletions(-) diff --git a/src/platform/intel/cavs/lib/dai.c b/src/platform/intel/cavs/lib/dai.c index 9791e48b060a..0cf77c323f5b 100644 --- a/src/platform/intel/cavs/lib/dai.c +++ b/src/platform/intel/cavs/lib/dai.c @@ -161,68 +161,74 @@ int dai_init(struct sof *sof) } #if CONFIG_INTEL_SSP - dai = ssp->dai_array; - - /* init ssp */ - for (i = 0; i < ssp->num_dais; i++) { - dai[i].index = i; - dai[i].drv = &ssp_driver; - dai[i].plat_data.base = SSP_BASE(i); - dai[i].plat_data.irq = IRQ_EXT_SSPx_LVL5(i); - dai[i].plat_data.irq_name = irq_name_level5; - dai[i].plat_data.fifo[SOF_IPC_STREAM_PLAYBACK].offset = - SSP_BASE(i) + SSDR; - dai[i].plat_data.fifo[SOF_IPC_STREAM_PLAYBACK].handshake = - DMA_HANDSHAKE_SSP0_TX + 2 * i; - dai[i].plat_data.fifo[SOF_IPC_STREAM_CAPTURE].offset = - SSP_BASE(i) + SSDR; - dai[i].plat_data.fifo[SOF_IPC_STREAM_CAPTURE].handshake = - DMA_HANDSHAKE_SSP0_RX + 2 * i; - /* initialize spin locks early to enable ref counting */ - k_spinlock_init(&dai[i].lock); + if (ssp) { + dai = ssp->dai_array; + + /* init ssp */ + for (i = 0; i < ssp->num_dais; i++) { + dai[i].index = i; + dai[i].drv = &ssp_driver; + dai[i].plat_data.base = SSP_BASE(i); + dai[i].plat_data.irq = IRQ_EXT_SSPx_LVL5(i); + dai[i].plat_data.irq_name = irq_name_level5; + dai[i].plat_data.fifo[SOF_IPC_STREAM_PLAYBACK].offset = + SSP_BASE(i) + SSDR; + dai[i].plat_data.fifo[SOF_IPC_STREAM_PLAYBACK].handshake = + DMA_HANDSHAKE_SSP0_TX + 2 * i; + dai[i].plat_data.fifo[SOF_IPC_STREAM_CAPTURE].offset = + SSP_BASE(i) + SSDR; + dai[i].plat_data.fifo[SOF_IPC_STREAM_CAPTURE].handshake = + DMA_HANDSHAKE_SSP0_RX + 2 * i; + /* initialize spin locks early to enable ref counting */ + k_spinlock_init(&dai[i].lock); + } } - #endif #if CONFIG_INTEL_MCLK mn_init(sof); #endif - dai = hda->dai_array; + if (hda) { + dai = hda->dai_array; - /* init hd/a, note that size depends on the platform caps */ - for (i = 0; i < hda->num_dais; i++) { - dai[i].index = i; - dai[i].drv = &hda_driver; - k_spinlock_init(&dai[i].lock); + /* init hd/a, note that size depends on the platform caps */ + for (i = 0; i < hda->num_dais; i++) { + dai[i].index = i; + dai[i].drv = &hda_driver; + k_spinlock_init(&dai[i].lock); + } } #if (CONFIG_INTEL_DMIC) - dai = dmic->dai_array; + if (dmic) { + dai = dmic->dai_array; - /* init dmic */ - for (i = 0; i < dmic->num_dais; i++) - k_spinlock_init(&dai[i].lock); + /* init dmic */ + for (i = 0; i < dmic->num_dais; i++) + k_spinlock_init(&dai[i].lock); + } #endif #if CONFIG_INTEL_ALH - dai = alh->dai_array; - - for (i = 0; i < alh->num_dais; i++) { - dai[i].index = (i / DAI_NUM_ALH_BI_DIR_LINKS_GROUP) << 8 | - (i % DAI_NUM_ALH_BI_DIR_LINKS_GROUP); - dai[i].drv = &alh_driver; - - /* set burst length to align with DMAT value in the - * Audio Link Hub. - */ - dai[i].plat_data.fifo[SOF_IPC_STREAM_PLAYBACK].depth = - ALH_GPDMA_BURST_LENGTH; - dai[i].plat_data.fifo[SOF_IPC_STREAM_CAPTURE].depth = - ALH_GPDMA_BURST_LENGTH; - k_spinlock_init(&dai[i].lock); + if (alh) { + dai = alh->dai_array; + + for (i = 0; i < alh->num_dais; i++) { + dai[i].index = (i / DAI_NUM_ALH_BI_DIR_LINKS_GROUP) << 8 | + (i % DAI_NUM_ALH_BI_DIR_LINKS_GROUP); + dai[i].drv = &alh_driver; + + /* set burst length to align with DMAT value in the + * Audio Link Hub. + */ + dai[i].plat_data.fifo[SOF_IPC_STREAM_PLAYBACK].depth = + ALH_GPDMA_BURST_LENGTH; + dai[i].plat_data.fifo[SOF_IPC_STREAM_CAPTURE].depth = + ALH_GPDMA_BURST_LENGTH; + k_spinlock_init(&dai[i].lock); + } } - #endif return 0; From 6ee7bf432c46728f96f3298799aa16a56b59872b Mon Sep 17 00:00:00 2001 From: Rander Wang Date: Tue, 24 May 2022 19:41:13 +0800 Subject: [PATCH 008/161] ipc4: set component direction if it is not set FW doesn't set component direction if the component is for gateway. Now check the component direction and skip set it if it is set. Only the direction of gateway module is figured out based on gateway type so only copier module supports get_attribute of direction. The original method can't deal with a corner case that gateway module has both input & output. Signed-off-by: Rander Wang --- src/audio/copier.c | 20 ++++++++++++++++++++ src/include/sof/ipc/topology.h | 2 +- src/ipc/ipc4/handler.c | 2 +- src/ipc/ipc4/helper.c | 16 ++++++---------- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/src/audio/copier.c b/src/audio/copier.c index 2d3aa6e8863d..e23deb85247e 100644 --- a/src/audio/copier.c +++ b/src/audio/copier.c @@ -1167,6 +1167,25 @@ static int copier_get_large_config(struct comp_dev *dev, uint32_t param_id, return -EINVAL; } +static int copier_get_attribute(struct comp_dev *dev, uint32_t type, void *value) +{ + struct copier_data *cd = comp_get_drvdata(dev); + + switch (type) { + case COMP_ATTR_COPY_DIR: + /* direction is set based on gateway type */ + if (!cd->endpoint_num) + return -EINVAL; + + *(uint32_t *)value = dev->direction; + break; + default: + return -EINVAL; + } + + return 0; +} + static const struct comp_driver comp_copier = { .uid = SOF_RT_UUID(copier_comp_uuid), .tctx = &copier_comp_tr, @@ -1180,6 +1199,7 @@ static const struct comp_driver comp_copier = { .params = copier_params, .prepare = copier_prepare, .reset = copier_reset, + .get_attribute = copier_get_attribute, }, }; diff --git a/src/include/sof/ipc/topology.h b/src/include/sof/ipc/topology.h index c78b92302eff..3ac58c8ac11a 100644 --- a/src/include/sof/ipc/topology.h +++ b/src/include/sof/ipc/topology.h @@ -52,7 +52,7 @@ int ipc4_add_comp_dev(struct comp_dev *dev); const struct comp_driver *ipc4_get_drv(uint8_t *uuid); int ipc4_create_chain_dma(struct ipc *ipc, struct ipc4_chain_dma *cdma); int ipc4_trigger_chain_dma(struct ipc *ipc, struct ipc4_chain_dma *cdma); -bool ipc4_comp_is_gateway(struct comp_dev *dev); +bool ipc4_comp_has_dir(struct comp_dev *dev); #else #error "No or invalid IPC MAJOR version selected." #endif diff --git a/src/ipc/ipc4/handler.c b/src/ipc/ipc4/handler.c index 74beac658ef6..cf3a13f0c217 100644 --- a/src/ipc/ipc4/handler.c +++ b/src/ipc/ipc4/handler.c @@ -422,7 +422,7 @@ static int update_dir_to_pipeline_component(uint32_t *ppl_id, uint32_t count) * since one of them is for playback and the other one * is for capture */ - if (ipc4_comp_is_gateway(icd->cd)) + if (ipc4_comp_has_dir(icd->cd)) break; icd->cd->direction = dai->direction; diff --git a/src/ipc/ipc4/helper.c b/src/ipc/ipc4/helper.c index 542ff69c92d9..cbc36523d760 100644 --- a/src/ipc/ipc4/helper.c +++ b/src/ipc/ipc4/helper.c @@ -780,17 +780,13 @@ const struct comp_driver *ipc4_get_drv(uint8_t *uuid) return drv; } -bool ipc4_comp_is_gateway(struct comp_dev *dev) +bool ipc4_comp_has_dir(struct comp_dev *dev) { - const struct sof_uuid copier = {0x9ba00c83, 0xca12, 0x4a83, {0x94, 0x3c, - 0x1f, 0xa2, 0xe8, 0x2f, 0x9d, 0xda}}; - - /* check whether it is a copier module with copier uuid */ - if (!memcmp(dev->drv->uid, &copier, UUID_SIZE)) { - /* dai or host, not a module for copy */ - if (list_is_empty(&dev->bsink_list) || list_is_empty(&dev->bsource_list)) - return true; - } + int dir = -EINVAL; + + comp_get_attribute(dev, COMP_ATTR_COPY_DIR, &dir); + if (dir == SOF_IPC_STREAM_PLAYBACK || dir == SOF_IPC_STREAM_CAPTURE) + return true; return false; } From 17c64332156eb05fbef6980c936dc1c6036141d2 Mon Sep 17 00:00:00 2001 From: Tomasz Leman Date: Fri, 27 May 2022 09:21:26 +0200 Subject: [PATCH 009/161] intel: dmic: set plat_data fifo depth for capture This patch sets plat_data fifo depth for SOF_IPC_STREAM_CAPTURE instead of a SOF_IPC_STREAM_PLAYBACK. The value is later read with get_fifo_depth(). Without this patch the driver sets the value to fifo[0].depth and then reads from fifo[1].depth. Signed-off-by: Tomasz Leman --- src/drivers/intel/dmic/dmic_nhlt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/intel/dmic/dmic_nhlt.c b/src/drivers/intel/dmic/dmic_nhlt.c index a4d2319bd46a..7b533696a301 100644 --- a/src/drivers/intel/dmic/dmic_nhlt.c +++ b/src/drivers/intel/dmic/dmic_nhlt.c @@ -318,7 +318,7 @@ int dmic_set_config_nhlt(struct dai *dai, void *spec_config) * configuration */ bfth = OUTCONTROL0_BFTH_GET(val); - dai->plat_data.fifo->depth = 1 << bfth; + dai->plat_data.fifo[SOF_IPC_STREAM_CAPTURE].depth = 1 << bfth; /* Get PDMx registers */ pdm_ctrl_mask = ((struct nhlt_pdm_ctrl_mask *)p)->pdm_ctrl_mask; From c17121bfbc029376287b73c90f0d31c3101b9fbc Mon Sep 17 00:00:00 2001 From: Andrula Song Date: Mon, 30 May 2022 08:45:34 +0800 Subject: [PATCH 010/161] audio: fix the unsymmetrical order of lock and unlock. fix the unsymmetrical order of lock and unlock issue in fuunction comp_get_copy_limits_with_lock to avoid IPC tiime out risk. Signed-off-by: Andrula Song --- src/include/sof/audio/component.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index a9b9c245e1ea..a8b922be0a67 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -844,8 +844,8 @@ void comp_get_copy_limits_with_lock(struct comp_buffer *source, comp_get_copy_limits(source_c, sink_c, cl); - buffer_release(source_c); buffer_release(sink_c); + buffer_release(source_c); } /** From 165a7841721ea02e563c5a08fe1fbd5aa7e9860b Mon Sep 17 00:00:00 2001 From: mengdonglin Date: Sun, 5 Jun 2022 21:36:56 -0400 Subject: [PATCH 011/161] xtensa-build-zephyr.py: switch default to sof/stable-v2.2 The release branch is created for SOF v2.2 in the cloned Zephyr repo: https://github.com/thesofproject/zephyr/tree/sof/stable-v2.2 This points to unmodified Zephyr upstream tag v3.1.0-rc3 Set default Zephyr URL to this cloned repo and switch default branch to sof/stable-v2.2 Signed-off-by: mengdonglin --- scripts/xtensa-build-zephyr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/xtensa-build-zephyr.py b/scripts/xtensa-build-zephyr.py index af268cc76889..cf86c03a0153 100755 --- a/scripts/xtensa-build-zephyr.py +++ b/scripts/xtensa-build-zephyr.py @@ -144,7 +144,7 @@ def parse_args(): help="Initial Zephyr git ref for the -c option." " Can be a branch, tag, full SHA1 in a fork") parser.add_argument("-u", "--url", required=False, - default="https://github.com/zephyrproject-rtos/zephyr/", + default="https://github.com/thesofproject/zephyr/", help="URL to clone Zephyr from") mode_group = parser.add_mutually_exclusive_group() mode_group.add_argument("-p", "--west_path", required=False, type=pathlib.Path, @@ -197,7 +197,7 @@ def parse_args(): if args.zephyr_ref and not args.clone_mode: raise RuntimeError(f"Argument -z without -c makes no sense") if args.clone_mode and not args.zephyr_ref: - args.zephyr_ref = "main" # set default name for -z if -c specified + args.zephyr_ref = "sof/stable-v2.2" # set default name for -z if -c specified if args.west_path: # let the user provide an already existing zephyrproject/ anywhere west_top = pathlib.Path(args.west_path) From 57864296b07c5ffd673214dd5b1e3d07ee274a22 Mon Sep 17 00:00:00 2001 From: mengdonglin Date: Sun, 22 May 2022 21:49:41 -0400 Subject: [PATCH 012/161] xtensa-build-zephyr.py: pass SOF firmware file version string to rimage Extract SOF firmware file version string major.minor.micro from the generated sof_version.h, and pass the version string to rimage in the signing phase. So rimage can write the version info to the firmware manifest headers for cAVS platforms. Signed-off-by: mengdonglin (cherry picked from commit 55d8d90980f54b030f6ad7733c6818b1012eaf98) --- scripts/xtensa-build-zephyr.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/scripts/xtensa-build-zephyr.py b/scripts/xtensa-build-zephyr.py index cf86c03a0153..4e99fcbb3442 100755 --- a/scripts/xtensa-build-zephyr.py +++ b/scripts/xtensa-build-zephyr.py @@ -23,6 +23,8 @@ west_top = pathlib.Path(SOF_TOP, "zephyrproject") default_rimage_key = pathlib.Path("modules", "audio", "sof", "keys", "otc_private_key.pem") +sof_version = None + if platform.system() == "Windows": xtensa_tools_version_postfix = "-win32" elif platform.system() == "Linux": @@ -323,6 +325,28 @@ def west_init_update(): # Do NOT "west update sof"!! execute_command(["west", "update", "zephyr", "hal_xtensa"], timeout=300, cwd=west_top) +def get_sof_version(abs_build_dir): + """[summary] Get version string major.minor.micro of SOF firmware + file. When building multiple platforms from the same SOF commit, + all platforms share the same version. So for the 1st platform, + generate the version string from sof_version.h and later platforms + will reuse it. + """ + global sof_version + if sof_version: + return sof_version + + versions = {} + with open(pathlib.Path(abs_build_dir, + "zephyr/include/generated/sof_versions.h"), encoding="utf8") as hfile: + for hline in hfile: + words = hline.split() + if words[0] == '#define': + versions[words[1]] = words[2] + sof_version = versions['SOF_MAJOR'] + '.' + versions['SOF_MINOR'] + '.' + \ + versions['SOF_MICRO'] + return sof_version + def build_platforms(): global west_top, SOF_TOP print(f"SOF_TOP={SOF_TOP}") @@ -447,6 +471,8 @@ def build_platforms(): signing_key = default_rimage_key sign_cmd += ["--tool-data", str(rimage_config), "--", "-k", str(signing_key)] + sign_cmd += ["-f", get_sof_version(abs_build_dir)] + if args.ipc == "IPC4": rimage_desc = pathlib.Path(SOF_TOP, "rimage", "config", platform_dict["IPC4_RIMAGE_DESC"]) sign_cmd += ["-c", str(rimage_desc)] From be16431bf3ea28169a3de0e53f754b8d5b1711ae Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Fri, 24 Jun 2022 15:25:02 -0500 Subject: [PATCH 013/161] topology1: sof-tgl-rt711-rt1308: add missing switch For some reason we never added the switch in this topology, with leads to a missing control when parsing UCM files BugLink: https://github.com/thesofproject/sof/issues/5950 BugLink: https://github.com/alsa-project/alsa-ucm-conf/issues/179 Signed-off-by: Pierre-Louis Bossart (cherry picked from commit c8551e3563d612596cacf4156d305338acc6a2a0) --- tools/topology/topology1/sof-tgl-rt711-rt1308.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 b/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 index 702b171e3307..e1f4b0ae3a48 100644 --- a/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 +++ b/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 @@ -114,7 +114,7 @@ ifelse(PLATFORM, `adl', ` # Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, +PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, 2, 1, 2, s32le, 1000, 0, 0, 48000, 48000, 48000) From 27b598bb2455bfdf81f54271e97da5731c1084c0 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Wed, 6 Jul 2022 10:39:19 -0500 Subject: [PATCH 014/161] topology1: intel-generic-dmic: add macro to enable PDM1 for 2ch cases There are multiple cases where we cannot detect that PDM1 is used instead of the default PDM0. BugLink: https://github.com/thesofproject/sof/issues/5989 Signed-off-by: Pierre-Louis Bossart (cherry picked from commit 73fd9248e0ba9a612355753bee524e52e631890c) --- .../topology1/platform/intel/intel-generic-dmic.m4 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/topology/topology1/platform/intel/intel-generic-dmic.m4 b/tools/topology/topology1/platform/intel/intel-generic-dmic.m4 index c9808c3d96f0..04b06427c9a5 100644 --- a/tools/topology/topology1/platform/intel/intel-generic-dmic.m4 +++ b/tools/topology/topology1/platform/intel/intel-generic-dmic.m4 @@ -144,6 +144,8 @@ PCM_CAPTURE_ADD(DMIC_48k_PCM_NAME, DMIC_PCM_48k_ID, concat(`PIPELINE_PCM_', DMIC ifdef(NO16KDMIC, `', `PCM_CAPTURE_ADD(DMIC_16k_PCM_NAME, DMIC_PCM_16k_ID, concat(`PIPELINE_PCM_', DMIC_PIPELINE_16k_ID))') +ifdef(`PDM1',`define(DEF_STEREO_PDM, `STEREO_PDM1')',`define(DEF_STEREO_PDM, `STEREO_PDM0')') + # # BE configurations - overrides config in ACPI if present # @@ -157,7 +159,7 @@ ifelse(DMIC_DAI_CHANNELS, 4, `DAI_CONFIG(DMIC, 0, DMIC_DAI_LINK_48k_ID, DMIC_DAI_LINK_48k_NAME, DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 48000, DMIC_WORD_LENGTH(s32le), 200, DMIC, 0, - PDM_CONFIG(DMIC, 0, STEREO_PDM0)))') + PDM_CONFIG(DMIC, 0, DEF_STEREO_PDM)))') ifdef(NO16KDMIC, `', `ifelse(DMIC16K_DAI_CHANNELS, 4, @@ -168,4 +170,6 @@ ifdef(NO16KDMIC, `', `DAI_CONFIG(DMIC, 1, DMIC_DAI_LINK_16k_ID, DMIC_DAI_LINK_16k_NAME, DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 16000, DMIC_WORD_LENGTH(s32le), 400, DMIC, 1, - PDM_CONFIG(DMIC, 1, STEREO_PDM0)))')') + PDM_CONFIG(DMIC, 1, DEF_STEREO_PDM)))')') + +undefine(DEF_STEREO_PDM) From c99e9231bcde3ddf93e404565383f71c77c9a77f Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Wed, 6 Jul 2022 11:02:50 -0500 Subject: [PATCH 015/161] topology1: generate new sof-hda-generic version for 2ch PDM1 Generate 2 files for 1 and 2ch cases. These topologies can be used by setting options snd-sof-pci tplg_filename= in /etc/modprobe.d/alsa-base.conf BugLink: https://github.com/thesofproject/sof/issues/5989 Signed-off-by: Pierre-Louis Bossart (cherry picked from commit 9d9c28848def697a6124acde0baf1607a804834d) --- tools/topology/topology1/CMakeLists.txt | 2 ++ tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 01616ac90d18..d0d032c457b9 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -24,7 +24,9 @@ set(TPLGS ## HDaudio codec topologies "sof-hda-generic\;sof-hda-generic\;-DCHANNELS=0\;-DHSPROC=volume\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-1ch\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" + "sof-hda-generic\;sof-hda-generic-1ch-pdm1\;-DPDM1\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-2ch\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" + "sof-hda-generic\;sof-hda-generic-2ch-pdm1\;-DPDM1\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-3ch\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-4ch\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" ## end HDaudio codec topologies diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index bd9134b2a3d2..5454c251262f 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -5,7 +5,9 @@ set(TPLGS_UP ## HDaudio codec topologies "sof-hda-generic\;sof-hda-generic\;-DDEEP_BUFFER\;-DCHANNELS=0\;-DHSPROC=volume\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-1ch\;-DDEEP_BUFFER\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" + "sof-hda-generic\;sof-hda-generic-1ch-pdm1\;-DPDM1\;-DDEEP_BUFFER\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-2ch\;-DDEEP_BUFFER\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" + "sof-hda-generic\;sof-hda-generic-2ch-pdm1\;-DPDM1\;-DDEEP_BUFFER\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-3ch\;-DDEEP_BUFFER\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-4ch\;-DDEEP_BUFFER\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" ## end HDaudio codec topologies From 5c4204a272513f11479204e538bcd55eb84df129 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Thu, 30 Jun 2022 13:13:23 -0500 Subject: [PATCH 016/161] topology1: sof-tgl-rt711-rt1308: make amplifier link configuration HP Omen 16 devices have an amplifier on link3, add the required configuration macro. BugLink: https://github.com/thesofproject/linux/issues/3727 Signed-off-by: Pierre-Louis Bossart (cherry picked from commit e70fd0fbf73bdf558a967c7d1cde3873e47960c6) --- tools/topology/topology1/sof-tgl-rt711-rt1308.m4 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 b/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 index e1f4b0ae3a48..4786f78c4a0b 100644 --- a/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 +++ b/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 @@ -30,6 +30,8 @@ define(JACK_OFFSET, `0') define(JACK_OFFSET, `2') ') +ifdef(`AMP_1_LINK',`', +`define(AMP_1_LINK, `1')') # if there is an external RT1308 amplifier connected over SoundWire, # enable "EXT_AMP" option in the CMakefile. @@ -100,7 +102,7 @@ DEBUG_START # PCM31 ---> volume ------^ # PCM1 <--- volume <---- ALH 3 BE dailink 1 ifdef(`EXT_AMP', ` -# PCM2 ---> volume ----> ALH 2 BE dailink 2 +# PCM2 ---> volume ----> ALH 2 BE dailink AMP_1_LINK ') # PCM5 ---> volume <---- iDisp1 # PCM6 ---> volume <---- iDisp2 @@ -219,10 +221,10 @@ ifdef(`HEADSET_DEEP_BUFFER', ifdef(`EXT_AMP', ` -# playback DAI is ALH(SDW1 PIN2) using 2 periods +# playback DAI is ALH(AMP_1_LINK PIN2) using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-playback.m4, - 3, ALH, 0x102, SDW1-Playback, + 3, ALH, eval(AMP_1_LINK * 256 + 2), `SDW'eval(AMP_1_LINK)`-Playback', PIPELINE_SOURCE_3, 2, s24le, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) ') @@ -287,9 +289,9 @@ DAI_CONFIG(ALH, 3, 1, SDW0-Capture, ifdef(`EXT_AMP', ` -#ALH SDW1 Pin2 (ID: 2) -DAI_CONFIG(ALH, 0x102, 2, SDW1-Playback, - ALH_CONFIG(ALH_CONFIG_DATA(ALH, 0x102, 48000, 2))) +#ALH SDW AMP_1_LINK Pin2 (ID: 2) +DAI_CONFIG(ALH, eval(AMP_1_LINK * 256 + 2), 2, `SDW'eval(AMP_1_LINK)`-Playback', + ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(AMP_1_LINK * 256 + 2), 48000, 2))) ') # 3 HDMI/DP outputs From e9347b914eca8d7b03ccf29854451750ab00f6fe Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Mon, 11 Jul 2022 13:02:09 -0500 Subject: [PATCH 017/161] topology1: CMakeLists: add topology for HP Omen 16 RT711 on link0 and RT1316 on link3. Signed-off-by: Pierre-Louis Bossart (cherry picked from commit 7666716e1278f8f3bbd0c71c06879e740365b7c1) --- tools/topology/topology1/CMakeLists.txt | 1 + tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index d0d032c457b9..e8934bb4f7ef 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -131,6 +131,7 @@ set(TPLGS "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DCHANNELS=0\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" ## end SoundWire topologies ## SoundWire NOJACK topologies diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index 5454c251262f..3da1de3f457b 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -39,6 +39,7 @@ set(TPLGS_UP "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=0\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" ## end SoundWire topologies ) From cc9a346e826bea21c450e89a79d7164ef1ba88ab Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Tue, 5 Jul 2022 12:23:31 -0500 Subject: [PATCH 018/161] topology1: sof-tgl-rt711-rt1308: make BT_OFFLOAD a CMakeFiles parameter Somehow we assumed that all ADL platforms support BT_OFFLOAD. Wrong, this is only valid for Chromebooks and needs to be set externally in the CMakeFiles definitions. Signed-off-by: Pierre-Louis Bossart (cherry picked from commit 04df9161cbfd5a667ff46c8b7ae9375ac4f47b46) --- tools/topology/topology1/CMakeLists.txt | 4 ++-- .../topology1/kernel_dependent/v5.19/CMakeLists.txt | 4 ++-- tools/topology/topology1/sof-tgl-rt711-rt1308.m4 | 12 ++++-------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index e8934bb4f7ef..1b6a204107b0 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -129,8 +129,8 @@ set(TPLGS "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DCHANNELS=0\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" ## end SoundWire topologies diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index 3da1de3f457b..993053c9605e 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -37,8 +37,8 @@ set(TPLGS_UP "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=0\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" ## end SoundWire topologies ) diff --git a/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 b/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 index 4786f78c4a0b..73f3bc7b67ae 100644 --- a/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 +++ b/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 @@ -76,12 +76,7 @@ define(DMIC_OFFSET, `2') define(HDMI_BE_ID_BASE, eval(JACK_OFFSET+AMP_OFFSET+AMP_REF_OFFSET+DMIC_OFFSET)) -# Add Bluetooth Audio Offload pass-through for ADL -ifelse(PLATFORM, `adl', -` -define(BT_OFFLOAD) -' -) +# Add Bluetooth Audio Offload pass-through ifdef(`BT_OFFLOAD', ` define(`BT_PIPELINE_PB_ID', `13') @@ -110,9 +105,10 @@ ifdef(`EXT_AMP', ` # PCM8 ---> volume <---- iDisp4 # PCM10 <----volume <---- DMIC01 # PCM11 <----volume <---- DMIC16k -ifelse(PLATFORM, `adl', ` +ifdef(`BT_OFFLOAD', +` # PCM14 <---> passthrough <---> SSP2 BT playback/capture -', `') +') # Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline with priority 0 on core 0 From 1358f37d27cd6c873a02b767699a4e4efe396056 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Tue, 5 Jul 2022 13:04:25 -0500 Subject: [PATCH 019/161] topology1: sof-tgl-rt711-rt1308: use EXT_AMP_REF for rt1316 RT1316 is exposed by the machine driver as having an echo reference, so the indices are different from the regular ones. Signed-off-by: Pierre-Louis Bossart (cherry picked from commit 4be016befc757595ae0f6be41eeb2a46e7195b81) --- tools/topology/topology1/CMakeLists.txt | 2 +- tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 1b6a204107b0..d3452fcde5bc 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -131,7 +131,7 @@ set(TPLGS "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=adl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" ## end SoundWire topologies ## SoundWire NOJACK topologies diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index 993053c9605e..2718a1ae38a0 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -39,7 +39,7 @@ set(TPLGS_UP "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=adl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" ## end SoundWire topologies ) From c0e812a50b5b706a4ec8fffb5421ff6430d800ab Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Mon, 18 Jul 2022 10:03:56 -0500 Subject: [PATCH 020/161] topology1: CMakeLists: add missing APL/GLK support for ES8336 with DMIC. For some reason we added DMIC-based topologies for all platforms except GLK and APL. This should be back-ported to 2.2 stable. Signed-off-by: Pierre-Louis Bossart (cherry picked from commit d87adcd2dcb087573bd2a1da034ab9f09b233ce4) --- tools/topology/topology1/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index d3452fcde5bc..27c5ed22cb7e 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -189,9 +189,17 @@ set(TPLGS "sof-glk-es8336\;sof-apl-es8336\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-apl-es8336-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-apl-es8336-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=0" + "sof-glk-es8336\;sof-apl-es8336-dmic2ch-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-apl-es8336-dmic2ch-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=2" + "sof-glk-es8336\;sof-apl-es8336-dmic4ch-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-apl-es8336-dmic4ch-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=4" "sof-glk-es8336\;sof-glk-es8336\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-glk-es8336-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-glk-es8336-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=0" + "sof-glk-es8336\;sof-glk-es8336-dmic2ch-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-glk-es8336-dmic2ch-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=2" + "sof-glk-es8336\;sof-glk-es8336-dmic4ch-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-glk-es8336-dmic4ch-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=4" "sof-glk-es8336\;sof-jsl-es8336-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-jsl-es8336-ssp0\;-DPLATFORM=jsl\;-DSSP_NUM=0\;-DCHANNELS=0" "sof-glk-es8336\;sof-jsl-es8336-dmic2ch-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=2" From 7b2d143a1ac70ce67e78462b65c3fa7e6e63d41f Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Thu, 4 Aug 2022 04:27:06 -0500 Subject: [PATCH 021/161] topology1: add SSP1 for all ES8336, SSP5 for APL/GLK We apparently missed quite a few platforms with SSP1, and SSP5 is also needed for APL/GLK. One day we'll have a better way to add topologies, but so far it's brute-force combinatorial addition. Oh well. Signed-off-by: Pierre-Louis Bossart (cherry picked from commit 190cfd79f77e3575b73e1dcf8ffeae923e74785e) --- tools/topology/topology1/CMakeLists.txt | 55 ++++++++++++++++++------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 27c5ed22cb7e..7d9bf2efe22b 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -187,38 +187,63 @@ set(TPLGS "sof-jsl-rt5682\;sof-jsl-cs42l42-mx98360a\;-DPLATFORM=jsl-dedede" "sof-glk-es8336\;sof-apl-es8336\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" - "sof-glk-es8336\;sof-apl-es8336-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-apl-es8336-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=0" - "sof-glk-es8336\;sof-apl-es8336-dmic2ch-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-apl-es8336-ssp1\;-DPLATFORM=bxt\;-DSSP_NUM=1\;-DCHANNELS=0" + "sof-glk-es8336\;sof-apl-es8336-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" + "sof-glk-es8336\;sof-apl-es8336-ssp5\;-DPLATFORM=bxt\;-DSSP_NUM=5\;-DCHANNELS=0" "sof-glk-es8336\;sof-apl-es8336-dmic2ch-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=2" - "sof-glk-es8336\;sof-apl-es8336-dmic4ch-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-apl-es8336-dmic2ch-ssp1\;-DPLATFORM=bxt\;-DSSP_NUM=1\;-DCHANNELS=2" + "sof-glk-es8336\;sof-apl-es8336-dmic2ch-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-apl-es8336-dmic2ch-ssp5\;-DPLATFORM=bxt\;-DSSP_NUM=5\;-DCHANNELS=2" "sof-glk-es8336\;sof-apl-es8336-dmic4ch-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=4" + "sof-glk-es8336\;sof-apl-es8336-dmic4ch-ssp1\;-DPLATFORM=bxt\;-DSSP_NUM=1\;-DCHANNELS=4" + "sof-glk-es8336\;sof-apl-es8336-dmic4ch-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-apl-es8336-dmic4ch-ssp5\;-DPLATFORM=bxt\;-DSSP_NUM=5\;-DCHANNELS=4" + "sof-glk-es8336\;sof-glk-es8336\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" - "sof-glk-es8336\;sof-glk-es8336-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-glk-es8336-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=0" - "sof-glk-es8336\;sof-glk-es8336-dmic2ch-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-glk-es8336-ssp1\;-DPLATFORM=bxt\;-DSSP_NUM=1\;-DCHANNELS=0" + "sof-glk-es8336\;sof-glk-es8336-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" + "sof-glk-es8336\;sof-glk-es8336-ssp5\;-DPLATFORM=bxt\;-DSSP_NUM=5\;-DCHANNELS=0" "sof-glk-es8336\;sof-glk-es8336-dmic2ch-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=2" - "sof-glk-es8336\;sof-glk-es8336-dmic4ch-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-glk-es8336-dmic2ch-ssp1\;-DPLATFORM=bxt\;-DSSP_NUM=1\;-DCHANNELS=2" + "sof-glk-es8336\;sof-glk-es8336-dmic2ch-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-glk-es8336-dmic2ch-ssp5\;-DPLATFORM=bxt\;-DSSP_NUM=5\;-DCHANNELS=2" "sof-glk-es8336\;sof-glk-es8336-dmic4ch-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=4" - "sof-glk-es8336\;sof-jsl-es8336-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=0" + "sof-glk-es8336\;sof-glk-es8336-dmic4ch-ssp1\;-DPLATFORM=bxt\;-DSSP_NUM=1\;-DCHANNELS=4" + "sof-glk-es8336\;sof-glk-es8336-dmic4ch-ssp2\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-glk-es8336-dmic4ch-ssp5\;-DPLATFORM=bxt\;-DSSP_NUM=5\;-DCHANNELS=4" + "sof-glk-es8336\;sof-jsl-es8336-ssp0\;-DPLATFORM=jsl\;-DSSP_NUM=0\;-DCHANNELS=0" - "sof-glk-es8336\;sof-jsl-es8336-dmic2ch-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-jsl-es8336-ssp1\;-DPLATFORM=jsl\;-DSSP_NUM=1\;-DCHANNELS=0" + "sof-glk-es8336\;sof-jsl-es8336-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-jsl-es8336-dmic2ch-ssp0\;-DPLATFORM=jsl\;-DSSP_NUM=0\;-DCHANNELS=2" - "sof-glk-es8336\;sof-jsl-es8336-dmic4ch-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-jsl-es8336-dmic2ch-ssp1\;-DPLATFORM=jsl\;-DSSP_NUM=1\;-DCHANNELS=2" + "sof-glk-es8336\;sof-jsl-es8336-dmic2ch-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=2" "sof-glk-es8336\;sof-jsl-es8336-dmic4ch-ssp0\;-DPLATFORM=jsl\;-DSSP_NUM=0\;-DCHANNELS=4" - "sof-glk-es8336\;sof-cml-es8336-ssp2\;-DPLATFORM=cml\;-DSSP_NUM=2\;-DCHANNELS=0" + "sof-glk-es8336\;sof-jsl-es8336-dmic4ch-ssp1\;-DPLATFORM=jsl\;-DSSP_NUM=1\;-DCHANNELS=4" + "sof-glk-es8336\;sof-jsl-es8336-dmic4ch-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-cml-es8336-ssp0\;-DPLATFORM=cml\;-DSSP_NUM=0\;-DCHANNELS=0" - "sof-glk-es8336\;sof-cml-es8336-dmic2ch-ssp2\;-DPLATFORM=cml\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-cml-es8336-ssp1\;-DPLATFORM=cml\;-DSSP_NUM=1\;-DCHANNELS=0" + "sof-glk-es8336\;sof-cml-es8336-ssp2\;-DPLATFORM=cml\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-cml-es8336-dmic2ch-ssp0\;-DPLATFORM=cml\;-DSSP_NUM=0\;-DCHANNELS=2" - "sof-glk-es8336\;sof-cml-es8336-dmic4ch-ssp2\;-DPLATFORM=cml\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-cml-es8336-dmic2ch-ssp1\;-DPLATFORM=cml\;-DSSP_NUM=1\;-DCHANNELS=2" + "sof-glk-es8336\;sof-cml-es8336-dmic2ch-ssp2\;-DPLATFORM=cml\;-DSSP_NUM=2\;-DCHANNELS=2" "sof-glk-es8336\;sof-cml-es8336-dmic4ch-ssp0\;-DPLATFORM=cml\;-DSSP_NUM=0\;-DCHANNELS=4" + "sof-glk-es8336\;sof-cml-es8336-dmic4ch-ssp1\;-DPLATFORM=cml\;-DSSP_NUM=1\;-DCHANNELS=4" + "sof-glk-es8336\;sof-cml-es8336-dmic4ch-ssp2\;-DPLATFORM=cml\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-tgl-es8336\;-DPLATFORM=tgl\;-DSSP_NUM=0\;-DCHANNELS=2" - "sof-glk-es8336\;sof-tgl-es8336-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-tgl-es8336-ssp0\;-DPLATFORM=tgl\;-DSSP_NUM=0\;-DCHANNELS=0" - "sof-glk-es8336\;sof-tgl-es8336-dmic2ch-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-tgl-es8336-ssp1\;-DPLATFORM=tgl\;-DSSP_NUM=1\;-DCHANNELS=0" + "sof-glk-es8336\;sof-tgl-es8336-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-tgl-es8336-dmic2ch-ssp0\;-DPLATFORM=tgl\;-DSSP_NUM=0\;-DCHANNELS=2" - "sof-glk-es8336\;sof-tgl-es8336-dmic4ch-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-tgl-es8336-dmic2ch-ssp1\;-DPLATFORM=tgl\;-DSSP_NUM=1\;-DCHANNELS=2" + "sof-glk-es8336\;sof-tgl-es8336-dmic2ch-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=2" "sof-glk-es8336\;sof-tgl-es8336-dmic4ch-ssp0\;-DPLATFORM=tgl\;-DSSP_NUM=0\;-DCHANNELS=4" + "sof-glk-es8336\;sof-tgl-es8336-dmic4ch-ssp1\;-DPLATFORM=tgl\;-DSSP_NUM=1\;-DCHANNELS=4" + "sof-glk-es8336\;sof-tgl-es8336-dmic4ch-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=4" "sof-imx8-nocodec\;sof-imx8-nocodec" "sof-imx8-cs42888\;sof-imx8-cs42888" From 935e3a9c72729efc25c8bf05fb9970d996a68dff Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Thu, 4 Aug 2022 14:03:01 +0300 Subject: [PATCH 022/161] topology: Add platform definition file for Intel Raptor Lake Start with Alder Lake definitions. Signed-off-by: Kai Vehmanen (cherry picked from commit 09944bc058915dc48faac9f2a671e1b7063dbbf7) --- tools/topology/topology1/platform/intel/rpl.m4 | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tools/topology/topology1/platform/intel/rpl.m4 diff --git a/tools/topology/topology1/platform/intel/rpl.m4 b/tools/topology/topology1/platform/intel/rpl.m4 new file mode 100644 index 000000000000..a36e847e9bad --- /dev/null +++ b/tools/topology/topology1/platform/intel/rpl.m4 @@ -0,0 +1,6 @@ +# +# Raptor Lake differentiation for pipelines and components +# + +# no difference yet, use Alder Lake definitions +include(`platform/intel/adl.m4') From 1c3669eac0c48cc23c9bd4d280fc05ba516d87fa Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Thu, 4 Aug 2022 14:03:35 +0300 Subject: [PATCH 023/161] topology: add sof-rpl-rt711 and sof-rpl-rt711-4ch topologies Add new topologies for Intel Raptor Lake. Signed-off-by: Kai Vehmanen (cherry picked from commit f2bfa2824e6640723fa12aa3bcfbc9bb596822b2) --- tools/topology/topology1/CMakeLists.txt | 2 ++ tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 7d9bf2efe22b..2095fcf92203 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -132,6 +132,8 @@ set(TPLGS "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-rpl-rt711-4ch\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=rpl" + "sof-tgl-rt711-rt1308\;sof-rpl-rt711\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=rpl" ## end SoundWire topologies ## SoundWire NOJACK topologies diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index 2718a1ae38a0..89154fb9c16f 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -40,6 +40,8 @@ set(TPLGS_UP "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-rpl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=rpl" + "sof-tgl-rt711-rt1308\;sof-rpl-rt711\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=rpl" ## end SoundWire topologies ) From afe466da0238d8b3af85f3d53e65ce4eb9cef90a Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Thu, 4 Aug 2022 13:53:13 +0300 Subject: [PATCH 024/161] topology: add sof-rpl-nocodec.tplg Add nocodec topology for Intel Raptor Lake. Signed-off-by: Kai Vehmanen (cherry picked from commit 8881a406af67536b9ac6bfbb53d1c712aacdae81) --- tools/topology/topology1/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 2095fcf92203..a70a3b1931c1 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -91,6 +91,7 @@ set(TPLGS "sof-cavs-nocodec\;sof-tgl-h-nocodec\;-DPLATFORM=tgl\;-DNCORES=2\;-DDYNAMIC=1" "sof-cavs-nocodec\;sof-ehl-nocodec\;-DPLATFORM=ehl\;-DDYNAMIC=1" "sof-cavs-nocodec\;sof-adl-nocodec\;-DPLATFORM=adl\;-DDMIC_48k_CORE_ID=1\;-DSSP0_CORE_ID=2\;-DSSP1_CORE_ID=3\;-DDYNAMIC=1" + "sof-cavs-nocodec\;sof-rpl-nocodec\;-DPLATFORM=rpl\;-DDMIC_48k_CORE_ID=1\;-DSSP0_CORE_ID=2\;-DSSP1_CORE_ID=3\;-DDYNAMIC=1" "sof-icl-dmic-4ch\;sof-icl-dmic-4ch" "sof-cml-rt5682\;sof-cml-rt5682\;-DPLATFORM=cml\;-DDMICPROC=eq-iir-volume\;-DDMIC16KPROC=eq-iir-volume" "sof-cml-rt5682\;sof-whl-rt5682\;-DPLATFORM=whl\;-DDMICPROC=eq-iir-volume\;-DDMIC16KPROC=eq-iir-volume" From d20db0db6b8c9042e3cd5b185eadb3a56949cee4 Mon Sep 17 00:00:00 2001 From: Muralidhar Reddy Date: Mon, 12 Sep 2022 19:17:15 +0530 Subject: [PATCH 025/161] topology1: CMakeLists: add ADL support for ES83x6 Added ADL support for ES83x6 on SSP1. Signed-off-by: Muralidhar Reddy (cherry picked from commit 187c845ddcd8d010212d0e6602f89d80f22e75db) --- tools/topology/topology1/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index a70a3b1931c1..d8bf8ae1c76b 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -248,6 +248,8 @@ set(TPLGS "sof-glk-es8336\;sof-tgl-es8336-dmic4ch-ssp1\;-DPLATFORM=tgl\;-DSSP_NUM=1\;-DCHANNELS=4" "sof-glk-es8336\;sof-tgl-es8336-dmic4ch-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-adl-es8336-ssp1\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=0" + "sof-imx8-nocodec\;sof-imx8-nocodec" "sof-imx8-cs42888\;sof-imx8-cs42888" "sof-imx8-nocodec-sai\;sof-imx8-nocodec-sai" From 2e045a49172fa0016ad628c660e2762b37f7ff78 Mon Sep 17 00:00:00 2001 From: Muralidhar Reddy Date: Mon, 12 Sep 2022 19:22:51 +0530 Subject: [PATCH 026/161] topology1: CMakeLists: add ADL support for ES83x6 & HDMI_In Capture Add ADL support for ES83x6 on SSP1, LT_HDMI_In capture on SSP0 & SSP2. Signed-off-by: Muralidhar Reddy (cherry picked from commit 586716e1b93037e06b6ba6dbd05c7fe7ac7c9ce4) --- tools/topology/topology1/CMakeLists.txt | 2 + .../platform/intel/intel-hdmi-ssp.m4 | 53 +++++++++++++++++++ tools/topology/topology1/sof-glk-es8336.m4 | 28 ++++++++++ 3 files changed, 83 insertions(+) create mode 100644 tools/topology/topology1/platform/intel/intel-hdmi-ssp.m4 diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index d8bf8ae1c76b..3307ef4b7bfb 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -249,6 +249,8 @@ set(TPLGS "sof-glk-es8336\;sof-tgl-es8336-dmic4ch-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=4" "sof-glk-es8336\;sof-adl-es8336-ssp1\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=0" + #sof-adl-es8336-ssp1-hdmi-ssp02 supports es8336 codec along with 2xHDMI_over_SSP Capture's. + "sof-glk-es8336\;sof-adl-es8336-ssp1-hdmi-ssp02\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=0\;-DHDMI_1_SSP_NUM=0\;-DHDMI_2_SSP_NUM=2" "sof-imx8-nocodec\;sof-imx8-nocodec" "sof-imx8-cs42888\;sof-imx8-cs42888" diff --git a/tools/topology/topology1/platform/intel/intel-hdmi-ssp.m4 b/tools/topology/topology1/platform/intel/intel-hdmi-ssp.m4 new file mode 100644 index 000000000000..afe48b4adad3 --- /dev/null +++ b/tools/topology/topology1/platform/intel/intel-hdmi-ssp.m4 @@ -0,0 +1,53 @@ +# +# HDMI-SSP Audio Offload support +# + +include(`ssp.m4') + +define(`HDMI_SSP_NAME', concat(concat(`SSP', HDMI_SSP_NUM),`-HDMI')) +define(`HDMI_SSP_PCM_NAME', concat(concat(`HDMI-', HDMI_SSP_NUM),`-In')) + +# variable that need to be defined in upper m4 +ifdef(`HDMI_SSP_PIPELINE_CP_ID',`',`fatal_error(note: Need to define capture pcm id for ssp intel-hdmi-in +)') +ifdef(`HDMI_SSP_DAI_LINK_ID',`',`fatal_error(note: Need to define DAI link id for ssp intel-hdmi-in +)') +ifdef(`HDMI_SSP_PCM_ID',`',`fatal_error(note: Need to define pipeline PCM dev id for ssp intel-hdmi-in +)') + + +# Low Latency capture pipeline 4 on PCM HDMI_SSP_PCM_ID using max 2 channels of s32le. +# 1000us deadline with priority 0 on core 0 +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, + HDMI_SSP_PIPELINE_CP_ID, HDMI_SSP_PCM_ID, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + + +# capture DAI is SSP using 2 periods +# Buffers use s32le format, 1000us deadline with priority 0 on core 0 +DAI_ADD(sof/pipe-dai-capture.m4, + HDMI_SSP_PIPELINE_CP_ID, SSP, HDMI_SSP_NUM, HDMI_SSP_NAME, + concat(`PIPELINE_SINK_', HDMI_SSP_PIPELINE_CP_ID), 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA) + + +PCM_CAPTURE_ADD(HDMI_SSP_PCM_NAME, HDMI_SSP_PCM_ID, concat(`PIPELINE_PCM_', HDMI_SSP_PIPELINE_CP_ID)) + + +#BE configuration in slave mode +DAI_CONFIG(SSP, HDMI_SSP_NUM, HDMI_SSP_DAI_LINK_ID, HDMI_SSP_NAME, + SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24576000, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_provider), + SSP_CLOCK(fsync, 48000, codec_provider), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, HDMI_SSP_NUM, 32, 0))) + + +undefine(`HDMI_SSP_PIPELINE_CP_ID') +undefine(`HDMI_SSP_DAI_LINK_ID') +undefine(`HDMI_SSP_PCM_ID') dnl use fixed PCM_ID +undefine(`HDMI_SSP_NUM') +undefine(`HDMI_SSP_NAME') +undefine(`HDMI_SSP_PCM_NAME') + diff --git a/tools/topology/topology1/sof-glk-es8336.m4 b/tools/topology/topology1/sof-glk-es8336.m4 index 08fc45124ca5..181b150ef523 100644 --- a/tools/topology/topology1/sof-glk-es8336.m4 +++ b/tools/topology/topology1/sof-glk-es8336.m4 @@ -53,6 +53,24 @@ include(`platform/intel/intel-generic-dmic.m4') ' ) +# Add HDMI-SSP Audio Offload pass-through +ifdef(`HDMI_1_SSP_NUM', +` define(`HDMI_SSP_NUM', HDMI_1_SSP_NUM) + define(`HDMI_SSP_PIPELINE_CP_ID', `8') + define(`HDMI_SSP_DAI_LINK_ID', 6) + define(`HDMI_SSP_PCM_ID', `3') dnl use fixed PCM_ID + include(`platform/intel/intel-hdmi-ssp.m4') +' +) + +ifdef(`HDMI_2_SSP_NUM', +` define(`HDMI_SSP_NUM', HDMI_2_SSP_NUM) + define(`HDMI_SSP_PIPELINE_CP_ID', `9') + define(`HDMI_SSP_DAI_LINK_ID', 7) + define(`HDMI_SSP_PCM_ID', `4') dnl use fixed PCM_ID + include(`platform/intel/intel-hdmi-ssp.m4') +' +) DEBUG_START # @@ -68,6 +86,16 @@ ifelse(CHANNELS, `0', # PCM5 ----> volume (pipe 5) -----> iDisp1 (HDMI/DP playback, BE link 5) # PCM6 ----> Volume (pipe 6) -----> iDisp2 (HDMI/DP playback, BE link 6) # PCM7 ----> volume (pipe 7) -----> iDisp3 (HDMI/DP playback, BE link 7) +ifdef(`HDMI_1_SSP_NUM', +` +# PCM3 <---- volume <----- HDMI_1_SSP_NUM (lt6911) +' +) +ifdef(`HDMI_2_SSP_NUM', +` +# PCM4 <---- volume <----- HDMI_2_SSP_NUM (lt6911) +' +) # Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. # 1000us deadline with priority 0 on core 0 From 40a15f80f6344aa4817b7418e22b2bb3062125e7 Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Mon, 26 Sep 2022 12:20:09 +0300 Subject: [PATCH 027/161] topology1: Update documentation to reflect multicodec support This updates documentation to reflect that now param id is only 2 bytes followed by 2 bytes codec id. Signed-off-by: Daniel Baluta (cherry picked from commit e60caa0c0cdfbc37658396fc4d0f22067410643a) --- tools/topology/topology1/sof/pipe-codec-adapter-capture.m4 | 3 ++- tools/topology/topology1/sof/pipe-codec-adapter-playback.m4 | 3 ++- .../topology1/sof/pipe-eq-iir-codec-adapter-playback.m4 | 3 ++- .../topology/topology1/sof/pipe-host-codec-adapter-playback.m4 | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/topology/topology1/sof/pipe-codec-adapter-capture.m4 b/tools/topology/topology1/sof/pipe-codec-adapter-capture.m4 index c62fe1b975b3..eb3350a493a2 100644 --- a/tools/topology/topology1/sof/pipe-codec-adapter-capture.m4 +++ b/tools/topology/topology1/sof/pipe-codec-adapter-capture.m4 @@ -38,7 +38,8 @@ include(`bytecontrol.m4') # - [16:19]: channels, e.g. 2 # - (optional) 12+ bytes codec_param: codec TLV parameters container, for more details please refer # struct codec_param under audio/codec_adapter/codec/generic.h -# - [0:3]: param ID +# - [0:1]: param ID +# - [2:3]: codec ID (when supporting multiple codecs, 0 otherwise) # - [4:7]: size in bytes (ID + size + data) # - [8:n-1]: data[], the param data ifdef(`CA_SETUP_CONTROLBYTES',`', `define(`CA_SETUP_CONTROLBYTES', diff --git a/tools/topology/topology1/sof/pipe-codec-adapter-playback.m4 b/tools/topology/topology1/sof/pipe-codec-adapter-playback.m4 index eb75022e1276..32bef3a1d3e7 100644 --- a/tools/topology/topology1/sof/pipe-codec-adapter-playback.m4 +++ b/tools/topology/topology1/sof/pipe-codec-adapter-playback.m4 @@ -38,7 +38,8 @@ include(`bytecontrol.m4') # - [16:19]: channels, e.g. 2 # - (optional) 12+ bytes codec_param: codec TLV parameters container, for more details please refer # struct codec_param under audio/codec_adapter/codec/generic.h -# - [0:3]: param ID +# - [0:1]: param ID +# - [2:3]: codec ID (when supporting multiple codecs, 0 otherwise) # - [4:7]: size in bytes (ID + size + data) # - [8:n-1]: data[], the param data ifdef(`CA_SETUP_CONTROLBYTES',`', `define(`CA_SETUP_CONTROLBYTES', diff --git a/tools/topology/topology1/sof/pipe-eq-iir-codec-adapter-playback.m4 b/tools/topology/topology1/sof/pipe-eq-iir-codec-adapter-playback.m4 index 647e32756750..82f846707ec0 100644 --- a/tools/topology/topology1/sof/pipe-eq-iir-codec-adapter-playback.m4 +++ b/tools/topology/topology1/sof/pipe-eq-iir-codec-adapter-playback.m4 @@ -39,7 +39,8 @@ include(`eq_iir.m4') # - [16:19]: channels, e.g. 2 # - (optional) 12+ bytes codec_param: codec TLV parameters container, for more details please refer # struct codec_param under audio/codec_adapter/codec/generic.h -# - [0:3]: param ID +# - [0:1]: param ID +# - [2:3]: codec ID (when supporting multiple codecs, 0 otherwise) # - [4:7]: size in bytes (ID + size + data) # - [8:n-1]: data[], the param data ifdef(`CA_SETUP_CONTROLBYTES',`', `define(`CA_SETUP_CONTROLBYTES', diff --git a/tools/topology/topology1/sof/pipe-host-codec-adapter-playback.m4 b/tools/topology/topology1/sof/pipe-host-codec-adapter-playback.m4 index b5a5dc25e40f..9a9b7af650c4 100644 --- a/tools/topology/topology1/sof/pipe-host-codec-adapter-playback.m4 +++ b/tools/topology/topology1/sof/pipe-host-codec-adapter-playback.m4 @@ -38,7 +38,8 @@ include(`bytecontrol.m4') # - [16:19]: channels, e.g. 2 # - (optional) 12+ bytes codec_param: codec TLV parameters container, for more details please refer # struct codec_param under audio/codec_adapter/codec/generic.h -# - [0:3]: param ID +# - [0:1]: param ID +# - [2:3]: codec ID, when supporting multiple codecs, 0 otherwise # - [4:7]: size in bytes (ID + size + data) # - [8:n-1]: data[], the param data ifdef(`CA_SETUP_CONTROLBYTES',`', `define(`CA_SETUP_CONTROLBYTES', From d0291e381b0d70d602487863dddd95add57556e5 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 27 Sep 2022 07:24:12 +0000 Subject: [PATCH 028/161] topology1: prefix custom targets with their subdirectory name This makes it possible to find stuff in the output of `ninja help`. Zero effect on the build artefacts. Signed-off-by: Marc Herbert (cherry picked from commit 567ad2122ec297f20f5d632c6229b0b8b868f091) --- tools/topology/topology1/development/CMakeLists.txt | 4 ++-- tools/topology/topology1/dsp_enhancement/CMakeLists.txt | 4 ++-- .../topology/topology1/kernel_dependent/v5.19/CMakeLists.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/topology/topology1/development/CMakeLists.txt b/tools/topology/topology1/development/CMakeLists.txt index 20c622f83f83..6885387046c6 100644 --- a/tools/topology/topology1/development/CMakeLists.txt +++ b/tools/topology/topology1/development/CMakeLists.txt @@ -92,8 +92,8 @@ foreach(tplg ${TPLGS}) add_alsatplg_command(${output}.conf ${output}.tplg) - add_custom_target(topology_${output} DEPENDS ${output}.tplg) - add_dependencies(dev_topologies1 topology_${output}) + add_custom_target(dev_topology_${output} DEPENDS ${output}.tplg) + add_dependencies(dev_topologies1 dev_topology_${output}) endforeach() # Duplicate of above to handle topologies in parent directory diff --git a/tools/topology/topology1/dsp_enhancement/CMakeLists.txt b/tools/topology/topology1/dsp_enhancement/CMakeLists.txt index 9399b48e5c21..dc0ef468c88b 100644 --- a/tools/topology/topology1/dsp_enhancement/CMakeLists.txt +++ b/tools/topology/topology1/dsp_enhancement/CMakeLists.txt @@ -41,6 +41,6 @@ foreach(tplg ${TPLGS_UP}) add_alsatplg_command(${output}.conf ${output}.tplg) - add_custom_target(topology_${output} DEPENDS ${output}.tplg) - add_dependencies(dsp_topologies1 topology_${output}) + add_custom_target(dsp_topology_${output} DEPENDS ${output}.tplg) + add_dependencies(dsp_topologies1 dsp_topology_${output}) endforeach() diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index 89154fb9c16f..cf823066e60a 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -79,6 +79,6 @@ foreach(tplg ${TPLGS_UP}) ) add_alsatplg_command(${output}.conf ${output}.tplg) - add_custom_target(topology_${output} DEPENDS ${output}.tplg) - add_dependencies(kernel_dependent_v5_19_topologies1 topology_${output}) + add_custom_target(k519_topology_${output} DEPENDS ${output}.tplg) + add_dependencies(kernel_dependent_v5_19_topologies1 k519_topology_${output}) endforeach() From a0246cfd9b7a56d72ed453ad5ae7d1d647f274c5 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 27 Sep 2022 08:27:07 +0000 Subject: [PATCH 029/161] topology1: fix incremental build dependency on abi.h Modifying abi.h now rebuilds topologies v1 Signed-off-by: Marc Herbert (cherry picked from commit a29d522059b79901af287974eb7a5b8056c284fe) --- tools/topology/topology1/CMakeLists.txt | 15 +++++++++++++-- .../topology/topology1/development/CMakeLists.txt | 4 ++-- .../topology1/dsp_enhancement/CMakeLists.txt | 2 +- .../kernel_dependent/v5.19/CMakeLists.txt | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 3307ef4b7bfb..6bc54d1c941a 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -9,8 +9,12 @@ file(GLOB TPLG_DEPS ) add_custom_target(abi_v1 + DEPENDS abi.h +) +add_custom_command(OUTPUT abi.h COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/get_abi.sh ${SOF_ROOT_SOURCE_DIRECTORY} - DEPENDS ${TPLG_DEPS} + DEPENDS ${TPLG_DEPS} ${SOF_ROOT_SOURCE_DIRECTORY}/src/include/kernel/abi.h + # get_abi.h generates (a smaller) abi.h in the current directory WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} VERBATIM USES_TERMINAL @@ -312,6 +316,8 @@ foreach(tplg ${TPLGS}) endforeach() endif() + # m4 + # TODO: reduce duplication with subdirectories add_custom_command( OUTPUT production/${output}.conf COMMAND m4 --fatal-warnings @@ -325,11 +331,16 @@ foreach(tplg ${TPLGS}) ${CMAKE_CURRENT_SOURCE_DIR}/${input}.m4 > production/${output}.conf MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/${input}.m4 - DEPENDS abi_v1 + # The 'abi.h' file is the real dependency that triggers + # a rebuild. 'abi_v1' is the target that avoids a race + # to rebuild abi.h. See the CMake FAQ or (better) Sam + # Thursfield's blog about custom targets. + DEPENDS abi_v1 ${CMAKE_CURRENT_BINARY_DIR}/abi.h VERBATIM USES_TERMINAL ) + # alsatplg add_alsatplg_command(production/${output}.conf production/${output}.tplg) add_custom_target(topology1_${output} DEPENDS production/${output}.tplg) diff --git a/tools/topology/topology1/development/CMakeLists.txt b/tools/topology/topology1/development/CMakeLists.txt index 6885387046c6..55086abee9dd 100644 --- a/tools/topology/topology1/development/CMakeLists.txt +++ b/tools/topology/topology1/development/CMakeLists.txt @@ -85,7 +85,7 @@ foreach(tplg ${TPLGS}) ${CMAKE_CURRENT_SOURCE_DIR}/../common/abi.m4 ${CMAKE_CURRENT_SOURCE_DIR}/${input}.m4 > ${output}.conf - DEPENDS abi_v1 + DEPENDS abi_v1 ${CMAKE_BINARY_DIR}/topology/topology1/abi.h VERBATIM USES_TERMINAL ) @@ -121,7 +121,7 @@ foreach(tplg ${TPLGS_UP}) ${CMAKE_CURRENT_SOURCE_DIR}/../common/abi.m4 ${CMAKE_CURRENT_SOURCE_DIR}/../${input}.m4 > ${output}.conf - DEPENDS abi_v1 + DEPENDS abi_v1 ${CMAKE_BINARY_DIR}/topology/topology1/abi.h VERBATIM USES_TERMINAL ) diff --git a/tools/topology/topology1/dsp_enhancement/CMakeLists.txt b/tools/topology/topology1/dsp_enhancement/CMakeLists.txt index dc0ef468c88b..bdb655dd7800 100644 --- a/tools/topology/topology1/dsp_enhancement/CMakeLists.txt +++ b/tools/topology/topology1/dsp_enhancement/CMakeLists.txt @@ -34,7 +34,7 @@ foreach(tplg ${TPLGS_UP}) ${CMAKE_CURRENT_SOURCE_DIR}/../common/abi.m4 ${CMAKE_CURRENT_SOURCE_DIR}/../${input}.m4 > ${output}.conf - DEPENDS abi_v1 + DEPENDS abi_v1 ${CMAKE_BINARY_DIR}/topology/topology1/abi.h VERBATIM USES_TERMINAL ) diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index cf823066e60a..c141eeceb88f 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -73,7 +73,7 @@ foreach(tplg ${TPLGS_UP}) ${CMAKE_CURRENT_SOURCE_DIR}/../../common/abi.m4 ${CMAKE_CURRENT_SOURCE_DIR}/../../${input}.m4 > ${output}.conf - DEPENDS abi_v1 + DEPENDS abi_v1 ${CMAKE_BINARY_DIR}/topology/topology1/abi.h VERBATIM USES_TERMINAL ) From 7e80583977189ad1cd79d18039f45f96a101bde8 Mon Sep 17 00:00:00 2001 From: Gongjun Song Date: Fri, 4 Nov 2022 10:03:47 +0800 Subject: [PATCH 030/161] add some missing topologies in v5.19/CMakeLists.txt Add missing adl SoundWire NOJACK topologies in v5.19/CMakeLists.txt Signed-off-by: Gongjun Song (cherry picked from commit 7c47f6aa55748b05afe267ccb98b2ea36954b35e) --- .../topology1/kernel_dependent/v5.19/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index c141eeceb88f..94474db357a8 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -43,6 +43,12 @@ set(TPLGS_UP "sof-tgl-rt711-rt1308\;sof-rpl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=rpl" "sof-tgl-rt711-rt1308\;sof-rpl-rt711\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=rpl" ## end SoundWire topologies + + ## SoundWire NOJACK topologies + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l0\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l12-rt714-l0\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l3\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" + ## end SoundWire NOJACK topologies ) add_custom_target(kernel_dependent_v5_19_topologies1) From 4f4f64e3cfef6fbd7b475c1bff6b32901bb76fb2 Mon Sep 17 00:00:00 2001 From: Gongjun Song Date: Thu, 13 Oct 2022 21:57:45 +0800 Subject: [PATCH 031/161] topology1: Add sof-rpl-rt1316-l12-rt714-l0 Audio hardware configuration of SKU 0C10 product is rt714 on link0, two rt1316s on link1 and link2 Signed-off-by: Gongjun Song (cherry picked from commit 11baeefd940986c5db23aaa0fc33e513cf129253) --- tools/topology/topology1/CMakeLists.txt | 1 + tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 6bc54d1c941a..fba19adc16ab 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -145,6 +145,7 @@ set(TPLGS "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l0\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l12-rt714-l0\;-DPLATFORM=adl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l3\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt1316-l12-rt714-l0\;-DPLATFORM=rpl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" ## end SoundWire NOJACK topologies "sof-ehl-rt5660\;sof-ehl-rt5660\;-DHDMI=1" diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index 94474db357a8..580f4e543b58 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -48,6 +48,7 @@ set(TPLGS_UP "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l0\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l12-rt714-l0\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l3\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt1316-l12-rt714-l0\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" ## end SoundWire NOJACK topologies ) From 2824078cb01d8b4a2476d1cacb4995d07c16be3e Mon Sep 17 00:00:00 2001 From: Gongjun Song Date: Fri, 14 Oct 2022 13:44:56 +0800 Subject: [PATCH 032/161] topology1: Add sof-rpl-rt711-l2-rt1316-l01-rt714-l3 Audio hardware configuration of SKU 0C40 product is rt711 on link2, two rt1316s on link0 and link1 and rt714 on link3 Signed-off-by: Gongjun Song (cherry picked from commit fc825a9ecbc841778adc23aa847c178f18830fd1) --- tools/topology/topology1/CMakeLists.txt | 1 + tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index fba19adc16ab..a3209555a108 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -131,6 +131,7 @@ set(TPLGS "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l0-rt1316-l13-rt714-l2\;-DPLATFORM=adl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=3\;-DEXT_AMP_REF\;-DMIC_LINK=2" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index 580f4e543b58..149ba63bc02e 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -34,6 +34,7 @@ set(TPLGS_UP "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l0-rt1316-l13-rt714-l2\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=3\;-DEXT_AMP_REF\;-DMIC_LINK=2" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" From 4bc60adf3e2554096cc38671f01f711dde440325 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Mon, 31 Oct 2022 17:37:23 -0400 Subject: [PATCH 033/161] topology1: add missing ES8336 topologies for ICL This needs to be added in sof-bin. Link: https://github.com/thesofproject/linux/issues/3873 Signed-off-by: Pierre-Louis Bossart (cherry picked from commit a5635e001122c5d7a31bef086c6be8bfb1dc733a) --- tools/topology/topology1/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index a3209555a108..c203ea9733cb 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -233,6 +233,16 @@ set(TPLGS "sof-glk-es8336\;sof-jsl-es8336-dmic4ch-ssp1\;-DPLATFORM=jsl\;-DSSP_NUM=1\;-DCHANNELS=4" "sof-glk-es8336\;sof-jsl-es8336-dmic4ch-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-icl-es8336-ssp0\;-DPLATFORM=jsl\;-DSSP_NUM=0\;-DCHANNELS=0" + "sof-glk-es8336\;sof-icl-es8336-ssp1\;-DPLATFORM=jsl\;-DSSP_NUM=1\;-DCHANNELS=0" + "sof-glk-es8336\;sof-icl-es8336-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=0" + "sof-glk-es8336\;sof-icl-es8336-dmic2ch-ssp0\;-DPLATFORM=jsl\;-DSSP_NUM=0\;-DCHANNELS=2" + "sof-glk-es8336\;sof-icl-es8336-dmic2ch-ssp1\;-DPLATFORM=jsl\;-DSSP_NUM=1\;-DCHANNELS=2" + "sof-glk-es8336\;sof-icl-es8336-dmic2ch-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-icl-es8336-dmic4ch-ssp0\;-DPLATFORM=jsl\;-DSSP_NUM=0\;-DCHANNELS=4" + "sof-glk-es8336\;sof-icl-es8336-dmic4ch-ssp1\;-DPLATFORM=jsl\;-DSSP_NUM=1\;-DCHANNELS=4" + "sof-glk-es8336\;sof-icl-es8336-dmic4ch-ssp2\;-DPLATFORM=jsl\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-cml-es8336-ssp0\;-DPLATFORM=cml\;-DSSP_NUM=0\;-DCHANNELS=0" "sof-glk-es8336\;sof-cml-es8336-ssp1\;-DPLATFORM=cml\;-DSSP_NUM=1\;-DCHANNELS=0" "sof-glk-es8336\;sof-cml-es8336-ssp2\;-DPLATFORM=cml\;-DSSP_NUM=2\;-DCHANNELS=0" From be9bb2465f810452dfb9451892333a0884c29c45 Mon Sep 17 00:00:00 2001 From: Gongjun Song Date: Sat, 29 Oct 2022 15:46:01 +0800 Subject: [PATCH 034/161] topology1: Add sof-rpl-rt711-l0-rt1318-l12-rt714-l3 Audio hardware configuration of SKU 0C11 product is rt711 on link0, two rt1318s on link1 and link2, rt714 on link3 Signed-off-by: Gongjun Song (cherry picked from commit b91af845b73e5b188e2b448955f21396f016c884) --- tools/topology/topology1/CMakeLists.txt | 1 + tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index c203ea9733cb..872b5c9c0465 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -132,6 +132,7 @@ set(TPLGS "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index 149ba63bc02e..e7c347ae53be 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -35,6 +35,7 @@ set(TPLGS_UP "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" From 7181348e2992be4a7ed49a97cb7c07748e1ec405 Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Mon, 7 Nov 2022 21:23:20 +0800 Subject: [PATCH 035/161] topology: sof-adl-nau8825: support RT1015P amplifier Add new topology sof-adl-rt1015-nau8825 which implements Realtek ALC1015 on SSP1. Signed-off-by: Brent Lu (cherry picked from commit 1e3a4cfe9b26176e28287b913b35bcbe12bbef79) --- tools/topology/topology1/CMakeLists.txt | 5 +++-- tools/topology/topology1/sof-adl-nau8825.m4 | 21 ++++++++++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 872b5c9c0465..e9253ca33f29 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -184,8 +184,9 @@ set(TPLGS "sof-adl-nau8825\;sof-adl-nau8825\;-DNO_AMP\;-DBT_OFFLOAD" "sof-adl-nau8825\;sof-adl-max98373-nau8825\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD" "sof-adl-nau8825\;sof-adl-max98373-nau8825-dts\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD\;-DDTS=`DTS'" - "sof-adl-nau8825\;sof-adl-max98360a-nau8825\;-DAMP_SSP=1\;-DBT_OFFLOAD" - "sof-adl-nau8825\;sof-adl-rt1019-nau8825\;-DAMP_SSP=2" + "sof-adl-nau8825\;sof-adl-max98360a-nau8825\;-DCODEC=MAX98360A\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD" + "sof-adl-nau8825\;sof-adl-rt1019-nau8825\;-DCODEC=RT1019P\;-DFMT=s16le\;-DAMP_SSP=2" + "sof-adl-nau8825\;sof-adl-rt1015-nau8825\;-DCODEC=RT1015P\;-DFMT=s32le\;-DAMP_SSP=1\;-DBT_OFFLOAD" "sof-tgl-sdw-max98373-rt5682\;sof-tgl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=tgl" "sof-tgl-sdw-max98373-rt5682\;sof-adl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=adl" "sof-jsl-da7219\;sof-jsl-da7219\;-DPLATFORM=jsl" diff --git a/tools/topology/topology1/sof-adl-nau8825.m4 b/tools/topology/topology1/sof-adl-nau8825.m4 index 8187597bc7eb..9159b3b24f3c 100644 --- a/tools/topology/topology1/sof-adl-nau8825.m4 +++ b/tools/topology/topology1/sof-adl-nau8825.m4 @@ -273,14 +273,14 @@ ifdef(`SMART_AMP',,` # Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, SPK_SSP_INDEX, SPK_SSP_NAME, - PIPELINE_SOURCE_1, 2, s16le, + PIPELINE_SOURCE_1, 2, FMT, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) # The echo refenrence pipeline has no connections in it, # it is used for the capture DAI widget to dock. DAI_ADD(sof/pipe-echo-ref-dai-capture.m4, 29, SSP, SPK_SSP_INDEX, SPK_SSP_NAME, - PIPELINE_SINK_29, 3, s16le, + PIPELINE_SINK_29, 3, FMT, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) # Capture pipeline 9 from demux on PCM 6 using max 2 channels of s32le. @@ -357,10 +357,25 @@ ifdef(`NO_AMP',,` ifdef(`SMART_AMP',,` `# SSP' SPK_SSP_INDEX `(ID: 7)' DAI_CONFIG(SSP, SPK_SSP_INDEX, SPK_BE_ID, SPK_SSP_NAME, +ifelse( + CODEC, `MAX98360A', ` SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK, codec_mclk_in), SSP_CLOCK(bclk, 1536000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 16, 3, 3), - SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 16)))')') + SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 16)))', + CODEC, `RT1019P', ` + SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK, codec_mclk_in), + SSP_CLOCK(bclk, 1536000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 16, 3, 3), + SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 16)))', + CODEC, `RT1015P', ` + SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 32)))', +)')') DEBUG_END From e5f4e88dfe56ec1b3f7c5f156c8e321aaa48bb99 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Fri, 9 Dec 2022 10:54:02 -0600 Subject: [PATCH 036/161] topology1: add ADL Rooks County laptop LAPRC710 Amplifier is on link 2, not 3, in this platform Fixes: https://github.com/thesofproject/linux/issues/4088 Signed-off-by: Pierre-Louis Bossart (cherry picked from commit c91326bda26673948f64927cd28fab1c79f2f5d6) --- tools/topology/topology1/CMakeLists.txt | 2 ++ tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt | 3 +++ 2 files changed, 5 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index e9253ca33f29..4fcb91145d56 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -139,6 +139,8 @@ set(TPLGS "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l2-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l2-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-rpl-rt711-4ch\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=rpl" "sof-tgl-rt711-rt1308\;sof-rpl-rt711\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=rpl" ## end SoundWire topologies diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index e7c347ae53be..5b0fe4493134 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -42,6 +42,9 @@ set(TPLGS_UP "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l2-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l2-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-rpl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=rpl" "sof-tgl-rt711-rt1308\;sof-rpl-rt711\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=rpl" ## end SoundWire topologies From dfa2b137d2efe5a9a9b87a3ea5d3cdbed230ebea Mon Sep 17 00:00:00 2001 From: Gongjun Song Date: Wed, 14 Dec 2022 21:26:22 +0800 Subject: [PATCH 037/161] topology1: add sof-rpl-rt711-l2-rt1316-l01 Add sof-rpl-rt711-l2-rt1316-l01. This tplg doesn't include any local MICs. Signed-off-by: Gongjun Song (cherry picked from commit 01447692297184964a18f3c7687f7a9e053d9d8b) --- tools/topology/topology1/CMakeLists.txt | 1 + tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 4fcb91145d56..46e94fe47f17 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -132,6 +132,7 @@ set(TPLGS "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index 5b0fe4493134..3a924a1a77a6 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -35,6 +35,7 @@ set(TPLGS_UP "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" From 343cd3b03cb106304e4378f29611c312a29c67e6 Mon Sep 17 00:00:00 2001 From: Gongjun Song Date: Fri, 16 Dec 2022 14:30:46 +0800 Subject: [PATCH 038/161] topology1: add sof-rpl-rt711-l0-rt1318-l12 Add sof-rpl-rt711-l0-rt1318-l12. This tplg doesn't include any local MICs. Signed-off-by: Gongjun Song (cherry picked from commit 89b1f5054a5a3f339f92fefe694f8a48cac4d79e) --- tools/topology/topology1/CMakeLists.txt | 1 + tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 46e94fe47f17..8ad3c749a363 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -134,6 +134,7 @@ set(TPLGS "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index 3a924a1a77a6..d4afa25a6e26 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -37,6 +37,7 @@ set(TPLGS_UP "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" From 85a4c4ba72f3d470457c3e08eee9ae34c16af093 Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Thu, 1 Dec 2022 11:23:26 +0800 Subject: [PATCH 039/161] topology: sof-jsl-rt5682: add sof-jsl-rt5682.tplg This topology supports JSL boards which implement ALC5682I-VD/VS on SSP0 port without speaker amplifier. Signed-off-by: Brent Lu (cherry picked from commit 8a394bb52626c2d3ab551b45091ef0987b888104) --- tools/topology/topology1/CMakeLists.txt | 1 + tools/topology/topology1/sof-jsl-rt5682.m4 | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 8ad3c749a363..82874e85a2a0 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -200,6 +200,7 @@ set(TPLGS "sof-jsl-rt5682\;sof-jsl-rt5682-rt1015-xperi\;-DPLATFORM=jsl-rt1015\;-DINCLUDE_IIR_EQ=1" "sof-jsl-rt5682\;sof-jsl-rt5682-mx98360a\;-DPLATFORM=jsl-dedede" "sof-jsl-rt5682\;sof-jsl-cs42l42-mx98360a\;-DPLATFORM=jsl-dedede" + "sof-jsl-rt5682\;sof-jsl-rt5682\;-DHEADPHONE=rt5682\;-DPLATFORM=icl\;-DNO_AMP" "sof-glk-es8336\;sof-apl-es8336\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-apl-es8336-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=0" diff --git a/tools/topology/topology1/sof-jsl-rt5682.m4 b/tools/topology/topology1/sof-jsl-rt5682.m4 index 89fb7045f344..37360fe7e3ec 100644 --- a/tools/topology/topology1/sof-jsl-rt5682.m4 +++ b/tools/topology/topology1/sof-jsl-rt5682.m4 @@ -23,7 +23,8 @@ DEBUG_START # # Define the pipelines # -# PCM0 ----> volume -----> SSP1 (Speaker - ALC1015) +ifdef(`NO_AMP',`',` +# PCM0 ----> volume -----> SSP1 (Speaker - ALC1015)') # PCM1 <---> volume <----> SSP0 (Headset - ALC5682) # PCM2 ----> volume -----> iDisp1 # PCM3 ----> volume -----> iDisp2 @@ -55,6 +56,7 @@ dnl PIPELINE_PCM_ADD(pipeline, dnl pipe id, pcm, max channels, format, dnl frames, deadline, priority, core) +ifdef(`NO_AMP',`',` # Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline with priority 0 on core 0 define(ENDPOINT_NAME, `Speakers') @@ -63,7 +65,7 @@ PIPELINE_PCM_ADD( 1, 0, 2, s32le, 1000, 0, 0, 48000, 48000, 48000) -undefine(ENDPOINT_NAME) +undefine(ENDPOINT_NAME)') # Low Latency playback pipeline 2 on PCM 1 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline with priority 0 on core 0 @@ -113,12 +115,13 @@ dnl pipe id, dai type, dai_index, dai_be, dnl buffer, periods, format, dnl frames, deadline, priority, core) +ifdef(`NO_AMP',`',` # playback DAI is SSP1 using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, SPK_INDEX, SPK_NAME, PIPELINE_SOURCE_1, 2, SPK_DATA_FORMAT, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)') # playback DAI is SSP0 using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 @@ -157,7 +160,8 @@ DAI_ADD(sof/pipe-dai-playback.m4, # PCM Low Latency, id 0 dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) -PCM_PLAYBACK_ADD(Speakers, 0, PIPELINE_PCM_1) +ifdef(`NO_AMP',`',` +PCM_PLAYBACK_ADD(Speakers, 0, PIPELINE_PCM_1)') PCM_DUPLEX_ADD(Headset, 1, PIPELINE_PCM_2, PIPELINE_PCM_3) PCM_PLAYBACK_ADD(HDMI1, 2, PIPELINE_PCM_5) PCM_PLAYBACK_ADD(HDMI2, 3, PIPELINE_PCM_6) @@ -180,9 +184,10 @@ DAI_CONFIG(SSP, 0, 0, SSP0-Codec, SSP_TDM(2, 25, 3, 3), SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_BCLK_ES))) +ifdef(`NO_AMP',`',` # SSP 1 (ID: 6) DAI_CONFIG(SSP, SPK_INDEX, 6, SPK_NAME, - SET_SSP_CONFIG) + SET_SSP_CONFIG)') # 4 HDMI/DP outputs (ID: 3,4,5) DAI_CONFIG(HDA, 0, 3, iDisp1, From 64968ee2d1c5a8f396f7b175af3e96bf55b423a3 Mon Sep 17 00:00:00 2001 From: stolx Date: Tue, 14 Mar 2023 10:30:28 +0200 Subject: [PATCH 040/161] tools: topology: fix jsl rt5682-based topologies Signed-off-by: stolx --- tools/topology/topology1/sof-jsl-rt5682.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/topology/topology1/sof-jsl-rt5682.m4 b/tools/topology/topology1/sof-jsl-rt5682.m4 index 37360fe7e3ec..89fa84b2f28c 100644 --- a/tools/topology/topology1/sof-jsl-rt5682.m4 +++ b/tools/topology/topology1/sof-jsl-rt5682.m4 @@ -65,7 +65,7 @@ PIPELINE_PCM_ADD( 1, 0, 2, s32le, 1000, 0, 0, 48000, 48000, 48000) -undefine(ENDPOINT_NAME)') +undefine(`ENDPOINT_NAME')') # Low Latency playback pipeline 2 on PCM 1 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline with priority 0 on core 0 @@ -77,7 +77,7 @@ PIPELINE_PCM_ADD( 2, 1, 2, s32le, 1000, 0, 0, 48000, 48000, 48000) -undefine(ENDPOINT_NAME) +undefine(`ENDPOINT_NAME') # Low Latency capture pipeline 3 on PCM 1 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline with priority 0 on core 0 From 6728a75d756f57481908b8d89fe86429fb7e3961 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Thu, 20 Apr 2023 18:17:24 +0300 Subject: [PATCH 041/161] topology1: fix buffer size calculation if period-size >44ms Calculation of SOF_TKN_BUF_SIZE in COMP_PERIOD_FRAMES() macro led to incorrect results with large period size values. For example at 48000Hz sampling rate, period size larger than 44739us would be incorrectly calculated. This happens as m4 eval does arithmetic in 32bit signed values and multiplication of period size and sampling rate can easily exceed 2^31. Fix the issue by splitting the arithmetic in steps that fit available value range. Link: https://github.com/thesofproject/sof/issues/7476 Signed-off-by: Kai Vehmanen (cherry picked from commit be43b4e4ebb9e774a05318c4b54c0445c7938db3) --- tools/topology/topology1/m4/buffer.m4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/topology/topology1/m4/buffer.m4 b/tools/topology/topology1/m4/buffer.m4 index 9a8f5b73f8f4..376e206c6c09 100644 --- a/tools/topology/topology1/m4/buffer.m4 +++ b/tools/topology/topology1/m4/buffer.m4 @@ -44,6 +44,8 @@ dnl COMP_BUFFER_SIZE( num_periods, sample_size, channels, fmames) define(`COMP_BUFFER_SIZE', `eval(`$1 * $2 * $3 * $4')') dnl COMP_PERIOD_FRAMES( sample_rate, period_us) -define(`COMP_PERIOD_FRAMES', `eval(`($1 * $2) / 1000000')') +dnl note: m4 eval arithmetic is 32bit signed, so split the 10^6 +dnl division to avoid overflow. +define(`COMP_PERIOD_FRAMES', `eval(`$1 / 100 * $2 / 10000')') divert(0)dnl From 4f1122cd3afaf6449493e336f70e0944ceb25d91 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Wed, 21 Dec 2022 10:24:50 -0600 Subject: [PATCH 042/161] topology1: add missing ADL-es8336 topologies. The ADL integration was botched with missing topologies and errors in topology names in the kernel. Link: https://github.com/thesofproject/linux/issues/4111 Signed-off-by: Pierre-Louis Bossart (cherry picked from commit 57e976ec3854cfe4ca34211f6edc041909c9c24a) --- tools/topology/topology1/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 82874e85a2a0..596df65911ba 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -271,7 +271,17 @@ set(TPLGS "sof-glk-es8336\;sof-tgl-es8336-dmic4ch-ssp1\;-DPLATFORM=tgl\;-DSSP_NUM=1\;-DCHANNELS=4" "sof-glk-es8336\;sof-tgl-es8336-dmic4ch-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=4" + "sof-glk-es8336\;sof-adl-es8336\;-DPLATFORM=adl\;-DSSP_NUM=0\;-DCHANNELS=2" + "sof-glk-es8336\;sof-adl-es8336-ssp0\;-DPLATFORM=adl\;-DSSP_NUM=0\;-DCHANNELS=0" "sof-glk-es8336\;sof-adl-es8336-ssp1\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=0" + "sof-glk-es8336\;sof-adl-es8336-ssp2\;-DPLATFORM=adl\;-DSSP_NUM=2\;-DCHANNELS=0" + "sof-glk-es8336\;sof-adl-es8336-dmic2ch-ssp0\;-DPLATFORM=adl\;-DSSP_NUM=0\;-DCHANNELS=2" + "sof-glk-es8336\;sof-adl-es8336-dmic2ch-ssp1\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=2" + "sof-glk-es8336\;sof-adl-es8336-dmic2ch-ssp2\;-DPLATFORM=adl\;-DSSP_NUM=2\;-DCHANNELS=2" + "sof-glk-es8336\;sof-adl-es8336-dmic4ch-ssp0\;-DPLATFORM=adl\;-DSSP_NUM=0\;-DCHANNELS=4" + "sof-glk-es8336\;sof-adl-es8336-dmic4ch-ssp1\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=4" + "sof-glk-es8336\;sof-adl-es8336-dmic4ch-ssp2\;-DPLATFORM=adl\;-DSSP_NUM=2\;-DCHANNELS=4" + #sof-adl-es8336-ssp1-hdmi-ssp02 supports es8336 codec along with 2xHDMI_over_SSP Capture's. "sof-glk-es8336\;sof-adl-es8336-ssp1-hdmi-ssp02\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=0\;-DHDMI_1_SSP_NUM=0\;-DHDMI_2_SSP_NUM=2" From f4d2f14dd7cb456f47ffccd6383d5be63b668804 Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Tue, 18 Apr 2023 10:24:17 +0800 Subject: [PATCH 043/161] pipeline: try to stop active component when reset When resetting a pipeline, components may be still in active state if previous pipeline walkthrough of stop trigger aborted due to some reason. Here we give it a second chance to stop the component before resetting it. Without doing this, some components like dai could cause DSP panic because the DMA is still running. Signed-off-by: Brent Lu (cherry picked from commit eff50e42625df0a6499b9590984c3f170350c27f) --- src/audio/pipeline/pipeline-graph.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/audio/pipeline/pipeline-graph.c b/src/audio/pipeline/pipeline-graph.c index 68c07b462445..c0dbe6ea0785 100644 --- a/src/audio/pipeline/pipeline-graph.c +++ b/src/audio/pipeline/pipeline-graph.c @@ -325,6 +325,17 @@ static int pipeline_comp_reset(struct comp_dev *current, } } + /* two cases for a component still being active here: + * 1. trigger function failed to handle stop event + * 2. trigger functon skipped due to error of other component's trigger function + */ + if (current->state == COMP_STATE_ACTIVE) { + pipe_warn(current->pipeline, "pipeline_comp_reset(): component is in active state, try to stop it"); + err = comp_trigger(current, COMP_TRIGGER_STOP); + if (err) + pipe_err(current->pipeline, "pipeline_comp_reset(): failed to recover"); + } + err = comp_reset(current); if (err < 0 || err == PPL_STATUS_PATH_STOP) return err; From a1f887b1937858a59878b91fce603c9a398e915a Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Fri, 5 May 2023 15:46:55 +0300 Subject: [PATCH 044/161] intel: ssp: do not read data directly if DMA is active If DMA is active, do not read data directly from the SSP RX fifo. Signed-off-by: Kai Vehmanen (cherry picked from commit e94071fb822b98d03b5ee9687bd4e4f3d2d736bb) --- src/drivers/intel/ssp/ssp.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/drivers/intel/ssp/ssp.c b/src/drivers/intel/ssp/ssp.c index cc30cfba7908..3a2ed6979ef6 100644 --- a/src/drivers/intel/ssp/ssp.c +++ b/src/drivers/intel/ssp/ssp.c @@ -74,9 +74,18 @@ static void ssp_empty_rx_fifo(struct dai *dai) uint64_t sample_ticks = clock_ticks_per_sample(PLATFORM_DEFAULT_CLOCK, ssp->params.fsync_rate); uint32_t retry = SSP_RX_FLUSH_RETRY_MAX; + bool direct_reads = ssp->state[DAI_DIR_CAPTURE] <= COMP_STATE_PREPARE; uint32_t entries; uint32_t i; +#if CONFIG_DMA_SUSPEND_DRAIN + /* + * In drain mode, DMA is stopped before DAI, so flush must be + * always done with direct register read. + */ + direct_reads = true; +#endif + /* * To make sure all the RX FIFO entries are read out for the flushing, * we need to wait a minimal SSP port delay after entries are all read, @@ -87,9 +96,12 @@ static void ssp_empty_rx_fifo(struct dai *dai) while ((ssp_read(dai, SSSR) & SSSR_RNE) && retry--) { entries = SSCR3_RFL_VAL(ssp_read(dai, SSCR3)); dai_dbg(dai, "ssp_empty_rx_fifo(), before flushing, entries %d", entries); - for (i = 0; i < entries + 1; i++) - /* read to try empty fifo */ - ssp_read(dai, SSDR); + + /* let DMA consume data or read RX FIFO directly */ + if (direct_reads) { + for (i = 0; i < entries + 1; i++) + ssp_read(dai, SSDR); + } /* wait to get valid fifo status and re-check */ wait_delay(sample_ticks); From c5a8b6ab3a218b010ef1d6031d43c0769621a5cb Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Fri, 5 May 2023 15:37:22 +0300 Subject: [PATCH 045/161] intel: ssp: drain RX fifo when starting If DMA transaction is ongoing when RX is enabled, this can lead to stuck communication between DMA and SSP (DMA service request not seen by the DMA). To avoid this, flush the RX fifo before enabling SSP RX. Link: https://github.com/thesofproject/sof/issues/7548 Suggested-by: Peter Ujfalusi Signed-off-by: Kai Vehmanen (cherry picked from commit 4a4d8d261907bd900c91d0e64d7458bdb32e4cb3) --- src/drivers/intel/ssp/ssp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/drivers/intel/ssp/ssp.c b/src/drivers/intel/ssp/ssp.c index 3a2ed6979ef6..b0a4296f813d 100644 --- a/src/drivers/intel/ssp/ssp.c +++ b/src/drivers/intel/ssp/ssp.c @@ -962,6 +962,10 @@ static void ssp_early_start(struct dai *dai, int direction) key = k_spin_lock(&dai->lock); + /* RX fifo must be cleared before start */ + if (direction == DAI_DIR_CAPTURE) + ssp_empty_rx_fifo(dai); + /* request mclk/bclk */ ssp_pre_start(dai); From 94efb268e3c8799219ee8d7eb6581e86a92d7206 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 2 May 2023 17:31:28 -0700 Subject: [PATCH 046/161] .github/zephyr: hardcode docker image to v0.23.4 (ZSDK 0.14) This is a release branch, we shouldn't be using any "latest" docker image. Signed-off-by: Marc Herbert --- .github/workflows/zephyr.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/zephyr.yml b/.github/workflows/zephyr.yml index 79be79fb4a9b..5bfb2dec95d5 100644 --- a/.github/workflows/zephyr.yml +++ b/.github/workflows/zephyr.yml @@ -15,11 +15,19 @@ jobs: # From time to time this will catch a git tag and change SOF_VERSION with: {fetch-depth: 10, submodules: recursive} + # v0.23.4 is the last image with Zephyr SDK 0.14. + # SDK 0.15 fails with the following Werror: + # /workdir/zephyrproject/zephyr/include/zephyr/kernel/thread_stack.h:190:16: + # error: ignoring attribute 'section (".cached.\"WEST_TOPDIR/zephyr/kernel/init.c\".3")' + # because it conflicts with previous 'section + # (".cached.\"WEST_TOPDIR/zephyr/arch/xtensa/include/kernel_arch_func.h\"' + # [-Werror=attributes] + # https://github.com/zephyrproject-rtos/docker-image # Note: env variables can be passed to the container with # -e https_proxy=... - name: build run: docker run -v "$(pwd)":/workdir - ghcr.io/zephyrproject-rtos/zephyr-build:latest + ghcr.io/zephyrproject-rtos/zephyr-build:v0.23.4 ./zephyr/docker-build.sh --cmake-args=-DEXTRA_CFLAGS=-Werror --cmake-args=--warn-uninitialized -a From 03cba6283e796f6320e6d0e4bfc93c88f67b52b3 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 2 May 2023 16:40:52 -0700 Subject: [PATCH 047/161] zephyr/docker-build.sh: pass http[s]_proxy variables to the container Support downloads from within the container - notably cloning Zephyr. Similar to commit 424da2cd9d43 ("zephyr/docker: pass http[s]_proxy variables to the container") on the main branch. Signed-off-by: Marc Herbert --- zephyr/docker-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zephyr/docker-build.sh b/zephyr/docker-build.sh index 191fa7b45975..77c7b2875efa 100755 --- a/zephyr/docker-build.sh +++ b/zephyr/docker-build.sh @@ -52,7 +52,7 @@ exec_as_sof_uid() # Double sudo to work around some funny restriction in # zephyr-build:/etc/sudoers: 'user' can do anything but... only as # root. - sudo sudo -u "$sof_user" "$0" "$@" + sudo sudo -u "$sof_user" http_proxy="$http_proxy" https_proxy="$https_proxy" "$0" "$@" exit "$?" } From 78302db21b63e8e660834e7121730da33f8fe78f Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Sat, 17 Sep 2022 00:30:23 +0000 Subject: [PATCH 048/161] .github: extend yamllint line-length to 100 Dropping *.yml change from the original commit cause there is no west.yml in this branch. Signed-off-by: Marc Herbert (cherry picked from commit 3d69a7f69eb63e29f526d502e8d11f4de011a829) --- .github/workflows/codestyle.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 6c0577a093ce..0480d3ead79d 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -53,4 +53,9 @@ jobs: - uses: actions/checkout@v2 - name: run yamllint - run: yamllint --strict .github/workflows/*.yml + # Quoting to please all parsers is hard. This indirection helps. + env: + yamllint_config: '{extends: default, rules: {line-length: {max: 100}}}' + run: yamllint -f parsable + -d "$yamllint_config" + --strict .github/workflows/*.yml From 791ac73ffca0849e52cc50c18b5550f2e50aab3a Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 1 Jun 2022 11:23:54 -0700 Subject: [PATCH 049/161] .github: add new job that builds all DEFAULT_PLATFORMS This will make sure platforms without an open-source toolchain available are added to SUPPORTED_PLATFORMS and do not break the -a option Signed-off-by: Marc Herbert (cherry picked from commit 8a7a1ad76af2deaa37e57fe9f7dfe4690a98a26f) --- .github/workflows/pull-request.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 01639e699845..6f25c475adfc 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -83,6 +83,26 @@ jobs: run: ./scripts/host-testbench.sh + # This is a bit redundant with the other jobs below and with the (much + # faster!) installer[.yml] but it may differ in which platforms are + # built. This makes sure platforms without any open-source toolchain + # are added in the right place and do not accidentally break the -a + # option, Docker testing etc. + gcc-build-default-platforms: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v2 + with: {fetch-depth: 5, submodules: recursive} + + - name: docker + run: docker pull thesofproject/sof && docker tag thesofproject/sof sof + + - name: xtensa-build-all.sh -a + run: ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -a || + ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -a -j 1 + + gcc-build-only: runs-on: ubuntu-20.04 @@ -107,7 +127,7 @@ jobs: - name: docker run: docker pull thesofproject/sof && docker tag thesofproject/sof sof - - name: xtensa-build-all + - name: xtensa-build-all.sh platforms env: PLATFORM: ${{ matrix.platform }} run: ./scripts/docker-run.sh @@ -146,7 +166,7 @@ jobs: - name: docker SOF run: docker pull thesofproject/sof && docker tag thesofproject/sof sof - - name: xtensa-build-all -o no-agent + - name: xtensa-build-all.sh -o no-agent platforms env: PLATFORM: ${{ matrix.platform }} run: ./scripts/docker-run.sh From 0ce528ee5540b65efe818043bccf9c3e59334d0a Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Mon, 5 Dec 2022 10:54:19 -0800 Subject: [PATCH 050/161] .github/workflows: upgrade actions/checkout@v2 -> v3 This should get rid of most warnings in daily tests ``` Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/ 2022-09-22-github-actions-all-actions-will-begin-running-on-node16... Please update the following actions to use Node.js 16: actions/checkout@v2 ``` Example at https://github.com/thesofproject/sof/actions/runs/3597808171 v3 seems backward compatible. Upgrade only the most used instances for now (most used because of the `matrix` of platforms), upgrade everything in a few days if no issue is spotted. Signed-off-by: Marc Herbert (cherry picked from commit f71eb15818fd43d9ecd16a73fe58e2983e527ecb) --- .github/workflows/pull-request.yml | 4 ++-- .github/workflows/zephyr.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 6f25c475adfc..ac7ab33abe70 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -92,7 +92,7 @@ jobs: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: {fetch-depth: 5, submodules: recursive} - name: docker @@ -121,7 +121,7 @@ jobs: steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: {fetch-depth: 0, submodules: recursive} - name: docker diff --git a/.github/workflows/zephyr.yml b/.github/workflows/zephyr.yml index 5bfb2dec95d5..737313368204 100644 --- a/.github/workflows/zephyr.yml +++ b/.github/workflows/zephyr.yml @@ -11,7 +11,7 @@ jobs: zephyr-build: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # From time to time this will catch a git tag and change SOF_VERSION with: {fetch-depth: 10, submodules: recursive} From c22378c04a691c8238f4b46f2d79672b37ef0f37 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Fri, 16 Dec 2022 15:26:13 -0800 Subject: [PATCH 051/161] .github/pull-request.yml: upgrade checkout v2 -> v3 This upgrade was already performed for other jobs in commit f71eb15818fd (".github/workflows: upgrade actions/checkout@v2 -> v3") and everything went fine. Finish the job and get rid of the last warnings in the daily tests (example: https://github.com/thesofproject/sof/actions/runs/3709176785) stable-v2.2: dropped sof-docs action which does not exist in this branch. Signed-off-by: Marc Herbert (cherry picked from commit 2ea4bc0ec43c0da1646eaaaec6cc73d6bd513097) --- .github/workflows/pull-request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index ac7ab33abe70..531cbd05a677 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -40,7 +40,7 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: apt get doxygen graphviz run: sudo apt-get -y install ninja-build doxygen graphviz @@ -156,7 +156,7 @@ jobs: steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: {fetch-depth: 0, submodules: recursive} - name: turn off HAVE_AGENT From 7fd3788385674731528210116d9c3c84a1a36234 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 2 May 2023 13:21:55 -0700 Subject: [PATCH 052/161] .github: upgrade all checkout actions to v3 Search and replace checkout@v2 with checkout@v3. This finally gets rid of all warnings "Node.js 12 actions are deprecated". We've been using v3 in a few other places and never met any backwards compatibility issue. Fixed testbench.yml conflict, still embedded in pull-request.yml Signed-off-by: Marc Herbert (cherry picked from commit 65a68b7c313ed4fea266902c8f6945c3d4079293) --- .github/workflows/codestyle.yml | 4 ++-- .github/workflows/installer.yml | 2 +- .github/workflows/pull-request.yml | 2 +- .github/workflows/repro-build.yml | 2 +- .github/workflows/tools.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 0480d3ead79d..3cb568999b39 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -27,7 +27,7 @@ jobs: # depth 2 so: # ^1. we can show the Subject of the current target branch tip # ^2. we reconnect/graft to the later fetch pull/1234/head, - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: {fetch-depth: 2} - name: install codespell @@ -50,7 +50,7 @@ jobs: yamllint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: run yamllint # Quoting to please all parsers is hard. This indirection helps. diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index 178c090f89d9..2b0601d9ef37 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -28,7 +28,7 @@ jobs: ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # From time to time this will catch a git tag and change SOF_VERSION with: {fetch-depth: 50, submodules: recursive} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 531cbd05a677..3a06f122765a 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -58,7 +58,7 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: {fetch-depth: 5} - name: apt get valgrind diff --git a/.github/workflows/repro-build.yml b/.github/workflows/repro-build.yml index c3090154b608..4325467123ce 100644 --- a/.github/workflows/repro-build.yml +++ b/.github/workflows/repro-build.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: {fetch-depth: 5, submodules: recursive} - name: docker pull diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 5be87125a8ba..670d67ad9627 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -12,7 +12,7 @@ jobs: top-level_default_CMake_target_ALL: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # The ALSA version in Ubuntu 20.04 is buggy # (https://github.com/thesofproject/sof/issues/2543) and likely diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 9bbe004092ea..bc1619fda3b5 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -14,7 +14,7 @@ jobs: cmocka_utests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: {fetch-depth: 2} - name: build and run all defconfigs From 06a52cd93cd36eb8ffea76e39bd36c1bf24656d0 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Thu, 1 Sep 2022 16:40:08 +0000 Subject: [PATCH 053/161] scripts/docker-run.sh: fix wrong "id -n" command -> "id -u" Fixes commit d09844ab98cc ("zephyr/docker-build.sh: match UID with 'adduser' instead of 'chgrp -R'") Signed-off-by: Marc Herbert (cherry picked from commit dfc6b46e1d52624fa95e9ecb630be9a8843b36b0) --- scripts/docker-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/docker-run.sh b/scripts/docker-run.sh index 96034cf27359..58dd16b594b4 100755 --- a/scripts/docker-run.sh +++ b/scripts/docker-run.sh @@ -27,7 +27,7 @@ fi # Not fatal, just a warning to allow other "creative" solutions. # TODO: fix this with 'adduser' like in zephyr/docker-build.sh -test "$(id -n)" = 1001 || +test "$(id -u)" = 1001 || >&2 printf "Warning: this script should be run as user ID 1001 to match the container\n" set -x From df10f9f9ce0c4ea056739f3d31819050b8e1a7c2 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 5 Oct 2022 22:09:31 -0700 Subject: [PATCH 054/161] Add new sudo-cwd.sh - partial cherry-pick from main branch. sudo-cwd.sh was developed on the main branch for zephyr but now we want to re-use it for building topologies. Cherry-pick only that script, not the zephyr parts. Original commit message: Besides making things more obvious, the important functional change is that the user switch is now performed for _every_ invoked, command, not just for the build command. Signed-off-by: Marc Herbert (cherry picked from commit 027be9837173444c6c92d5b331a3c75a0769c7bf) --- scripts/sudo-cwd.sh | 73 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100755 scripts/sudo-cwd.sh diff --git a/scripts/sudo-cwd.sh b/scripts/sudo-cwd.sh new file mode 100755 index 000000000000..c8499fbf05fb --- /dev/null +++ b/scripts/sudo-cwd.sh @@ -0,0 +1,73 @@ +#!/bin/sh +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2022 Intel Corporation. All rights reserved. + +# This is a "brute force" solution to filesystem permission issues: +# +# If the current user does not own the current directory then this +# wrapper script switches to the user who does own the current directory +# before running the given command. + +# If no user owns the current directory, a user who does gets created +# first! + +# The main use case is to run this first thing inside a container to +# solve file ownership mismatches. + +# `docker run --user=$(id -un) ...` achieves something very similar +# without any code except the resulting user many not exist inside the +# container. Some commands may not like that. +# +# To understand more about the Docker problem solved here take a look at +# https://stackoverflow.com/questions/35291520/docker-and-userns-remap-how-to-manage-volume-permissions-to-share-data-betwee +# and many other similar questions. + +# TODO: replace sudo with gosu? + +set -e +set -x + +# TODO: rename the "sof_" bits + +main() +{ + sof_uid="$(stat --printf='%u' .)" + local current_uid; current_uid="$(id -u)" + if test "$current_uid" = "$sof_uid"; then + exec "$@" + else + exec_as_sof_uid "$@" + fi +} + +exec_as_sof_uid() +{ + # Add new container user matching the host user owning the SOF + # checkout + local sof_user; sof_user="$(id "$sof_uid")" || { + sof_user=sof_zephyr_docker_builder + + local sof_guid; sof_guid="$(stat --printf='%g' .)" + + getent group "$sof_guid" || + sudo groupadd -g "$sof_guid" sof_zephyr_docker_group + + sudo useradd -m -u "$sof_uid" -g "$sof_guid" "$sof_user" + + local current_user; current_user="$(id -un)" + + # Copy sudo permissions just in case the build needs it + sudo sed -e "s/$current_user/$sof_user/" /etc/sudoers.d/"$current_user" | + sudo tee -a /etc/sudoers.d/"$sof_user" + sudo chmod --reference=/etc/sudoers.d/"$current_user" \ + /etc/sudoers.d/"$sof_user" + } + + # Double sudo to work around some funny restriction in + # zephyr-build:/etc/sudoers: 'user' can do anything but... only as + # root. + sudo sudo -u "$sof_user" REAL_CC="$REAL_CC" "$@" + exit "$?" +} + +main "$@" From 22e4be5714f268caf9b9b241129ae004672acc62 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 5 Oct 2022 22:34:38 -0700 Subject: [PATCH 055/161] sudo-cwd.sh: drop the all 'sof_' prefixes and references This script is now generic. This was not done earlier to be gentle on git blame. Signed-off-by: Marc Herbert (cherry picked from commit 0a4b1d62d5b31b41699b5df60f837bf53326292a) --- scripts/sudo-cwd.sh | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/scripts/sudo-cwd.sh b/scripts/sudo-cwd.sh index c8499fbf05fb..2901fd95ee77 100755 --- a/scripts/sudo-cwd.sh +++ b/scripts/sudo-cwd.sh @@ -27,46 +27,43 @@ set -e set -x -# TODO: rename the "sof_" bits - main() { - sof_uid="$(stat --printf='%u' .)" + cwd_uid="$(stat --printf='%u' .)" local current_uid; current_uid="$(id -u)" - if test "$current_uid" = "$sof_uid"; then + if test "$current_uid" = "$cwd_uid"; then exec "$@" else - exec_as_sof_uid "$@" + exec_as_cwd_uid "$@" fi } -exec_as_sof_uid() +exec_as_cwd_uid() { - # Add new container user matching the host user owning the SOF - # checkout - local sof_user; sof_user="$(id "$sof_uid")" || { - sof_user=sof_zephyr_docker_builder + # If missing, add new user owning the current directory + local cwd_user; cwd_user="$(id "$cwd_uid")" || { + cwd_user='cwd_user' - local sof_guid; sof_guid="$(stat --printf='%g' .)" + local cwd_guid; cwd_guid="$(stat --printf='%g' .)" - getent group "$sof_guid" || - sudo groupadd -g "$sof_guid" sof_zephyr_docker_group + getent group "$cwd_guid" || + sudo groupadd -g "$cwd_guid" 'cwd_group' - sudo useradd -m -u "$sof_uid" -g "$sof_guid" "$sof_user" + sudo useradd -m -u "$cwd_uid" -g "$cwd_guid" "$cwd_user" local current_user; current_user="$(id -un)" # Copy sudo permissions just in case the build needs it - sudo sed -e "s/$current_user/$sof_user/" /etc/sudoers.d/"$current_user" | - sudo tee -a /etc/sudoers.d/"$sof_user" + sudo sed -e "s/$current_user/$cwd_user/" /etc/sudoers.d/"$current_user" | + sudo tee -a /etc/sudoers.d/"$cwd_user" sudo chmod --reference=/etc/sudoers.d/"$current_user" \ - /etc/sudoers.d/"$sof_user" + /etc/sudoers.d/"$cwd_user" } # Double sudo to work around some funny restriction in # zephyr-build:/etc/sudoers: 'user' can do anything but... only as # root. - sudo sudo -u "$sof_user" REAL_CC="$REAL_CC" "$@" + sudo sudo -u "$cwd_user" REAL_CC="$REAL_CC" "$@" exit "$?" } From 8a14228e348d3b099fba63621fae4555ee3e6a75 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 5 Oct 2022 22:15:36 -0700 Subject: [PATCH 056/161] scripts/docker-run.sh: fix wrong uid in warning 1001 -> 1000 Fixes commit d09844ab98cc ("zephyr/docker-build.sh: match UID with 'adduser' instead of 'chgrp -R'") Also clarify comment and add reference to new sudo-cwd.sh script. Signed-off-by: Marc Herbert (cherry picked from commit c28400baaa383030f0e6860e922365a79e51c31a) --- scripts/docker-run.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/docker-run.sh b/scripts/docker-run.sh index 58dd16b594b4..21e2919db194 100755 --- a/scripts/docker-run.sh +++ b/scripts/docker-run.sh @@ -25,10 +25,12 @@ if tty --quiet; then SOF_DOCKER_RUN="$SOF_DOCKER_RUN --tty" fi -# Not fatal, just a warning to allow other "creative" solutions. -# TODO: fix this with 'adduser' like in zephyr/docker-build.sh -test "$(id -u)" = 1001 || - >&2 printf "Warning: this script should be run as user ID 1001 to match the container\n" +# The --user option below can cause the command to run as a user who +# does not exist in the container. So far so good but in case something +# ever goes wrong try replacing --user with the newer +# scripts/sudo-cwd.sh script. +test "$(id -u)" = 1000 || + >&2 printf "Warning: this script should be run as user ID 1000 to match the container's account\n" set -x docker run -i -v "${SOF_TOP}":/home/sof/work/sof.git \ From dbcf7e18564cede175269ee228aa2357067ba352 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Thu, 15 Dec 2022 02:33:35 +0000 Subject: [PATCH 057/161] zephyr/docker: pass http[s]_proxy variables to the container Support downloads from within the container. Signed-off-by: Marc Herbert (cherry picked from commit 424da2cd9d436ed42a8323b0200d0401e6be7f84) --- scripts/sudo-cwd.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/sudo-cwd.sh b/scripts/sudo-cwd.sh index 2901fd95ee77..2c4d859345d8 100755 --- a/scripts/sudo-cwd.sh +++ b/scripts/sudo-cwd.sh @@ -63,7 +63,12 @@ exec_as_cwd_uid() # Double sudo to work around some funny restriction in # zephyr-build:/etc/sudoers: 'user' can do anything but... only as # root. - sudo sudo -u "$cwd_user" REAL_CC="$REAL_CC" "$@" + # Passing empty http[s]_proxy is OK + # shellcheck disable=SC2154 + sudo sudo -u "$cwd_user" REAL_CC="$REAL_CC" \ + http_proxy="$http_proxy" https_proxy="$https_proxy" \ + "$@" + exit "$?" } From 73f908f16cab60ab4d56220f40dffca68c99ab80 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Fri, 6 Jan 2023 01:22:00 +0000 Subject: [PATCH 058/161] scripts/sudo-cwd.sh: don't try to copy missing sudoers.d/ permissions Copying a file that does not exist obviously fails. This bug was found when trying to switch from the current "Developer Image" to the smaller "CI Image": https://github.com/zephyrproject-rtos/docker-image zephyr-build Signed-off-by: Marc Herbert (cherry picked from commit 75fa04de091581eb182cf4e25f7251ef9e15ebf4) --- scripts/sudo-cwd.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/sudo-cwd.sh b/scripts/sudo-cwd.sh index 2c4d859345d8..2823cf2f6c73 100755 --- a/scripts/sudo-cwd.sh +++ b/scripts/sudo-cwd.sh @@ -54,10 +54,12 @@ exec_as_cwd_uid() local current_user; current_user="$(id -un)" # Copy sudo permissions just in case the build needs it - sudo sed -e "s/$current_user/$cwd_user/" /etc/sudoers.d/"$current_user" | + if test -e /etc/sudoers.d/"$current_user"; then + sudo sed -e "s/$current_user/$cwd_user/" /etc/sudoers.d/"$current_user" | sudo tee -a /etc/sudoers.d/"$cwd_user" - sudo chmod --reference=/etc/sudoers.d/"$current_user" \ + sudo chmod --reference=/etc/sudoers.d/"$current_user" \ /etc/sudoers.d/"$cwd_user" + fi } # Double sudo to work around some funny restriction in From 4bf9059154c42b552165b1747d7eaf629278fb00 Mon Sep 17 00:00:00 2001 From: Fred Oh Date: Fri, 28 Apr 2023 08:01:07 -0700 Subject: [PATCH 059/161] scripts/docker-run.sh: run with sudo-cwd.sh There is a UID mistmatch and file permission problem. sudo-cwd.sh will switch id every docker run command. Commit 80e9c3454a0a ("scripts/docker-run.sh: run with sudo-cwd.sh") was reverted due to missing a toolchain. Signed-off-by: Fred Oh (cherry picked from commit 745d4ccd8bbf5509fd3af6218f663441d5b18862) --- scripts/docker-run.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/docker-run.sh b/scripts/docker-run.sh index 21e2919db194..4b3d64fe1c12 100755 --- a/scripts/docker-run.sh +++ b/scripts/docker-run.sh @@ -33,6 +33,8 @@ test "$(id -u)" = 1000 || >&2 printf "Warning: this script should be run as user ID 1000 to match the container's account\n" set -x +# FIXME: During the transition to sudo-cwd.sh, the tag will be "latest_ubuntu22.04". +# Later it will be back to latest docker run -i -v "${SOF_TOP}":/home/sof/work/sof.git \ -v "${SOF_TOP}":/home/sof/work/sof-bind-mount-DO-NOT-DELETE \ --env CMAKE_BUILD_TYPE \ @@ -42,6 +44,5 @@ docker run -i -v "${SOF_TOP}":/home/sof/work/sof.git \ --env VERBOSE \ --env http_proxy="$http_proxy" \ --env https_proxy="$https_proxy" \ - --user "$(id -u)" \ $SOF_DOCKER_RUN \ - thesofproject/sof "$@" + thesofproject/sof:latest_ubuntu22.04 ./scripts/sudo-cwd.sh "$@" From e4cd66bac21643a0b60e9c72e5f71094859c8f1f Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 1 Jun 2023 11:14:39 +0300 Subject: [PATCH 060/161] platform: tigerlake: Correct SSP FIFO depth value The actual FIFO depth in Tiger Lake platforms is 32 and not 16. Signed-off-by: Peter Ujfalusi --- src/platform/tigerlake/include/platform/platform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/tigerlake/include/platform/platform.h b/src/platform/tigerlake/include/platform/platform.h index 75848cf282f6..169f69833237 100644 --- a/src/platform/tigerlake/include/platform/platform.h +++ b/src/platform/tigerlake/include/platform/platform.h @@ -81,7 +81,7 @@ struct timer; #define PLATFORM_FORCE_L1_EXIT_TIME 985 /* the SSP port fifo depth */ -#define SSP_FIFO_DEPTH 16 +#define SSP_FIFO_DEPTH 32 /* the watermark for the SSP fifo depth setting */ #define SSP_FIFO_WATERMARK 8 From 69d56a757740274a6f2ccf17fc77c4188f17fc01 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Wed, 31 May 2023 11:32:46 +0300 Subject: [PATCH 061/161] intel: ssp: Revise receive FIFO draining The receive FIFO needs to be drained in a different way depending when it is done. - before start If the RX FIFO is in overflow state then we must read all the entries out to empty it (it was after all full). - before stop The DMA might be already running to read out data. Check the FIFO level change in one sample time which gives us the needed information to decide to wait for another loop for the DMA burst to finish, wait for the DMA to start it's burst (DMA request was asserted) or drain the FIFO directly. No need to drain the RX fifo at probe time. Signed-off-by: Peter Ujfalusi --- src/drivers/intel/ssp/ssp.c | 91 +++++++++++++++++++++++-------------- 1 file changed, 57 insertions(+), 34 deletions(-) diff --git a/src/drivers/intel/ssp/ssp.c b/src/drivers/intel/ssp/ssp.c index b0a4296f813d..d0162e61dae1 100644 --- a/src/drivers/intel/ssp/ssp.c +++ b/src/drivers/intel/ssp/ssp.c @@ -67,49 +67,74 @@ static void ssp_empty_tx_fifo(struct dai *dai) ssp_write(dai, SSSR, sssr); } -/* empty SSP receive FIFO */ -static void ssp_empty_rx_fifo(struct dai *dai) +static void ssp_empty_rx_fifo_on_start(struct dai *dai) +{ + uint32_t retry = SSP_RX_FLUSH_RETRY_MAX; + uint32_t i, sssr; + + sssr = ssp_read(dai, SSSR); + + if (sssr & SSSR_ROR) { + /* The RX FIFO is in overflow condition, empty it */ + for (i = 0; i < SSP_FIFO_DEPTH; i++) + ssp_read(dai, SSDR); + + /* Clear the overflow status */ + ssp_update_bits(dai, SSSR, SSSR_ROR, SSSR_ROR); + /* Re-read the SSSR register */ + sssr = ssp_read(dai, SSSR); + } + + while ((sssr & SSSR_RNE) && retry--) { + uint32_t entries = SSCR3_RFL_VAL(ssp_read(dai, SSCR3)); + + /* Empty the RX FIFO (the DMA is not running at this point) */ + for (i = 0; i < entries + 1; i++) + ssp_read(dai, SSDR); + + sssr = ssp_read(dai, SSSR); + } +} + +static void ssp_empty_rx_fifo_on_stop(struct dai *dai) { struct ssp_pdata *ssp = dai_get_drvdata(dai); uint64_t sample_ticks = clock_ticks_per_sample(PLATFORM_DEFAULT_CLOCK, ssp->params.fsync_rate); uint32_t retry = SSP_RX_FLUSH_RETRY_MAX; - bool direct_reads = ssp->state[DAI_DIR_CAPTURE] <= COMP_STATE_PREPARE; - uint32_t entries; - uint32_t i; + uint32_t entries[2]; + uint32_t i, sssr; -#if CONFIG_DMA_SUSPEND_DRAIN - /* - * In drain mode, DMA is stopped before DAI, so flush must be - * always done with direct register read. - */ - direct_reads = true; -#endif + sssr = ssp_read(dai, SSSR); + entries[0] = SSCR3_RFL_VAL(ssp_read(dai, SSCR3)); - /* - * To make sure all the RX FIFO entries are read out for the flushing, - * we need to wait a minimal SSP port delay after entries are all read, - * and then re-check to see if there is any subsequent entries written - * to the FIFO. This will help to make sure there is no sample mismatched - * issue for the next run with the SSP RX. - */ - while ((ssp_read(dai, SSSR) & SSSR_RNE) && retry--) { - entries = SSCR3_RFL_VAL(ssp_read(dai, SSCR3)); - dai_dbg(dai, "ssp_empty_rx_fifo(), before flushing, entries %d", entries); + while ((sssr & SSSR_RNE) && retry--) { + /* Wait one sample time */ + wait_delay(sample_ticks); - /* let DMA consume data or read RX FIFO directly */ - if (direct_reads) { - for (i = 0; i < entries + 1; i++) + entries[1] = SSCR3_RFL_VAL(ssp_read(dai, SSCR3)); + sssr = ssp_read(dai, SSSR); + + if (entries[0] > entries[1]) { + /* + * The DMA is reading the FIFO, check the status in the + * next loop + */ + entries[0] = entries[1]; + } else if (!(sssr & SSSR_RFS)) { + /* + * The DMA request is not asserted, read the FIFO + * directly, otherwise let the next loop iteration to + * check the status + */ + for (i = 0; i < entries[1] + 1; i++) ssp_read(dai, SSDR); } - /* wait to get valid fifo status and re-check */ - wait_delay(sample_ticks); - entries = SSCR3_RFL_VAL(ssp_read(dai, SSCR3)); - dai_dbg(dai, "ssp_empty_rx_fifo(), after flushing, entries %d", entries); + sssr = ssp_read(dai, SSSR); } - /* clear interrupt */ + /* Just in case clear the overflow status */ ssp_update_bits(dai, SSSR, SSSR_ROR, SSSR_ROR); } @@ -964,7 +989,7 @@ static void ssp_early_start(struct dai *dai, int direction) /* RX fifo must be cleared before start */ if (direction == DAI_DIR_CAPTURE) - ssp_empty_rx_fifo(dai); + ssp_empty_rx_fifo_on_start(dai); /* request mclk/bclk */ ssp_pre_start(dai); @@ -1045,7 +1070,7 @@ static void ssp_stop(struct dai *dai, int direction) if (direction == DAI_DIR_CAPTURE && ssp->state[SOF_IPC_STREAM_CAPTURE] != COMP_STATE_PREPARE) { ssp_update_bits(dai, SSRSA, SSRSA_RXEN, 0); - ssp_empty_rx_fifo(dai); + ssp_empty_rx_fifo_on_stop(dai); ssp->state[SOF_IPC_STREAM_CAPTURE] = COMP_STATE_PREPARE; dai_info(dai, "ssp_stop(), RX stop"); } @@ -1147,8 +1172,6 @@ static int ssp_probe(struct dai *dai) /* Disable dynamic clock gating before touching any register */ pm_runtime_get_sync(SSP_CLK, dai->index); - ssp_empty_rx_fifo(dai); - return 0; } From 3ddd15caa4822e0556cd26580905c7cc21ef6043 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 13 Jun 2023 13:27:18 -0700 Subject: [PATCH 062/161] .github: disable fuzzing This is a partial fix for #7709; doc updates still to be done. Quoting @cujomalainey in - #7699 > I still don't see the benefit here. This branch and IPC3 are mostly > stable/archived. Hence anything we fuzz on main we should be able to > cherry-pick down. Nothing new should be landing on this branch so I > don't see the benefit of continued fuzzing past support on main. Quoting @andyross in - #7675 > I guess my gut says that fuzzing is a technique for validation of > new code. It has minimal (but sure, not zero) value on maintenance > branches that are expected to be protocol-compatible in perpetuity. Signed-off-by: Marc Herbert --- .github/workflows/ipc_fuzzer.yml | 42 -------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 .github/workflows/ipc_fuzzer.yml diff --git a/.github/workflows/ipc_fuzzer.yml b/.github/workflows/ipc_fuzzer.yml deleted file mode 100644 index 036cbc82f37e..000000000000 --- a/.github/workflows/ipc_fuzzer.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- - -# For the actual fuzzer see tools/oss-fuzz/README. -# also see -# https://google.github.io/oss-fuzz/getting-started/continuous-integration/ -# -# Build and run fuzzer for 5s just to check that it runs properly. If it -# consistently fails in under 5s you probably did something wrong - -# If you came here to quickly copy/paste the invocation of some build -# script in order to reproduce a failure reported by github then you -# will be disappointed by the Github Action below: it's magical. For a -# thorough reproduction you must follow the links above. For a quick, -# dirty and incomplete reproduction hack you can try the following two -# lines. Don't do this at home. -# -# OUT=unused_dir cmake -B oss-fuzz-build/ -S tools/oss-fuzz/ -# make -j -C oss-fuzz-build sof_ep fuzz_ipc.o - -name: IPC fuzzer compile test - -# 'workflow_dispatch' allows running this workflow manually from the -# 'Actions' tab - -# yamllint disable-line rule:truthy -on: [pull_request, workflow_dispatch] - -jobs: - ipc-fuzzer-build: - runs-on: ubuntu-latest - steps: - - name: Build Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master - with: - oss-fuzz-project-name: 'sound-open-firmware' - - - name: Run Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master - with: - oss-fuzz-project-name: 'sound-open-firmware' - language: c - fuzz-seconds: 5 From f2b74168146dbfcc6ce601ad5ed46b57ba20428e Mon Sep 17 00:00:00 2001 From: apoorv Date: Thu, 4 May 2023 10:39:56 +0530 Subject: [PATCH 063/161] topology1: CMakeLists: add RPLP CRB support for SoundWire Added RPLP CRB support for SoundWire0 and SoundWire2 Signed-off-by: apoorv (cherry picked from commit 5fa9cb6be4cb0648293fee7fcc2939fec83668d6) --- tools/topology/topology1/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 596df65911ba..26ce1b501442 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -131,6 +131,8 @@ set(TPLGS "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l0-rt1316-l13-rt714-l2\;-DPLATFORM=adl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=3\;-DEXT_AMP_REF\;-DMIC_LINK=2" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DNOAMP\;-DNO_LOCAL_MIC" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DNOAMP\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" From 7ef5d2ba00cebc22c4073fc78a114ea1b345f083 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Thu, 25 May 2023 15:37:35 -0500 Subject: [PATCH 064/161] topology1: add Dell SKU 0BDA support Yet another missing topology This needs to be back-ported to the 2.2 stable branch for releases Closes: https://github.com/thesofproject/linux/issues/4380 Signed-off-by: Pierre-Louis Bossart (cherry picked from commit 3d54d14f3ff4b56f03416b6a33e806a721db15c3) --- tools/topology/topology1/CMakeLists.txt | 1 + tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 26ce1b501442..506795ae0c1f 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -135,6 +135,7 @@ set(TPLGS "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DNOAMP\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index d4afa25a6e26..dd9c2551a5ad 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -36,6 +36,7 @@ set(TPLGS_UP "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" From f072c5efb65a3c3dbf2be7928e1f93a0ab2ecef4 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Thu, 1 Jun 2023 10:59:40 -0500 Subject: [PATCH 065/161] topology1: add support for Dell SKU 0934 Yet another permutation. This needs to be back-ported to 2.2 releases Closes: https://github.com/thesofproject/linux/issues/4399 Signed-off-by: Pierre-Louis Bossart (cherry picked from commit 058e6571a5a36dd8eaef37981ea39606f1527c9c) --- tools/topology/topology1/CMakeLists.txt | 1 + tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 506795ae0c1f..66dff428e304 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -151,6 +151,7 @@ set(TPLGS ## end SoundWire topologies ## SoundWire NOJACK topologies + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l1-mono-rt714-l0\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=0" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l0\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l12-rt714-l0\;-DPLATFORM=adl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l3\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index dd9c2551a5ad..d28cba3d19ce 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -53,6 +53,7 @@ set(TPLGS_UP ## end SoundWire topologies ## SoundWire NOJACK topologies + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l1-mono-rt714-l0\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=0" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l0\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l12-rt714-l0\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l3\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" From 9b73ec861a1a044e5aac2927f4230587cc3a472c Mon Sep 17 00:00:00 2001 From: Mengdong Lin Date: Wed, 28 Jun 2023 21:00:44 -0400 Subject: [PATCH 066/161] topology1: add comments to separate Intel x86 and NXP imx platforms This is necessary to avoid conflict when cherry picking Intel topology1 updates from main to stable-v2.2 branch. Signed-off-by: Mengdong Lin --- tools/topology/topology1/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 66dff428e304..f8aa392f87c4 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -289,6 +289,7 @@ set(TPLGS #sof-adl-es8336-ssp1-hdmi-ssp02 supports es8336 codec along with 2xHDMI_over_SSP Capture's. "sof-glk-es8336\;sof-adl-es8336-ssp1-hdmi-ssp02\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=0\;-DHDMI_1_SSP_NUM=0\;-DHDMI_2_SSP_NUM=2" + ## i.MX8 (i.MX8QM and i.MX8QXP) topologies "sof-imx8-nocodec\;sof-imx8-nocodec" "sof-imx8-cs42888\;sof-imx8-cs42888" "sof-imx8-nocodec-sai\;sof-imx8-nocodec-sai" From b3f1dc34bf07f4d3ee8a1ac6385d045155391a30 Mon Sep 17 00:00:00 2001 From: Balamurugan C Date: Thu, 8 Jun 2023 16:53:45 +0530 Subject: [PATCH 067/161] topology1: add support for rt1308 ssp amp + HDMI-in capture. Adding support for rt1308 ssp amplifier and HDMI-in capture via I2S. Signed-off-by: Balamurugan C (cherry picked from commit d0dbfd62caea406eda6faeec814b9309b12a87ac) --- tools/topology/topology1/CMakeLists.txt | 3 + .../topology1/sof-tgl-rt1308-hdmi-ssp.m4 | 219 ++++++++++++++++++ 2 files changed, 222 insertions(+) create mode 100644 tools/topology/topology1/sof-tgl-rt1308-hdmi-ssp.m4 diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index f8aa392f87c4..d6fde07cef7d 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -289,6 +289,9 @@ set(TPLGS #sof-adl-es8336-ssp1-hdmi-ssp02 supports es8336 codec along with 2xHDMI_over_SSP Capture's. "sof-glk-es8336\;sof-adl-es8336-ssp1-hdmi-ssp02\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=0\;-DHDMI_1_SSP_NUM=0\;-DHDMI_2_SSP_NUM=2" + #To support HDMI-in capture with RT1308 ssp-amplifier products. + "sof-tgl-rt1308-hdmi-ssp\;sof-tgl-rt1308-ssp2-hdmi-ssp15\;-DAMP_SSP_NUM=2\;-DHDMI_1_SSP_NUM=1\;-DHDMI_2_SSP_NUM=5\;-DPLATFORM=tgl" + ## i.MX8 (i.MX8QM and i.MX8QXP) topologies "sof-imx8-nocodec\;sof-imx8-nocodec" "sof-imx8-cs42888\;sof-imx8-cs42888" diff --git a/tools/topology/topology1/sof-tgl-rt1308-hdmi-ssp.m4 b/tools/topology/topology1/sof-tgl-rt1308-hdmi-ssp.m4 new file mode 100644 index 000000000000..a10cd51c05f8 --- /dev/null +++ b/tools/topology/topology1/sof-tgl-rt1308-hdmi-ssp.m4 @@ -0,0 +1,219 @@ +# +# Topology for Tigerlake with rt1308 codec + DMIC + 3 HDMI out + 2 HDMI-in capture +# + +# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4') +include(`ssp.m4') +include(`hda.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Tigerlake DSP configuration +include(`platform/intel/'PLATFORM`.m4') +include(`platform/intel/dmic.m4') + +define(`HDMI1_SSP_NAME', concat(concat(`SSP', HDMI_1_SSP_NUM),`-HDMI')) +define(`HDMI2_SSP_NAME', concat(concat(`SSP', HDMI_2_SSP_NUM),`-HDMI')) +define(`AMP_SSP_NAME', concat(concat(`SSP', AMP_SSP_NUM),`-Codec')) + +ifdef(`NO_AMP',`',` +ifdef(`AMP_SSP_NUM',`',`fatal_error(note: Define AMP_SSP_NUM for speaker amp SSP)')') + +DEBUG_START +# +# Define the pipelines +# +# PCM0 <---- volume <----- HDMI-1 SSP +# PCM1 <---- volume <----- HDMI-2 SSP +# PCM2 ----> volume -----> Codec SSP +# PCM3 <---- volume <----- DMIC01 (dmic0 capture) +# + +# PCM5 ----> volume (pipe 5) -----> iDisp1 (HDMI/DP playback, BE link 5) +# PCM6 ----> Volume (pipe 6) -----> iDisp2 (HDMI/DP playback, BE link 6) +# PCM7 ----> volume (pipe 7) -----> iDisp3 (HDMI/DP playback, BE link 7) + + +dnl PIPELINE_PCM_ADD(pipeline, +dnl pipe id, pcm, max channels, format, +dnl frames, deadline, priority, core) + +# Low Latency capture pipeline 1 on PCM 0 using max 2 channels of s16le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, + 1, 0, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + + +# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s16le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, + 2, 1, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +ifdef(`NO_AMP',`',` +# Low Latency playback pipeline 3 on PCM 2 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 3, 2, 2, s24le, + 1000, 0, 0, + 48000, 48000, 48000)') + +# Passthrough capture pipeline 4 on PCM 3 using max 4 channels. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, + 4, 3, 4, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +# Low Latency playback pipeline 5 on PCM 5 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 5, 5, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +# Low Latency playback pipeline 6 on PCM 6 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 6, 6, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +# Low Latency playback pipeline 7 on PCM 7 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 7, 7, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +# +# DAIs configuration +# + +dnl DAI_ADD(pipeline, +dnl pipe id, dai type, dai_index, dai_be, +dnl buffer, periods, format, +dnl frames, deadline, priority, core) + +# capture DAI using 2 periods +# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4, + 1, SSP, HDMI_1_SSP_NUM, HDMI1_SSP_NAME, + PIPELINE_SINK_1, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# capture DAI using 2 periods +# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4, + 2, SSP, HDMI_2_SSP_NUM, HDMI2_SSP_NAME, + PIPELINE_SINK_2, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +ifdef(`NO_AMP',`',` +# playback DAI using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 3, SSP, AMP_SSP_NUM, AMP_SSP_NAME, + PIPELINE_SOURCE_3, 2, s24le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)') + +# capture DAI is DMIC01 using 2 periods +# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4, + 4, DMIC, 0, dmic01, + PIPELINE_SINK_4, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# playback DAI is iDisp1 using 2 periods +# Buffers use s32le format, 1000us deadline with priority 0 on core 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 5, HDA, 5, iDisp1, + PIPELINE_SOURCE_5, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# playback DAI is iDisp2 using 2 periods +# Buffers use s32le format, 1000us deadline with priority 0 on core 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 6, HDA, 6, iDisp2, + PIPELINE_SOURCE_6, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# playback DAI is iDisp3 using 2 periods +# Buffers use s32le format, 1000us deadline with priority 0 on core 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 7, HDA, 7, iDisp3, + PIPELINE_SOURCE_7, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# PCM Low Latency, id 0 +dnl PCM_CAPTURE_ADD(name, pcm_id, capture) +PCM_CAPTURE_ADD(HDMI-IN-1, 0, PIPELINE_PCM_1) + +dnl PCM_CAPTURE_ADD(name, pcm_id, capture) +PCM_CAPTURE_ADD(HDMI-IN-2, 1, PIPELINE_PCM_2) + +ifdef(`NO_AMP',`',` +dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) +PCM_PLAYBACK_ADD(Speaker, 2, PIPELINE_PCM_3)') +PCM_CAPTURE_ADD(DMIC01, 3, PIPELINE_PCM_4) + +PCM_PLAYBACK_ADD(HDMI 1, 5, PIPELINE_PCM_5) +PCM_PLAYBACK_ADD(HDMI 2, 6, PIPELINE_PCM_6) +PCM_PLAYBACK_ADD(HDMI 3, 7, PIPELINE_PCM_7) + +# +# BE configurations - overrides config in ACPI if present +# + +#HDMI-1 SSP (ID: 0) +#MCLK is not required and won't impact for HDMI-in capture use case. +DAI_CONFIG(SSP, HDMI_1_SSP_NUM, 0, HDMI1_SSP_NAME, + SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_master), + SSP_CLOCK(fsync, 48000, codec_master), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, HDMI_1_SSP_NUM, 32, 0))) + +#HDMI-2 SSP (ID: 1) +#MCLK is not required and won't impact for HDMI-in capture use case. +DAI_CONFIG(SSP, HDMI_2_SSP_NUM, 1, HDMI2_SSP_NAME, + SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_master), + SSP_CLOCK(fsync, 48000, codec_master), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, HDMI_2_SSP_NUM, 32, 0))) + +ifdef(`NO_AMP',`',` +#Amplifier Codec SSP (ID: 2) +DAI_CONFIG(SSP, AMP_SSP_NUM, 2, AMP_SSP_NAME, + SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), + SSP_CLOCK(bclk, 2400000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 25, 3, 3), + SSP_CONFIG_DATA(SSP, AMP_SSP_NUM, 24)))') + +# dmic01 (ID: 3) +DAI_CONFIG(DMIC, 0, 3, dmic01, + DMIC_CONFIG(1, 500000, 4800000, 40, 60, 48000, + DMIC_WORD_LENGTH(s32le), 400, DMIC, 0, + PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1))) + + +# 3 HDMI/DP outputs (ID: 5,6,7) +DAI_CONFIG(HDA, 5, 5, iDisp1, + HDA_CONFIG(HDA_CONFIG_DATA(HDA, 5, 48000, 2))) +DAI_CONFIG(HDA, 6, 6, iDisp2, + HDA_CONFIG(HDA_CONFIG_DATA(HDA, 6, 48000, 2))) +DAI_CONFIG(HDA, 7, 7, iDisp3, + HDA_CONFIG(HDA_CONFIG_DATA(HDA, 7, 48000, 2))) +DEBUG_END From e53e91aebdfe3ef75a01add088775173ff1b906d Mon Sep 17 00:00:00 2001 From: Balamurugan C Date: Tue, 20 Jun 2023 15:50:12 +0530 Subject: [PATCH 068/161] topology1: tgl: add support for Nocodec amp and HDMI-in capture. Adding support for the product which doesn't have no ssp amplifier but need to support HDMI audio playback and HDMI-in capture via I2S. Signed-off-by: Balamurugan C (cherry picked from commit 310b10c0552eced709beeb3ce8bcc901970e5b67) --- tools/topology/topology1/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index d6fde07cef7d..f528d1b969ff 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -291,6 +291,8 @@ set(TPLGS #To support HDMI-in capture with RT1308 ssp-amplifier products. "sof-tgl-rt1308-hdmi-ssp\;sof-tgl-rt1308-ssp2-hdmi-ssp15\;-DAMP_SSP_NUM=2\;-DHDMI_1_SSP_NUM=1\;-DHDMI_2_SSP_NUM=5\;-DPLATFORM=tgl" + #Topologies for No SSP-amp or codec+HDMI-IN capture support. + "sof-tgl-rt1308-hdmi-ssp\;sof-tgl-nocodec-hdmi-ssp15\;-DNO_AMP\;-DHDMI_1_SSP_NUM=1\;-DHDMI_2_SSP_NUM=5\;-DPLATFORM=tgl" ## i.MX8 (i.MX8QM and i.MX8QXP) topologies "sof-imx8-nocodec\;sof-imx8-nocodec" From b6c174c8f9a8bbed242934cf43057a573c917cd5 Mon Sep 17 00:00:00 2001 From: Balamurugan C Date: Tue, 20 Jun 2023 15:53:47 +0530 Subject: [PATCH 069/161] topology1: adl: add support for Nocodec amp and HDMI-in capture. Adding support for the alderlake products which doesn't have no ssp amplifier but need to support HDMI audio playback and HDMI-in capture via I2S Signed-off-by: Balamurugan C (cherry picked from commit 81f582279c2b50e0640a9079375e0c3ebdcdcb33) --- tools/topology/topology1/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index f528d1b969ff..8117234ca20a 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -293,6 +293,7 @@ set(TPLGS "sof-tgl-rt1308-hdmi-ssp\;sof-tgl-rt1308-ssp2-hdmi-ssp15\;-DAMP_SSP_NUM=2\;-DHDMI_1_SSP_NUM=1\;-DHDMI_2_SSP_NUM=5\;-DPLATFORM=tgl" #Topologies for No SSP-amp or codec+HDMI-IN capture support. "sof-tgl-rt1308-hdmi-ssp\;sof-tgl-nocodec-hdmi-ssp15\;-DNO_AMP\;-DHDMI_1_SSP_NUM=1\;-DHDMI_2_SSP_NUM=5\;-DPLATFORM=tgl" + "sof-tgl-rt1308-hdmi-ssp\;sof-adl-nocodec-hdmi-ssp02\;-DNO_AMP\;-DHDMI_1_SSP_NUM=0\;-DHDMI_2_SSP_NUM=2\;-DPLATFORM=adl" ## i.MX8 (i.MX8QM and i.MX8QXP) topologies "sof-imx8-nocodec\;sof-imx8-nocodec" From 04c33e856099ccb9a9a17b245afff490bc9dadc2 Mon Sep 17 00:00:00 2001 From: Sathya Prakash M R Date: Wed, 19 Jul 2023 00:05:23 +0530 Subject: [PATCH 070/161] smart amp : Do not use DYNAMIC topology DYNAMIC topology should not be used for pipeline with volatile Kcontrols. Hence ensuring the flag is un defined before processing smart amp related PCM and DAI configs Suggested-by: Sridharan, Ranjani Signed-off-by: Sathya Prakash M R (cherry picked from commit 214f98378f12ed179bd22f0c4feb09b0b3aaea81) --- tools/topology/topology1/sof-smart-amplifier.m4 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/topology/topology1/sof-smart-amplifier.m4 b/tools/topology/topology1/sof-smart-amplifier.m4 index b96f7f163480..6896419b8719 100644 --- a/tools/topology/topology1/sof-smart-amplifier.m4 +++ b/tools/topology/topology1/sof-smart-amplifier.m4 @@ -19,6 +19,11 @@ DEBUG_START # define the default macros. # define them in your specific platform .m4 if needed. +#undefine the DYNAMIC flag (if enabled, save it) for smart amplifier as it uses volatile kcontrols +ifdef(`DYNAMIC', `define(`SAVED_DYNAMIC', DYNAMIC)',`') +undefine(`DYNAMIC') + + # define(`SMART_AMP_CORE', 1) define the DSP core that the DSM pipeline will be run on, if not done yet ifdef(`SMART_AMP_CORE',`',`define(`SMART_AMP_CORE', 0)') @@ -236,4 +241,7 @@ DAI_CONFIG(SSP, SMART_SSP_INDEX, SMART_BE_ID, SMART_SSP_NAME, SSP_CONFIG_DATA(SSP, SMART_SSP_INDEX, 32, 0, SMART_SSP_QUIRK))) ') +#Re-enable DYNAMIC flag if it was enabled for other pipelines +ifdef(`SAVED_DYNAMIC', `define(`DYNAMIC', 1)',`') + DEBUG_END From d84a001c1345301251839941c65f471e9e95940e Mon Sep 17 00:00:00 2001 From: Pin-chih Lin Date: Thu, 24 Nov 2022 15:53:15 +0800 Subject: [PATCH 071/161] topology: fix DMICPROC undefined issue for intel-generic-dmic Adds fatal assertion in intel-generic-dmic.m4 for DMICPROC is not defined in upper m4, and fixes a potential risk of assertion by sof-tgl-max98357a-rt5682.m4. Signed-off-by: Pin-chih Lin (cherry picked from commit ff7861f2229d3c9f4fe7b5eb7631a1139c14c24b) --- tools/topology/topology1/platform/intel/intel-generic-dmic.m4 | 2 ++ tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 | 1 + 2 files changed, 3 insertions(+) diff --git a/tools/topology/topology1/platform/intel/intel-generic-dmic.m4 b/tools/topology/topology1/platform/intel/intel-generic-dmic.m4 index 04b06427c9a5..de24ffe1a6b7 100644 --- a/tools/topology/topology1/platform/intel/intel-generic-dmic.m4 +++ b/tools/topology/topology1/platform/intel/intel-generic-dmic.m4 @@ -11,6 +11,8 @@ ifdef(`DMIC_16k_PCM_NAME',`', `define(DMIC_16k_PCM_NAME, `DMIC16kHz')') # variable that need to be defined in upper m4 +ifdef(`DMICPROC',`',`fatal_error(note: Need to define dmic processing for intel-generic-dmic +)') ifdef(`CHANNELS',`',`fatal_error(note: Need to define channel number for intel-generic-dmic )') ifdef(`DMIC_PCM_48k_ID',`',`fatal_error(note: Need to define dmic48k pcm id for intel-generic-dmic diff --git a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 index 679efc658967..38698c612e16 100644 --- a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 +++ b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 @@ -165,6 +165,7 @@ define(KWD_PIPE_SCH_DEADLINE_US, 5000) ifdef(`NOHOTWORD', ` define(NO16KDMIC) +ifdef(`DMICPROC',`',`define(`DMICPROC', passthrough)') include(`platform/intel/intel-generic-dmic.m4')', `include(`platform/intel/intel-generic-dmic-kwd.m4')') From 2ef4fb674c3a6b63a61a745e431b163ccef85903 Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Thu, 24 Aug 2023 12:36:41 +0800 Subject: [PATCH 072/161] topology1: adl-max98360a-da7219: support DA7219 headphone codec Add an new topology adl-max98360a-da7219.tplg for DA7219 headphone codec with MAX98360A speaker amplifier on ADL boards. The MCLK frequency is set to 24.576MHz to use PLL bypass mode and avoid the WCLK locking problem on earlier platforms. Signed-off-by: Brent Lu (cherry picked from commit dca9085047f2aaaff59587d19c3b524eea58b888) --- tools/topology/topology1/CMakeLists.txt | 1 + .../topology1/sof-tgl-max98357a-rt5682.m4 | 30 +++++++++++++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 8117234ca20a..efe526d6d066 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -184,6 +184,7 @@ set(TPLGS "sof-tgl-max98357a-rt5682\;sof-adl-rt5682\;-DNO_AMP\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682" "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-da7219\;-DUSE_DA7219\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682\;-DAMP_SSP=1" "sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682-igonr\;-DAMP_SSP=1\;-DIGO" "sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682-xperi\;-DAMP_SSP=1\;-DINCLUDE_IIR_EQ=1" diff --git a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 index 38698c612e16..9ff028654314 100644 --- a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 +++ b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 @@ -30,6 +30,9 @@ DEBUG_START # ifdef(`2CH_2WAY', `ifdef(`4CH_PASSTHROUGH', `fatal_error(note: 2CH_2WAY and 4CH_PASSTHROUGH are mutually exclusive)')') +ifdef(`USE_DA7219',`define(HEADPHONE, `DA7219')',`define(HEADPHONE, `RT5682')') +ifdef(`USE_DA7219',`define(MCLK_RATE, `24576000')',`define(MCLK_RATE, `19200000')') + # # Define the demux configure # @@ -412,43 +415,43 @@ ifdef(`NO_AMP',`',` DAI_CONFIG(SSP, SPK_SSP_INDEX, SPK_BE_ID, SPK_SSP_NAME, ifelse( CODEC, `MAX98357A', ` - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 19200000, codec_mclk_in), + SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 1536000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 16, 3, 3), SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 16)))', CODEC, `MAX98360A', ` - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 19200000, codec_mclk_in), + SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 3072000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 32, 3, 3), SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 32)))', CODEC, `MAX98360A_TDM', ` - SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, 19200000, codec_mclk_in), + SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 12288000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(8, 32, 15, 15), SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 32)))', CODEC, `RT1011', ` - SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, 19200000, codec_mclk_in), + SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 4800000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(4, 25, 3, 15), SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 24)))', CODEC, `MAX98390', ` - SSP_CONFIG(DSP_B, SSP_CLOCK(mclk, 19200000, codec_mclk_in), + SSP_CONFIG(DSP_B, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 6144000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(4, 32, 3, 15), SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 32)))', CODEC, `RT1019', ` - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 19200000, codec_mclk_in), + SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 3072000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 32, 3, 3), SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 24)))', CODEC, `CS35L41', ` - SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, 19200000, codec_mclk_in), + SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 6144000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(4, 32, 3, 15), @@ -458,11 +461,20 @@ ifelse( ifdef(`NO_HEADPHONE',`',` # SSP 0 (ID: BOARD_HP_BE_ID) DAI_CONFIG(SSP, 0, BOARD_HP_BE_ID, SSP0-Codec, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 19200000, codec_mclk_in), +ifelse( + HEADPHONE, `DA7219', ` + SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, 0, 24)))', + HEADPHONE, `RT5682', ` + SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 2400000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_BCLK_ES)))') + SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_BCLK_ES)))', + )') # 4 HDMI/DP outputs (ID: 3,4,5,6) DAI_CONFIG(HDA, 0, BOARD_HDMI_BE_ID_BASE, iDisp1, From ef8418ca299902f0ac01ac5f9360b1f7ff20cf7b Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Mon, 14 Aug 2023 15:51:50 +0800 Subject: [PATCH 073/161] topology1: sof-tgl-max98357a-rt5682: add sof-adl-rt5650 topology Add a new topology sof-adl-rt5650 for ALC5650 which supports SSP0 for headset and SSP1 for speakers since this codec implements two I2S interfaces. DAI format changed to mclk: 24.576MHz, bclk: 3.072MHz, sample bits: 24-bit to avoid using ASRC function on codec side. Signed-off-by: Brent Lu (cherry picked from commit bd6933b5ab9b61e99acb9843b6f6f14bdefdbe27) --- tools/topology/topology1/CMakeLists.txt | 1 + .../topology1/sof-tgl-max98357a-rt5682.m4 | 32 +++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index efe526d6d066..a682da1d021a 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -185,6 +185,7 @@ set(TPLGS "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-da7219\;-DUSE_DA7219\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DNOHOTWORD\;-DNO16KDMIC" + "sof-tgl-max98357a-rt5682\;sof-adl-rt5650\;-DUSE_RT5650\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682\;-DAMP_SSP=1" "sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682-igonr\;-DAMP_SSP=1\;-DIGO" "sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682-xperi\;-DAMP_SSP=1\;-DINCLUDE_IIR_EQ=1" diff --git a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 index 9ff028654314..bb6017f6773e 100644 --- a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 +++ b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 @@ -30,8 +30,24 @@ DEBUG_START # ifdef(`2CH_2WAY', `ifdef(`4CH_PASSTHROUGH', `fatal_error(note: 2CH_2WAY and 4CH_PASSTHROUGH are mutually exclusive)')') -ifdef(`USE_DA7219',`define(HEADPHONE, `DA7219')',`define(HEADPHONE, `RT5682')') -ifdef(`USE_DA7219',`define(MCLK_RATE, `24576000')',`define(MCLK_RATE, `19200000')') +# +# Set headphone type, default is RT5682 +# +ifdef(`USE_DA7219',`define(HEADPHONE, `DA7219')',` + ifdef(`USE_RT5650',`define(HEADPHONE, `RT5650')',`define(HEADPHONE, `RT5682')')') + +# +# Set the MCLK rate for headphone and amplifier SSP ports +# +ifelse( + HEADPHONE, `DA7219', ` + define(MCLK_RATE, `24576000')', + HEADPHONE, `RT5650', ` + define(MCLK_RATE, `24576000') + define(CODEC, `RT5650')', + HEADPHONE, `RT5682', ` + define(MCLK_RATE, `19200000')', + `fatal_error(note: unknown HEADPHONE type)') # # Define the demux configure @@ -456,6 +472,12 @@ ifelse( SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(4, 32, 3, 15), SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 24)))', + CODEC, `RT5650', ` + SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 24, 0, 0, 0, SSP_CC_MCLK_AON)))', )') ifdef(`NO_HEADPHONE',`',` @@ -474,6 +496,12 @@ ifelse( SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 25, 3, 3), SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_BCLK_ES)))', + HEADPHONE, `RT5650', ` + SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_MCLK_AON)))', )') # 4 HDMI/DP outputs (ID: 3,4,5,6) From 96b9a1afed10ec6cb82333e98ea0c71fa978a2b4 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Thu, 7 Sep 2023 00:05:34 +0000 Subject: [PATCH 074/161] sof-glk-nocodec: disable pipelines when disabling SSPs When we added the flags to disable SSP0 and SSP1 on the UP2, we took the shortcut of just removing the PCMs in topology but left the pipelines and widgets in the topology in. While this works in practice to prevent us from testing those SSPs, the right way is to also remove those pipelines also when the SSPs are disabled. This stops tplgtool2.py from complaining constantly about this inconsistency since https://github.com/thesofproject/sof-test/pull/1079 which made the sof-test verify-tplg-binary.sh fail every time: ``` tplgtool2.py sof-glk-nocodec.tplg ERROR: No pcm id=0 for widget=PCM0C ERROR: No pcm id=1 for widget=PCM1C ERROR: No pcm id=0 for widget=PCM0P ERROR: No pcm id=1 for widget=PCM1P ERROR: tplgtool2.py returned 4 ``` This change affects only sof-apl-nocodec and sof-glk-nocodec. Signed-off-by: Marc Herbert Signed-off-by: Ranjani Sridharan (cherry picked from commit 9ccfbc4e39bbfd09c68476f20789c2ab0879ad76) --- tools/topology/topology1/sof-cavs-nocodec.m4 | 44 ++++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/tools/topology/topology1/sof-cavs-nocodec.m4 b/tools/topology/topology1/sof-cavs-nocodec.m4 index 1efa0dddf109..40e563eba400 100644 --- a/tools/topology/topology1/sof-cavs-nocodec.m4 +++ b/tools/topology/topology1/sof-cavs-nocodec.m4 @@ -115,17 +115,19 @@ dnl time_domain, sched_comp) # Volume switch capture pipeline 2 on PCM 0 using max 2 channels of PIPE_BITS. # Set 1000us deadline on core SSP0_CORE_ID with priority 0 -PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, +ifdef(`DISABLE_SSP0',, + `PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, 2, 0, 2, PIPE_BITS, 1000, 0, SSP0_CORE_ID, - 48000, 48000, 48000) + 48000, 48000, 48000)') # Volume switch capture pipeline 4 on PCM 1 using max 2 channels of PIPE_BITS. # Set 1000us deadline on core SSP1_CORE_ID with priority 0 -PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, +ifdef(`DISABLE_SSP1',, + `PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, 4, 1, 2, PIPE_BITS, 1000, 0, SSP1_CORE_ID, - 48000, 48000, 48000) + 48000, 48000, 48000)') # Volume switch capture pipeline 6 on PCM 2 using max 2 channels of PIPE_BITS. # Set 1000us deadline with priority 0 on core SSP2_CORE_ID @@ -146,19 +148,21 @@ dnl deadline, priority, core, time_domain) # playback DAI is SSP0 using 2 periods # Buffers use DAI_BITS format, 1000us deadline with priority 0 on core SSP0_CORE_ID # The 'NOT_USED_IGNORED' is due to dependencies and is adjusted later with an explicit dapm line. -DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, +ifdef(`DISABLE_SSP0',, + `DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, 1, SSP, SSP0_IDX, NoCodec-0, NOT_USED_IGNORED, 2, DAI_BITS, - 1000, 0, SSP0_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000) + 1000, 0, SSP0_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000)') # Low Latency playback pipeline 1 on PCM 0 using max 2 channels of PIPE_BITS. # Set 1000us deadline on core SSP0_CORE_ID with priority 0 -PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, +ifdef(`DISABLE_SSP0',, + `PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, 7, 0, 2, PIPE_BITS, 1000, 0, SSP0_CORE_ID, 48000, 48000, 48000, SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) + PIPELINE_PLAYBACK_SCHED_COMP_1)') # Deep buffer playback pipeline 11 on PCM 3 using max 2 channels of PIPE_BITS. # Set 1000us deadline on core SSP0_CORE_ID with priority 0. @@ -173,33 +177,37 @@ ifelse(PLATFORM, `bxt', `', # capture DAI is SSP0 using 2 periods # Buffers use DAI_BITS format, 1000us deadline with priority 0 on core SSP0_IDX -DAI_ADD(sof/pipe-dai-capture.m4, +ifdef(`DISABLE_SSP0',, + `DAI_ADD(sof/pipe-dai-capture.m4, 2, SSP, SSP0_IDX, NoCodec-0, PIPELINE_SINK_2, 2, DAI_BITS, - 1000, 0, SSP0_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER) + 1000, 0, SSP0_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER)') # playback DAI is SSP1 using 2 periods # Buffers use DAI_BITS format, 1000us deadline with priority 0 on core SSP1_CORE_ID -DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, +ifdef(`DISABLE_SSP1',, + `DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, 3, SSP, SSP1_IDX, NoCodec-1, NOT_USED_IGNORED, 2, DAI_BITS, - 1000, 0, SSP1_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000) + 1000, 0, SSP1_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000)') # Low Latency playback pipeline 8 on PCM 1 using max 2 channels of PIPE_BITS. # Set 1000us deadline on core SSP1_CORE_ID with priority 0 -PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, +ifdef(`DISABLE_SSP1',, + `PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, 8, 1, 2, PIPE_BITS, 1000, 0, SSP1_CORE_ID, 48000, 48000, 48000, SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_3) + PIPELINE_PLAYBACK_SCHED_COMP_3)') # capture DAI is SSP1 using 2 periods # Buffers use DAI_BITS format, 1000us deadline with priority 0 on core SSP1_CORE_ID -DAI_ADD(sof/pipe-dai-capture.m4, +ifdef(`DISABLE_SSP1',, + `DAI_ADD(sof/pipe-dai-capture.m4, 4, SSP, SSP1_IDX, NoCodec-1, PIPELINE_SINK_4, 2, DAI_BITS, - 1000, 0, SSP1_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER) + 1000, 0, SSP1_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER)') # playback DAI is SSP2 using 2 periods # Buffers use DAI_BITS format, 1000us deadline with priority 0 on core SSP2_CORE_ID @@ -240,8 +248,8 @@ SectionGraph."mixer-host" { lines [ # connect mixer dai pipelines to PCM pipelines - dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_7) - dapm(PIPELINE_MIXER_3, PIPELINE_SOURCE_8) + ifdef(`DISABLE_SSP0',,`dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_7)') + ifdef(`DISABLE_SSP1',, `dapm(PIPELINE_MIXER_3, PIPELINE_SOURCE_8)') dapm(PIPELINE_MIXER_5, PIPELINE_SOURCE_9) ifelse(PLATFORM, `bxt', `dapm(PIPELINE_MIXER_5, PIPELINE_SOURCE_11)', From 770c72da55d4fe15539651932efd6c2063c64a5f Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Thu, 14 Sep 2023 17:47:08 +0800 Subject: [PATCH 075/161] topology1: add sof-rpl-rt711-l0-rt1316-l12.tplg support Adding sof-rpl-rt711-l0-rt1316-l12.tplg. The topology is the same as sof-rpl-rt711-l0-rt1316-l12-rt714-l3, but without local mic (rt714). Signed-off-by: Bard Liao (cherry picked from commit 3eada7c188a773ef7c5cfd884ea7329437ce3116) --- tools/topology/topology1/CMakeLists.txt | 1 + tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index a682da1d021a..36e121fa8e0e 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -136,6 +136,7 @@ set(TPLGS "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index d28cba3d19ce..a772aa1a9ff7 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -37,6 +37,7 @@ set(TPLGS_UP "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" From 95e8bb00d81263ea56b57c3af4af4076ede75a63 Mon Sep 17 00:00:00 2001 From: Curtis Malainey Date: Mon, 7 Mar 2022 17:25:04 -0800 Subject: [PATCH 076/161] topology: add new aec topology New target device, also move the path over to core 1 when running in no_hotword mode fixed conflict in file tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 by manually adding the change Signed-off-by: Curtis Malainey Signed-off-by: Pin-chih Lin (cherry picked from commit 048ffd8003625835dc1e2aa99629c8ce3c84eb59) --- tools/topology/topology1/CMakeLists.txt | 2 +- .../topology1/sof-tgl-max98357a-rt5682.m4 | 1 + ...tnr-google-rtc-audio-processing-capture.m4 | 112 ++++++++++++++++++ 3 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 tools/topology/topology1/sof/pipe-rtnr-google-rtc-audio-processing-capture.m4 diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 36e121fa8e0e..9e67242e8919 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -179,7 +179,7 @@ set(TPLGS "sof-tgl-max98357a-rt5682\;sof-tgl-rt1011-rt5682\;-DCODEC=RT1011\;-DFMT=s24le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR" "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DGOOGLE_RTC_AUDIO_PROCESSING" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DNOHOTWORD\;-DDMICPROC=google-rtc-audio-processing\;-DNO16KDMIC" "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DRTNR\;-DNOHOTWORD\;-DDMICPROC=rtnr\;-DNO16KDMIC\;-DDMIC_48k_CORE_ID=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98390-ssp2-rt5682-ssp0\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2" "sof-tgl-max98357a-rt5682\;sof-adl-rt5682\;-DNO_AMP\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682" diff --git a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 index bb6017f6773e..c3f5153b47d0 100644 --- a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 +++ b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 @@ -184,6 +184,7 @@ define(KWD_PIPE_SCH_DEADLINE_US, 5000) ifdef(`NOHOTWORD', ` define(NO16KDMIC) +define(DMIC_48k_CORE_ID, 1) ifdef(`DMICPROC',`',`define(`DMICPROC', passthrough)') include(`platform/intel/intel-generic-dmic.m4')', `include(`platform/intel/intel-generic-dmic-kwd.m4')') diff --git a/tools/topology/topology1/sof/pipe-rtnr-google-rtc-audio-processing-capture.m4 b/tools/topology/topology1/sof/pipe-rtnr-google-rtc-audio-processing-capture.m4 new file mode 100644 index 000000000000..dc69c36f847b --- /dev/null +++ b/tools/topology/topology1/sof/pipe-rtnr-google-rtc-audio-processing-capture.m4 @@ -0,0 +1,112 @@ +# Acoustic echo cancelling Pipeline and PCM +# +# Pipeline Endpoints for connection are :- +# +# host PCM_C <-- B0 <- NC <-- B1 <-- AEC <-- B2 <-- source DAI0 +# ^----- B3 <-- AEC reference + +# Include topology builder +include(`utils.m4') +include(`buffer.m4') +include(`pcm.m4') +include(`dai.m4') +include(`mixercontrol.m4') +include(`pipeline.m4') +include(`bytecontrol.m4') +include(`enumcontrol.m4') +include(`google_rtc_audio_processing.m4') +include(`rtnr.m4') + +define(GOOGLE_RTC_AUDIO_PROCESSING_priv, concat(`google_rtc_audio_processing_bytes_', PIPELINE_ID)) +define(GOOGLE_RTC_AUDIO_PROCESSING_CTRL, concat(`google_rtc_audio_processing_control_', PIPELINE_ID)) + +include(`google_rtc_audio_processing_default.m4') + +C_CONTROLBYTES(GOOGLE_RTC_AUDIO_PROCESSING_CTRL, PIPELINE_ID, + CONTROLBYTES_OPS(bytes, 258 binds the control to bytes get/put handlers, 258, 258), + CONTROLBYTES_EXTOPS(258 binds the control to bytes get/put handlers, 258, 258), + , , , + CONTROLBYTES_MAX(, 2048), + , + GOOGLE_RTC_AUDIO_PROCESSING_priv) + +define(DEF_RTNR_PRIV, concat(`rtnr_priv_', PIPELINE_ID)) +define(DEF_RTNR_BYTES, concat(`rtnr_bytes_', PIPELINE_ID)) + +CONTROLBYTES_PRIV(DEF_RTNR_PRIV, +` bytes "0x53,0x4f,0x46,0x00,0x00,0x00,0x00,0x00,' +` 0x20,0x00,0x00,0x00,0x00,0x30,0x01,0x03,' +` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,' +` 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,' +` 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,' +` 0x80,0xbb,0x00,0x00,0x00,0x00,0x00,0x00"' +) + +# RTNR Bytes control with max value of 255 +C_CONTROLBYTES(DEF_RTNR_BYTES, PIPELINE_ID, + CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258, 258), + CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258), + , , , + CONTROLBYTES_MAX(, 256), + , + DEF_RTNR_PRIV) + +# +# Components and Buffers +# + +# Host "Google RTC Audio Processing Capture" PCM +# with 0 sink and 2 source periods +W_PCM_CAPTURE(PCM_ID, Google RTC Audio Processing, 0, DAI_PERIODS, SCHEDULE_CORE) + +W_GOOGLE_RTC_AUDIO_PROCESSING(0, PIPELINE_FORMAT, 2, DAI_PERIODS, SCHEDULE_CORE, + LIST(` ', "GOOGLE_RTC_AUDIO_PROCESSING_CTRL")) + +# "RTNR 0" has 2 sink period and 2 source periods +W_RTNR(0, PIPELINE_FORMAT, 2, DAI_PERIODS, SCHEDULE_CORE, LIST(` ', "DEF_RTNR_BYTES")) + +# Capture Buffers +W_BUFFER(0, COMP_BUFFER_SIZE(2, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), + PLATFORM_HOST_MEM_CAP) +W_BUFFER(1, COMP_BUFFER_SIZE(DAI_PERIODS, + COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), + PLATFORM_DAI_MEM_CAP) +W_BUFFER(2, COMP_BUFFER_SIZE(DAI_PERIODS, + COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), + PLATFORM_DAI_MEM_CAP) +W_BUFFER(3, COMP_BUFFER_SIZE(DAI_PERIODS, + COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), + PLATFORM_DAI_MEM_CAP) + +define(`N_AEC_REF_BUF',`BUF'PIPELINE_ID`.'3) +# +# Pipeline Graph +# +# host PCM_P <-- B0 <-- RTNR0 <-- B1 <-- AEC0 <-- B2 <-- sink DAI0 +# ^------- B3 <-- AEC ref + +P_GRAPH(pipe-google-aec-capture-PIPELINE_ID, PIPELINE_ID, + LIST(` ', + `dapm(N_PCMC(PCM_ID), N_BUFFER(0))', + `dapm(N_BUFFER(0), N_RTNR(0))', + `dapm(N_RTNR(0), N_BUFFER(1))', + `dapm(N_BUFFER(1), N_GOOGLE_RTC_AUDIO_PROCESSING(0))', + `dapm(N_GOOGLE_RTC_AUDIO_PROCESSING(0), N_BUFFER(2))', + `dapm(N_GOOGLE_RTC_AUDIO_PROCESSING(0), N_BUFFER(3))')) + +# +# Pipeline Source and Sinks +# +indir(`define', concat(`PIPELINE_SINK_', PIPELINE_ID), N_BUFFER(2)) +indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Google RTC Audio Processing PCM_ID) + +# +# PCM Configuration +# + +PCM_CAPABILITIES(Google RTC Audio Processing PCM_ID, CAPABILITY_FORMAT_NAME(PIPELINE_FORMAT), + PCM_MIN_RATE, PCM_MAX_RATE, PIPELINE_CHANNELS, PIPELINE_CHANNELS, + 2, 16, 192, 16384, 65536, 65536) From 5ae3ad15107bd17fed698da33372a818f522d28d Mon Sep 17 00:00:00 2001 From: Curtis Malainey Date: Wed, 2 Mar 2022 14:10:34 -0800 Subject: [PATCH 077/161] topology: add rtnr + google_aec topology files Add topologies for RTNR and GOOGLE AEC integration Signed-off-by: Curtis Malainey Signed-off-by: Pin-chih (cherry picked from commit efd3742cab7709b2ce0b181f11f9dc6fc1d799ca) --- tools/topology/topology1/CMakeLists.txt | 5 +- .../topology1/sof-tgl-max98357a-rt5682.m4 | 2 +- ...tnr-google-rtc-audio-processing-capture.m4 | 46 +++++++++++++------ 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 9e67242e8919..c210e3b57415 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -174,13 +174,14 @@ set(TPLGS "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D4CH_PASSTHROUGH\;-DBT_OFFLOAD" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" - "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-google-aec\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DGOOGLE_RTC_AUDIO_PROCESSING" + "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-google-aec\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-drceq\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DDRC_EQ" "sof-tgl-max98357a-rt5682\;sof-tgl-rt1011-rt5682\;-DCODEC=RT1011\;-DFMT=s24le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR" "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DNOHOTWORD\;-DDMICPROC=google-rtc-audio-processing\;-DNO16KDMIC" "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DRTNR\;-DNOHOTWORD\;-DDMICPROC=rtnr\;-DNO16KDMIC\;-DDMIC_48k_CORE_ID=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DNOHOTWORD\;-DNO16KDMIC" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98357a-rt5682\;sof-adl-max98390-ssp2-rt5682-ssp0\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2" "sof-tgl-max98357a-rt5682\;sof-adl-rt5682\;-DNO_AMP\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682" "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" diff --git a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 index c3f5153b47d0..21b67536976b 100644 --- a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 +++ b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 @@ -152,7 +152,7 @@ define(`SPK_REF_DAI_NAME', concat(concat(`SSP', SPK_SSP_INDEX),`.IN'))') # to generate dmic setting with kwd when we have dmic # define channel -define(CHANNELS, `4') +ifdef(`CHANNELS', `', `define(`CHANNELS', 4)') # define kfbm with volume define(KFBM_TYPE, `vol-kfbm') # define pcm, pipeline and dai id diff --git a/tools/topology/topology1/sof/pipe-rtnr-google-rtc-audio-processing-capture.m4 b/tools/topology/topology1/sof/pipe-rtnr-google-rtc-audio-processing-capture.m4 index dc69c36f847b..38b7fb77be5f 100644 --- a/tools/topology/topology1/sof/pipe-rtnr-google-rtc-audio-processing-capture.m4 +++ b/tools/topology/topology1/sof/pipe-rtnr-google-rtc-audio-processing-capture.m4 @@ -22,17 +22,12 @@ define(GOOGLE_RTC_AUDIO_PROCESSING_CTRL, concat(`google_rtc_audio_processing_con include(`google_rtc_audio_processing_default.m4') -C_CONTROLBYTES(GOOGLE_RTC_AUDIO_PROCESSING_CTRL, PIPELINE_ID, - CONTROLBYTES_OPS(bytes, 258 binds the control to bytes get/put handlers, 258, 258), - CONTROLBYTES_EXTOPS(258 binds the control to bytes get/put handlers, 258, 258), - , , , - CONTROLBYTES_MAX(, 2048), - , - GOOGLE_RTC_AUDIO_PROCESSING_priv) - define(DEF_RTNR_PRIV, concat(`rtnr_priv_', PIPELINE_ID)) define(DEF_RTNR_BYTES, concat(`rtnr_bytes_', PIPELINE_ID)) +ifdef(`RTNR_BUFFER_SIZE_MIN',`', define(RTNR_BUFFER_SIZE_MIN, `65536')) +ifdef(`RTNR_BUFFER_SIZE_MAX',`', define(RTNR_BUFFER_SIZE_MAX, `65536')) + CONTROLBYTES_PRIV(DEF_RTNR_PRIV, ` bytes "0x53,0x4f,0x46,0x00,0x00,0x00,0x00,0x00,' ` 0x20,0x00,0x00,0x00,0x00,0x30,0x01,0x03,' @@ -45,14 +40,36 @@ CONTROLBYTES_PRIV(DEF_RTNR_PRIV, ) # RTNR Bytes control with max value of 255 -C_CONTROLBYTES(DEF_RTNR_BYTES, PIPELINE_ID, - CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258, 258), - CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258), +C_CONTROLBYTES_READONLY(DEF_RTNR_BYTES, PIPELINE_ID, + CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258), + CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258), , , , CONTROLBYTES_MAX(, 256), , DEF_RTNR_PRIV) +# RTNR Enable switch +define(DEF_RTNR_ENABLE, concat(`rtnr_enable_', PIPELINE_ID)) +define(`CONTROL_NAME', `DEF_RTNR_ENABLE') + +C_CONTROLMIXER(DEF_RTNR_ENABLE, PIPELINE_ID, + CONTROLMIXER_OPS(volsw, 259 binds the mixer control to switch get/put handlers, 259, 259), + CONTROLMIXER_MAX(max 1 indicates switch type control, 1), + false, + , + Channel register and shift for Front Center, + LIST(` ', KCONTROL_CHANNEL(FC, 3, 0)), + "1") +undefine(`CONTROL_NAME') + +C_CONTROLBYTES(`Config', PIPELINE_ID, + CONTROLBYTES_OPS(bytes, 258 binds the control to bytes get/put handlers, 258, 258), + CONTROLBYTES_EXTOPS(258 binds the control to bytes get/put handlers, 258, 258), + , , , + CONTROLBYTES_MAX(, 2048), + , + GOOGLE_RTC_AUDIO_PROCESSING_priv) + # # Components and Buffers # @@ -62,10 +79,11 @@ C_CONTROLBYTES(DEF_RTNR_BYTES, PIPELINE_ID, W_PCM_CAPTURE(PCM_ID, Google RTC Audio Processing, 0, DAI_PERIODS, SCHEDULE_CORE) W_GOOGLE_RTC_AUDIO_PROCESSING(0, PIPELINE_FORMAT, 2, DAI_PERIODS, SCHEDULE_CORE, - LIST(` ', "GOOGLE_RTC_AUDIO_PROCESSING_CTRL")) + `', + LIST(` ', "Config")) # "RTNR 0" has 2 sink period and 2 source periods -W_RTNR(0, PIPELINE_FORMAT, 2, DAI_PERIODS, SCHEDULE_CORE, LIST(` ', "DEF_RTNR_BYTES")) +W_RTNR(0, PIPELINE_FORMAT, 2, DAI_PERIODS, SCHEDULE_CORE, LIST(` ', "DEF_RTNR_BYTES"), LIST(` ', "DEF_RTNR_ENABLE")) # Capture Buffers W_BUFFER(0, COMP_BUFFER_SIZE(2, @@ -110,3 +128,5 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Google RTC Audio Processin PCM_CAPABILITIES(Google RTC Audio Processing PCM_ID, CAPABILITY_FORMAT_NAME(PIPELINE_FORMAT), PCM_MIN_RATE, PCM_MAX_RATE, PIPELINE_CHANNELS, PIPELINE_CHANNELS, 2, 16, 192, 16384, 65536, 65536) + +undefine(`DEF_RTNR_ENABLE') From a174f9e827bbe5acf35d21ce772c46a54be70524 Mon Sep 17 00:00:00 2001 From: Pin-chih Lin Date: Mon, 7 Nov 2022 22:16:30 +0800 Subject: [PATCH 078/161] topology: enable GOOGLE_AEC and WAVES on CS35L41 amp Add WAVES+AEC topology fixed conflict in tools/topology/topology1/CMakeLists.txt by manually adding changes Signed-off-by: Pin-chih Lin (cherry picked from commit 058dc69b1f8acaea9151efd91af78540cce7eafd) --- tools/topology/topology1/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index c210e3b57415..1443c461538f 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -185,6 +185,7 @@ set(TPLGS "sof-tgl-max98357a-rt5682\;sof-adl-max98390-ssp2-rt5682-ssp0\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2" "sof-tgl-max98357a-rt5682\;sof-adl-rt5682\;-DNO_AMP\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682" "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" + "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-google-aec-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-da7219\;-DUSE_DA7219\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98357a-rt5682\;sof-adl-rt5650\;-DUSE_RT5650\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC" From 5ca64f67c71fc9e94a41f7307f5e2d36a381aa27 Mon Sep 17 00:00:00 2001 From: Pin-chih Lin Date: Mon, 7 Nov 2022 15:19:15 +0800 Subject: [PATCH 079/161] sof-nau8825: add DSM lib and remove hotword/dmic16k For nau8825 codec devices e.g. Kano/Volmar/Zavala, it had been observed that when Hotword module is enabled, noticeable pop noises appear in the playback audio. While disabled, the playback audio becomes clear. Because Hotword module is optional, remove it for now as WA fix for noise issue. Signed-off-by: Pin-chih Lin (cherry picked from commit 864064d4a9de4b1a8f03aa3cefaa876211b759ea) --- .../xtensa/configs/override/tigerlake_chrome_dts.config | 2 ++ tools/topology/topology1/CMakeLists.txt | 4 ++-- tools/topology/topology1/sof-adl-nau8825.m4 | 8 +++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/arch/xtensa/configs/override/tigerlake_chrome_dts.config b/src/arch/xtensa/configs/override/tigerlake_chrome_dts.config index 2ab50bab406c..86876f830f54 100644 --- a/src/arch/xtensa/configs/override/tigerlake_chrome_dts.config +++ b/src/arch/xtensa/configs/override/tigerlake_chrome_dts.config @@ -2,3 +2,5 @@ CONFIG_CAVS_LPS=y CONFIG_COMP_IIR=y CONFIG_COMP_CODEC_ADAPTER=y CONFIG_DTS_CODEC=y +CONFIG_SAMPLE_KEYPHRASE=n +CONFIG_MAXIM_DSM=y diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 1443c461538f..2d4f92bd7c9b 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -195,8 +195,8 @@ set(TPLGS "sof-tgl-max98373-rt5682\;sof-tgl-rt5682-ssp0-max98373-ssp2\;-DAMP_SSP=2" "sof-tgl-max98373-rt5682\;sof-tgl-rt5682-ssp0-max98373-ssp2-xperi\;-DAMP_SSP=2\;-DINCLUDE_IIR_EQ=1" "sof-adl-nau8825\;sof-adl-nau8825\;-DNO_AMP\;-DBT_OFFLOAD" - "sof-adl-nau8825\;sof-adl-max98373-nau8825\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD" - "sof-adl-nau8825\;sof-adl-max98373-nau8825-dts\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD\;-DDTS=`DTS'" + "sof-adl-nau8825\;sof-adl-max98373-nau8825\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC" + "sof-adl-nau8825\;sof-adl-max98373-nau8825-dts\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC\;-DDTS=`DTS'" "sof-adl-nau8825\;sof-adl-max98360a-nau8825\;-DCODEC=MAX98360A\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD" "sof-adl-nau8825\;sof-adl-rt1019-nau8825\;-DCODEC=RT1019P\;-DFMT=s16le\;-DAMP_SSP=2" "sof-adl-nau8825\;sof-adl-rt1015-nau8825\;-DCODEC=RT1015P\;-DFMT=s32le\;-DAMP_SSP=1\;-DBT_OFFLOAD" diff --git a/tools/topology/topology1/sof-adl-nau8825.m4 b/tools/topology/topology1/sof-adl-nau8825.m4 index 9159b3b24f3c..05618a9b2aac 100644 --- a/tools/topology/topology1/sof-adl-nau8825.m4 +++ b/tools/topology/topology1/sof-adl-nau8825.m4 @@ -142,7 +142,13 @@ ifdef(`IGO', `define(`DMIC_PIPELINE_48k_CORE_ID', 1)') # define pcm, pipeline and dai id define(KWD_PIPE_SCH_DEADLINE_US, 20000) # include the generic dmic with kwd -include(`platform/intel/intel-generic-dmic-kwd.m4') +ifdef(`NOHOTWORD', +` +define(NO16KDMIC) +define(DMIC_48k_CORE_ID, 1) +define(DMICPROC, passthrough) +include(`platform/intel/intel-generic-dmic.m4')', +`include(`platform/intel/intel-generic-dmic-kwd.m4')') # define(`SSP_MCLK', ) ifdef(`SSP_MCLK',`',`define(`SSP_MCLK', 19200000)') From bfac0b3f5cd6c0539dbc5a9a65ab151372629d7c Mon Sep 17 00:00:00 2001 From: Vamshi Krishna Gopal Date: Wed, 16 Nov 2022 12:36:21 +0530 Subject: [PATCH 080/161] topology: Change Speaker period size to 10 ms for RPL and ADL-N Chrome designs with 10ms period size we have seen power improvements. We are working to move all topologies of Chrome to 10 ms. Starting with current RPL and ADL-N topologies. With many topologies already using GOOGLE_RTC_PROCESSING flag to set 10ms, making a simpler flag to be used across to set required SPEAKER PERIOD. This helps to scale later to all designs. fixed conflict in tools/topology/topology1/CMakeLists.txt by adding changes manually Signed-off-by: Sathya Prakash M R Signed-off-by: Vamshi Krishna Gopal (cherry picked from commit a036799103eebab87994a40ad8f2a3a87862be4f) --- tools/topology/topology1/CMakeLists.txt | 16 ++++++++-------- tools/topology/topology1/sof-adl-nau8825.m4 | 6 ++++-- .../topology1/sof-tgl-max98357a-rt5682.m4 | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 2d4f92bd7c9b..c58a0422908f 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -168,7 +168,7 @@ set(TPLGS "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D2CH_2WAY" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-waves-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D2CH_2WAY\;-DWAVES" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D4CH_PASSTHROUGH" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-waves\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D4CH_PASSTHROUGH\;-DBT_OFFLOAD" @@ -181,12 +181,12 @@ set(TPLGS "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD" "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DRTNR\;-DNOHOTWORD\;-DDMICPROC=rtnr\;-DNO16KDMIC\;-DDMIC_48k_CORE_ID=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DNOHOTWORD\;-DNO16KDMIC" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC\;-DSPK_MIC_PERIOD_US=10000" "sof-tgl-max98357a-rt5682\;sof-adl-max98390-ssp2-rt5682-ssp0\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2" "sof-tgl-max98357a-rt5682\;sof-adl-rt5682\;-DNO_AMP\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682" - "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" - "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-google-aec-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC" - "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE" + "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000" + "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-google-aec-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC\;-DSPK_MIC_PERIOD_US=10000" + "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DSPK_MIC_PERIOD_US=10000" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-da7219\;-DUSE_DA7219\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98357a-rt5682\;sof-adl-rt5650\;-DUSE_RT5650\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682\;-DAMP_SSP=1" @@ -197,9 +197,9 @@ set(TPLGS "sof-adl-nau8825\;sof-adl-nau8825\;-DNO_AMP\;-DBT_OFFLOAD" "sof-adl-nau8825\;sof-adl-max98373-nau8825\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC" "sof-adl-nau8825\;sof-adl-max98373-nau8825-dts\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC\;-DDTS=`DTS'" - "sof-adl-nau8825\;sof-adl-max98360a-nau8825\;-DCODEC=MAX98360A\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD" - "sof-adl-nau8825\;sof-adl-rt1019-nau8825\;-DCODEC=RT1019P\;-DFMT=s16le\;-DAMP_SSP=2" - "sof-adl-nau8825\;sof-adl-rt1015-nau8825\;-DCODEC=RT1015P\;-DFMT=s32le\;-DAMP_SSP=1\;-DBT_OFFLOAD" + "sof-adl-nau8825\;sof-adl-max98360a-nau8825\;-DCODEC=MAX98360A\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000" + "sof-adl-nau8825\;sof-adl-rt1019-nau8825\;-DCODEC=RT1019P\;-DFMT=s16le\;-DAMP_SSP=2\;-DSPK_MIC_PERIOD_US=10000" + "sof-adl-nau8825\;sof-adl-rt1015-nau8825\;-DCODEC=RT1015P\;-DFMT=s32le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000" "sof-tgl-sdw-max98373-rt5682\;sof-tgl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=tgl" "sof-tgl-sdw-max98373-rt5682\;sof-adl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=adl" "sof-jsl-da7219\;sof-jsl-da7219\;-DPLATFORM=jsl" diff --git a/tools/topology/topology1/sof-adl-nau8825.m4 b/tools/topology/topology1/sof-adl-nau8825.m4 index 05618a9b2aac..8cb3c9dde1c9 100644 --- a/tools/topology/topology1/sof-adl-nau8825.m4 +++ b/tools/topology/topology1/sof-adl-nau8825.m4 @@ -93,6 +93,8 @@ ifdef(`BT_OFFLOAD', ` # PCM99 <---- volume <---- DMIC01 (dmic 48k capture) # PCM100 <---- kpb <---- DMIC16K (dmic 16k capture) +ifdef(`SPK_MIC_PERIOD_US',`', `define(`SPK_MIC_PERIOD_US', 1000)') + ifdef(`NO_AMP',,` ifdef(`SMART_AMP',` # Smart amplifier related @@ -176,7 +178,7 @@ ifdef(`SMART_AMP',,` # Schedule 48 frames per 1000us deadline with priority 0 on core 0 PIPELINE_PCM_ADD(sof/pipe-volume-demux-playback.m4, 1, 0, 2, s32le, - 1000, 0, 0, + SPK_MIC_PERIOD_US, 0, 0, 48000, 48000, 48000)')') # Low Latency playback pipeline 2 on PCM 1 using max 2 channels of s32le. @@ -280,7 +282,7 @@ ifdef(`SMART_AMP',,` DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, SPK_SSP_INDEX, SPK_SSP_NAME, PIPELINE_SOURCE_1, 2, FMT, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + SPK_MIC_PERIOD_US, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) # The echo refenrence pipeline has no connections in it, # it is used for the capture DAI widget to dock. diff --git a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 index 21b67536976b..cbb35774c13d 100644 --- a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 +++ b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 @@ -133,7 +133,7 @@ ifdef(`WAVES',` # PCM99 <---- volume <---- DMIC01 (dmic 48k capture) # PCM100 <---- kpb <---- DMIC16K (dmic 16k capture) -ifdef(`GOOGLE_RTC_AUDIO_PROCESSING', `define(`SPK_MIC_PERIOD_US', 10000)', `define(`SPK_MIC_PERIOD_US', 1000)') +ifdef(`SPK_MIC_PERIOD_US',`', `define(`SPK_MIC_PERIOD_US', 1000)') ifdef(`NO_AMP',`',` # Define pipeline id for sof-tgl-CODEC-rt5682.m4 From 93f44543a53c594e4c2f037bcd6f727d64a68772 Mon Sep 17 00:00:00 2001 From: Pin-chih Lin Date: Wed, 7 Dec 2022 22:23:42 +0800 Subject: [PATCH 081/161] topology: add more make cases for ADL Adds cases {MAX09360A + RTNR + GOOGLE_RTC_AUDIO} and {CS35L41 + WAVES}. fixed conflict in tools/topology/topology1/CMakeLists.txt by adding changes manually Signed-off-by: Pin-chih Lin (cherry picked from commit f42d015d596a7536d0cc72e847f32dc3560e9a40) --- tools/topology/topology1/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index c58a0422908f..ee2b1e7f0769 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -173,6 +173,7 @@ set(TPLGS "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D4CH_PASSTHROUGH\;-DBT_OFFLOAD" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr-google-aec\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-google-aec\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-drceq\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DDRC_EQ" @@ -187,6 +188,7 @@ set(TPLGS "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000" "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-google-aec-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC\;-DSPK_MIC_PERIOD_US=10000" "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DSPK_MIC_PERIOD_US=10000" + "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-da7219\;-DUSE_DA7219\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98357a-rt5682\;sof-adl-rt5650\;-DUSE_RT5650\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682\;-DAMP_SSP=1" From 8625f6669c6860c1936397ced282096bdf87bd6a Mon Sep 17 00:00:00 2001 From: Pin-chih Lin Date: Fri, 16 Dec 2022 18:03:08 +0800 Subject: [PATCH 082/161] topology: add waves-integrated tplg file for RT1019 codec Add topology case {WAVES + RT1019 CODEC} fixed conflict in tools/topology/topology1/CMakeLists.txt resolved by adding changes manually Signed-off-by: Pin-chih Lin (cherry picked from commit b581aa52e994eca70ef79c693b2950b437314e8f) --- tools/topology/topology1/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index ee2b1e7f0769..4851cbceef36 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -186,6 +186,7 @@ set(TPLGS "sof-tgl-max98357a-rt5682\;sof-adl-max98390-ssp2-rt5682-ssp0\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2" "sof-tgl-max98357a-rt5682\;sof-adl-rt5682\;-DNO_AMP\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682" "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000" + "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682-waves\;-DCODEC=RT1019\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES" "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-google-aec-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC\;-DSPK_MIC_PERIOD_US=10000" "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DSPK_MIC_PERIOD_US=10000" "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC" From c9cc5615839d15d535b543b3f73af06ad3d518fb Mon Sep 17 00:00:00 2001 From: Ajye Huang Date: Tue, 10 Jan 2023 22:55:48 +0800 Subject: [PATCH 083/161] topology: sof-adl-rt1019-rt5682: add bluetooth offload uses SSP2 link Adding support for Bluetooth offload. sof-adl-rt1019-rt5682, and sof-adl-rt1019-rt5682-waves: rt5682 headphone connects SSP0 link. rt1019 Amp speakers connects SSP1 link. bluetooth offload uses SSP2 link. Signed-off-by: Ajye Huang (cherry picked from commit 5aa15456862c0830250cffbb27dd9bf77c422d4c) --- tools/topology/topology1/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 4851cbceef36..161291329134 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -185,8 +185,8 @@ set(TPLGS "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC\;-DSPK_MIC_PERIOD_US=10000" "sof-tgl-max98357a-rt5682\;sof-adl-max98390-ssp2-rt5682-ssp0\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2" "sof-tgl-max98357a-rt5682\;sof-adl-rt5682\;-DNO_AMP\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682" - "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000" - "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682-waves\;-DCODEC=RT1019\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES" + "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD" + "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682-waves\;-DCODEC=RT1019\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES\;-DBT_OFFLOAD" "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-google-aec-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC\;-DSPK_MIC_PERIOD_US=10000" "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DSPK_MIC_PERIOD_US=10000" "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC" From 67edb6f714579a86600b60a1955a752ae6d8bc0c Mon Sep 17 00:00:00 2001 From: Pin-chih Lin Date: Mon, 13 Feb 2023 06:29:04 +0800 Subject: [PATCH 084/161] topology1: add PDM1 version for sof-adl-max98360a-rt5682-2way Adds new topology build based on sof-adl-max98360a-rt5682-2way with appending arg `-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1` for existing ADL-P projects. Signed-off-by: Pin-chih Lin (cherry picked from commit feeb51f216d3f26a4e00eb1047f2583cd59b16bf) --- tools/topology/topology1/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 161291329134..bbb0aa8c24df 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -171,6 +171,7 @@ set(TPLGS "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-waves\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way-pdm1\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D4CH_PASSTHROUGH\;-DBT_OFFLOAD" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr-google-aec\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC" From 8b48f45a128287b6902c562aea0f2b90d9b43339 Mon Sep 17 00:00:00 2001 From: Vamshi Krishna Gopal Date: Thu, 24 Aug 2023 19:44:31 +0530 Subject: [PATCH 085/161] topology1: Use DYNAMIC for ADL and RPL topologies use dynamic for all the adl and rpl topologies except 3p(waves,DTS), excluded Dell sdw topologies which are not tested. fixed conflict in tools/topology/topology1/CMakeLists.txt resolved by adding changes manually Signed-off-by: Vamshi Krishna Gopal (cherry picked from commit 6f2475b086ce1336a405fea0f9d46429f166b11b) --- tools/topology/topology1/CMakeLists.txt | 48 ++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index bbb0aa8c24df..12b5579b8944 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -162,34 +162,34 @@ set(TPLGS "sof-ehl-rt5660\;sof-ehl-rt5660\;-DHDMI=1" "sof-ehl-rt5660\;sof-ehl-rt5660-nohdmi" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DCHANNELS=2\;-DRTNR" + "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DCHANNELS=2\;-DRTNR\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-waves\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DWAVES" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D2CH_2WAY" + "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D2CH_2WAY\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-waves-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D2CH_2WAY\;-DWAVES" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D4CH_PASSTHROUGH" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000" + "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D4CH_PASSTHROUGH\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-waves\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way-pdm1\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D4CH_PASSTHROUGH\;-DBT_OFFLOAD" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr-google-aec\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way-pdm1\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D4CH_PASSTHROUGH\;-DBT_OFFLOAD\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr-google-aec\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-google-aec\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-drceq\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DDRC_EQ" "sof-tgl-max98357a-rt5682\;sof-tgl-rt1011-rt5682\;-DCODEC=RT1011\;-DFMT=s24le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DRTNR\;-DNOHOTWORD\;-DDMICPROC=rtnr\;-DNO16KDMIC\;-DDMIC_48k_CORE_ID=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DNOHOTWORD\;-DNO16KDMIC" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC\;-DSPK_MIC_PERIOD_US=10000" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-ssp2-rt5682-ssp0\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2" - "sof-tgl-max98357a-rt5682\;sof-adl-rt5682\;-DNO_AMP\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682" - "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DRTNR\;-DNOHOTWORD\;-DDMICPROC=rtnr\;-DNO16KDMIC\;-DDMIC_48k_CORE_ID=1\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DNOHOTWORD\;-DNO16KDMIC\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-ssp2-rt5682-ssp0\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-rt5682\;-DNO_AMP\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682-waves\;-DCODEC=RT1019\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES\;-DBT_OFFLOAD" "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-google-aec-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC\;-DSPK_MIC_PERIOD_US=10000" - "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DSPK_MIC_PERIOD_US=10000" + "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-da7219\;-DUSE_DA7219\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98357a-rt5682\;sof-adl-rt5650\;-DUSE_RT5650\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC" @@ -198,14 +198,14 @@ set(TPLGS "sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682-xperi\;-DAMP_SSP=1\;-DINCLUDE_IIR_EQ=1" "sof-tgl-max98373-rt5682\;sof-tgl-rt5682-ssp0-max98373-ssp2\;-DAMP_SSP=2" "sof-tgl-max98373-rt5682\;sof-tgl-rt5682-ssp0-max98373-ssp2-xperi\;-DAMP_SSP=2\;-DINCLUDE_IIR_EQ=1" - "sof-adl-nau8825\;sof-adl-nau8825\;-DNO_AMP\;-DBT_OFFLOAD" - "sof-adl-nau8825\;sof-adl-max98373-nau8825\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC" + "sof-adl-nau8825\;sof-adl-nau8825\;-DNO_AMP\;-DBT_OFFLOAD\;-DDYNAMIC=1" + "sof-adl-nau8825\;sof-adl-max98373-nau8825\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC\;-DDYNAMIC=1" "sof-adl-nau8825\;sof-adl-max98373-nau8825-dts\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC\;-DDTS=`DTS'" - "sof-adl-nau8825\;sof-adl-max98360a-nau8825\;-DCODEC=MAX98360A\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000" - "sof-adl-nau8825\;sof-adl-rt1019-nau8825\;-DCODEC=RT1019P\;-DFMT=s16le\;-DAMP_SSP=2\;-DSPK_MIC_PERIOD_US=10000" - "sof-adl-nau8825\;sof-adl-rt1015-nau8825\;-DCODEC=RT1015P\;-DFMT=s32le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000" + "sof-adl-nau8825\;sof-adl-max98360a-nau8825\;-DCODEC=MAX98360A\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" + "sof-adl-nau8825\;sof-adl-rt1019-nau8825\;-DCODEC=RT1019P\;-DFMT=s16le\;-DAMP_SSP=2\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" + "sof-adl-nau8825\;sof-adl-rt1015-nau8825\;-DCODEC=RT1015P\;-DFMT=s32le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" "sof-tgl-sdw-max98373-rt5682\;sof-tgl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=tgl" - "sof-tgl-sdw-max98373-rt5682\;sof-adl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=adl" + "sof-tgl-sdw-max98373-rt5682\;sof-adl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=adl\;-DDYNAMIC=1" "sof-jsl-da7219\;sof-jsl-da7219\;-DPLATFORM=jsl" "sof-jsl-da7219\;sof-jsl-da7219-mx98360a\;-DPLATFORM=jsl-dedede" "sof-smart-amplifier-nocodec\;sof-smart-amplifier-nocodec" From f2f3de31eb1ea456ccb5f2063d3958d8b5b32984 Mon Sep 17 00:00:00 2001 From: Pin-chih Lin Date: Wed, 16 Aug 2023 16:30:13 +0800 Subject: [PATCH 086/161] topology1: waves: add definition WAVES_SPK_ONLY Introduced var WAVES_SPK_ONLY (depend on WAVES) for specifying the topology requested to apply Waves module on Speaker pipeline only (not on Heaadphones). Signed-off-by: Pin-chih Lin (cherry picked from commit b793d1ce2bfa1f4b4247906144658338e7e57536) Signed-off-by: Kai Vehmanen --- tools/topology/topology1/CMakeLists.txt | 1 + tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 12b5579b8944..3bd0168b7ef0 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -170,6 +170,7 @@ set(TPLGS "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D4CH_PASSTHROUGH\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-waves\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-waves-spk-only\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES\;-DWAVES_SPK_ONLY" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way-pdm1\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D4CH_PASSTHROUGH\;-DBT_OFFLOAD\;-DDYNAMIC=1" diff --git a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 index cbb35774c13d..fca5062752d1 100644 --- a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 +++ b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 @@ -219,11 +219,14 @@ PIPELINE_PCM_ADD( undefine(`ENDPOINT_NAME')') ifdef(`NO_HEADPHONE',`',` +# define Waves integration on Headphones = WAVES && !WAVES_SPK_ONLY +ifdef(`WAVES', `ifdef(`WAVES_SPK_ONLY', `', `define(`WAVES_HEADPHONE')')', `') + # Low Latency playback pipeline 2 on PCM 1 using max 2 channels of s24le. # Schedule 48 frames per 1000us deadline with priority 0 on core 0 define(`ENDPOINT_NAME', `Headphones') PIPELINE_PCM_ADD( - ifdef(`WAVES', sof/pipe-waves-codec-playback.m4, sof/pipe-volume-playback.m4), + ifdef(`WAVES_HEADPHONE', sof/pipe-waves-codec-playback.m4, sof/pipe-volume-playback.m4), 2, 1, 2, s32le, 1000, 0, 0, 48000, 48000, 48000) From 6ba5bb2ff4d32fb8da10f820a0b99a6bd77717dc Mon Sep 17 00:00:00 2001 From: Ajye Huang Date: Sun, 11 Dec 2022 15:08:52 +0800 Subject: [PATCH 087/161] topology: sof-adl-nau8825: add variant with nau8318 amplifier Adding support for nau8318 Amplifier. sof-adl-nau8318-nau8825: nau8825 headphone connects SSP0 link. nau8318 Amp speakers connects SSP1 link. bluetooth offload uses SSP2 link. Signed-off-by: Ajye Huang (cherry picked from commit cdcbdae705a42578dc99d6bf54f275c699afbc81) --- tools/topology/topology1/CMakeLists.txt | 1 + tools/topology/topology1/sof-adl-nau8825.m4 | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 3bd0168b7ef0..7fb0ff27806b 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -205,6 +205,7 @@ set(TPLGS "sof-adl-nau8825\;sof-adl-max98360a-nau8825\;-DCODEC=MAX98360A\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" "sof-adl-nau8825\;sof-adl-rt1019-nau8825\;-DCODEC=RT1019P\;-DFMT=s16le\;-DAMP_SSP=2\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" "sof-adl-nau8825\;sof-adl-rt1015-nau8825\;-DCODEC=RT1015P\;-DFMT=s32le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" + "sof-adl-nau8825\;sof-adl-nau8318-nau8825\;-DCODEC=NAU8318\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" "sof-tgl-sdw-max98373-rt5682\;sof-tgl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=tgl" "sof-tgl-sdw-max98373-rt5682\;sof-adl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=adl\;-DDYNAMIC=1" "sof-jsl-da7219\;sof-jsl-da7219\;-DPLATFORM=jsl" diff --git a/tools/topology/topology1/sof-adl-nau8825.m4 b/tools/topology/topology1/sof-adl-nau8825.m4 index 8cb3c9dde1c9..d71aa8f91090 100644 --- a/tools/topology/topology1/sof-adl-nau8825.m4 +++ b/tools/topology/topology1/sof-adl-nau8825.m4 @@ -384,6 +384,12 @@ ifelse( SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 32, 3, 3), SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 32)))', + CODEC, `NAU8318', ` + SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK, codec_mclk_in), + SSP_CLOCK(bclk, 1536000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 16, 3, 3), + SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 16)))', )')') DEBUG_END From 57f020e4dd97f06fa29cbe7c4cd4f0f9dd0e1ea8 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Thu, 25 Nov 2021 02:45:52 +0000 Subject: [PATCH 088/161] logger: open /sys/debug/fw_version _after_ /sys/debug/[e]trace Open /sys/kernel/debug/sof/fw_version _after_ /sys/kernel/debug/sof/[e]trace because reading the former is optional and the latter is not. So when the driver is not loaded, we get the same (missing trace) error trace message whether we use the -n option or not. Signed-off-by: Marc Herbert (cherry picked from commit af6bd41a994ccf9998a5c6c32d1fe27974bc612e) --- tools/logger/logger.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/logger/logger.c b/tools/logger/logger.c index 543e8e85a0c8..a9aa08c77d28 100644 --- a/tools/logger/logger.c +++ b/tools/logger/logger.c @@ -304,17 +304,6 @@ int main(int argc, char *argv[]) goto out; } - if (config.version_fw) { - config.version_fd = fopen(config.version_file, "rb"); - if (!config.version_fd && !config.dump_ldc) { - ret = errno; - fprintf(stderr, - "error: Unable to open version file %s: %s\n", - config.version_file, strerror(ret)); - goto out; - } - } - if (config.out_file) { config.out_fd = fopen(config.out_file, "w"); if (!config.out_fd) { @@ -360,6 +349,17 @@ int main(int argc, char *argv[]) if (isatty(fileno(config.out_fd)) != 1) config.use_colors = 0; + if (config.version_fw) { + config.version_fd = fopen(config.version_file, "rb"); + if (!config.version_fd && !config.dump_ldc) { + ret = errno; + fprintf(stderr, + "error: Unable to open version file %s: %s\n", + config.version_file, strerror(ret)); + goto out; + } + } + ret = -convert(&config); out: From 5899d51c37e75e65777ae42507366e30dec298b2 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Thu, 25 Nov 2021 02:51:29 +0000 Subject: [PATCH 089/161] logger: allow starting before the driver is loaded Don't fail immediately when the driver is not loaded. Use inotify instead to wait for /sys/kernel/debug/sof/[e]trace to appear. This makes it possible to start before the driver is loaded which reduces considerably the chances of missing early logs. Fixes a small part of https://github.com/thesofproject/linux/issues/3275 Signed-off-by: Marc Herbert (cherry picked from commit dcf0577a7725413aad1a378d629b9cc6659550ef) --- tools/logger/logger.c | 114 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 113 insertions(+), 1 deletion(-) diff --git a/tools/logger/logger.c b/tools/logger/logger.c index a9aa08c77d28..a28661e53caa 100644 --- a/tools/logger/logger.c +++ b/tools/logger/logger.c @@ -15,6 +15,12 @@ #include #include #include +#include +#include +#include +#include +#include + #include "convert.h" #include "misc.h" @@ -170,6 +176,93 @@ static int append_filter_config(struct convert_config *config, const char *input return 0; } +/* + * This 5 minutes timeout is for "backward compatible safety" in case + * any user/script of an earlier, pre-inotify version of sof-logger + * (accidentally?) _expected_ the tool to quit when the driver was not + * loaded. This expectation was always wrong but an infinite wait is too + * severe of a punishment. This timeout cannot be too small otherwise it + * would defeat the new feature. + */ +#ifndef SOF_LOGGER_WAIT_OPEN_TIMEOUT_SECS +#define SOF_LOGGER_WAIT_OPEN_TIMEOUT_SECS (5 * 60) +#endif + +/* + * Using inotify, wait up to 5 minutes for 'expected_name' to appear in + * 'watched_dir'. Then return opendir/fopen(expected_name). fopen() and + * opendir() failures are NOT handled; e.g. NULL from fopen() is just + * passed through. + * + * Returns a FILE * or DIR * + */ +static void *wait_open(const char *watched_dir, const char *expected_file) +{ + if (access(watched_dir, R_OK)) { + fprintf(stderr, "error: %s() cannot read %s\n", __func__, watched_dir); + return NULL; + } + + const int iqueue = inotify_init(); + const int dwatch = inotify_add_watch(iqueue, watched_dir, IN_CREATE); + struct stat expected_stat; + void *ret_stream = NULL; + + char * const fpath = malloc(strlen(watched_dir) + 1 + strlen(expected_file) + 1); + + strcpy(fpath, watched_dir); + strcat(fpath, "/"); + strcat(fpath, expected_file); + + /* Not racy because the inotify watch was set first. */ + if (!access(fpath, F_OK)) + goto fopenit; + + fprintf(stdout, "%s: waiting in %s/ for %s\n", APP_NAME, watched_dir, expected_file); + fflush(stdout); + + while (1) { + char evlist[1 * sizeof(struct inotify_event)]; + struct pollfd pfd[1] = {{ .fd = iqueue, .events = POLLIN, .revents = 0 }}; + int pret = poll(pfd, sizeof(pfd) / sizeof(struct pollfd), + SOF_LOGGER_WAIT_OPEN_TIMEOUT_SECS * 1000); + + if (pret == 0) { + fprintf(stderr, "error: no %s after waiting %d seconds\n", + expected_file, SOF_LOGGER_WAIT_OPEN_TIMEOUT_SECS); + goto cleanup; + } + + if (pret < 0 || pfd[0].revents != POLLIN) { + fprintf(stderr, "error: in %s, poll(%s) returned %d, %d\n", + __func__, watched_dir, pret, pfd[0].revents); + goto cleanup; + } + + /* Silence __attribute__((warn_unused_result)) which is + * enabled by some Linux distros even when broken in gcc: + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 + */ + (void)!read(iqueue, evlist, sizeof(evlist)); + + if (!access(fpath, F_OK)) + goto fopenit; + } + +fopenit: + stat(fpath, &expected_stat); + if ((expected_stat.st_mode & S_IFMT) == S_IFDIR) + ret_stream = opendir(fpath); + else + ret_stream = fopen(fpath, "rb"); + +cleanup: + free(fpath); + inotify_rm_watch(iqueue, dwatch); + + return ret_stream; +} + int main(int argc, char *argv[]) { static const char optstring[] = "ho:i:l:ps:c:u:tv:rd:Le:f:gF:n"; @@ -337,7 +430,26 @@ int main(int argc, char *argv[]) goto out; } } else if (config.in_file) { - config.in_fd = fopen(config.in_file, "rb"); + static const char sys_debug[] = "/sys/kernel/debug"; + static const char sys_debug_sof[] = "/sys/kernel/debug/sof"; + /* In the future we could add an option to force waiting + * for _any_ input file, not just for /sys/kernel/debug/sof/[e]trace + */ + config.in_fd = NULL; + if (strncmp(config.in_file, sys_debug, strlen(sys_debug))) { + config.in_fd = fopen(config.in_file, "rb"); + } else { + DIR *dbg_sof = (DIR *)wait_open(sys_debug, "sof"); + + if (dbg_sof) { + closedir(dbg_sof); + config.in_fd = + (FILE *)wait_open(sys_debug_sof, + config.in_file + + strlen(sys_debug_sof) + 1); + } + } + if (!config.in_fd) { ret = errno; fprintf(stderr, From 4fb21b026ee02d1cd405dbb5a49cdc2b47499998 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Thu, 25 Aug 2022 15:14:40 -0700 Subject: [PATCH 090/161] sof-logger: make inotify optional Restores ability to compile on Windows with MSYS. Fixes commit dcf0577a7725 ("logger: allow starting before the driver is loaded") Signed-off-by: Marc Herbert (cherry picked from commit 92d828bc37329020b4e92b29109efadb28f794ca) --- tools/logger/CMakeLists.txt | 8 ++++++++ tools/logger/config.h.in | 1 + tools/logger/logger.c | 24 ++++++++++++++++++++---- 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 tools/logger/config.h.in diff --git a/tools/logger/CMakeLists.txt b/tools/logger/CMakeLists.txt index d84c92ce0cc5..57637706c5d6 100644 --- a/tools/logger/CMakeLists.txt +++ b/tools/logger/CMakeLists.txt @@ -1,5 +1,13 @@ # SPDX-License-Identifier: BSD-3-Clause +# https://gitlab.kitware.com/cmake/community/-/wikis/doc/tutorials/How-To-Write-Platform-Checks +INCLUDE (CheckIncludeFiles) +CHECK_INCLUDE_FILES(sys/inotify.h HAS_INOTIFY) + +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in + ${CMAKE_CURRENT_BINARY_DIR}/config.h) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + add_executable(sof-logger logger.c convert.c diff --git a/tools/logger/config.h.in b/tools/logger/config.h.in new file mode 100644 index 000000000000..fecbafbd274c --- /dev/null +++ b/tools/logger/config.h.in @@ -0,0 +1 @@ +#cmakedefine01 HAS_INOTIFY diff --git a/tools/logger/logger.c b/tools/logger/logger.c index a28661e53caa..b5df7e185d32 100644 --- a/tools/logger/logger.c +++ b/tools/logger/logger.c @@ -5,6 +5,7 @@ // Author: Bartosz Kokoszko // Artur Kloniecki +#include #include #include #include @@ -15,11 +16,17 @@ #include #include #include + +#include +#include + +#include "config.h" + +#if HAS_INOTIFY #include #include -#include #include -#include +#endif #include "convert.h" #include "misc.h" @@ -176,6 +183,12 @@ static int append_filter_config(struct convert_config *config, const char *input return 0; } +#if !HAS_INOTIFY +static void *wait_open(const char *watched_dir, const char *expected_file) +{ + assert(HAS_INOTIFY); /* Should never be called */ +} +#else /* * This 5 minutes timeout is for "backward compatible safety" in case * any user/script of an earlier, pre-inotify version of sof-logger @@ -262,6 +275,8 @@ static void *wait_open(const char *watched_dir, const char *expected_file) return ret_stream; } +#endif // HAS_INOTIFY + int main(int argc, char *argv[]) { @@ -436,9 +451,10 @@ int main(int argc, char *argv[]) * for _any_ input file, not just for /sys/kernel/debug/sof/[e]trace */ config.in_fd = NULL; - if (strncmp(config.in_file, sys_debug, strlen(sys_debug))) { + if (!HAS_INOTIFY || + strncmp(config.in_file, sys_debug, strlen(sys_debug))) { config.in_fd = fopen(config.in_file, "rb"); - } else { + } else { // both inotify and /sys/kernel/debug/ DIR *dbg_sof = (DIR *)wait_open(sys_debug, "sof"); if (dbg_sof) { From d4fdfd9677dba6738bdfc84b433ae9c6fe7335b8 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Mon, 19 Dec 2022 17:15:36 +0200 Subject: [PATCH 091/161] sof-logger: exit with error if malloc fails In user-space tools, memory allocations can reasonably be expected to always succeed. Make this assumption explicit by adding error handling after malloc. Signed-off-by: Kai Vehmanen (cherry picked from commit 4d64893b868297e259f578267a18e18275e538c1) --- tools/logger/logger.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/logger/logger.c b/tools/logger/logger.c index b5df7e185d32..11e3753638bf 100644 --- a/tools/logger/logger.c +++ b/tools/logger/logger.c @@ -223,6 +223,11 @@ static void *wait_open(const char *watched_dir, const char *expected_file) char * const fpath = malloc(strlen(watched_dir) + 1 + strlen(expected_file) + 1); + if (!fpath) { + fprintf(stderr, "error: can't allocate memory\n"); + exit(EXIT_FAILURE); + } + strcpy(fpath, watched_dir); strcat(fpath, "/"); strcat(fpath, expected_file); From 0cfa1348a6b6a2af639895dacfe880b977f503a5 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Mon, 19 Dec 2022 16:41:48 +0200 Subject: [PATCH 092/161] logger: exit with error if calloc fails In user-space tools, memory allocations can reasonably be expected to always succeed. Make this assumption explicit by adding error handling after calloc. Signed-off-by: Kai Vehmanen (cherry picked from commit 4bec5b292c708a84a22a0a4d84e9747d61ecd70d) --- tools/logger/convert.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/logger/convert.c b/tools/logger/convert.c index 569f81579f52..fb0c8cdc2777 100644 --- a/tools/logger/convert.c +++ b/tools/logger/convert.c @@ -131,6 +131,10 @@ static const char *format_uid(uint32_t uid_ptr, int use_colors, bool be, bool up if (uid_ptr < uids_dict->base_address || uid_ptr >= uids_dict->base_address + uids_dict->data_length) { str = calloc(1, strlen(BAD_PTR_STR) + 1 + 6); + if (!str) { + log_err("can't allocate memory\n"); + exit(EXIT_FAILURE); + } sprintf(str, BAD_PTR_STR, uid_ptr); } else { uid_entry = get_uuid_entry(uid_ptr); From 5024f914d7414f99a448318466d39100352d412c Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Mon, 19 Dec 2022 16:55:24 +0200 Subject: [PATCH 093/161] sof-logger: print error if -u uart option is given with no infile sof-logger -u 115200 -d /lib/firmware/sof-foo.ldc Leads to silent failure as a NULL is passed to open(). Add explicit error handling for this case. Signed-off-by: Kai Vehmanen (cherry picked from commit 80adcdf36a1d0e0590012fe73c7fd4d593a9b3cd) --- tools/logger/logger.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/logger/logger.c b/tools/logger/logger.c index 11e3753638bf..b61023a3f301 100644 --- a/tools/logger/logger.c +++ b/tools/logger/logger.c @@ -441,6 +441,11 @@ int main(int argc, char *argv[]) if (!config.in_file && !config.dump_ldc) config.in_file = "/sys/kernel/debug/sof/etrace"; + if (!config.in_file && baud) { + fprintf(stderr, "error: No UART device specified\n"); + usage(); + } + if (config.input_std) { config.in_fd = stdin; } else if (baud) { From 47aa921bd7a533aa033980469ddcf308e1389008 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 20 Dec 2022 22:11:17 +0000 Subject: [PATCH 094/161] logger: make "global_config" truly global Finish the job that commit 5b29dae9c870 ("logger: Create global convert_config variable to avoid spaghetti code.") started but did not finish, leaving behind a supposedly "global" variable that is actually a confusing global pointer to a struct local to the main() function. This confuses some static analyzer complaining that stack values are being returned, see #6858 and #6738. This is a false positive because the main()'s stack lifespan is the same as a global but let's simplify things anyway. Also stop using 'extern' in .c files, use a proper .h file instead. Signed-off-by: Marc Herbert (cherry picked from commit 327a26bf8ad70113f1eda933e5a53df175bc8e95) --- tools/logger/convert.c | 13 ++++++++----- tools/logger/convert.h | 6 +++++- tools/logger/filter.c | 2 -- tools/logger/logger.c | 5 ++++- tools/logger/misc.c | 2 -- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/tools/logger/convert.c b/tools/logger/convert.c index fb0c8cdc2777..503966b2fb1f 100644 --- a/tools/logger/convert.c +++ b/tools/logger/convert.c @@ -65,9 +65,6 @@ static const char *BAD_PTR_STR = ""; #define UUID_LOWER "%s%s%s<%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x>%s%s%s" #define UUID_UPPER "%s%s%s<%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X>%s%s%s" -/* pointer to config for global context */ -struct convert_config *global_config; - static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_address); char *format_uid_raw(const struct sof_uuid_entry *uid_entry, int use_colors, int name_first, @@ -1037,14 +1034,20 @@ static int dump_ldc_info(void) return 0; } -int convert(struct convert_config *config) +int convert(void) { struct snd_sof_logs_header snd; struct snd_sof_uids_header uids_hdr; int count, ret = 0; + /* const pointer initialized at build time */ + if (!global_config) + abort(); + + /* just a shorter alias */ + struct convert_config * const config = global_config; + config->logs_header = &snd; - global_config = config; count = fread(&snd, sizeof(snd), 1, config->ldc_fd); if (!count) { diff --git a/tools/logger/convert.h b/tools/logger/convert.h index 607e5e59e049..dcf8d0db06b7 100644 --- a/tools/logger/convert.h +++ b/tools/logger/convert.h @@ -47,4 +47,8 @@ struct convert_config { }; uint32_t get_uuid_key(const struct sof_uuid_entry *entry); -int convert(struct convert_config *config); + +/* pointer to config for global context */ +extern struct convert_config * const global_config; + +int convert(void); diff --git a/tools/logger/filter.c b/tools/logger/filter.c index b70af55f156b..80b5f72345fd 100644 --- a/tools/logger/filter.c +++ b/tools/logger/filter.c @@ -22,8 +22,6 @@ #define COMPONENTS_SEPARATOR ',' #define COMPONENT_NAME_SCAN_STRING_LENGTH 32 -extern struct convert_config *global_config; - /** map between log level given by user and enum value */ static const struct { const char name[16]; diff --git a/tools/logger/logger.c b/tools/logger/logger.c index b61023a3f301..14f3fc88f657 100644 --- a/tools/logger/logger.c +++ b/tools/logger/logger.c @@ -282,6 +282,8 @@ static void *wait_open(const char *watched_dir, const char *expected_file) } #endif // HAS_INOTIFY +static struct convert_config _global_config; +struct convert_config * const global_config = &_global_config; int main(int argc, char *argv[]) { @@ -498,7 +500,8 @@ int main(int argc, char *argv[]) } } - ret = -convert(&config); + _global_config = config; + ret = -convert(); out: /* free memory */ diff --git a/tools/logger/misc.c b/tools/logger/misc.c index 37ca30adb9c1..20e5db9f95b8 100644 --- a/tools/logger/misc.c +++ b/tools/logger/misc.c @@ -41,8 +41,6 @@ char *log_asprintf(const char *format, ...) return result; } -extern struct convert_config *global_config; - /** Prints 1. once to stderr. 2. a second time to the global out_fd if * out_fd is neither stderr nor stdout (because the -o option was used). */ From 6733cc100189f04f8dda5e88bb082b1611d955cb Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 20 Dec 2022 23:15:48 +0000 Subject: [PATCH 095/161] logger: convert.c: move global_config->logs_header to the heap Finish the job that commit 5b29dae9c870 ("logger: Create global convert_config variable to avoid spaghetti code.") started but did not complete, leaving a confusing mix of globals and locals. This confuses some static analyzer complaining that stack values are being returned, see #6858 and #6738. This is a false positive because convert's() stack lifespan is practically the same as a global but let's simplify things anyway. Signed-off-by: Marc Herbert (cherry picked from commit 2dfaee6a7d872ae8baab03026a56da76da6a64f3) --- tools/logger/convert.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tools/logger/convert.c b/tools/logger/convert.c index 503966b2fb1f..c802c67b8951 100644 --- a/tools/logger/convert.c +++ b/tools/logger/convert.c @@ -1036,7 +1036,7 @@ static int dump_ldc_info(void) int convert(void) { - struct snd_sof_logs_header snd; + struct snd_sof_logs_header * const logs_hdr = malloc(sizeof(*logs_hdr)); struct snd_sof_uids_header uids_hdr; int count, ret = 0; @@ -1044,32 +1044,35 @@ int convert(void) if (!global_config) abort(); + if (!logs_hdr) + abort(); + /* just a shorter alias */ struct convert_config * const config = global_config; - config->logs_header = &snd; + config->logs_header = logs_hdr; - count = fread(&snd, sizeof(snd), 1, config->ldc_fd); + count = fread(logs_hdr, sizeof(*logs_hdr), 1, config->ldc_fd); if (!count) { log_err("Error while reading %s.\n", config->ldc_file); return -ferror(config->ldc_fd); } - if (strncmp((char *) snd.sig, SND_SOF_LOGS_SIG, SND_SOF_LOGS_SIG_SIZE)) { + if (strncmp((char *)logs_hdr->sig, SND_SOF_LOGS_SIG, SND_SOF_LOGS_SIG_SIZE)) { log_err("Invalid ldc file signature.\n"); return -EINVAL; } if (global_config->version_fw && /* -n option */ !global_config->dump_ldc) { - ret = verify_ldc_checksum(global_config->logs_header->version.src_hash); + ret = verify_ldc_checksum(logs_hdr->version.src_hash); if (ret) return ret; } /* default logger and ldc_file abi verification */ if (SOF_ABI_VERSION_INCOMPATIBLE(SOF_ABI_DBG_VERSION, - snd.version.abi_version)) { + logs_hdr->version.abi_version)) { log_err("abi version in %s file does not coincide with abi version used by logger.\n", config->ldc_file); log_err("logger ABI Version is %d:%d:%d\n", @@ -1077,14 +1080,14 @@ int convert(void) SOF_ABI_VERSION_MINOR(SOF_ABI_DBG_VERSION), SOF_ABI_VERSION_PATCH(SOF_ABI_DBG_VERSION)); log_err("ldc_file ABI Version is %d:%d:%d\n", - SOF_ABI_VERSION_MAJOR(snd.version.abi_version), - SOF_ABI_VERSION_MINOR(snd.version.abi_version), - SOF_ABI_VERSION_PATCH(snd.version.abi_version)); + SOF_ABI_VERSION_MAJOR(logs_hdr->version.abi_version), + SOF_ABI_VERSION_MINOR(logs_hdr->version.abi_version), + SOF_ABI_VERSION_PATCH(logs_hdr->version.abi_version)); return -EINVAL; } /* read uuid section header */ - fseek(config->ldc_fd, snd.data_offset + snd.data_length, SEEK_SET); + fseek(config->ldc_fd, logs_hdr->data_offset + logs_hdr->data_length, SEEK_SET); count = fread(&uids_hdr, sizeof(uids_hdr), 1, config->ldc_fd); if (!count) { log_err("Error while reading uuids header from %s.\n", config->ldc_file); From 0d0fa4ff0160e3019f3dc15f23819aa0d22a0fce Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Tue, 20 Dec 2022 14:28:40 +0100 Subject: [PATCH 096/161] logger: check localtime() return value localtime() can return NULL in error cases. Check the return value before dereferencing it. Signed-off-by: Guennadi Liakhovetski (cherry picked from commit 84b2dd2ae94ccc4101f44ecbea9564ffdd87d754) --- tools/logger/convert.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/logger/convert.c b/tools/logger/convert.c index c802c67b8951..0b23cac276c6 100644 --- a/tools/logger/convert.c +++ b/tools/logger/convert.c @@ -356,11 +356,14 @@ static inline void print_table_header(void) fprintf(out_fd, "%s", "CONTENT"); if (global_config->time_precision >= 0) { + struct tm *ltime = localtime(&epoc_secs); + /* e.g.: ktime=4263.487s @ 2021-04-27 14:21:13 -0700 PDT */ fprintf(out_fd, "\tktime=%lu.%03lus", ktime.tv_sec, ktime.tv_nsec / 1000000); - if (strftime(date_string, sizeof(date_string), - "%F %X %z %Z", localtime(&epoc_secs))) + + if (ltime && strftime(date_string, sizeof(date_string), + "%F %X %z %Z", ltime)) fprintf(out_fd, " @ %s", date_string); } From ffe468b71fc75836e463e81fbe5a6bb16183d10d Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Wed, 21 Dec 2022 12:56:20 +0200 Subject: [PATCH 097/161] sof-logger: ensure NULL string is not passed to printf/fprintf Due to allocation failures, or invalid content in dictionary, "params" entries in "struct proc_ldc_entry" may be NULL. In print_entry_params(), the NULL entries may be passed as arguments to fprintf(). While e.g. glibc handles these without error, this is not guaranteed behaviour and may result in segfault on some platforms. Fix the issue by aborting program if allocation fails and explicitly handling the cases when asprintf_entry_text returns NULL. Signed-off-by: Kai Vehmanen (cherry picked from commit 1a7a36a84cfe31a6f6b40488300d5b6cd709250c) --- tools/logger/convert.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/logger/convert.c b/tools/logger/convert.c index 0b23cac276c6..417d3ee6e8b4 100644 --- a/tools/logger/convert.c +++ b/tools/logger/convert.c @@ -65,6 +65,8 @@ static const char *BAD_PTR_STR = ""; #define UUID_LOWER "%s%s%s<%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x>%s%s%s" #define UUID_UPPER "%s%s%s<%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X>%s%s%s" +static const char *missing = ""; + static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_address); char *format_uid_raw(const struct sof_uuid_entry *uid_entry, int use_colors, int name_first, @@ -249,6 +251,8 @@ static void process_params(struct proc_ldc_entry *pe, /* check for string printing, because it leads to logger crash */ log_err("String printing is not supported\n"); pe->params[i] = (uintptr_t)log_asprintf("", raw_param); + if (!pe->params[i]) + abort(); pe->subst_mask |= 1 << i; ++i; p += 2; @@ -257,6 +261,8 @@ static void process_params(struct proc_ldc_entry *pe, /* substitute UUID entry address with formatted string pointer from heap */ pe->params[i] = (uintptr_t)asprintf_uuid(p, raw_param, use_colors, &uuid_fmt_len); + if (!pe->params[i]) + abort(); pe->subst_mask |= 1 << i; ++i; /* replace uuid formatter with %s */ @@ -268,7 +274,12 @@ static void process_params(struct proc_ldc_entry *pe, /* %pQ format specifier */ /* substitute log entry address with formatted entry text */ pe->params[i] = (uintptr_t)asprintf_entry_text(raw_param); - pe->subst_mask |= 1 << i; + + if (pe->params[i]) + pe->subst_mask |= 1 << i; + else + pe->params[i] = (uintptr_t)missing; + ++i; /* replace entry formatter with %s */ @@ -1021,7 +1032,7 @@ static int dump_ldc_info(void) while (remaining > 0) { name = format_uid_raw(&uid_ptr[cnt], 0, 0, false, false); uid_addr = get_uuid_key(&uid_ptr[cnt]); - fprintf(out_fd, "\t%p %s\n", (void *)uid_addr, name); + fprintf(out_fd, "\t%p %s\n", (void *)uid_addr, name ? name : missing); if (name) { free(name); From c7745e2c12cdfc1281cf46d469b5ff11861d6dd1 Mon Sep 17 00:00:00 2001 From: Adrian Warecki Date: Mon, 18 Sep 2023 15:08:26 +0200 Subject: [PATCH 098/161] smex: elf: Removed unnecessary initialization of local variables The values assigned when declaring variables were overwritten in the code. Redundant initialization was removed. Signed-off-by: Adrian Warecki (cherry picked from commit 877079af471dad5ef9329749cbedfa99ea6056bb) --- smex/elf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/smex/elf.c b/smex/elf.c index bd088716691d..3aeb62e3d4fc 100644 --- a/smex/elf.c +++ b/smex/elf.c @@ -17,7 +17,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) { Elf32_Ehdr *hdr = &module->hdr; - Elf32_Shdr *section = module->section; + Elf32_Shdr *section; size_t count; int i, ret; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); @@ -128,7 +128,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) static int elf_read_programs(struct elf_module *module, bool verbose) { Elf32_Ehdr *hdr = &module->hdr; - Elf32_Phdr *prg = module->prg; + Elf32_Phdr *prg; size_t count; int i, ret; @@ -431,7 +431,7 @@ int elf_read_section(const struct elf_module *module, const char *section_name, const Elf32_Shdr **dst_section, void **dst_buff) { const Elf32_Shdr *section; - int section_index = -1; + int section_index; int read; section_index = elf_find_section(module, section_name); From 65b34bc6b6d91106fed99f70f7f42fbe0371e036 Mon Sep 17 00:00:00 2001 From: Adrian Warecki Date: Mon, 18 Sep 2023 15:10:11 +0200 Subject: [PATCH 099/161] smex: elf: Added checking of value returned by file operation function Added checking of the value returned by fseek function and added memory release when an error is detected. Signed-off-by: Adrian Warecki (cherry picked from commit 71418367e780f34568bef70deee3d2bc49b979ff) --- smex/elf.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/smex/elf.c b/smex/elf.c index 3aeb62e3d4fc..0683df2ffe14 100644 --- a/smex/elf.c +++ b/smex/elf.c @@ -432,7 +432,7 @@ int elf_read_section(const struct elf_module *module, const char *section_name, { const Elf32_Shdr *section; int section_index; - int read; + int ret; section_index = elf_find_section(module, section_name); if (section_index < 0) { @@ -451,17 +451,25 @@ int elf_read_section(const struct elf_module *module, const char *section_name, return -ENOMEM; /* fill buffer with section content */ - fseek(module->fd, section->off, SEEK_SET); - read = fread(*dst_buff, 1, section->size, module->fd); - if (read != section->size) { - fprintf(stderr, - "error: can't read %s section %d\n", section_name, - -errno); - free(*dst_buff); - return -errno; + ret = fseek(module->fd, section->off, SEEK_SET); + if (ret) { + fprintf(stderr, "error: can't seek to %s section %d\n", section_name, -errno); + ret = -errno; + goto error; + } + + ret = fread(*dst_buff, 1, section->size, module->fd); + if (ret != section->size) { + fprintf(stderr, "error: can't read %s section %d\n", section_name, -errno); + ret = ret < 0 ? -errno : -ENODATA; + goto error; } return section->size; + +error: + free(*dst_buff); + return ret; } int elf_read_module(struct elf_module *module, const char *name, bool verbose) From 400dc5e6ca690c2fa9fc4423d764176ddca44a0a Mon Sep 17 00:00:00 2001 From: Adrian Warecki Date: Thu, 21 Sep 2023 16:20:42 +0200 Subject: [PATCH 100/161] smex: elf: Fixed an error code returned when a file operation fails If fseek reports an error, the error code set in errno is returned. Improved handling an error during reading from a file. Now it distinguishes between an error reported by the fread and insufficient data in a file. Signed-off-by: Adrian Warecki (cherry picked from commit e5f337ba70a5c4154e803917f35d7416d1705763) --- smex/elf.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/smex/elf.c b/smex/elf.c index 0683df2ffe14..9cafa0d1214c 100644 --- a/smex/elf.c +++ b/smex/elf.c @@ -27,7 +27,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) if (ret < 0) { fprintf(stderr, "error: can't seek to %s section header %d\n", module->elf_file, ret); - return ret; + return -errno; } /* allocate space for each section header */ @@ -41,7 +41,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) if (count != hdr->shnum) { fprintf(stderr, "error: failed to read %s section header %d\n", module->elf_file, -errno); - return -errno; + return count < 0 ? -errno : -ENODATA; } /* read in strings */ @@ -56,7 +56,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) if (ret < 0) { fprintf(stderr, "error: can't seek to %s stringss %d\n", module->elf_file, ret); - return ret; + return -errno; } count = fread(module->strings, 1, section[hdr->shstrndx].size, @@ -64,7 +64,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) if (count != section[hdr->shstrndx].size) { fprintf(stderr, "error: failed to read %s strings %d\n", module->elf_file, -errno); - return -errno; + return count < 0 ? -errno : -ENODATA; } module->bss_index = elf_find_section(module, ".bss"); @@ -137,7 +137,7 @@ static int elf_read_programs(struct elf_module *module, bool verbose) if (ret < 0) { fprintf(stderr, "error: cant seek to %s program header %d\n", module->elf_file, ret); - return ret; + return -errno; } /* allocate space for programs */ @@ -151,7 +151,7 @@ static int elf_read_programs(struct elf_module *module, bool verbose) if (count != hdr->phnum) { fprintf(stderr, "error: failed to read %s program header %d\n", module->elf_file, -errno); - return -errno; + return count < 0 ? -errno : -ENODATA; } /* check each program */ @@ -191,7 +191,7 @@ static int elf_read_hdr(struct elf_module *module, bool verbose) if (count != 1) { fprintf(stderr, "error: failed to read %s elf header %d\n", module->elf_file, -errno); - return -errno; + return count < 0 ? -errno : -ENODATA; } if (!verbose) @@ -398,6 +398,7 @@ int elf_find_section(const struct elf_module *module, const char *name) ret = fseek(module->fd, section->off, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: cant seek to string section %d\n", ret); + ret = -errno; goto out; } @@ -405,7 +406,7 @@ int elf_find_section(const struct elf_module *module, const char *name) if (count != section->size) { fprintf(stderr, "error: can't read string section %d\n", -errno); - ret = -errno; + ret = count < 0 ? -errno : -ENODATA; goto out; } @@ -487,12 +488,16 @@ int elf_read_module(struct elf_module *module, const char *name, bool verbose) /* get file size */ ret = fseek(module->fd, 0, SEEK_END); - if (ret < 0) + if (ret < 0) { + ret = -errno; goto hdr_err; + } module->file_size = ftell(module->fd); ret = fseek(module->fd, 0, SEEK_SET); - if (ret < 0) + if (ret < 0) { + ret = -errno; goto hdr_err; + } /* read in elf header */ ret = elf_read_hdr(module, verbose); From 88f49fdad45450f1bd416204b5986c8ae84bbeab Mon Sep 17 00:00:00 2001 From: Adrian Warecki Date: Mon, 18 Sep 2023 15:11:09 +0200 Subject: [PATCH 101/161] smex: elf: elf_find_section: Check function input data String terminator was added to the buffer with a list of section names in the elf file. Added check to the section name index to make sure it doesn't go beyond the buffer size. Signed-off-by: Adrian Warecki (cherry picked from commit 5c016bc9e78b8cef0f6e755ad66e17107feb10d7) --- smex/elf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/smex/elf.c b/smex/elf.c index 9cafa0d1214c..0d0e976dcb8a 100644 --- a/smex/elf.c +++ b/smex/elf.c @@ -409,10 +409,17 @@ int elf_find_section(const struct elf_module *module, const char *name) ret = count < 0 ? -errno : -ENODATA; goto out; } + buffer[section->size - 1] = '\0'; /* find section with name */ for (i = 0; i < hdr->shnum; i++) { s = &module->section[i]; + if (s->name >= section->size) { + fprintf(stderr, "error: invalid section name string index %d\n", s->name); + ret = -EINVAL; + goto out; + } + if (!strcmp(name, buffer + s->name)) { ret = i; goto out; From 7c9b26fc1c452b91fa2930d6ee70295271d9fa9d Mon Sep 17 00:00:00 2001 From: Adrian Warecki Date: Mon, 18 Sep 2023 15:23:36 +0200 Subject: [PATCH 102/161] logger: convert: Fixed handling of an error reported by clock_gettime The clock_gettime function only returns information that an error occurred. The error code should be taken from the errno variable. Signed-off-by: Adrian Warecki (cherry picked from commit f882c301f1555433e13fb6d16babfc40445cabe6) --- tools/logger/convert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/logger/convert.c b/tools/logger/convert.c index 417d3ee6e8b4..bf26f758e188 100644 --- a/tools/logger/convert.c +++ b/tools/logger/convert.c @@ -349,7 +349,7 @@ static inline void print_table_header(void) if (gettime_ret) { log_err("clock_gettime() failed: %s\n", - strerror(gettime_ret)); + strerror(errno)); exit(1); } From de8457ed9af021de05317ba5fac130c30c1f6c7f Mon Sep 17 00:00:00 2001 From: Adrian Warecki Date: Mon, 18 Sep 2023 15:26:37 +0200 Subject: [PATCH 103/161] logger: convert: Added error handling for file operation functions. Added checking of value returned by file operation functions. In case of an error, message is printed and error code is returned. Signed-off-by: Adrian Warecki (cherry picked from commit 9f36a5dc11683a57ad2c448ba6125c070f4b08f2) --- tools/logger/convert.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/tools/logger/convert.c b/tools/logger/convert.c index bf26f758e188..0977108c6219 100644 --- a/tools/logger/convert.c +++ b/tools/logger/convert.c @@ -624,7 +624,13 @@ static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_ entry->params = NULL; /* set file position to beginning of processed entry */ - fseek(global_config->ldc_fd, entry_offset, SEEK_SET); + ret = fseek(global_config->ldc_fd, entry_offset, SEEK_SET); + if (ret) { + log_err("Failed to seek to entry header for offset 0x%x in dictionary.\n", + entry_offset); + ret = -errno; + goto out; + } /* fetching elf header params */ ret = fread(&entry->header, sizeof(entry->header), 1, global_config->ldc_fd); @@ -915,8 +921,13 @@ static int logger_read(void) /* When the address is not correct, move forward by one DWORD (not * entire struct dma_log) */ - fseek(global_config->in_fd, -(sizeof(dma_log) - sizeof(uint32_t)), - SEEK_CUR); + ret = fseek(global_config->in_fd, -(sizeof(dma_log) - sizeof(uint32_t)), + SEEK_CUR); + if (ret) { + log_err("fetch_entry() failed on seek, aborting\n"); + ret = -errno; + break; + } skipped_dwords++; continue; @@ -1013,7 +1024,7 @@ static int dump_ldc_info(void) if (global_config->version_fd) { struct sof_ipc_fw_version ver; - if (fread(&ver, sizeof(ver), 1, global_config->version_fd)) + if (fread(&ver, sizeof(ver), 1, global_config->version_fd) == 1) fprintf(out_fd, "Loaded FW expects checksum\t0x%08x\n", ver.src_hash); } @@ -1101,7 +1112,12 @@ int convert(void) } /* read uuid section header */ - fseek(config->ldc_fd, logs_hdr->data_offset + logs_hdr->data_length, SEEK_SET); + ret = fseek(config->ldc_fd, logs_hdr->data_offset + logs_hdr->data_length, SEEK_SET); + if (ret) { + log_err("Error while seeking to uuids header from %s.\n", config->ldc_file); + return -errno; + } + count = fread(&uids_hdr, sizeof(uids_hdr), 1, config->ldc_fd); if (!count) { log_err("Error while reading uuids header from %s.\n", config->ldc_file); From 760cca264d38c4d04b6adae17f92829f24ddc6b3 Mon Sep 17 00:00:00 2001 From: Adrian Warecki Date: Mon, 18 Sep 2023 15:31:28 +0200 Subject: [PATCH 104/161] logger: convert: Simplified printing of a timestamp The timestamp printing process has been simplified by eliminating the dynamic creation of the formatting string. All necessary parameters are now passed directly to the printing function. Signed-off-by: Adrian Warecki (cherry picked from commit 4c905f5234faf2cb32b0663dfd0b1c494b0a2a93) --- tools/logger/convert.c | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/tools/logger/convert.c b/tools/logger/convert.c index 0977108c6219..7ed2772aed00 100644 --- a/tools/logger/convert.c +++ b/tools/logger/convert.c @@ -339,7 +339,6 @@ static inline void print_table_header(void) { FILE *out_fd = global_config->out_fd; int hide_location = global_config->hide_location; - char time_fmt[32]; char date_string[64]; const time_t epoc_secs = time(NULL); @@ -354,11 +353,9 @@ static inline void print_table_header(void) } if (global_config->time_precision >= 0) { - const unsigned int ts_width = - timestamp_width(global_config->time_precision); - snprintf(time_fmt, sizeof(time_fmt), "%%-%ds(us)%%%ds ", - ts_width, ts_width); - fprintf(out_fd, time_fmt, " TIMESTAMP", "DELTA"); + const unsigned int ts_width = timestamp_width(global_config->time_precision); + + fprintf(out_fd, "%*s(us)%*s ", -ts_width, " TIMESTAMP", ts_width, "DELTA"); } fprintf(out_fd, "%2s %-18s ", "C#", "COMPONENT"); @@ -476,7 +473,6 @@ static void print_entry_params(const struct log_entry_header *dma_log, char ids[TRACE_MAX_IDS_STR]; float dt = to_usecs(dma_log->timestamp - last_timestamp); struct proc_ldc_entry proc_entry; - static char time_fmt[64]; int ret; if (raw_output) @@ -517,13 +513,7 @@ static void print_entry_params(const struct log_entry_header *dma_log, ids[0] = '\0'; if (raw_output) { /* "raw" means script-friendly (not all hex) */ - const char *entry_fmt = "%s%u %u %s%s%s "; - - if (time_precision >= 0) - snprintf(time_fmt, sizeof(time_fmt), "%%.%df %%.%df ", - time_precision, time_precision); - - fprintf(out_fd, entry_fmt, + fprintf(out_fd, "%s%u %u %s%s%s ", entry->header.level == use_colors ? (LOG_LEVEL_CRITICAL ? KRED : KNRM) : "", dma_log->core_id, @@ -531,9 +521,12 @@ static void print_entry_params(const struct log_entry_header *dma_log, get_component_name(entry->header.component_class, dma_log->uid), raw_output && strlen(ids) ? "-" : "", ids); + if (time_precision >= 0) - fprintf(out_fd, time_fmt, - to_usecs(dma_log->timestamp - timestamp_origin), dt); + fprintf(out_fd, "%.*f %.*f ", + time_precision, to_usecs(dma_log->timestamp - timestamp_origin), + time_precision, dt); + if (!hide_location) fprintf(out_fd, "(%s:%u) ", format_file_name(entry->file_name, raw_output), @@ -542,13 +535,11 @@ static void print_entry_params(const struct log_entry_header *dma_log, if (time_precision >= 0) { const unsigned int ts_width = timestamp_width(time_precision); - snprintf(time_fmt, sizeof(time_fmt), - "%%s[%%%d.%df] (%%%d.%df)%%s ", - ts_width, time_precision, ts_width, time_precision); - - fprintf(out_fd, time_fmt, + fprintf(out_fd, "%s[%*.*f] (%*.*f)%s ", use_colors ? KGRN : "", - to_usecs(dma_log->timestamp - timestamp_origin), dt, + ts_width, time_precision, + to_usecs(dma_log->timestamp - timestamp_origin), + ts_width, time_precision, dt, use_colors ? KNRM : ""); } From 3e8a80a3992463b5342b58d80e453ac49b79ab00 Mon Sep 17 00:00:00 2001 From: Adrian Warecki Date: Mon, 18 Sep 2023 15:35:11 +0200 Subject: [PATCH 105/161] logger: convert: read_entry_from_ldc_file: Make sure string null terminated Added a null string terminator to be sure that strings read from a file are terminated correctly. Signed-off-by: Adrian Warecki (cherry picked from commit 30a2855d48c87aa039d77c7618bb5d97ee5cbaae) --- tools/logger/convert.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/logger/convert.c b/tools/logger/convert.c index 7ed2772aed00..b5d750341d39 100644 --- a/tools/logger/convert.c +++ b/tools/logger/convert.c @@ -637,7 +637,7 @@ static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_ ret = -EINVAL; goto out; } - entry->file_name = (char *)malloc(entry->header.file_name_len); + entry->file_name = (char *)malloc(entry->header.file_name_len + 1); if (!entry->file_name) { log_err("can't allocate %d byte for entry.file_name\n", @@ -648,6 +648,8 @@ static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_ ret = fread(entry->file_name, sizeof(char), entry->header.file_name_len, global_config->ldc_fd); + entry->file_name[entry->header.file_name_len] = '\0'; + if (ret != entry->header.file_name_len) { log_err("Failed to read source filename for offset 0x%x in dictionary.\n", entry_offset); @@ -661,7 +663,7 @@ static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_ ret = -EINVAL; goto out; } - entry->text = (char *)malloc(entry->header.text_len); + entry->text = (char *)malloc(entry->header.text_len + 1); if (!entry->text) { log_err("can't allocate %d byte for entry.text\n", entry->header.text_len); ret = -ENOMEM; @@ -674,6 +676,7 @@ static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_ ret = -1; goto out; } + entry->text[entry->header.text_len] = '\0'; return 0; From cbf76cb26f5d0b0065a5c9b33f2d2522cfd785ec Mon Sep 17 00:00:00 2001 From: Adrian Warecki Date: Mon, 18 Sep 2023 15:37:12 +0200 Subject: [PATCH 106/161] logger: convert: Code quality improvements The precision check condition has been simplified, the unsigned value cannot be negative. Added definitions containing an error message instead of using a constant variable. Signed-off-by: Adrian Warecki (cherry picked from commit 56a135216394a85cfe9d6f8474ee511335241ff4) --- tools/logger/convert.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/logger/convert.c b/tools/logger/convert.c index b5d750341d39..e393f828e1b1 100644 --- a/tools/logger/convert.c +++ b/tools/logger/convert.c @@ -60,8 +60,7 @@ struct proc_ldc_entry { uintptr_t params[TRACE_MAX_PARAMS_COUNT]; }; -static const char *BAD_PTR_STR = ""; - +#define BAD_PTR_STR "" #define UUID_LOWER "%s%s%s<%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x>%s%s%s" #define UUID_UPPER "%s%s%s<%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X>%s%s%s" @@ -325,7 +324,7 @@ static unsigned int timestamp_width(unsigned int precision) * gcc 9.3, this avoids a very long precision causing snprintf() * to truncate time_fmt */ - assert(precision >= 0 && precision < 20); + assert(precision < 20); /* * 12 digits for units is enough for 1M seconds = 11 days which * should be enough for most test runs. From 2b4a9f469d737dc4a39eb214b7c7ab841469fc0d Mon Sep 17 00:00:00 2001 From: Adrian Warecki Date: Mon, 18 Sep 2023 15:42:56 +0200 Subject: [PATCH 107/161] tools: logger: Use a safe variant of the string manipulation functions Used string manipulation functions that check the size of the available buffer. Signed-off-by: Adrian Warecki (cherry picked from commit 651af68384cb872676ac8c14f4bcdf1df7c4ff0f) --- tools/logger/logger.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tools/logger/logger.c b/tools/logger/logger.c index 14f3fc88f657..5991289ee296 100644 --- a/tools/logger/logger.c +++ b/tools/logger/logger.c @@ -104,8 +104,8 @@ static int snapshot(const char *name) for (i = 0; i < ARRAY_SIZE(debugfs); i++) { - sprintf(pinname, "%s/%s", path, debugfs[i]); - sprintf(poutname, "%s.%s.txt", name, debugfs[i]); + snprintf(pinname, sizeof(pinname), "%s/%s", path, debugfs[i]); + snprintf(poutname, sizeof(poutname), "%s.%s.txt", name, debugfs[i]); /* open debugfs for reading */ in_fd = fopen(pinname, "rb"); @@ -132,7 +132,7 @@ static int snapshot(const char *name) if (count != 4) break; - sprintf(buffer, "0x%6.6x: 0x%8.8x\n", addr, val); + snprintf(buffer, sizeof(buffer), "0x%6.6x: 0x%8.8x\n", addr, val); count = fwrite(buffer, 1, strlen(buffer), out_fd); @@ -220,17 +220,15 @@ static void *wait_open(const char *watched_dir, const char *expected_file) const int dwatch = inotify_add_watch(iqueue, watched_dir, IN_CREATE); struct stat expected_stat; void *ret_stream = NULL; - - char * const fpath = malloc(strlen(watched_dir) + 1 + strlen(expected_file) + 1); + const int fpath_len = strlen(watched_dir) + 1 + strlen(expected_file) + 1; + char * const fpath = malloc(fpath_len); if (!fpath) { fprintf(stderr, "error: can't allocate memory\n"); exit(EXIT_FAILURE); } - strcpy(fpath, watched_dir); - strcat(fpath, "/"); - strcat(fpath, expected_file); + snprintf(fpath, fpath_len, "%s/%s", watched_dir, expected_file); /* Not racy because the inotify watch was set first. */ if (!access(fpath, F_OK)) From abac95f30b2acf4b797ca82770b40e8a1e30b31e Mon Sep 17 00:00:00 2001 From: Adrian Warecki Date: Mon, 18 Sep 2023 15:52:14 +0200 Subject: [PATCH 108/161] tools: logger: Fix resources release Improved release of resources when an error is detected. Signed-off-by: Adrian Warecki (cherry picked from commit 966ad48e7ed87ff4117e5d54af5d6c95e2d4bff3) --- tools/logger/logger.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/tools/logger/logger.c b/tools/logger/logger.c index 5991289ee296..b6c2b26bd629 100644 --- a/tools/logger/logger.c +++ b/tools/logger/logger.c @@ -134,7 +134,12 @@ static int snapshot(const char *name) snprintf(buffer, sizeof(buffer), "0x%6.6x: 0x%8.8x\n", addr, val); - count = fwrite(buffer, 1, strlen(buffer), out_fd); + i = strlen(buffer); + count = fwrite(buffer, 1, i, out_fd); + if (count != i) { + fprintf(stderr, "error: an error occurred during write to %s: %s\n", + poutname, strerror(errno)); + } addr += 4; } @@ -164,7 +169,12 @@ static int configure_uart(const char *file, unsigned int baud) tio.c_cc[VMIN] = 1; ret = tcsetattr(fd, TCSANOW, &tio); - return ret < 0 ? -errno : fd; + if (ret < 0) { + close(fd); + return -errno; + } + + return fd; } /* Concantenate `config->filter_config` with `input` + `\n` */ @@ -266,7 +276,9 @@ static void *wait_open(const char *watched_dir, const char *expected_file) } fopenit: - stat(fpath, &expected_stat); + if (stat(fpath, &expected_stat)) + goto cleanup; + if ((expected_stat.st_mode & S_IFMT) == S_IFDIR) ret_stream = opendir(fpath); else @@ -362,7 +374,8 @@ int main(int argc, char *argv[]) if (i < 0 || 1 < i) { fprintf(stderr, "%s: invalid option: -e %s\n", APP_NAME, optarg); - return -EINVAL; + ret = -EINVAL; + goto out; } config.relative_timestamps = i; break; @@ -371,7 +384,8 @@ int main(int argc, char *argv[]) config.time_precision = atoi(optarg); if (config.time_precision < 0) { usage(); - return -EINVAL; + ret = -EINVAL; + goto out; } break; case 'g': @@ -401,8 +415,10 @@ int main(int argc, char *argv[]) usage(); } - if (snapshot_file) - return baud ? EINVAL : -snapshot(snapshot_file); + if (snapshot_file) { + ret = baud ? EINVAL : -snapshot(snapshot_file); + goto out; + } if (!config.ldc_file) { fprintf(stderr, "error: Missing ldc file\n"); From a0cf075afd6fbe7a31b7c4a279c5c5122e14f597 Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Tue, 3 Oct 2023 09:09:53 +0800 Subject: [PATCH 109/161] topology1: sof-adl-cs35l41: remove pop noise Enable bclk early start to remove speaker pop noise when resuming from S3 or switching audio path. Signed-off-by: Brent Lu --- tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 index fca5062752d1..02f4bd7caae5 100644 --- a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 +++ b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 @@ -475,7 +475,7 @@ ifelse( SSP_CLOCK(bclk, 6144000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(4, 32, 3, 15), - SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 24)))', + SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 24, 0, 0, 0, SSP_CC_BCLK_ES)))', CODEC, `RT5650', ` SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 3072000, codec_slave), From dba4a81f577ae1fef0503425bf48bb80ccf5b469 Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Thu, 12 Oct 2023 13:17:11 +0800 Subject: [PATCH 110/161] topology1: Use DYNAMIC for RPL SDW topologies Use dynamic for all the rpl SDW topologies. Signed-off-by: Bard Liao --- tools/topology/topology1/CMakeLists.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 7fb0ff27806b..4b721f19a88f 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -131,14 +131,14 @@ set(TPLGS "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l0-rt1316-l13-rt714-l2\;-DPLATFORM=adl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=3\;-DEXT_AMP_REF\;-DMIC_LINK=2" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DNOAMP\;-DNO_LOCAL_MIC" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DNOAMP\;-DNO_LOCAL_MIC" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DNOAMP\;-DNO_LOCAL_MIC\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DNOAMP\;-DNO_LOCAL_MIC\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC\;-DDYNAMIC=1" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" @@ -147,8 +147,8 @@ set(TPLGS "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l2-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l2-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" - "sof-tgl-rt711-rt1308\;sof-rpl-rt711-4ch\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=rpl" - "sof-tgl-rt711-rt1308\;sof-rpl-rt711\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=rpl" + "sof-tgl-rt711-rt1308\;sof-rpl-rt711-4ch\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=rpl\;-DDYNAMIC=1" + "sof-tgl-rt711-rt1308\;sof-rpl-rt711\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=rpl\;-DDYNAMIC=1" ## end SoundWire topologies ## SoundWire NOJACK topologies @@ -156,7 +156,7 @@ set(TPLGS "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l0\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l12-rt714-l0\;-DPLATFORM=adl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l3\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt1316-l12-rt714-l0\;-DPLATFORM=rpl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt1316-l12-rt714-l0\;-DPLATFORM=rpl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0\;-DDYNAMIC=1" ## end SoundWire NOJACK topologies "sof-ehl-rt5660\;sof-ehl-rt5660\;-DHDMI=1" From eff661bcdaed0228ea43ad0814ce454a5dc4c8ce Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Mon, 27 Jun 2022 16:51:31 +0800 Subject: [PATCH 111/161] intel: ssp: implement mclk always-on feature In the earliest design, mclk is turned on in set_config() and never turned off. The behavior is modified in this commit: d5840a920073 ("ssp: move mclk request/release to pre_start and post_stop") Now the mclk is enabled only during audio streaming so some codec may pop. This commit adds the always-on behavior back as an new feature. Signed-off-by: Brent Lu (cherry picked from commit 8dfc008b8b99a1bdbe7707739b62714aaa65abf6) --- src/drivers/intel/ssp/ssp.c | 17 +++++++++++++++-- src/include/ipc/dai-intel.h | 2 ++ src/include/kernel/abi.h | 4 ++-- src/include/sof/drivers/ssp.h | 1 + tools/topology/topology1/platform/common/ssp.m4 | 2 ++ 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/drivers/intel/ssp/ssp.c b/src/drivers/intel/ssp/ssp.c index d0162e61dae1..4da6cd6427d2 100644 --- a/src/drivers/intel/ssp/ssp.c +++ b/src/drivers/intel/ssp/ssp.c @@ -736,6 +736,17 @@ static int ssp_set_config_tplg(struct dai *dai, struct ipc_config_dai *common_co ssp->state[DAI_DIR_CAPTURE] = COMP_STATE_PREPARE; clk: + /* MCLK always-on: turn on mclk and never turn it off */ + if (ssp->params.clks_control & SOF_DAI_INTEL_SSP_CLKCTRL_MCLK_AON) { + ret = ssp_mclk_prepare_enable(dai); + if (ret < 0) + goto out; + + ssp->clk_active |= SSP_CLK_MCLK_AON_REQ; + + dai_info(dai, "ssp_set_config(): enable MCLK for SSP%d", dai->index); + } + switch (config->flags & SOF_DAI_CONFIG_FLAGS_CMD_MASK) { case SOF_DAI_CONFIG_FLAGS_HW_PARAMS: if (ssp->params.clks_control & SOF_DAI_INTEL_SSP_CLKCTRL_MCLK_ES) { @@ -910,7 +921,8 @@ static int ssp_pre_start(struct dai *dai) * We will test if mclk/bclk is configured in * ssp_mclk/bclk_prepare_enable/disable functions */ - if (!(ssp->clk_active & SSP_CLK_MCLK_ES_REQ)) { + if (!(ssp->clk_active & SSP_CLK_MCLK_ES_REQ) && + !(ssp->clk_active & SSP_CLK_MCLK_AON_REQ)) { /* MCLK config */ ret = ssp_mclk_prepare_enable(dai); if (ret < 0) @@ -940,7 +952,8 @@ static void ssp_post_stop(struct dai *dai) dai->index); ssp_bclk_disable_unprepare(dai); } - if (!(ssp->clk_active & SSP_CLK_MCLK_ES_REQ)) { + if (!(ssp->clk_active & SSP_CLK_MCLK_ES_REQ) && + !(ssp->clk_active & SSP_CLK_MCLK_AON_REQ)) { dai_info(dai, "ssp_post_stop releasing MCLK clocks for SSP%d...", dai->index); ssp_mclk_disable_unprepare(dai); diff --git a/src/include/ipc/dai-intel.h b/src/include/ipc/dai-intel.h index 41e39a47db1f..4545a2b40282 100644 --- a/src/include/ipc/dai-intel.h +++ b/src/include/ipc/dai-intel.h @@ -60,6 +60,8 @@ #define SOF_DAI_INTEL_SSP_CLKCTRL_MCLK_ES BIT(6) /* bclk early start */ #define SOF_DAI_INTEL_SSP_CLKCTRL_BCLK_ES BIT(7) +/* mclk always on */ +#define SOF_DAI_INTEL_SSP_CLKCTRL_MCLK_AON BIT(8) /* DMIC max. four controllers for eight microphone channels */ #define SOF_DAI_INTEL_DMIC_NUM_CTRL 4 diff --git a/src/include/kernel/abi.h b/src/include/kernel/abi.h index f59fa1f2bc0a..b14618749a5e 100644 --- a/src/include/kernel/abi.h +++ b/src/include/kernel/abi.h @@ -29,8 +29,8 @@ /** \brief SOF ABI version major, minor and patch numbers */ #define SOF_ABI_MAJOR 3 -#define SOF_ABI_MINOR 22 -#define SOF_ABI_PATCH 1 +#define SOF_ABI_MINOR 23 +#define SOF_ABI_PATCH 0 /** \brief SOF ABI version number. Format within 32bit word is MMmmmppp */ #define SOF_ABI_MAJOR_SHIFT 24 diff --git a/src/include/sof/drivers/ssp.h b/src/include/sof/drivers/ssp.h index 5d6e8988808a..7757816fe904 100644 --- a/src/include/sof/drivers/ssp.h +++ b/src/include/sof/drivers/ssp.h @@ -232,6 +232,7 @@ extern const struct dai_driver ssp_driver; #define SSP_CLK_MCLK_ACTIVE BIT(1) #define SSP_CLK_BCLK_ES_REQ BIT(2) #define SSP_CLK_BCLK_ACTIVE BIT(3) +#define SSP_CLK_MCLK_AON_REQ BIT(4) /* SSP private data */ struct ssp_pdata { diff --git a/tools/topology/topology1/platform/common/ssp.m4 b/tools/topology/topology1/platform/common/ssp.m4 index 39a5ba185b0f..9dbedcf643f6 100644 --- a/tools/topology/topology1/platform/common/ssp.m4 +++ b/tools/topology/topology1/platform/common/ssp.m4 @@ -34,6 +34,8 @@ dnl SSP_CC_MCLK_ES 64 = (1 << 6) define(`SSP_CC_MCLK_ES', 64) dnl SSP_CC_BCLK_ES 128 = (1 << 7) define(`SSP_CC_BCLK_ES', 128) +dnl SSP_CC_BCLK_ES 256 = (1 << 8) +define(`SSP_CC_MCLK_AON', 256) dnl SSP_CONFIG_DATA(type, idx, valid bits, mclk_id, quirks, bclk_delay, dnl clks_control, pulse_width, padding) From 57823bd2557b5adff27a56951c99d543107bb850 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Wed, 1 Nov 2023 09:46:30 +0200 Subject: [PATCH 112/161] intel: ssp: Ignore TX/RX or DMA request enable bits from blob When loading the SSP configuration from a blob ignore the bits which would enable the TX/RX or DMA requests at configuration phase. The TX/RX enable and DMA request is handled by the driver itself. If the blob wrongly enables any of the bits can have runtime (startup time) seemingly random issues. Signed-off-by: Peter Ujfalusi --- src/drivers/intel/ssp/ssp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/drivers/intel/ssp/ssp.c b/src/drivers/intel/ssp/ssp.c index 4da6cd6427d2..0e9a2bc697f1 100644 --- a/src/drivers/intel/ssp/ssp.c +++ b/src/drivers/intel/ssp/ssp.c @@ -835,18 +835,19 @@ static int ssp_set_config_blob(struct dai *dai, struct ipc_config_dai *common_co { struct ipc4_ssp_configuration_blob *blob = spec_config; struct ssp_pdata *ssp = dai_get_drvdata(dai); - uint32_t ssc0, sstsa, ssrsa; + uint32_t ssc0, sstsa, ssrsa, sscr1; /* set config only once for playback or capture */ if (dai->sref > 1) return 0; ssc0 = blob->i2s_driver_config.i2s_config.ssc0; - sstsa = blob->i2s_driver_config.i2s_config.sstsa; - ssrsa = blob->i2s_driver_config.i2s_config.ssrsa; + sstsa = SSTSA_GET(blob->i2s_driver_config.i2s_config.sstsa); + ssrsa = SSRSA_GET(blob->i2s_driver_config.i2s_config.ssrsa); + sscr1 = blob->i2s_driver_config.i2s_config.ssc1 & ~(SSCR1_RSRE | SSCR1_TSRE); ssp_write(dai, SSCR0, ssc0); - ssp_write(dai, SSCR1, blob->i2s_driver_config.i2s_config.ssc1); + ssp_write(dai, SSCR1, sscr1); ssp_write(dai, SSCR2, blob->i2s_driver_config.i2s_config.ssc2); ssp_write(dai, SSCR3, blob->i2s_driver_config.i2s_config.ssc3); ssp_write(dai, SSPSP, blob->i2s_driver_config.i2s_config.sspsp); @@ -857,8 +858,7 @@ static int ssp_set_config_blob(struct dai *dai, struct ipc_config_dai *common_co ssp_write(dai, SSRSA, ssrsa); dai_info(dai, "ssp_set_config(), sscr0 = 0x%08x, sscr1 = 0x%08x, ssto = 0x%08x, sspsp = 0x%0x", - ssc0, blob->i2s_driver_config.i2s_config.ssc1, - blob->i2s_driver_config.i2s_config.sscto, + ssc0, sscr1, blob->i2s_driver_config.i2s_config.sscto, blob->i2s_driver_config.i2s_config.sspsp); dai_info(dai, "ssp_set_config(), sscr2 = 0x%08x, sspsp2 = 0x%08x, sscr3 = 0x%08x", blob->i2s_driver_config.i2s_config.ssc2, blob->i2s_driver_config.i2s_config.sspsp2, From 93f6c5e0c214e3598eb866d0b7728d48e4ff66df Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 1 Jun 2023 17:15:22 +0300 Subject: [PATCH 113/161] intel: ssp: Manage the DMA request enable/disable dynamically Do not keep both DMA request enabled whenever the SSP is in use. Manage the SSCR1_TSRE and SSCR1_RSRE bits in sync with the enabled directions. When only playback is used there is no need to have the RX DMA request enabled for example. Signed-off-by: Peter Ujfalusi --- src/drivers/intel/ssp/ssp.c | 42 ++++++++++--------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/src/drivers/intel/ssp/ssp.c b/src/drivers/intel/ssp/ssp.c index 0e9a2bc697f1..d83e3120040e 100644 --- a/src/drivers/intel/ssp/ssp.c +++ b/src/drivers/intel/ssp/ssp.c @@ -773,12 +773,6 @@ static int ssp_set_config_tplg(struct dai *dai, struct ipc_config_dai *common_co ssp->clk_active |= SSP_CLK_BCLK_ES_REQ; if (enable_sse) { - - /* enable TRSE/RSRE before SSE */ - ssp_update_bits(dai, SSCR1, - SSCR1_TSRE | SSCR1_RSRE, - SSCR1_TSRE | SSCR1_RSRE); - /* enable port */ ssp_update_bits(dai, SSCR0, SSCR0_SSE, SSCR0_SSE); @@ -802,11 +796,6 @@ static int ssp_set_config_tplg(struct dai *dai, struct ipc_config_dai *common_co dai_info(dai, "ssp_set_config(): hw_free stage: releasing BCLK clocks for SSP%d...", dai->index); if (ssp->clk_active & SSP_CLK_BCLK_ACTIVE) { - /* clear TRSE/RSRE before SSE */ - ssp_update_bits(dai, SSCR1, - SSCR1_TSRE | SSCR1_RSRE, - 0); - ssp_update_bits(dai, SSCR0, SSCR0_SSE, 0); dai_info(dai, "ssp_set_config(): SSE clear for SSP%d", dai->index); } @@ -886,9 +875,6 @@ static int ssp_set_config_blob(struct dai *dai, struct ipc_config_dai *common_co blob->i2s_driver_config.mclk_config.mdivr); ssp->clk_active |= SSP_CLK_MCLK_ES_REQ; - /* enable TRSE/RSRE before SSE */ - ssp_update_bits(dai, SSCR1, SSCR1_TSRE | SSCR1_RSRE, SSCR1_TSRE | SSCR1_RSRE); - /* enable port */ ssp_update_bits(dai, SSCR0, SSCR0_SSE, SSCR0_SSE); ssp->clk_active |= SSP_CLK_BCLK_ES_REQ; @@ -1008,11 +994,6 @@ static void ssp_early_start(struct dai *dai, int direction) ssp_pre_start(dai); if (!(ssp->clk_active & SSP_CLK_BCLK_ES_REQ)) { - /* enable TRSE/RSRE before SSE */ - ssp_update_bits(dai, SSCR1, - SSCR1_TSRE | SSCR1_RSRE, - SSCR1_TSRE | SSCR1_RSRE); - /* enable port */ ssp_update_bits(dai, SSCR0, SSCR0_SSE, SSCR0_SSE); dai_info(dai, "ssp_early_start(): SSE set for SSP%d", dai->index); @@ -1033,10 +1014,13 @@ static void ssp_start(struct dai *dai, int direction) dai_info(dai, "ssp_start()"); /* enable DMA */ - if (direction == DAI_DIR_PLAYBACK) + if (direction == DAI_DIR_PLAYBACK) { + ssp_update_bits(dai, SSCR1, SSCR1_TSRE, SSCR1_TSRE); ssp_update_bits(dai, SSTSA, SSTSA_TXEN, SSTSA_TXEN); - else + } else { + ssp_update_bits(dai, SSCR1, SSCR1_RSRE, SSCR1_RSRE); ssp_update_bits(dai, SSRSA, SSRSA_RXEN, SSRSA_RXEN); + } ssp->state[direction] = COMP_STATE_ACTIVE; @@ -1083,6 +1067,7 @@ static void ssp_stop(struct dai *dai, int direction) if (direction == DAI_DIR_CAPTURE && ssp->state[SOF_IPC_STREAM_CAPTURE] != COMP_STATE_PREPARE) { ssp_update_bits(dai, SSRSA, SSRSA_RXEN, 0); + ssp_update_bits(dai, SSCR1, SSCR1_RSRE, 0); ssp_empty_rx_fifo_on_stop(dai); ssp->state[SOF_IPC_STREAM_CAPTURE] = COMP_STATE_PREPARE; dai_info(dai, "ssp_stop(), RX stop"); @@ -1091,6 +1076,7 @@ static void ssp_stop(struct dai *dai, int direction) /* stop Tx if needed */ if (direction == DAI_DIR_PLAYBACK && ssp->state[SOF_IPC_STREAM_PLAYBACK] != COMP_STATE_PREPARE) { + ssp_update_bits(dai, SSCR1, SSCR1_TSRE, 0); ssp_empty_tx_fifo(dai); ssp_update_bits(dai, SSTSA, SSTSA_TXEN, 0); ssp->state[SOF_IPC_STREAM_PLAYBACK] = COMP_STATE_PREPARE; @@ -1099,16 +1085,10 @@ static void ssp_stop(struct dai *dai, int direction) /* disable SSP port if no users */ if (ssp->state[SOF_IPC_STREAM_CAPTURE] == COMP_STATE_PREPARE && - ssp->state[SOF_IPC_STREAM_PLAYBACK] == COMP_STATE_PREPARE) { - if (!(ssp->clk_active & SSP_CLK_BCLK_ES_REQ)) { - /* clear TRSE/RSRE before SSE */ - ssp_update_bits(dai, SSCR1, - SSCR1_TSRE | SSCR1_RSRE, - 0); - - ssp_update_bits(dai, SSCR0, SSCR0_SSE, 0); - dai_info(dai, "ssp_stop(): SSE clear SSP%d", dai->index); - } + ssp->state[SOF_IPC_STREAM_PLAYBACK] == COMP_STATE_PREPARE && + !(ssp->clk_active & SSP_CLK_BCLK_ES_REQ)) { + ssp_update_bits(dai, SSCR0, SSCR0_SSE, 0); + dai_info(dai, "ssp_stop(): SSE clear for SSP%d", dai->index); } ssp_post_stop(dai); From 755a5127054e1156c68462efdad6e16ce07e039a Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 15 Jun 2023 11:43:49 +0300 Subject: [PATCH 114/161] intel: ssp: Handle the cases when SSP is not clock provider for FS and/or BCLK When SSP is consumer for FS and BCLK then it does not needs MCLK as the shifting and rate is derived form the I2S bus directly. When SSP provides FS only then the BCLK setup is not needed. When SSP provides BCLK only then both MCLK and BCLK setup is needed. Signed-off-by: Peter Ujfalusi --- src/drivers/intel/ssp/ssp.c | 33 +++++++++++++++++++++++++-------- src/include/sof/drivers/ssp.h | 10 ++++++---- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/src/drivers/intel/ssp/ssp.c b/src/drivers/intel/ssp/ssp.c index d83e3120040e..0ec5d2ab88c0 100644 --- a/src/drivers/intel/ssp/ssp.c +++ b/src/drivers/intel/ssp/ssp.c @@ -142,13 +142,15 @@ static int ssp_mclk_prepare_enable(struct dai *dai) { struct ssp_pdata *ssp = dai_get_drvdata(dai); struct sof_ipc_dai_config *config = &ssp->config; - int ret; + int ret = 0; if (ssp->clk_active & SSP_CLK_MCLK_ACTIVE) return 0; /* MCLK config */ - ret = mn_set_mclk(config->ssp.mclk_id, config->ssp.mclk_rate); + if (ssp->clk_active & SSP_CLK_MCLK_IS_NEEDED) + ret = mn_set_mclk(config->ssp.mclk_id, config->ssp.mclk_rate); + if (ret < 0) dai_err(dai, "ssp_mclk_prepare_enable(): invalid mclk_rate = %d for mclk_id = %d", config->ssp.mclk_rate, config->ssp.mclk_id); @@ -165,7 +167,8 @@ static void ssp_mclk_disable_unprepare(struct dai *dai) if (!(ssp->clk_active & SSP_CLK_MCLK_ACTIVE)) return; - mn_release_mclk(ssp->config.ssp.mclk_id); + if (ssp->clk_active & SSP_CLK_MCLK_IS_NEEDED) + mn_release_mclk(ssp->config.ssp.mclk_id); ssp->clk_active &= ~SSP_CLK_MCLK_ACTIVE; } @@ -179,6 +182,9 @@ static int ssp_bclk_prepare_enable(struct dai *dai) bool need_ecs = false; int ret = 0; + if (!(ssp->clk_active & SSP_CLK_BCLK_IS_NEEDED)) + goto out; + if (ssp->clk_active & SSP_CLK_BCLK_ACTIVE) return 0; @@ -239,7 +245,8 @@ static void ssp_bclk_disable_unprepare(struct dai *dai) if (!(ssp->clk_active & SSP_CLK_BCLK_ACTIVE)) return; #if CONFIG_INTEL_MN - mn_release_bclk(dai->index); + if (ssp->clk_active & SSP_CLK_BCLK_IS_NEEDED) + mn_release_bclk(dai->index); #endif ssp->clk_active &= ~SSP_CLK_BCLK_ACTIVE; } @@ -344,16 +351,19 @@ static int ssp_set_config_tplg(struct dai *dai, struct ipc_config_dai *common_co sscr1 |= SSCR1_SCLKDIR | SSCR1_SFRMDIR; break; case SOF_DAI_FMT_CBC_CFC: + ssp->clk_active |= SSP_CLK_MCLK_IS_NEEDED | SSP_CLK_BCLK_IS_NEEDED; sscr1 |= SSCR1_SCFR; cfs = true; break; case SOF_DAI_FMT_CBP_CFC: + ssp->clk_active |= SSP_CLK_MCLK_IS_NEEDED; sscr1 |= SSCR1_SCLKDIR; /* FIXME: this mode has not been tested */ cfs = true; break; case SOF_DAI_FMT_CBC_CFP: + ssp->clk_active |= SSP_CLK_MCLK_IS_NEEDED | SSP_CLK_BCLK_IS_NEEDED; sscr1 |= SSCR1_SCFR | SSCR1_SFRMDIR; /* FIXME: this mode has not been tested */ break; @@ -868,11 +878,18 @@ static int ssp_set_config_blob(struct dai *dai, struct ipc_config_dai *common_co ssp->state[DAI_DIR_PLAYBACK] = COMP_STATE_PREPARE; ssp->state[DAI_DIR_CAPTURE] = COMP_STATE_PREPARE; - /* ssp blob is set by pcm_hw_params for ipc4 stream, so enable - * mclk and bclk at this time. + /* ssp blob is set by pcm_hw_params for ipc4 stream. + * Configure MCLK/BCLK only if SSP is the clock provider */ - mn_set_mclk_blob(blob->i2s_driver_config.mclk_config.mdivc, - blob->i2s_driver_config.mclk_config.mdivr); + if (!(blob->i2s_driver_config.i2s_config.ssc1 & (SSCR1_SCLKDIR | SSCR1_SFRMDIR))) { + ssp->clk_active |= SSP_CLK_MCLK_IS_NEEDED; + if (!(blob->i2s_driver_config.i2s_config.ssc1 & SSCR1_SCLKDIR)) + ssp->clk_active |= SSP_CLK_BCLK_IS_NEEDED; + + mn_set_mclk_blob(blob->i2s_driver_config.mclk_config.mdivc, + blob->i2s_driver_config.mclk_config.mdivr); + } + ssp->clk_active |= SSP_CLK_MCLK_ES_REQ; /* enable port */ diff --git a/src/include/sof/drivers/ssp.h b/src/include/sof/drivers/ssp.h index 7757816fe904..0ab1e9523c51 100644 --- a/src/include/sof/drivers/ssp.h +++ b/src/include/sof/drivers/ssp.h @@ -228,11 +228,13 @@ extern const struct dai_driver ssp_driver; #define ssp_irq(ssp) \ ssp->plat_data.irq -#define SSP_CLK_MCLK_ES_REQ BIT(0) -#define SSP_CLK_MCLK_ACTIVE BIT(1) -#define SSP_CLK_BCLK_ES_REQ BIT(2) -#define SSP_CLK_BCLK_ACTIVE BIT(3) +#define SSP_CLK_MCLK_IS_NEEDED BIT(1) +#define SSP_CLK_MCLK_ES_REQ BIT(2) +#define SSP_CLK_MCLK_ACTIVE BIT(3) #define SSP_CLK_MCLK_AON_REQ BIT(4) +#define SSP_CLK_BCLK_IS_NEEDED BIT(5) +#define SSP_CLK_BCLK_ES_REQ BIT(6) +#define SSP_CLK_BCLK_ACTIVE BIT(7) /* SSP private data */ struct ssp_pdata { From 1e0fe65ab0ac754153c83a3ddc256eb27b8cabe3 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Fri, 2 Jun 2023 16:33:10 +0300 Subject: [PATCH 115/161] intel: ssp: On playback stop only wait for the DMA to stop It does not make much sense to wait for the TX FIFO to drain as we either going to power off SSP or the clocks will remain running due to active capture. It just introduces extra delay on stop, which can be significant in case of low sampling rates. However we should make sure that the DMA is not filling the TX FIFO to make sure that the SSP is not disabled during DMA burst. Signed-off-by: Peter Ujfalusi --- src/drivers/intel/ssp/ssp.c | 48 +++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/src/drivers/intel/ssp/ssp.c b/src/drivers/intel/ssp/ssp.c index 0ec5d2ab88c0..57292727e110 100644 --- a/src/drivers/intel/ssp/ssp.c +++ b/src/drivers/intel/ssp/ssp.c @@ -41,30 +41,37 @@ DECLARE_SOF_UUID("ssp-dai", ssp_uuid, 0x31458125, 0x95c4, 0x4085, DECLARE_TR_CTX(ssp_tr, SOF_UUID(ssp_uuid), LOG_LEVEL_INFO); -/* empty SSP transmit FIFO */ -static void ssp_empty_tx_fifo(struct dai *dai) +static void ssp_wait_tx_dma_idle(struct dai *dai) { - int ret; - uint32_t sssr; + struct ssp_pdata *ssp = dai_get_drvdata(dai); + uint64_t sample_ticks = clock_ticks_per_sample(PLATFORM_DEFAULT_CLOCK, + ssp->params.fsync_rate); + uint32_t retry = SSP_RX_FLUSH_RETRY_MAX; + uint32_t entries[2]; - /* - * SSSR_TNF is cleared when TX FIFO is empty or full, - * so wait for set TNF then for TFL zero - order matter. - */ - ret = poll_for_register_delay(dai_base(dai) + SSSR, SSSR_TNF, SSSR_TNF, - SSP_MAX_SEND_TIME_PER_SAMPLE); - ret |= poll_for_register_delay(dai_base(dai) + SSCR3, SSCR3_TFL_MASK, 0, - SSP_MAX_SEND_TIME_PER_SAMPLE * - (SSP_FIFO_DEPTH - 1) / 2); + entries[0] = SSCR3_TFL_VAL(ssp_read(dai, SSCR3)); - if (ret) - dai_warn(dai, "ssp_empty_tx_fifo() warning: timeout"); + /* Unlikely: the TX FIFO is empty */ + if (!entries[0] && (ssp_read(dai, SSSR) & SSSR_TNF)) + return; - sssr = ssp_read(dai, SSSR); + while (retry--) { + /* Wait one sample time */ + wait_delay(sample_ticks); + + entries[1] = SSCR3_TFL_VAL(ssp_read(dai, SSCR3)); + + /* + * If the TX FIFO has less entries or equal entries after one + * sample time then DMA is not running to fill the FIFO and we + * can break out from the loop + */ + if (entries[0] >= entries[1]) + break; + } - /* clear interrupt */ - if (sssr & SSSR_TUR) - ssp_write(dai, SSSR, sssr); + /* Just in case clear the underflow status */ + ssp_update_bits(dai, SSSR, SSSR_TUR, SSSR_TUR); } static void ssp_empty_rx_fifo_on_start(struct dai *dai) @@ -1032,6 +1039,7 @@ static void ssp_start(struct dai *dai, int direction) /* enable DMA */ if (direction == DAI_DIR_PLAYBACK) { + ssp_update_bits(dai, SSSR, SSSR_TUR, SSSR_TUR); ssp_update_bits(dai, SSCR1, SSCR1_TSRE, SSCR1_TSRE); ssp_update_bits(dai, SSTSA, SSTSA_TXEN, SSTSA_TXEN); } else { @@ -1094,7 +1102,7 @@ static void ssp_stop(struct dai *dai, int direction) if (direction == DAI_DIR_PLAYBACK && ssp->state[SOF_IPC_STREAM_PLAYBACK] != COMP_STATE_PREPARE) { ssp_update_bits(dai, SSCR1, SSCR1_TSRE, 0); - ssp_empty_tx_fifo(dai); + ssp_wait_tx_dma_idle(dai); ssp_update_bits(dai, SSTSA, SSTSA_TXEN, 0); ssp->state[SOF_IPC_STREAM_PLAYBACK] = COMP_STATE_PREPARE; dai_info(dai, "ssp_stop(), TX stop"); From 6dc474c2e7031f2ad0534174d7d4c3caad7b58c3 Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Fri, 17 Nov 2023 11:51:10 +0800 Subject: [PATCH 116/161] intel: ssp: check mclk always-on quirk in ssp_remove Dynamic pipeline breaks mclk always-on feature by freeing dai component in HW_FREE stage; the ssp_remove() will be called and disables mclk unconditionally. Signed-off-by: Brent Lu --- src/drivers/intel/ssp/ssp.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/drivers/intel/ssp/ssp.c b/src/drivers/intel/ssp/ssp.c index 57292727e110..e2fac23c3ad6 100644 --- a/src/drivers/intel/ssp/ssp.c +++ b/src/drivers/intel/ssp/ssp.c @@ -1195,9 +1195,18 @@ static int ssp_probe(struct dai *dai) static int ssp_remove(struct dai *dai) { + struct ssp_pdata *ssp = dai_get_drvdata(dai); + pm_runtime_put_sync(SSP_CLK, dai->index); - ssp_mclk_disable_unprepare(dai); + /* + * dai comp will be freed during HW_FREE stage if dynamic pipeline is + * enabled; need to check the MCLK_AON quirk to see if we need to keep + * MCLK on even when dai comp is going to be freed + */ + if (!(ssp->params.clks_control & SOF_DAI_INTEL_SSP_CLKCTRL_MCLK_AON)) + ssp_mclk_disable_unprepare(dai); + ssp_bclk_disable_unprepare(dai); /* Disable SSP power */ From 87ef48bb92b2e691ebeb763c247824f4946932a1 Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Tue, 21 Nov 2023 11:28:48 +0800 Subject: [PATCH 117/161] topology1: sof-tgl-max98357a-rt5682: enable mclk always-on feature Enable mclk always-on feature to remove pop noise during HW_FREE stage. Signed-off-by: Brent Lu --- tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 index 02f4bd7caae5..d69b2c6a581d 100644 --- a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 +++ b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 @@ -499,7 +499,7 @@ ifelse( SSP_CLOCK(bclk, 2400000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_BCLK_ES)))', + SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, eval(SSP_CC_BCLK_ES | SSP_CC_MCLK_AON))))', HEADPHONE, `RT5650', ` SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), SSP_CLOCK(bclk, 3072000, codec_slave), From f35515a77acf7f11d72ee9ea3ec38c2703291f40 Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Tue, 21 Nov 2023 11:29:11 +0800 Subject: [PATCH 118/161] topology1: sof-tgl-max98373-rt5682: enable mclk always-on feature Enable mclk always-on feature to remove pop noise during HW_FREE stage. Signed-off-by: Brent Lu --- tools/topology/topology1/sof-tgl-max98373-rt5682.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/topology/topology1/sof-tgl-max98373-rt5682.m4 b/tools/topology/topology1/sof-tgl-max98373-rt5682.m4 index 7c71cc44a309..455347f74127 100644 --- a/tools/topology/topology1/sof-tgl-max98373-rt5682.m4 +++ b/tools/topology/topology1/sof-tgl-max98373-rt5682.m4 @@ -238,7 +238,7 @@ DAI_CONFIG(SSP, 0, 0, SSP0-Codec, SSP_CLOCK(bclk, 3072000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 32, 3, 3), - SSP_CONFIG_DATA(SSP, 0, 32))) + SSP_CONFIG_DATA(SSP, 0, 32, 0, 0, 0, SSP_CC_MCLK_AON))) # 4 HDMI/DP outputs (ID: 3,4,5,6) DAI_CONFIG(HDA, 0, 3, iDisp1, From 7908a6e0131ba63ddce4c68dac414eeddaa13f86 Mon Sep 17 00:00:00 2001 From: David Rau Date: Mon, 20 Nov 2023 11:10:42 +0800 Subject: [PATCH 119/161] topology1: adl-sdw-cs42l42: support CS42L42-SDW codec Add a new topology sof-adl-sdw-cs42l42 for CS42L42 which supports SDW1 for headset on ADL board. Signed-off-by: David Rau --- tools/topology/topology1/CMakeLists.txt | 1 + .../topology/topology1/sof-adl-sdw-cs42l42.m4 | 286 ++++++++++++++++++ 2 files changed, 287 insertions(+) create mode 100755 tools/topology/topology1/sof-adl-sdw-cs42l42.m4 diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 4b721f19a88f..41a6c6ee68ac 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -208,6 +208,7 @@ set(TPLGS "sof-adl-nau8825\;sof-adl-nau8318-nau8825\;-DCODEC=NAU8318\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" "sof-tgl-sdw-max98373-rt5682\;sof-tgl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=tgl" "sof-tgl-sdw-max98373-rt5682\;sof-adl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=adl\;-DDYNAMIC=1" + "sof-adl-sdw-cs42l42\;sof-adl-sdw-cs42l42-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" "sof-jsl-da7219\;sof-jsl-da7219\;-DPLATFORM=jsl" "sof-jsl-da7219\;sof-jsl-da7219-mx98360a\;-DPLATFORM=jsl-dedede" "sof-smart-amplifier-nocodec\;sof-smart-amplifier-nocodec" diff --git a/tools/topology/topology1/sof-adl-sdw-cs42l42.m4 b/tools/topology/topology1/sof-adl-sdw-cs42l42.m4 new file mode 100755 index 000000000000..9d627be852fc --- /dev/null +++ b/tools/topology/topology1/sof-adl-sdw-cs42l42.m4 @@ -0,0 +1,286 @@ +# +# Topology for Tigerlake with rt711 + rt1308 (x2). +# + +# if XPROC is not defined, define with default pipe +ifdef(`DMICPROC', , `define(DMICPROC, eq-iir-volume)') +ifdef(`DMIC16KPROC', , `define(DMIC16KPROC, eq-iir-volume)') + +# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4') +include(`alh.m4') +include(`hda.m4') +include(`platform/intel/dmic.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +include(`platform/intel/'PLATFORM`.m4') + +ifdef(`NO_JACK', +` +define(JACK_OFFSET, `0') +', +` +define(JACK_OFFSET, `2') +') + +ifdef(`AMP_1_LINK',`', +`define(AMP_1_LINK, `1')') + +# if there is an external RT1308 amplifier connected over SoundWire, +# enable "EXT_AMP" option in the CMakefile. +ifdef(`EXT_AMP', +` +define(AMP_OFFSET, `1') +', +` +define(AMP_OFFSET, `0') +' +) + +ifdef(`EXT_AMP_REF', +` +define(AMP_REF_OFFSET, `1') +', +` +define(AMP_REF_OFFSET, `0') +' +) + +# Define pipeline id for intel-generic-dmic.m4 +# to generate dmic setting +ifelse(CHANNELS, `0', +` +define(DMIC_OFFSET, `0') +' +, +` +define(DMIC_PCM_48k_ID, `10') +define(DMIC_PCM_16k_ID, `11') +define(DMIC_PIPELINE_48k_ID, `4') +define(DMIC_PIPELINE_16k_ID, `5') + +define(DMIC_DAI_LINK_48k_ID, eval(JACK_OFFSET+AMP_OFFSET+AMP_REF_OFFSET)) +define(DMIC_DAI_LINK_16k_ID, eval(JACK_OFFSET+AMP_OFFSET+AMP_REF_OFFSET+1)) +include(`platform/intel/intel-generic-dmic.m4') + +define(DMIC_OFFSET, `2') +' +) + +define(HDMI_BE_ID_BASE, eval(JACK_OFFSET+AMP_OFFSET+AMP_REF_OFFSET+DMIC_OFFSET)) + +# Add Bluetooth Audio Offload pass-through + +ifdef(`BT_OFFLOAD', +` define(`BT_PIPELINE_PB_ID', `13') + define(`BT_PIPELINE_CP_ID', `14') + define(`BT_DAI_LINK_ID', eval(HDMI_BE_ID_BASE + 4)) + define(`BT_PCM_ID', `14') dnl use fixed PCM_ID + define(HW_CONFIG_ID, eval(6 + DMIC_OFFSET)) + include(`platform/intel/intel-generic-bt.m4') +' +) + +DEBUG_START + +# +# Define the pipelines +# +# PCM0 ---> volume ----> mixer --->ALH 2 BE dailink 0 +# PCM31 ---> volume ------^ +# PCM1 <--- volume <---- ALH 3 BE dailink 1 +ifdef(`EXT_AMP', ` +# PCM2 ---> volume ----> ALH 2 BE dailink AMP_1_LINK +') +# PCM5 ---> volume <---- iDisp1 +# PCM6 ---> volume <---- iDisp2 +# PCM7 ---> volume <---- iDisp3 +# PCM8 ---> volume <---- iDisp4 +# PCM10 <----volume <---- DMIC01 +# PCM11 <----volume <---- DMIC16k +ifdef(`BT_OFFLOAD', +` +# PCM14 <---> passthrough <---> SSP2 BT playback/capture +') + +# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline with priority 0 on core 0 +PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, + 2, 1, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +ifdef(`EXT_AMP', +` +# Low Latency playback pipeline 3 on PCM 2 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline with priority 0 on core 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 3, 2, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) +') +# Low Latency playback pipeline 6 on PCM 5 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline with priority 0 on core 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 6, 5, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +# Low Latency playback pipeline 7 on PCM 6 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline with priority 0 on core 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 7, 6, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +# Low Latency playback pipeline 8 on PCM 7 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline with priority 0 on core 0 +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, + 8, 7, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +# +# DAIs configuration +# + +dnl DAI_ADD(pipeline, +dnl pipe id, dai type, dai_index, dai_be, +dnl buffer, periods, format, +dnl deadline, priority, core, time_domain) + +# playback DAI is ALH(SDW1 PIN258) using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, + 1, ALH, 258, SDW1-Playback, + NOT_USED_IGNORED, 2, s24le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000) + +# capture DAI is ALH(SDW1 PIN259) using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4, + 2, ALH, 259, SDW1-Capture, + PIPELINE_SINK_2, 2, s24le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# Low Latency playback pipeline 30 on PCM 0 using max 2 channels of s32le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, + 30, 0, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000, + SCHEDULE_TIME_DOMAIN_TIMER, + PIPELINE_PLAYBACK_SCHED_COMP_1) + +# Deep buffer playback pipeline 31 on PCM 31 using max 2 channels of s32le +# Set 1000us deadline on core 0 with priority 0. +# TODO: Modify pipeline deadline to account for deep buffering +ifdef(`HEADSET_DEEP_BUFFER', +` +PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, + 31, 31, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000, + SCHEDULE_TIME_DOMAIN_TIMER, + PIPELINE_PLAYBACK_SCHED_COMP_1) +' +) + +SectionGraph."mixer-host" { + index "0" + + lines [ + # connect mixer dai pipelines to PCM pipelines + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_30) +ifdef(`HEADSET_DEEP_BUFFER', +` + + dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_31) +' +) + ] +} + +ifdef(`EXT_AMP', +` +# playback DAI is ALH(AMP_1_LINK PIN2) using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 3, ALH, eval(AMP_1_LINK * 256 + 2), `SDW'eval(AMP_1_LINK)`-Playback', + PIPELINE_SOURCE_3, 2, s24le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) +') + +# playback DAI is iDisp1 using 2 periods +# Buffers use s32le format, 1000us deadline with priority 0 on core 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 6, HDA, 0, iDisp1, + PIPELINE_SOURCE_6, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# playback DAI is iDisp2 using 2 periods +# Buffers use s32le format, 1000us deadline with priority 0 on core 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 7, HDA, 1, iDisp2, + PIPELINE_SOURCE_7, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# playback DAI is iDisp3 using 2 periods +# Buffers use s32le format, 1000us deadline with priority 0 on core 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 8, HDA, 2, iDisp3, + PIPELINE_SOURCE_8, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# PCM Low Latency, id 0 +dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) +PCM_PLAYBACK_ADD(Jack Out, 0, PIPELINE_PCM_30) +ifdef(`HEADSET_DEEP_BUFFER', +` +PCM_PLAYBACK_ADD(Jack Out DeepBuffer, 31, PIPELINE_PCM_31) +' +) +PCM_CAPTURE_ADD(Jack In, 1, PIPELINE_PCM_2) +ifdef(`EXT_AMP', +` +PCM_PLAYBACK_ADD(Speaker, 2, PIPELINE_PCM_3) +') +PCM_PLAYBACK_ADD(HDMI 1, 5, PIPELINE_PCM_6) +PCM_PLAYBACK_ADD(HDMI 2, 6, PIPELINE_PCM_7) +PCM_PLAYBACK_ADD(HDMI 3, 7, PIPELINE_PCM_8) +# +# BE configurations - overrides config in ACPI if present +# + +#ALH dai index = ((link_id << 8) | PDI id) +#ALH SDW1 Pin258 (ID: 0) +DAI_CONFIG(ALH, 258, 0, SDW1-Playback, + ALH_CONFIG(ALH_CONFIG_DATA(ALH, 258, 48000, 2))) + +#ALH SDW1 Pin259 (ID: 1) +DAI_CONFIG(ALH, 259, 1, SDW1-Capture, + ALH_CONFIG(ALH_CONFIG_DATA(ALH, 259, 48000, 2))) + +ifdef(`EXT_AMP', +` +#ALH SDW AMP_1_LINK Pin2 (ID: 2) +DAI_CONFIG(ALH, eval(AMP_1_LINK * 256 + 2), 2, `SDW'eval(AMP_1_LINK)`-Playback', + ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(AMP_1_LINK * 256 + 2), 48000, 2))) +') + +# 3 HDMI/DP outputs +DAI_CONFIG(HDA, 0, HDMI_BE_ID_BASE, iDisp1, + HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2))) +DAI_CONFIG(HDA, 1, eval(HDMI_BE_ID_BASE + 1), iDisp2, + HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2))) +DAI_CONFIG(HDA, 2, eval(HDMI_BE_ID_BASE + 2), iDisp3, + HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2))) + +DEBUG_END From cdb87ad46cc3078d0fd230f1a6aa0707ba5527b1 Mon Sep 17 00:00:00 2001 From: Pin-chih Lin Date: Sun, 7 Jan 2024 19:53:54 +0800 Subject: [PATCH 120/161] topology1: add DRC/EQ integrated topologies Adds new topology builds integrating DRC/EQ on Speaker pipeline. Signed-off-by: Pin-chih Lin --- tools/topology/topology1/CMakeLists.txt | 16 ++++++++++++++++ tools/topology/topology1/sof-adl-nau8825.m4 | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 41a6c6ee68ac..98cfb452dd3f 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -218,6 +218,22 @@ set(TPLGS "sof-jsl-rt5682\;sof-jsl-cs42l42-mx98360a\;-DPLATFORM=jsl-dedede" "sof-jsl-rt5682\;sof-jsl-rt5682\;-DHEADPHONE=rt5682\;-DPLATFORM=icl\;-DNO_AMP" + ## DRC/EQ topologies + "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-drceq\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-drceq\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-drceq\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-ssp2-rt5682-ssp0-drceq\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682-drceq\;-DCODEC=RT1019\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-drceq\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-da7219-drceq\;-DUSE_DA7219\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DNOHOTWORD\;-DNO16KDMIC\;-DDRC_EQ" + "sof-tgl-max98357a-rt5682\;sof-adl-rt5650-drceq\;-DUSE_RT5650\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC\;-DDRC_EQ" + + "sof-adl-nau8825\;sof-adl-max98360a-nau8825-drceq\;-DCODEC=MAX98360A\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-adl-nau8825\;sof-adl-rt1019-nau8825-drceq\;-DCODEC=RT1019P\;-DFMT=s16le\;-DAMP_SSP=2\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-adl-nau8825\;sof-adl-rt1015-nau8825-drceq\;-DCODEC=RT1015P\;-DFMT=s32le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1\;-DDRC_EQ" + "sof-adl-nau8825\;sof-adl-nau8318-nau8825-drceq\;-DCODEC=NAU8318\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1\;-DDRC_EQ" + ## end DRC/EQ topologies + "sof-glk-es8336\;sof-apl-es8336\;-DPLATFORM=bxt\;-DSSP_NUM=2\;-DCHANNELS=0" "sof-glk-es8336\;sof-apl-es8336-ssp0\;-DPLATFORM=bxt\;-DSSP_NUM=0\;-DCHANNELS=0" "sof-glk-es8336\;sof-apl-es8336-ssp1\;-DPLATFORM=bxt\;-DSSP_NUM=1\;-DCHANNELS=0" diff --git a/tools/topology/topology1/sof-adl-nau8825.m4 b/tools/topology/topology1/sof-adl-nau8825.m4 index d71aa8f91090..860065c7a6dd 100644 --- a/tools/topology/topology1/sof-adl-nau8825.m4 +++ b/tools/topology/topology1/sof-adl-nau8825.m4 @@ -176,7 +176,9 @@ ifdef(`NO_AMP',,` ifdef(`SMART_AMP',,` # Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. # Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-demux-playback.m4, +PIPELINE_PCM_ADD( + ifdef(`DRC_EQ', sof/pipe-drc-eq-volume-demux-playback.m4, + sof/pipe-volume-demux-playback.m4), 1, 0, 2, s32le, SPK_MIC_PERIOD_US, 0, 0, 48000, 48000, 48000)')') From 516a9fb24b5241b528e41f9826ed97c41dd9c8c1 Mon Sep 17 00:00:00 2001 From: Pin-chih Lin Date: Fri, 5 Jan 2024 15:03:15 +0800 Subject: [PATCH 121/161] topology1: do not apply dynamic pipeline on RTNR tplg Enabling dynamic pipeline on RTNR-integrated topologies will causes DSP crashes. By now dynamic pipeline is planned to be applied on all adl/rpl topologies without third-party modules. RTNR should be excluded as well. Signed-off-by: Pin-chih Lin (cherry picked from commit 14909919fabbe3269fc795f087b4df0869c45266) --- tools/topology/topology1/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 98cfb452dd3f..d0f9674b1680 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -163,7 +163,7 @@ set(TPLGS "sof-ehl-rt5660\;sof-ehl-rt5660-nohdmi" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DCHANNELS=2\;-DRTNR\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DCHANNELS=2\;-DRTNR" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-waves\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DWAVES" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D2CH_2WAY\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-waves-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D2CH_2WAY\;-DWAVES" @@ -174,17 +174,17 @@ set(TPLGS "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way-pdm1\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D4CH_PASSTHROUGH\;-DBT_OFFLOAD\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr-google-aec\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr-google-aec\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-google-aec\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-drceq\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DDRC_EQ" "sof-tgl-max98357a-rt5682\;sof-tgl-rt1011-rt5682\;-DCODEC=RT1011\;-DFMT=s24le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR" "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DRTNR\;-DNOHOTWORD\;-DDMICPROC=rtnr\;-DNO16KDMIC\;-DDMIC_48k_CORE_ID=1\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DRTNR\;-DNOHOTWORD\;-DDMICPROC=rtnr\;-DNO16KDMIC\;-DDMIC_48k_CORE_ID=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DNOHOTWORD\;-DNO16KDMIC\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98357a-rt5682\;sof-adl-max98390-ssp2-rt5682-ssp0\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-rt5682\;-DNO_AMP\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD\;-DDYNAMIC=1" From 8c5216312f2445b4a517a691c412524387ab40a9 Mon Sep 17 00:00:00 2001 From: Yong Zhi Date: Tue, 16 Jan 2024 17:20:15 -0600 Subject: [PATCH 122/161] sof_ri_info: fix imr size for cnl Fix the typo for 8MB imr size. Signed-off-by: Yong Zhi (cherry picked from commit 40f6de58da5ceb6d88510a615de23d3e113e7e37) --- tools/sof_ri_info/sof_ri_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/sof_ri_info/sof_ri_info.py b/tools/sof_ri_info/sof_ri_info.py index 8bd2f4c4502c..079bf22366e8 100755 --- a/tools/sof_ri_info/sof_ri_info.py +++ b/tools/sof_ri_info/sof_ri_info.py @@ -1461,7 +1461,7 @@ def dump_info(self): CNL_MEMORY_SPACE = DspMemory('Intel Cannonlake', [ - DspMemorySegment('imr', 0xb0000000, 8*0x1024*0x1024), + DspMemorySegment('imr', 0xb0000000, 8*1024*1024), DspMemorySegment('l2 hpsram', 0xbe000000, 48*64*1024), DspMemorySegment('l2 lpsram', 0xbe800000, 1*64*1024) ]) From 956b370976cfe073d98a9b74139fe18028afdc5a Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 23 Jan 2024 15:03:41 +0200 Subject: [PATCH 123/161] logger: convert: Fix compile time error with newer toolchain Using Compiler version: aarch64-poky-linux-gcc (GCC) 13.2.0 we get the following error: tools/logger/convert.c: In function 'convert': tools/logger/convert.c:357:34: error: '%*s' directive output between 4294967264 and 4294967284 bytes exceeds 'INT_MAX' [-Werror=format-overflow=] | 357 | fprintf(out_fd, "%*s(us)%*s ", -ts_width, " TIMESTAMP", ts_width, "DELTA"); | | ^~~ ~~~~~~~~~~~~ | In file included from /opt/builds/OBNand/build/tmp/work/armv8a-poky-linux/sof-tools/2.8.0/recipe-sysroot/usr/include/stdio.h:964, | from /opt/builds/OBNand/build/tmp/work/armv8a-poky-linux/sof-tools/2.8.0/git/tools/logger/convert.h:13, | from /opt/builds/OBNand/build/tmp/work/armv8a-poky-linux/sof-tools/2.8.0/git/tools/logger/convert.c:21: | In function 'fprintf', Signed-off-by: Daniel Baluta Signed-off-by: Marc Herbert (cherry picked from commit ff9343aa4a59d714f40714aa16950ee37b911df2) --- tools/logger/convert.c | 4 ++-- tools/logger/convert.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/logger/convert.c b/tools/logger/convert.c index e393f828e1b1..7de47f97075b 100644 --- a/tools/logger/convert.c +++ b/tools/logger/convert.c @@ -318,7 +318,7 @@ static double to_usecs(uint64_t time) } /** Justified timestamp width for printf format string */ -static unsigned int timestamp_width(unsigned int precision) +static uint8_t timestamp_width(uint8_t precision) { /* 64bits yields less than 20 digits precision. As reported by * gcc 9.3, this avoids a very long precision causing snprintf() @@ -352,7 +352,7 @@ static inline void print_table_header(void) } if (global_config->time_precision >= 0) { - const unsigned int ts_width = timestamp_width(global_config->time_precision); + const uint8_t ts_width = timestamp_width(global_config->time_precision); fprintf(out_fd, "%*s(us)%*s ", -ts_width, " TIMESTAMP", ts_width, "DELTA"); } diff --git a/tools/logger/convert.h b/tools/logger/convert.h index dcf8d0db06b7..8117e023b2f9 100644 --- a/tools/logger/convert.h +++ b/tools/logger/convert.h @@ -41,7 +41,7 @@ struct convert_config { int dump_ldc; int hide_location; int relative_timestamps; - int time_precision; + uint8_t time_precision; struct snd_sof_uids_header *uids_dict; struct snd_sof_logs_header *logs_header; }; From 8e8ff75a7669c5bb1abb281c98557e42ab1aef67 Mon Sep 17 00:00:00 2001 From: Johny Lin Date: Fri, 8 Mar 2024 09:50:04 +0000 Subject: [PATCH 124/161] multiband_drc: instantaneous enabled state switch on processing In present multiband_drc design, the enabled state is determined by the switch control while multiband_drc starts to process. If the switch control toggles while processing, it will take effects on the next time multiband_drc starts to process. This commit makes change to let the enabled state update instantaneously by the switch control toggle when multiband_drc is processing. Signed-off-by: Pin-chih Lin --- src/audio/multiband_drc/multiband_drc.c | 45 +++++++++---------- .../multiband_drc/multiband_drc_generic.c | 8 ++-- .../sof/audio/multiband_drc/multiband_drc.h | 5 +++ 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/src/audio/multiband_drc/multiband_drc.c b/src/audio/multiband_drc/multiband_drc.c index a9238d0cb9fa..bcb33908c61a 100644 --- a/src/audio/multiband_drc/multiband_drc.c +++ b/src/audio/multiband_drc/multiband_drc.c @@ -135,6 +135,16 @@ static int multiband_drc_init_coef(struct multiband_drc_comp_data *cd, int16_t n "multiband_drc_init_coef(), initializing %i-way crossover", config->num_bands); + /* Crossover: determine the split function */ + cd->crossover_split = crossover_find_split_func(config->num_bands); + if (!cd->crossover_split) { + comp_cl_err(&comp_multiband_drc, + "multiband_drc_init_coef(), No crossover_split for band num %i", + config->num_bands); + ret = -EINVAL; + goto err; + } + /* Crossover: collect the coef array and assign it to every channel */ crossover = config->crossover_coef; for (ch = 0; ch < nch; ch++) { @@ -456,7 +466,10 @@ static void multiband_drc_process(struct comp_dev *dev, struct comp_buffer *sour buffer_stream_invalidate(source, source_bytes); - cd->multiband_drc_func(dev, &source->stream, &sink->stream, frames); + if (cd->process_enabled) + cd->multiband_drc_func(dev, &source->stream, &sink->stream, frames); + else + multiband_drc_default_pass(dev, &source->stream, &sink->stream, frames); buffer_stream_writeback(sink, sink_bytes); @@ -530,35 +543,19 @@ static int multiband_drc_prepare(struct comp_dev *dev) comp_dbg(dev, "multiband_drc_prepare(), source_format=%d, sink_format=%d", cd->source_format, cd->source_format); cd->config = comp_get_data_blob(cd->model_handler, NULL, NULL); - if (cd->config && cd->process_enabled) { + if (cd->config) { ret = multiband_drc_setup(cd, sourceb->stream.channels, sourceb->stream.rate); if (ret < 0) { comp_err(dev, "multiband_drc_prepare() error: multiband_drc_setup failed."); goto err; } + } - cd->multiband_drc_func = multiband_drc_find_proc_func(cd->source_format); - if (!cd->multiband_drc_func) { - comp_err(dev, "multiband_drc_prepare(), No proc func"); - ret = -EINVAL; - goto err; - } - - cd->crossover_split = crossover_find_split_func(cd->config->num_bands); - if (!cd->crossover_split) { - comp_err(dev, "multiband_drc_prepare(), No crossover_split for band num %i", - cd->config->num_bands); - ret = -EINVAL; - goto err; - } - } else { - comp_info(dev, "multiband_drc_prepare(), DRC is in passthrough mode"); - cd->multiband_drc_func = multiband_drc_find_proc_func_pass(cd->source_format); - if (!cd->multiband_drc_func) { - comp_err(dev, "multiband_drc_prepare(), No proc func passthrough"); - ret = -EINVAL; - goto err; - } + cd->multiband_drc_func = multiband_drc_find_proc_func(cd->source_format); + if (!cd->multiband_drc_func) { + comp_err(dev, "multiband_drc_prepare(), No proc func"); + ret = -EINVAL; + goto err; } /* validate sink data format and period bytes */ diff --git a/src/audio/multiband_drc/multiband_drc_generic.c b/src/audio/multiband_drc/multiband_drc_generic.c index 57689a09d633..2aef2e2b2771 100644 --- a/src/audio/multiband_drc/multiband_drc_generic.c +++ b/src/audio/multiband_drc/multiband_drc_generic.c @@ -10,10 +10,10 @@ #include #include -static void multiband_drc_default_pass(const struct comp_dev *dev, - const struct audio_stream *source, - struct audio_stream *sink, - uint32_t frames) +void multiband_drc_default_pass(const struct comp_dev *dev, + const struct audio_stream *source, + struct audio_stream *sink, + uint32_t frames) { audio_stream_copy(source, 0, sink, 0, source->channels * frames); } diff --git a/src/include/sof/audio/multiband_drc/multiband_drc.h b/src/include/sof/audio/multiband_drc/multiband_drc.h index ae98aa785b14..b08a18b54f26 100644 --- a/src/include/sof/audio/multiband_drc/multiband_drc.h +++ b/src/include/sof/audio/multiband_drc/multiband_drc.h @@ -52,6 +52,11 @@ extern const struct multiband_drc_proc_fnmap multiband_drc_proc_fnmap[]; extern const struct multiband_drc_proc_fnmap multiband_drc_proc_fnmap_pass[]; extern const size_t multiband_drc_proc_fncount; +void multiband_drc_default_pass(const struct comp_dev *dev, + const struct audio_stream *source, + struct audio_stream *sink, + uint32_t frames); + /** * \brief Returns Multiband DRC processing function. */ From 60ef38e7f5c63e5f839a07363967f16535d479aa Mon Sep 17 00:00:00 2001 From: Balamurugan C Date: Thu, 28 Mar 2024 13:27:13 +0530 Subject: [PATCH 125/161] topology1: Add new sof-adl-es8336-ssp1-hdmi-ssp02-4ch topology. Add support to generate the topology which can be used to support 4channel DMIC,SSP based codec and HDMI-in capture via I2S combo. Signed-off-by: Balamurugan C --- tools/topology/topology1/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index d0f9674b1680..54452c61e3e0 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -316,6 +316,7 @@ set(TPLGS #sof-adl-es8336-ssp1-hdmi-ssp02 supports es8336 codec along with 2xHDMI_over_SSP Capture's. "sof-glk-es8336\;sof-adl-es8336-ssp1-hdmi-ssp02\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=0\;-DHDMI_1_SSP_NUM=0\;-DHDMI_2_SSP_NUM=2" + "sof-glk-es8336\;sof-adl-es8336-ssp1-hdmi-ssp02-4ch\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=4\;-DHDMI_1_SSP_NUM=0\;-DHDMI_2_SSP_NUM=2" #To support HDMI-in capture with RT1308 ssp-amplifier products. "sof-tgl-rt1308-hdmi-ssp\;sof-tgl-rt1308-ssp2-hdmi-ssp15\;-DAMP_SSP_NUM=2\;-DHDMI_1_SSP_NUM=1\;-DHDMI_2_SSP_NUM=5\;-DPLATFORM=tgl" From 7b46ae6a8a9e4293e329c58e25302f231ab54281 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Thu, 11 Apr 2024 20:52:30 +0000 Subject: [PATCH 126/161] dma-trace.c: lower log level of dropped logs and stop recursion Dropping logs is bad but it should not be fatal in itself. This ERROR is one of the last remaining errors in stable-v2.2, see https://github.com/thesofproject/sof-test/pull/1075#issuecomment-2049051006 Also switch to the "etrace": drop the dubious recursion and stop using the DMA trace when it's already saturated. Disclaimer: this was (successfully) tested only on stable-v2.2, see #9036 Signed-off-by: Marc Herbert (cherry picked from commit bb31696aa6c9b6785e07237f8c6d4b29f59a7946) --- src/trace/dma-trace.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/trace/dma-trace.c b/src/trace/dma-trace.c index 730d823c837b..1ae9f7add659 100644 --- a/src/trace/dma-trace.c +++ b/src/trace/dma-trace.c @@ -645,15 +645,9 @@ static void dtrace_add_event(const char *e, uint32_t length) uint32_t tmp_dropped_entries = trace_data->dropped_entries; trace_data->dropped_entries = 0; - /* - * this trace_error invocation causes recursion, - * so after it we have to recalculate margin and - * overflow - */ - tr_err(&dt_tr, "dtrace_add_event(): number of dropped logs = %u", - tmp_dropped_entries); - margin = dtrace_calc_buf_margin(buffer); - overflow = dtrace_calc_buf_overflow(buffer, length); + mtrace_printf(LOG_LEVEL_WARNING, + "dtrace_add_event(): number of dropped logs = %u", + tmp_dropped_entries); } } From 64416ba5135457e5aff49f75c2689188ea340937 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Thu, 9 May 2024 18:18:50 +0000 Subject: [PATCH 127/161] drivers: Intel: hda-dma: lower log level of "underrun detected" Lower the log level of `tr_err(&hdma_tr, "hda_dma_link_check_xrun(): underrun detected");` to `tr_warn()`. Underruns are expected when testing pause/start and these errors can hide other, "real", not expected errors; more details in https://github.com/thesofproject/sof-test/pull/1188 This "fixes" 2019 commit 293dfe2469cb ("hda-dma: refactor xrun handling") Note this driver is not in the main branch anymore, removed by commit 59028ad3d136 ("drivers: Intel: remove Intel XTOS drivers") Signed-off-by: Marc Herbert --- src/drivers/intel/hda/hda-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/intel/hda/hda-dma.c b/src/drivers/intel/hda/hda-dma.c index 01f82055ac18..76be5c8050cc 100644 --- a/src/drivers/intel/hda/hda-dma.c +++ b/src/drivers/intel/hda/hda-dma.c @@ -945,7 +945,7 @@ static int hda_dma_link_check_xrun(struct dma_chan_data *chan) uint32_t dgcs = dma_chan_reg_read(chan, DGCS); if (chan->direction == DMA_DIR_MEM_TO_DEV && dgcs & DGCS_BUR) { - tr_err(&hdma_tr, "hda_dma_link_check_xrun(): underrun detected"); + tr_warn(&hdma_tr, "hda_dma_link_check_xrun(): underrun detected"); dma_chan_reg_update_bits(chan, DGCS, DGCS_BUR, DGCS_BUR); } else if (chan->direction == DMA_DIR_DEV_TO_MEM && dgcs & DGCS_BOR) { tr_err(&hdma_tr, "hda_dma_link_check_xrun(): overrun detected"); From 2e3ebfbf58aafbe16f8fc101c1b1c5c96a81d83f Mon Sep 17 00:00:00 2001 From: Johny Lin Date: Fri, 21 Jun 2024 11:55:21 +0000 Subject: [PATCH 128/161] topology1: tgl: backward align Waves bytes control name The default names for Waves bytes control are different betweeen tgl-012-drop-stable and cavs2.5-001-drop-stable. For the purpose of keeping config API constant during branch migration, this commit aligns the control names backward for TGL topology builds only. Signed-off-by: Pin-chih Lin --- .../topology1/sof/pipe-waves-codec-demux-playback.m4 | 4 +++- tools/topology/topology1/sof/pipe-waves-codec-playback.m4 | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/topology/topology1/sof/pipe-waves-codec-demux-playback.m4 b/tools/topology/topology1/sof/pipe-waves-codec-demux-playback.m4 index 71775b68bf82..a29e43a3bfdb 100644 --- a/tools/topology/topology1/sof/pipe-waves-codec-demux-playback.m4 +++ b/tools/topology/topology1/sof/pipe-waves-codec-demux-playback.m4 @@ -31,7 +31,9 @@ include(`codec_adapter.m4') ifdef(`ENDPOINT_NAME',`',`fatal_error(`Pipe requires ENDPOINT_NAME to be defined: Speakers, Headphones, etc.')') -define(`SETUP_PARAMS_NAME', `Waves' `ENDPOINT_NAME' `Setup' PIPELINE_ID) +ifelse(PLATFORM, `tgl', ` + define(SETUP_PARAMS_NAME, `MaxxChrome Setup' PIPELINE_ID)', ` + define(SETUP_PARAMS_NAME, `Waves' `ENDPOINT_NAME' `Setup' PIPELINE_ID)') CONTROLBYTES_PRIV(PP_SETUP_CONFIG, ` bytes "0x53,0x4f,0x46,0x00,' diff --git a/tools/topology/topology1/sof/pipe-waves-codec-playback.m4 b/tools/topology/topology1/sof/pipe-waves-codec-playback.m4 index 2c19ec0f19a2..ee13918b69ab 100644 --- a/tools/topology/topology1/sof/pipe-waves-codec-playback.m4 +++ b/tools/topology/topology1/sof/pipe-waves-codec-playback.m4 @@ -22,7 +22,10 @@ define(`CA_SETUP_CONTROLBYTES', ` 0x00,0x00,0x00,0x00"'' ) define(`CA_SETUP_CONTROLBYTES_MAX', 8192) -define(`CA_SETUP_CONTROLBYTES_NAME', `Waves' `ENDPOINT_NAME' `Setup ') + +ifelse(PLATFORM, `tgl', ` + define(CA_SETUP_CONTROLBYTES_NAME, `MaxxChrome Setup ')', ` + define(CA_SETUP_CONTROLBYTES_NAME, `Waves' `ENDPOINT_NAME' `Setup ')') define(`CA_SCHEDULE_CORE', 0) From 7cedb3ed679b47ce1224d86e0d071cf024eda92a Mon Sep 17 00:00:00 2001 From: Johny Lin Date: Fri, 21 Jun 2024 12:09:42 +0000 Subject: [PATCH 129/161] topology1: tgl: add Waves-integrated topology builds Adds topology builds with Waves codec integrated for TGL usage. Signed-off-by: Pin-chih Lin --- tools/topology/topology1/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 54452c61e3e0..b420657761d8 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -162,6 +162,7 @@ set(TPLGS "sof-ehl-rt5660\;sof-ehl-rt5660\;-DHDMI=1" "sof-ehl-rt5660\;sof-ehl-rt5660-nohdmi" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" + "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-waves\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DCHANNELS=2\;-DRTNR" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-waves\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DWAVES" @@ -180,6 +181,7 @@ set(TPLGS "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-google-aec\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-drceq\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DDRC_EQ" "sof-tgl-max98357a-rt5682\;sof-tgl-rt1011-rt5682\;-DCODEC=RT1011\;-DFMT=s24le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" + "sof-tgl-max98357a-rt5682\;sof-tgl-rt1011-rt5682-waves\;-DCODEC=RT1011\;-DFMT=s24le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR" "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DRTNR\;-DNOHOTWORD\;-DDMICPROC=rtnr\;-DNO16KDMIC\;-DDMIC_48k_CORE_ID=1" From a5ec5f84143b2312e74d4daefc6d0a923c4d3c02 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Tue, 2 Jul 2024 12:10:51 +0200 Subject: [PATCH 130/161] topology1: BT_OFFLOAD is only supported on Chromebooks Remove BT_OFFLOAD on all Intel RVPs, otherwise we will have a run-time mismatch between kernel and topologies. Signed-off-by: Pierre-Louis Bossart --- tools/topology/topology1/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index b420657761d8..cf8d5ab1187f 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -142,13 +142,13 @@ set(TPLGS "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" + "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DCHANNELS=0\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l2-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l2-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" - "sof-tgl-rt711-rt1308\;sof-rpl-rt711-4ch\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=rpl\;-DDYNAMIC=1" - "sof-tgl-rt711-rt1308\;sof-rpl-rt711\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=rpl\;-DDYNAMIC=1" + "sof-tgl-rt711-rt1308\;sof-rpl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=rpl\;-DDYNAMIC=1" + "sof-tgl-rt711-rt1308\;sof-rpl-rt711\;-DCHANNELS=0\;-DPLATFORM=rpl\;-DDYNAMIC=1" ## end SoundWire topologies ## SoundWire NOJACK topologies From 9e4dadc4d8e05119191affcf529a7047004738bf Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 31 Jul 2024 17:36:49 +0000 Subject: [PATCH 131/161] Update rimage to version 02abc5d342a3, including critical openssl3 fix Fixes #9340 This adds the following commits from the main rimage branch: ``` commit 02abc5d342a3 ("rimage: ace signing functions need openssl 3.0 guards") commit 73a9d7c897d3 ("rimage: fix openssl 3.0 support in ver25 signing") commit 8ba3d1729656 ("adsp_config: fix name parsing error in parse_signed_pkg_ace_v1_5") commit fe4dcaa62c13 ("mtl: Add ASRC module to the manifest") commit af947cb63dd6 ("config: Add toml config for mtl") commit c484d99abf89 ("rimage: add ACE V1.5 handling") commit 1b233f68bdee ("config: add rmb toml file to support rembrandt build") ``` This is the smallest main branch fast-forward that includes the critical openssl3 fix commit 73a9d7c897d3 ("rimage: fix openssl 3.0 support in ver25 signing") _and_ compiles. This happens to align the rimage version in stable-v2.2 to the version in stable-v2.3. stable-v2.3 is not in use anymore but it was routinely tested in CI for a long time. In fact this stable-v2.2 commit is the same as stable-v2.3 commit 4e1d3ba61abd3b ("rimage: update to version 02abc5d342a3") Signed-off-by: Marc Herbert --- rimage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rimage b/rimage index 9d453321f892..02abc5d342a3 160000 --- a/rimage +++ b/rimage @@ -1 +1 @@ -Subproject commit 9d453321f892b7ec3f0c74d3382eaa4e674a6e6a +Subproject commit 02abc5d342a3ee6965bdc933ea1439d85d0256da From 307ddc7fa185359795d32e7f445b12882a1a3375 Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Wed, 31 Jul 2024 11:26:02 +0800 Subject: [PATCH 132/161] topology1: sof-hda-generic: support BT audio offload Add new pipelines to sof-hda-generic.m4 to support BT audio offload on SSP2 if BT_OFFLOAD is defined in makefile. Signed-off-by: Brent Lu --- tools/topology/topology1/sof-hda-generic.m4 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/topology/topology1/sof-hda-generic.m4 b/tools/topology/topology1/sof-hda-generic.m4 index 485ef520c496..d7fd82662e8e 100644 --- a/tools/topology/topology1/sof-hda-generic.m4 +++ b/tools/topology/topology1/sof-hda-generic.m4 @@ -37,6 +37,15 @@ include(`platform/intel/intel-generic-dmic.m4') ' ) +ifdef(`BT_OFFLOAD', ` +# BT offload support +define(`BT_PIPELINE_PB_ID', `12') +define(`BT_PIPELINE_CP_ID', `13') +define(`BT_DAI_LINK_ID', 8) +define(`BT_PCM_ID', `8') +define(`HW_CONFIG_ID', 8) +include(`platform/intel/intel-generic-bt.m4')') + # The pipeline naming notation is pipe-mixer-PROCESSING-dai-DIRECTION.m4 # HSPROC is set by makefile, if not the default above is applied define(PIPE_HEADSET_PLAYBACK, `sof/pipe-mixer-`HSPROC'-dai-playback.m4') From e05ca349de3d65a093fbbe09a3390306755e9a30 Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Wed, 31 Jul 2024 11:27:13 +0800 Subject: [PATCH 133/161] topology1: add sof-hda-generic-4ch-bt topology Add an new topology sof-hda-generic-4ch-bt.tplg which supports 4-channel DMIC PCM and BT audio offload for Chromebooks. Signed-off-by: Brent Lu --- tools/topology/topology1/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index cf8d5ab1187f..08a903b2404c 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -33,6 +33,7 @@ set(TPLGS "sof-hda-generic\;sof-hda-generic-2ch-pdm1\;-DPDM1\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-3ch\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" "sof-hda-generic\;sof-hda-generic-4ch\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" + "sof-hda-generic\;sof-hda-generic-4ch-bt\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1\;-DBT_OFFLOAD" ## end HDaudio codec topologies "sof-hda-generic-idisp\;sof-hda-generic-idisp\;-DCHANNELS=0\;-DDYNAMIC=1" From 82f62fb893d0b55add37cee23ea554a51aff40a9 Mon Sep 17 00:00:00 2001 From: Curtis Malainey Date: Fri, 27 May 2022 15:12:47 -0700 Subject: [PATCH 134/161] OWNERS: move google files to team reference Now we won't need code changes to update reviewers when we have additions or departures. Signed-off-by: Curtis Malainey (cherry picked from commit df36d2564eccea86322a526a0d426f2a091ec1b9) --- CODEOWNERS | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 3a5a8b899053..7268a29f9da7 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -29,13 +29,13 @@ src/audio/eq_iir* @singalsu src/audio/tone.c @singalsu src/audio/kpb.c @mrajwa src/audio/mux/* @akloniex -src/audio/dcblock* @cujomalainey @chiang831 @johnylin76 -src/audio/crossover* @cujomalainey @chiang831 @johnylin76 +src/audio/dcblock* @thesofproject/google +src/audio/crossover* @thesofproject/google src/audio/tdfb* @singalsu -src/audio/drc/* @johnylin76 @cujomalainey @chiang831 -src/audio/multiband_drc/* @johnylin76 @cujomalainey @chiang831 +src/audio/drc/* @thesofproject/google +src/audio/multiband_drc/* @thesofproject/google src/audio/codec_adapter/* @cujomalainey @mrajwa @dbaluta -src/audio/google_hotword_detect.c @bzhg @cujomalainey @chiang831 @johnylin76 +src/audio/google_hotword_detect.c @thesofproject/google # platforms src/platform/haswell/* @randerwang @@ -73,10 +73,10 @@ tools/testbench/* @ranj063 tools/test/audio/* @singalsu tools/ctl/* @singalsu tools/tune/* @singalsu -tools/tune/crossover/* @cujomalainey @johnylin76 @chiang831 -tools/tune/dcblock/* @cujomalainey @johnylin76 @chiang831 -tools/tune/drc/* @cujomalainey @johnylin76 @chiang831 -tools/oss-fuzz/* @cujomalainey +tools/tune/crossover/* @thesofproject/google +tools/tune/dcblock/* @thesofproject/google +tools/tune/drc/* @thesofproject/google +tools/oss-fuzz/* @thesofproject/google # build system **/CMakeLists.txt @marc-hb @aborisovich From 5fb35022dd740f8127e58ac247efdb5df6540f85 Mon Sep 17 00:00:00 2001 From: Curtis Malainey Date: Tue, 10 Jan 2023 11:20:13 -0800 Subject: [PATCH 135/161] owners: fix google audio component path Forgot to update this after moving our components to a folder Signed-off-by: Curtis Malainey (cherry picked from commit 3b8ef3a791107d91daa639300fe94b1b8574b69f) --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index 7268a29f9da7..22b678ea6e5d 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -35,7 +35,7 @@ src/audio/tdfb* @singalsu src/audio/drc/* @thesofproject/google src/audio/multiband_drc/* @thesofproject/google src/audio/codec_adapter/* @cujomalainey @mrajwa @dbaluta -src/audio/google_hotword_detect.c @thesofproject/google +src/audio/google/* @thesofproject/google # platforms src/platform/haswell/* @randerwang From 3aa64bf9e928a57883baddf08efcd350358d18c2 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Thu, 12 Jan 2023 12:09:36 -0800 Subject: [PATCH 136/161] CODEOWNERS: search/replace @mrajwa -> @abonislawski Dumb search/replace per @mwasko's request in #6933. Urgently required because the @mrawja account does not exist anymore and Github complains. Signed-off-by: Marc Herbert (cherry picked from commit cb4cb1d0a2738811c0eaaabe23d7a9d22005c5bd) --- CODEOWNERS | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 22b678ea6e5d..caee9c46356f 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -14,10 +14,10 @@ src/include/ipc/** @thesofproject/steering-committee src/include/ipc/** @randerwang @marcinszkudlinski src/include/kernel/** @thesofproject/steering-committee src/include/user/** @thesofproject/steering-committee -src/include/sof/debug/gdb/* @mrajwa -src/include/sof/audio/kpb.h @mrajwa +src/include/sof/debug/gdb/* @abonislawski +src/include/sof/audio/kpb.h @abonislawski src/include/sof/audio/mux.h @akloniex -src/include/sof/audio/codec_adapter/* @cujomalainey @mrajwa @dbaluta +src/include/sof/audio/codec_adapter/* @cujomalainey @abonislawski @dbaluta src/include/sof/drivers/acp_dai_dma.h @bhiregoudar @sunilkumardommati src/include/sof/drivers/afe* @yaochunhung @@ -27,20 +27,20 @@ src/audio/eq* @singalsu src/audio/eq_fir* @singalsu src/audio/eq_iir* @singalsu src/audio/tone.c @singalsu -src/audio/kpb.c @mrajwa +src/audio/kpb.c @abonislawski src/audio/mux/* @akloniex src/audio/dcblock* @thesofproject/google src/audio/crossover* @thesofproject/google src/audio/tdfb* @singalsu src/audio/drc/* @thesofproject/google src/audio/multiband_drc/* @thesofproject/google -src/audio/codec_adapter/* @cujomalainey @mrajwa @dbaluta +src/audio/codec_adapter/* @cujomalainey @abonislawski @dbaluta src/audio/google/* @thesofproject/google # platforms src/platform/haswell/* @randerwang src/platform/suecreek/* @lyakh -src/arch/xtensa/debug/gdb/* @mrajwa +src/arch/xtensa/debug/gdb/* @abonislawski src/platform/imx8/** @dbaluta src/platform/amd/** @bhiregoudar @sunilkumardommati src/platform/mt8195/** @yaochunhung @kuanhsuncheng @@ -59,8 +59,8 @@ src/math/* @singalsu src/ipc/* @bardliao @marcinszkudlinski src/drivers/intel/cavs/sue-ipc.c @lyakh src/lib/* @libinyang -src/debug/gdb/* @mrajwa -src/schedule @mrajwa +src/debug/gdb/* @abonislawski +src/schedule @abonislawski # other helpers # Mostly overridden by *.(ba)sh below From d8120e166a4eecca335829c7c4f6f84da64dfc44 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Thu, 12 Jan 2023 11:58:56 -0800 Subject: [PATCH 137/161] CODEOWNERS: be more selective when matching CMakeLists.txt files I don't want to be spammed any more every time someone adds or renames a source file. Signed-off-by: Marc Herbert (cherry picked from commit 235dd98e831744484e592957ac8f57210b95b983) --- CODEOWNERS | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index caee9c46356f..ae2639e4e9d4 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -7,6 +7,8 @@ # Order is important. The last matching pattern has the most precedence. # So if a pull request only touches javascript files, only these owners # will be requested to review. +# File patterns work mostly like .gitignore. Try to keep this file +# simple because it's literally impossible to test. # include files src/include/sof/drivers/dmic.h @singalsu @@ -63,7 +65,7 @@ src/debug/gdb/* @abonislawski src/schedule @abonislawski # other helpers -# Mostly overridden by *.(ba)sh below +# Many files overridden by *.(ba)sh pattern below scripts/* @marc-hb @aborisovich # tools(old 'soft' repo) @@ -78,11 +80,19 @@ tools/tune/dcblock/* @thesofproject/google tools/tune/drc/* @thesofproject/google tools/oss-fuzz/* @thesofproject/google -# build system -**/CMakeLists.txt @marc-hb @aborisovich -# **/Kconfig -# scripts/cmake/** -# scripts/kconfig/** +# CMake + +# Include only "top-level" CMakeLists.txt files; the other ones are just +# dumb list of source files and generate too much noise. +/CMakeLists.txt @marc-hb @aborisovich +/*/CMakeLists.txt @marc-hb @aborisovich +/test/cmocka/CMakeLists.txt @marc-hb @aborisovich + +# There's a small enough number of files in tools/ and little +# churn: keep it simple and take them all. +# FIXME: some topology CMakeLists.txt files are configuration files +# in disguise. Move them to actual configuration files. +/tools/**/CMakeLists.txt @marc-hb @aborisovich *.sh @marc-hb *.bash @marc-hb From 27db779720b98e208813ec01dcd292ce38d37387 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Fri, 17 Feb 2023 14:50:44 +0200 Subject: [PATCH 138/161] CODEOWNERS: add new owner for topology and topology2 Mark Ranjani Sridharan for full topology folder. Add Jyri Sarha for topology2 folders. Signed-off-by: Kai Vehmanen (cherry picked from commit 9353c2d5f137004f4541b62643c8dc0d01b1b588) --- CODEOWNERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index ae2639e4e9d4..6e078ab518e7 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -70,7 +70,8 @@ scripts/* @marc-hb @aborisovich # tools(old 'soft' repo) tools/logger/* @bkokoszx @akloniex -tools/topology/* @ranj063 +tools/topology/** @ranj063 +tools/topology/topology2/** @ranj063 @jsarha tools/testbench/* @ranj063 tools/test/audio/* @singalsu tools/ctl/* @singalsu From c763084db6a30e435e9e0956b19cf4bc4c9378c0 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Fri, 17 Feb 2023 14:54:54 +0200 Subject: [PATCH 139/161] CODEOWNERS: add owners for zephyr/ subfolders Add Kai Vehmanen, Guennadi Liakhovetski, Iulia Prodan and Daniel Baluta as owners for the 'zephyr/' subfolder. Signed-off-by: Kai Vehmanen (cherry picked from commit 441bd035449e7962baa410956a4b99fa4a3fb970) --- CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CODEOWNERS b/CODEOWNERS index 6e078ab518e7..9261fd8b575f 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -81,6 +81,8 @@ tools/tune/dcblock/* @thesofproject/google tools/tune/drc/* @thesofproject/google tools/oss-fuzz/* @thesofproject/google +zephyr/** @kv2019i @lyakh @iuliana-prodan @dbaluta + # CMake # Include only "top-level" CMakeLists.txt files; the other ones are just From d939dc8d8d16edaec22eaa4b29183f877988bf94 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Fri, 17 Feb 2023 14:55:54 +0200 Subject: [PATCH 140/161] CODEOWNERS: add owner for installer/ subfolder Add Marc Herbert as code owner for installer subfolder. Signed-off-by: Kai Vehmanen (cherry picked from commit 94a128d516b70d615178cc3313ba0be83b94c987) --- CODEOWNERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CODEOWNERS b/CODEOWNERS index 9261fd8b575f..a09ca69e5a7c 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -83,6 +83,9 @@ tools/oss-fuzz/* @thesofproject/google zephyr/** @kv2019i @lyakh @iuliana-prodan @dbaluta +# installer +installer/** @marc-hb + # CMake # Include only "top-level" CMakeLists.txt files; the other ones are just From 4f83517d4027569719800e3d28e741e5aa19c40a Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Mon, 20 Feb 2023 19:27:49 +0200 Subject: [PATCH 141/161] CODEOWNERS: refer to github documentation on file syntax Add a link to online github documentation with regard to file syntax and how it can be tested. Suggested-by: Marc Herbert Signed-off-by: Kai Vehmanen (cherry picked from commit 430893f18aaccced8d77722cb323fd51ce1276f1) --- CODEOWNERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index a09ca69e5a7c..780163b4ddc3 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -7,8 +7,8 @@ # Order is important. The last matching pattern has the most precedence. # So if a pull request only touches javascript files, only these owners # will be requested to review. -# File patterns work mostly like .gitignore. Try to keep this file -# simple because it's literally impossible to test. +# +# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners # include files src/include/sof/drivers/dmic.h @singalsu From a2b234779c0b63a25f9a41834ef756af79b70d9d Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Tue, 21 Feb 2023 11:34:45 -0800 Subject: [PATCH 142/161] CODEOWNERS: restore dropped comment Fix minor misunderstanding in review of git commit 430893f18aac ("CODEOWNERS: refer to github documentation on file syntax") Signed-off-by: Marc Herbert (cherry picked from commit 7975c266a453d0afdf5ef2eca3e52bce40cd1f04) --- CODEOWNERS | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 780163b4ddc3..ce89d223363f 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -5,9 +5,8 @@ * @lgirdwood @plbossart @mmaka1 @lbetlej @dbaluta # Order is important. The last matching pattern has the most precedence. -# So if a pull request only touches javascript files, only these owners -# will be requested to review. -# +# File patterns work mostly like .gitignore. Try to keep this file +# simple because it's literally impossible to test. # https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners # include files From c10addda0ae97be979e21c06b28d9d7431539ba5 Mon Sep 17 00:00:00 2001 From: Michal Wasko Date: Thu, 23 Feb 2023 16:34:17 +0100 Subject: [PATCH 143/161] CODEOWNERS: more intel code owners added Intel code owners added based on latest contribution and expertise. Signed-off-by: Michal Wasko (cherry picked from commit e40cf6d7d15732d835b63c9ca8c237c175971420) --- CODEOWNERS | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index ce89d223363f..647dbd31d8dd 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -12,30 +12,39 @@ # include files src/include/sof/drivers/dmic.h @singalsu src/include/ipc/** @thesofproject/steering-committee -src/include/ipc/** @randerwang @marcinszkudlinski +src/include/ipc/** @randerwang @marcinszkudlinski @pblaszko +src/include/ipc4/** @randerwang @marcinszkudlinski @pblaszko @aborisovich src/include/kernel/** @thesofproject/steering-committee src/include/user/** @thesofproject/steering-committee src/include/sof/debug/gdb/* @abonislawski -src/include/sof/audio/kpb.h @abonislawski -src/include/sof/audio/mux.h @akloniex +src/include/sof/audio/aria/* @abonislawski +src/include/sof/audio/kpb.h @fkwasowi @iganakov +src/include/sof/audio/mux.h @fkwasowi +src/include/sof/audio/up_down_mixer/* @abonislawski src/include/sof/audio/codec_adapter/* @cujomalainey @abonislawski @dbaluta +src/include/sof/audio/module_adapter/* @ranj063 @jxstelter src/include/sof/drivers/acp_dai_dma.h @bhiregoudar @sunilkumardommati src/include/sof/drivers/afe* @yaochunhung # audio component -src/audio/src* @singalsu +src/audio/src* @singalsu @abonislawski +src/audio/chain_dma* @makarukp +src/audio/copier/* @randerwang @abonislawski @pblaszko src/audio/eq* @singalsu src/audio/eq_fir* @singalsu src/audio/eq_iir* @singalsu src/audio/tone.c @singalsu -src/audio/kpb.c @abonislawski -src/audio/mux/* @akloniex +src/audio/kpb.c @fkwasowi @iganakov +src/audio/mux/* @fkwasowi src/audio/dcblock* @thesofproject/google src/audio/crossover* @thesofproject/google src/audio/tdfb* @singalsu src/audio/drc/* @thesofproject/google +src/audio/selector/* @tlissows +src/audio/up_down_mixer/* @abonislawski src/audio/multiband_drc/* @thesofproject/google src/audio/codec_adapter/* @cujomalainey @abonislawski @dbaluta +src/audio/module_adapter/* @ranj063 @jxstelter src/audio/google/* @thesofproject/google # platforms @@ -57,11 +66,14 @@ src/drivers/mediatek/mt8195/* @yaochunhung @kuanhsuncheng # other libs src/math/* @singalsu -src/ipc/* @bardliao @marcinszkudlinski +src/ipc/* @bardliao @marcinszkudlinski @pblaszko @aborisovich src/drivers/intel/cavs/sue-ipc.c @lyakh src/lib/* @libinyang src/debug/gdb/* @abonislawski -src/schedule @abonislawski +src/schedule @pblaszko @marcinszkudlinski + +# samples +samples/audio/detect_test.c @iganakov # other helpers # Many files overridden by *.(ba)sh pattern below @@ -80,7 +92,10 @@ tools/tune/dcblock/* @thesofproject/google tools/tune/drc/* @thesofproject/google tools/oss-fuzz/* @thesofproject/google -zephyr/** @kv2019i @lyakh @iuliana-prodan @dbaluta +zephyr/** @kv2019i @lyakh @iuliana-prodan @dbaluta @abonislawski +zephyr/lib/cpu.c @tmleman +zephyr/lib/alloc.c @dabekjakub +zephyr/lib/regions_mm.c @dabekjakub # installer installer/** @marc-hb From a10673049d57038cfb43b342ca188f6a42831e34 Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Wed, 17 May 2023 14:26:31 +0300 Subject: [PATCH 144/161] CODEOWNERS: Add NXP people as owners for scheduler With the work done for zephyr DMA domain we got a lot of insights about how scheduler works. So add myself and Laurentiu as codeowners. Signed-off-by: Daniel Baluta (cherry picked from commit aa91bedf38695e456b591727140b09a714c3cd6d) --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index 647dbd31d8dd..88c949661404 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -70,7 +70,7 @@ src/ipc/* @bardliao @marcinszkudlinski @pblaszko @aborisovich src/drivers/intel/cavs/sue-ipc.c @lyakh src/lib/* @libinyang src/debug/gdb/* @abonislawski -src/schedule @pblaszko @marcinszkudlinski +src/schedule @pblaszko @marcinszkudlinski @dbaluta @LaurentiuM1234 # samples samples/audio/detect_test.c @iganakov From 66876bfbb27fb5cc3a39a42e88fa7251858abdfd Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Mon, 28 Aug 2023 14:37:10 -0700 Subject: [PATCH 145/161] CODEOWNERS: remove @aborisovich Andrey is not at Intel any more. Signed-off-by: Marc Herbert (cherry picked from commit ed8dd91654ef3538abbfad21bf3ec46f8e26c9d9) --- CODEOWNERS | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 88c949661404..d05d03b18173 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -13,7 +13,7 @@ src/include/sof/drivers/dmic.h @singalsu src/include/ipc/** @thesofproject/steering-committee src/include/ipc/** @randerwang @marcinszkudlinski @pblaszko -src/include/ipc4/** @randerwang @marcinszkudlinski @pblaszko @aborisovich +src/include/ipc4/** @randerwang @marcinszkudlinski @pblaszko src/include/kernel/** @thesofproject/steering-committee src/include/user/** @thesofproject/steering-committee src/include/sof/debug/gdb/* @abonislawski @@ -66,7 +66,7 @@ src/drivers/mediatek/mt8195/* @yaochunhung @kuanhsuncheng # other libs src/math/* @singalsu -src/ipc/* @bardliao @marcinszkudlinski @pblaszko @aborisovich +src/ipc/* @bardliao @marcinszkudlinski @pblaszko src/drivers/intel/cavs/sue-ipc.c @lyakh src/lib/* @libinyang src/debug/gdb/* @abonislawski @@ -77,7 +77,7 @@ samples/audio/detect_test.c @iganakov # other helpers # Many files overridden by *.(ba)sh pattern below -scripts/* @marc-hb @aborisovich +scripts/* @marc-hb # tools(old 'soft' repo) tools/logger/* @bkokoszx @akloniex @@ -104,21 +104,21 @@ installer/** @marc-hb # Include only "top-level" CMakeLists.txt files; the other ones are just # dumb list of source files and generate too much noise. -/CMakeLists.txt @marc-hb @aborisovich -/*/CMakeLists.txt @marc-hb @aborisovich -/test/cmocka/CMakeLists.txt @marc-hb @aborisovich +/CMakeLists.txt @marc-hb +/*/CMakeLists.txt @marc-hb +/test/cmocka/CMakeLists.txt @marc-hb # There's a small enough number of files in tools/ and little # churn: keep it simple and take them all. # FIXME: some topology CMakeLists.txt files are configuration files # in disguise. Move them to actual configuration files. -/tools/**/CMakeLists.txt @marc-hb @aborisovich +/tools/**/CMakeLists.txt @marc-hb *.sh @marc-hb *.bash @marc-hb *trace.* @akloniex -/.github/ @dbaluta @cujomalainey @lgirdwood @marc-hb @aborisovich +/.github/ @dbaluta @cujomalainey @lgirdwood @marc-hb # You can also use email addresses if you prefer. #docs/* docs@example.com From 15ed030cb313d9129a9ba6fc2d494c072ca75263 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Thu, 31 Aug 2023 11:00:41 +0300 Subject: [PATCH 146/161] CODEOWNERS: add kv2019i to the list of default owners Add myself to the list of default owners that get added to all pull requests if no other entries match. Signed-off-by: Kai Vehmanen (cherry picked from commit 7c013b27e541130bc6b8f3ac6a4a8b22b07cf91a) --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index d05d03b18173..983c5802f659 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -2,7 +2,7 @@ # Each line is a file pattern followed by one or more owners. # These owners will be the default owners for everything in the repo. -* @lgirdwood @plbossart @mmaka1 @lbetlej @dbaluta +* @lgirdwood @plbossart @mmaka1 @lbetlej @dbaluta @kv2019i # Order is important. The last matching pattern has the most precedence. # File patterns work mostly like .gitignore. Try to keep this file From e2b271fbf0f6d1f0c9c811c8c14d40912fa974f7 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Thu, 29 Aug 2024 08:29:01 -0700 Subject: [PATCH 147/161] CODEOWNERS: remove marc-hb New assignment. Signed-off-by: Marc Herbert (cherry picked from commit 077187d500f4d1799e7b83d43d05131e7bf6102d) --- CODEOWNERS | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 983c5802f659..1eda4e7c4ba7 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -77,7 +77,7 @@ samples/audio/detect_test.c @iganakov # other helpers # Many files overridden by *.(ba)sh pattern below -scripts/* @marc-hb +# scripts/* TODO # tools(old 'soft' repo) tools/logger/* @bkokoszx @akloniex @@ -98,27 +98,27 @@ zephyr/lib/alloc.c @dabekjakub zephyr/lib/regions_mm.c @dabekjakub # installer -installer/** @marc-hb +# installer/** TODO # CMake # Include only "top-level" CMakeLists.txt files; the other ones are just # dumb list of source files and generate too much noise. -/CMakeLists.txt @marc-hb -/*/CMakeLists.txt @marc-hb -/test/cmocka/CMakeLists.txt @marc-hb +# /CMakeLists.txt TODO +#/*/CMakeLists.txt TODO +# /test/cmocka/CMakeLists.txt TODO # There's a small enough number of files in tools/ and little # churn: keep it simple and take them all. # FIXME: some topology CMakeLists.txt files are configuration files # in disguise. Move them to actual configuration files. -/tools/**/CMakeLists.txt @marc-hb +# /tools/**/CMakeLists.txt TODO -*.sh @marc-hb -*.bash @marc-hb +# *.sh TODO +# *.bash TODO *trace.* @akloniex -/.github/ @dbaluta @cujomalainey @lgirdwood @marc-hb +/.github/ @dbaluta @cujomalainey @lgirdwood # You can also use email addresses if you prefer. #docs/* docs@example.com From ce8d8c6a42f811f3112045e0d993e2c2493ca7cd Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Thu, 29 Aug 2024 09:01:12 -0700 Subject: [PATCH 148/161] CODEOWNERS: remove invalid libinyang and makarukp Both are reported by Github as "Unknown owner on line 31: make sure @makarukp exists and has write access to the repository" Signed-off-by: Marc Herbert (cherry picked from commit 945af8712414c3acfcd899050619a8ae21195ecc) --- CODEOWNERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 1eda4e7c4ba7..365405b49e7a 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -28,7 +28,7 @@ src/include/sof/drivers/afe* @yaochunhung # audio component src/audio/src* @singalsu @abonislawski -src/audio/chain_dma* @makarukp +# src/audio/chain_dma* TODO src/audio/copier/* @randerwang @abonislawski @pblaszko src/audio/eq* @singalsu src/audio/eq_fir* @singalsu @@ -68,7 +68,7 @@ src/drivers/mediatek/mt8195/* @yaochunhung @kuanhsuncheng src/math/* @singalsu src/ipc/* @bardliao @marcinszkudlinski @pblaszko src/drivers/intel/cavs/sue-ipc.c @lyakh -src/lib/* @libinyang +# src/lib/* TODO src/debug/gdb/* @abonislawski src/schedule @pblaszko @marcinszkudlinski @dbaluta @LaurentiuM1234 From c2cd312bb89bfe96f79d2aada6de98ebef7c65fc Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Thu, 19 Sep 2024 18:15:07 +0800 Subject: [PATCH 149/161] Revert "topology: sof-jsl-rt5682: add SSP_CC_BCLK_ES flag to codec DAI" This reverts commit b365447dc61226c8e53358c15d588ba9616f8cd2. Signed-off-by: Brent Lu --- tools/topology/topology1/CMakeLists.txt | 1 - tools/topology/topology1/sof-jsl-rt5682.m4 | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 08a903b2404c..7aa7febf375b 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -218,7 +218,6 @@ set(TPLGS "sof-jsl-rt5682\;sof-jsl-rt5682-rt1015\;-DPLATFORM=jsl-rt1015" "sof-jsl-rt5682\;sof-jsl-rt5682-rt1015-xperi\;-DPLATFORM=jsl-rt1015\;-DINCLUDE_IIR_EQ=1" "sof-jsl-rt5682\;sof-jsl-rt5682-mx98360a\;-DPLATFORM=jsl-dedede" - "sof-jsl-rt5682\;sof-jsl-cs42l42-mx98360a\;-DPLATFORM=jsl-dedede" "sof-jsl-rt5682\;sof-jsl-rt5682\;-DHEADPHONE=rt5682\;-DPLATFORM=icl\;-DNO_AMP" ## DRC/EQ topologies diff --git a/tools/topology/topology1/sof-jsl-rt5682.m4 b/tools/topology/topology1/sof-jsl-rt5682.m4 index 89fa84b2f28c..6c49a1dcb0f9 100644 --- a/tools/topology/topology1/sof-jsl-rt5682.m4 +++ b/tools/topology/topology1/sof-jsl-rt5682.m4 @@ -182,7 +182,7 @@ DAI_CONFIG(SSP, 0, 0, SSP0-Codec, SSP_CLOCK(bclk, 2400000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_BCLK_ES))) + SSP_CONFIG_DATA(SSP, 0, 24))) ifdef(`NO_AMP',`',` # SSP 1 (ID: 6) From d1a251c1517487d5708003b8b06cc32a32ac1b38 Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Wed, 28 Jul 2021 14:24:09 +0800 Subject: [PATCH 150/161] topology: sof-jsl-rt5682: add support for cs42l42 with max98360a Add support for cs42l42 with max98360a running on JSL boards. The cs42l42 needs to enable bclk earlier in prepare stage and disable bclk at hw_free statge so we add the SSP_CC_BCLK_ES flag for it. Signed-off-by: Brent Lu (cherry picked from commit 80a7795bd1c32387cf351a54d062bf7ddd5a3604) --- tools/topology/topology1/CMakeLists.txt | 7 ++++--- tools/topology/topology1/sof-jsl-rt5682.m4 | 17 +++++++++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 7aa7febf375b..44596d58630f 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -215,9 +215,10 @@ set(TPLGS "sof-jsl-da7219\;sof-jsl-da7219\;-DPLATFORM=jsl" "sof-jsl-da7219\;sof-jsl-da7219-mx98360a\;-DPLATFORM=jsl-dedede" "sof-smart-amplifier-nocodec\;sof-smart-amplifier-nocodec" - "sof-jsl-rt5682\;sof-jsl-rt5682-rt1015\;-DPLATFORM=jsl-rt1015" - "sof-jsl-rt5682\;sof-jsl-rt5682-rt1015-xperi\;-DPLATFORM=jsl-rt1015\;-DINCLUDE_IIR_EQ=1" - "sof-jsl-rt5682\;sof-jsl-rt5682-mx98360a\;-DPLATFORM=jsl-dedede" + "sof-jsl-rt5682\;sof-jsl-rt5682-rt1015\;-DHEADPHONE=rt5682\;-DPLATFORM=jsl-rt1015" + "sof-jsl-rt5682\;sof-jsl-rt5682-rt1015-xperi\;-DHEADPHONE=rt5682\;-DPLATFORM=jsl-rt1015\;-DINCLUDE_IIR_EQ=1" + "sof-jsl-rt5682\;sof-jsl-rt5682-mx98360a\;-DHEADPHONE=rt5682\;-DPLATFORM=jsl-dedede" + "sof-jsl-rt5682\;sof-jsl-cs42l42-mx98360a\;-DHEADPHONE=cs42l42\;-DPLATFORM=jsl-dedede" "sof-jsl-rt5682\;sof-jsl-rt5682\;-DHEADPHONE=rt5682\;-DPLATFORM=icl\;-DNO_AMP" ## DRC/EQ topologies diff --git a/tools/topology/topology1/sof-jsl-rt5682.m4 b/tools/topology/topology1/sof-jsl-rt5682.m4 index 6c49a1dcb0f9..a554229d63a6 100644 --- a/tools/topology/topology1/sof-jsl-rt5682.m4 +++ b/tools/topology/topology1/sof-jsl-rt5682.m4 @@ -1,5 +1,8 @@ # -# Topology for JasperLake with rt5682 codec + DMIC + 3 HDMI + Speaker amp +# Topology for JasperLake with rt5682 or cs42l42 codec + +# DMIC + +# 3 HDMI + +# speaker amp # # Include topology builder @@ -25,7 +28,7 @@ DEBUG_START # ifdef(`NO_AMP',`',` # PCM0 ----> volume -----> SSP1 (Speaker - ALC1015)') -# PCM1 <---> volume <----> SSP0 (Headset - ALC5682) +`# PCM1 <---> volume <----> SSP0 (Headset - 'HEADPHONE`)' # PCM2 ----> volume -----> iDisp1 # PCM3 ----> volume -----> iDisp2 # PCM4 ----> volume -----> iDisp3 @@ -176,6 +179,7 @@ dnl SSP_CONFIG(format, mclk, bclk, fsync, tdm, ssp_config_data) dnl SSP_CLOCK(clock, freq, codec_master, polarity) dnl SSP_CONFIG_DATA(type, idx, valid bits, mclk_id) +ifelse(HEADPHONE, `rt5682', ` # SSP 0 (ID: 0) ALC5682 DAI_CONFIG(SSP, 0, 0, SSP0-Codec, SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24000000, codec_mclk_in), @@ -183,6 +187,15 @@ DAI_CONFIG(SSP, 0, 0, SSP0-Codec, SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 25, 3, 3), SSP_CONFIG_DATA(SSP, 0, 24))) +', HEADPHONE, `cs42l42', ` +# SSP 0 (ID: 0) CS42L42 +DAI_CONFIG(SSP, 0, 0, SSP0-Codec, + SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24000000, codec_mclk_in), + SSP_CLOCK(bclk, 2400000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 25, 3, 3), + SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_BCLK_ES))) +', ) ifdef(`NO_AMP',`',` # SSP 1 (ID: 6) From 0a668f3203ef753f74c81d66be69583d4a0538b0 Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Mon, 27 Jun 2022 17:07:52 +0800 Subject: [PATCH 151/161] topology: sof-jsl-rt5682: enable mclk always-on feature Enable the always-on feature for pop. Signed-off-by: Brent Lu (cherry picked from commit 41e56b336de33bd0f52ab3047281f4421432e42f) (cherry picked from commit dd08b24e104c3ad7e1ff4136d8bb3ce5c79ad7c9) --- tools/topology/topology1/sof-jsl-rt5682.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/topology/topology1/sof-jsl-rt5682.m4 b/tools/topology/topology1/sof-jsl-rt5682.m4 index a554229d63a6..5e39e707d9e1 100644 --- a/tools/topology/topology1/sof-jsl-rt5682.m4 +++ b/tools/topology/topology1/sof-jsl-rt5682.m4 @@ -186,7 +186,7 @@ DAI_CONFIG(SSP, 0, 0, SSP0-Codec, SSP_CLOCK(bclk, 2400000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, 0, 24))) + SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_MCLK_AON))) ', HEADPHONE, `cs42l42', ` # SSP 0 (ID: 0) CS42L42 DAI_CONFIG(SSP, 0, 0, SSP0-Codec, From 88bfd0e3f73cf17792b6ff40190f36d586483936 Mon Sep 17 00:00:00 2001 From: Brent Lu Date: Fri, 11 Aug 2023 11:41:31 +0800 Subject: [PATCH 152/161] topology1: sof-jsl-rt5650: support ALC5650 Add a new topology sof-jsl-rt5650 for ALC5650 which supports SSP0 for headset and SSP1 for speakers since this codec implements two I2S interfaces. DAI format changed to mclk: 24.576MHz, bclk: 3.072MHz, sample bits: 24-bit to avoid using ASRC function on codec side. Signed-off-by: Brent Lu (cherry picked from commit 6dc35044e6af98197e79c1e49c8e08b365312540) --- tools/topology/topology1/CMakeLists.txt | 1 + tools/topology/topology1/platform/intel/jsl-rt1015.m4 | 9 +++++++++ tools/topology/topology1/sof-jsl-rt5682.m4 | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 44596d58630f..e2a6509c7831 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -220,6 +220,7 @@ set(TPLGS "sof-jsl-rt5682\;sof-jsl-rt5682-mx98360a\;-DHEADPHONE=rt5682\;-DPLATFORM=jsl-dedede" "sof-jsl-rt5682\;sof-jsl-cs42l42-mx98360a\;-DHEADPHONE=cs42l42\;-DPLATFORM=jsl-dedede" "sof-jsl-rt5682\;sof-jsl-rt5682\;-DHEADPHONE=rt5682\;-DPLATFORM=icl\;-DNO_AMP" + "sof-jsl-rt5682\;sof-jsl-rt5650\;-DHEADPHONE=rt5650\;-DPLATFORM=jsl-rt1015" ## DRC/EQ topologies "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-drceq\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DDYNAMIC=1\;-DDRC_EQ" diff --git a/tools/topology/topology1/platform/intel/jsl-rt1015.m4 b/tools/topology/topology1/platform/intel/jsl-rt1015.m4 index 981045d93f6b..d1b8a003b294 100644 --- a/tools/topology/topology1/platform/intel/jsl-rt1015.m4 +++ b/tools/topology/topology1/platform/intel/jsl-rt1015.m4 @@ -10,9 +10,18 @@ define(`SPK_NAME', `SSP1-Codec') undefine(`SPK_DATA_FORMAT') define(`SPK_DATA_FORMAT', `s24le') +ifelse(HEADPHONE, `rt5650', ` +define(`SET_SSP_CONFIG', + `SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24576000, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, 1, 24, 0, 0, 0, SSP_CC_MCLK_AON))') +', ` define(`SET_SSP_CONFIG', `SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24000000, codec_mclk_in), SSP_CLOCK(bclk, 3072000, codec_slave), SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 32, 3, 3), SSP_CONFIG_DATA(SSP, 1, 24))') +') \ No newline at end of file diff --git a/tools/topology/topology1/sof-jsl-rt5682.m4 b/tools/topology/topology1/sof-jsl-rt5682.m4 index 5e39e707d9e1..14da0da4d346 100644 --- a/tools/topology/topology1/sof-jsl-rt5682.m4 +++ b/tools/topology/topology1/sof-jsl-rt5682.m4 @@ -195,6 +195,14 @@ DAI_CONFIG(SSP, 0, 0, SSP0-Codec, SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 25, 3, 3), SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_BCLK_ES))) +', HEADPHONE, `rt5650', ` +# SSP 0 (ID: 0) ALC5650-I2S1 +DAI_CONFIG(SSP, 0, 0, SSP0-Codec, + SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24576000, codec_mclk_in), + SSP_CLOCK(bclk, 3072000, codec_slave), + SSP_CLOCK(fsync, 48000, codec_slave), + SSP_TDM(2, 32, 3, 3), + SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_MCLK_AON))) ', ) ifdef(`NO_AMP',`',` From 84209f616f51b48be2a95a769be1f21e8d55f187 Mon Sep 17 00:00:00 2001 From: Mac Chiang Date: Fri, 4 Oct 2024 22:17:26 +0800 Subject: [PATCH 153/161] topology1: add sdw multi-function codec support The topology includes multi-function codec support on single SoundWire link. The hardware configuration on RPL product is below: Soundwire# link 0: cs42l43 multi-function codec with JACK, DMIC and Speakers endpoints. The SDW used bidirectional DAI for each sdw link. DAI index starts from 2. sdw0/1/2/3: 2(ALH_OUT/IN) / 3(ALH_IN/OUT) In this SKU, reorder to match cs42l43 DAIs Pin on sdw link 0: sdw0: 2(JACK_OUT), 3(DMIC_IN), 4(JACK_IN), 5(AMP_OUT) Besides, align the partial string match of dai name from main branch. Signed-off-by: Mac Chiang --- tools/topology/topology1/CMakeLists.txt | 1 + .../sof-icl-rt711-rt1308-rt715-hdmi.m4 | 70 +++++++++++++------ 2 files changed, 51 insertions(+), 20 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index e2a6509c7831..7b473939066e 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -140,6 +140,7 @@ set(TPLGS "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC\;-DDYNAMIC=1" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3\;-DDYNAMIC=1" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-cs42l43-l0\;-DPLATFORM=adl\;-DUAJ_LINK=0\;-DMIC_LINK=0\;-DAMP_1_LINK=0\;-DMONO\;-DMFC" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" diff --git a/tools/topology/topology1/sof-icl-rt711-rt1308-rt715-hdmi.m4 b/tools/topology/topology1/sof-icl-rt711-rt1308-rt715-hdmi.m4 index 74f96d7b4d3d..c3fd8099199b 100644 --- a/tools/topology/topology1/sof-icl-rt711-rt1308-rt715-hdmi.m4 +++ b/tools/topology/topology1/sof-icl-rt711-rt1308-rt715-hdmi.m4 @@ -40,6 +40,36 @@ ifdef(`MIC_LINK',`', # HDMI ID calculated based on the configuraiton define(HDMI_BE_ID_BASE, `0') +# SDW Pin as DAIs index starts from 2 on each SDW link +define(`ALH_JACK_OUT_PIN', `2') +define(`ALH_JACK_IN_PIN', `3') +define(`ALH_AMP_OUT_PIN', `2') +define(`ALH_DMIC_IN_PIN', `2') + +define(`ALH_JACK_OUT_NAME', `SDW'eval(UAJ_LINK)`-Playback') +define(`ALH_JACK_IN_NAME', `SDW'eval(UAJ_LINK)`-Capture') +define(`ALH_AMP_OUT_NAME', `SDW'eval(AMP_1_LINK)`-Playback') +define(`ALH_DMIC_IN_NAME', `SDW'eval(MIC_LINK)`-Capture') + +ifdef(`MFC', ` +undefine(`ALH_JACK_IN_PIN') +undefine(`ALH_AMP_OUT_PIN') +undefine(`ALH_DMIC_IN_PIN') +define(`ALH_JACK_IN_PIN', `4') +define(`ALH_AMP_OUT_PIN', `5') +define(`ALH_DMIC_IN_PIN', `3') + +# align the partial string match of full dai link name +undefine(`ALH_JACK_OUT_NAME') +undefine(`ALH_JACK_IN_NAME') +undefine(`ALH_AMP_OUT_NAME') +undefine(`ALH_DMIC_IN_NAME') +define(`ALH_JACK_OUT_NAME', `Playback-SimpleJack') +define(`ALH_JACK_IN_NAME', `Capture-SimpleJack') +define(`ALH_AMP_OUT_NAME', `Playback-SmartAmp') +define(`ALH_DMIC_IN_NAME', `Capture-SmartMic')' +) + ifdef(`NO_JACK', `', `undefine(`HDMI_BE_ID_BASE') define(HDMI_BE_ID_BASE, `2')' @@ -106,16 +136,16 @@ ifdef(`NOJACK', `', ` # PCM0 ---> volume ----> mixer --->ALH 2 BE UAJ_LINK # PCM31 ---> volume ------^ -# PCM1 <--- volume <---- ALH 3 BE UAJ_LINK +# PCM1 <--- volume <---- ALH 3/4 BE UAJ_LINK ') ifdef(`NOAMP', `', ` -# PCM2 ---> volume ----> ALH 2 BE AMP_1_LINK +# PCM2 ---> volume ----> ALH 2/5 BE AMP_1_LINK ifdef(`MONO', `', -`# PCM40 ---> volume ----> ALH 2 BE AMP_2_LINK') +`# PCM40 ---> volume ----> ALH 2/5 BE AMP_2_LINK') ') ifdef(`NO_LOCAL_MIC', `', -`# PCM4 <--- volume <---- ALH 2 BE MIC_LINK') +`# PCM4 <--- volume <---- ALH 2/3 BE MIC_LINK') ifdef(`NOHDMI', `', ` @@ -215,14 +245,14 @@ ifdef(`NOJACK', `', # The NOT_USED_IGNORED is due to dependencies and is adjusted later with an explicit dapm line. DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, - 1, ALH, eval(UAJ_LINK * 256 + 2), `SDW'eval(UAJ_LINK)`-Playback', + 1, ALH, eval(UAJ_LINK * 256 + ALH_JACK_OUT_PIN), ALH_JACK_OUT_NAME, NOT_USE_IGNORED, 2, s24le, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000) # capture DAI is ALH(UAJ_LINK PIN3) using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, - 2, ALH, eval(UAJ_LINK * 256 + 3), `SDW'eval(UAJ_LINK)`-Capture', + 2, ALH, eval(UAJ_LINK * 256 + ALH_JACK_IN_PIN), ALH_JACK_IN_NAME, PIPELINE_SINK_2, 2, s24le, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) @@ -271,13 +301,13 @@ ifdef(`NOAMP', `', # playback DAI is ALH(AMP_1_LINK PIN2/AMP_2_LINK PIN2) using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-playback.m4, - 3, ALH, eval(AMP_1_LINK * 256 + 2), `SDW'eval(AMP_1_LINK)`-Playback', + 3, ALH, eval(AMP_1_LINK * 256 + ALH_AMP_OUT_PIN), ALH_AMP_OUT_NAME, PIPELINE_SOURCE_3, 2, s24le, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) ifdef(`MONO', `', `DAI_ADD_SCHED(sof/pipe-dai-sched-playback.m4, - 4, ALH, eval(AMP_2_LINK * 256 + 2), `SDW'eval(AMP_1_LINK)`-Playback', + 4, ALH, eval(AMP_2_LINK * 256 + ALH_AMP_OUT_PIN), ALH_AMP_OUT_NAME, PIPELINE_SOURCE_4, 2, s24le, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, PIPELINE_PLAYBACK_SCHED_COMP_3) @@ -299,7 +329,7 @@ ifdef(`NO_LOCAL_MIC', `', # capture DAI is ALH(MIC_LINK PIN2) using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, - 5, ALH, eval(MIC_LINK * 256 + 2), `SDW'eval(MIC_LINK)`-Capture', + 5, ALH, eval(MIC_LINK * 256 + ALH_DMIC_IN_PIN), ALH_DMIC_IN_NAME, PIPELINE_SINK_5, 2, s24le, 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) ') @@ -362,26 +392,26 @@ ifdef(`NOJACK', `', ` #ALH dai index = ((link_id << 8) | PDI id) #ALH UAJ_LINK Pin2 (ID: 0) -DAI_CONFIG(ALH, eval(UAJ_LINK * 256 + 2), 0, `SDW'eval(UAJ_LINK)`-Playback', - ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(UAJ_LINK * 256 + 2), 48000, 2))) +DAI_CONFIG(ALH, eval(UAJ_LINK * 256 + ALH_JACK_OUT_PIN), 0, ALH_JACK_OUT_NAME, + ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(UAJ_LINK * 256 + ALH_JACK_OUT_PIN), 48000, 2))) -#ALH UAJ_LINK Pin3 (ID: 1) -DAI_CONFIG(ALH, eval(UAJ_LINK * 256 + 3), 1, `SDW'eval(UAJ_LINK)`-Capture', - ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(UAJ_LINK * 256 + 3), 48000, 2))) +#ALH UAJ_LINK Pin3/4 (ID: 1) +DAI_CONFIG(ALH, eval(UAJ_LINK * 256 + ALH_JACK_IN_PIN), 1, ALH_JACK_IN_NAME, + ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(UAJ_LINK * 256 + ALH_JACK_IN_PIN), 48000, 2))) ') ifdef(`NOAMP', `', ` -#ALH AMP_1_LINK Pin2 (ID: 2) -DAI_CONFIG(ALH, eval(AMP_1_LINK * 256 + 2), 2, `SDW'eval(AMP_1_LINK)`-Playback', - ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(AMP_1_LINK * 256 + 2), 48000, 2))) +#ALH AMP_1_LINK Pin2/5 (ID: 2) +DAI_CONFIG(ALH, eval(AMP_1_LINK * 256 + ALH_AMP_OUT_PIN), 2, ALH_AMP_OUT_NAME, + ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(AMP_1_LINK * 256 + ALH_AMP_OUT_PIN), 48000, 2))) ') ifdef(`NO_LOCAL_MIC', `', ` -#ALH MIC_LINK Pin2 (ID: 4) -DAI_CONFIG(ALH, eval(MIC_LINK * 256 + 2), 4, `SDW'eval(MIC_LINK)`-Capture', - ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(MIC_LINK * 256 + 2), 48000, 2))) +#ALH MIC_LINK Pin2/3 (ID: 4) +DAI_CONFIG(ALH, eval(MIC_LINK * 256 + ALH_DMIC_IN_PIN), 4, ALH_DMIC_IN_NAME, + ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(MIC_LINK * 256 + ALH_DMIC_IN_PIN), 48000, 2))) ') ifdef(`NOHDMI', `', From ae5e842dc174a4ae5a21822f19b4644a8da79829 Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Tue, 24 Dec 2024 19:21:43 +0800 Subject: [PATCH 154/161] topology1: remove mute led from SoundWire capture We should only use mute led on the PCH dmic. pipe-highpass-switch-capture.m4 and pipe-volume-switch-capture are only used by SoundWire and nocodec pipelines. It will not impact the existing products. Signed-off-by: Bard Liao --- tools/topology/topology1/sof/pipe-highpass-switch-capture.m4 | 2 +- tools/topology/topology1/sof/pipe-volume-switch-capture.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/topology/topology1/sof/pipe-highpass-switch-capture.m4 b/tools/topology/topology1/sof/pipe-highpass-switch-capture.m4 index e34b454d662c..04f668aac112 100644 --- a/tools/topology/topology1/sof/pipe-highpass-switch-capture.m4 +++ b/tools/topology/topology1/sof/pipe-highpass-switch-capture.m4 @@ -38,7 +38,7 @@ C_CONTROLMIXER(Master Capture Switch, PIPELINE_ID, , Channel register and shift for Front Left/Right, LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), KCONTROL_CHANNEL(FR, 2, 1)), - "1", "1") + "0", "0") # # Volume Configuration # diff --git a/tools/topology/topology1/sof/pipe-volume-switch-capture.m4 b/tools/topology/topology1/sof/pipe-volume-switch-capture.m4 index e61cd45afc4b..7d713a424b1c 100644 --- a/tools/topology/topology1/sof/pipe-volume-switch-capture.m4 +++ b/tools/topology/topology1/sof/pipe-volume-switch-capture.m4 @@ -32,7 +32,7 @@ C_CONTROLMIXER(Master Capture Switch, PIPELINE_ID, , Channel register and shift for Front Left/Right, LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), KCONTROL_CHANNEL(FR, 2, 1)), - "1", "1") + "0", "0") # # Volume Configuration From 664f57cf2016c30b8c4ef3a86a0b190d72683306 Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Fri, 20 Dec 2024 10:31:24 +0800 Subject: [PATCH 155/161] Topology1: sof-icl-rt711-rt1308-rt715-hdmi: add PCH DMIC support PCH DMIC may be used along with SoundWire codecs. Signed-off-by: Bard Liao --- .../sof-icl-rt711-rt1308-rt715-hdmi.m4 | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tools/topology/topology1/sof-icl-rt711-rt1308-rt715-hdmi.m4 b/tools/topology/topology1/sof-icl-rt711-rt1308-rt715-hdmi.m4 index c3fd8099199b..26430f3d45fe 100644 --- a/tools/topology/topology1/sof-icl-rt711-rt1308-rt715-hdmi.m4 +++ b/tools/topology/topology1/sof-icl-rt711-rt1308-rt715-hdmi.m4 @@ -2,6 +2,10 @@ # Topology for Icelake with rt711 + rt1308 (x2) + rt715. # +# if XPROC is not defined, define with default pipe +ifdef(`DMICPROC', , `define(DMICPROC, eq-iir-volume)') +ifdef(`DMIC16KPROC', , `define(DMIC16KPROC, eq-iir-volume)') + # Include topology builder include(`utils.m4') include(`dai.m4') @@ -9,6 +13,7 @@ include(`pipeline.m4') include(`alh.m4') include(`muxdemux.m4') include(`hda.m4') +include(`platform/intel/dmic.m4') # Include TLV library include(`common/tlv.m4') @@ -19,6 +24,9 @@ include(`sof/tokens.m4') # Include Platform specific DSP configuration include(`platform/intel/'PLATFORM`.m4') +ifdef(`CHANNELS',`', +`define(CHANNELS, `0')') + ifdef(`UAJ_LINK',`', `define(UAJ_LINK, `0')') @@ -91,6 +99,27 @@ ifdef(`NO_LOCAL_MIC', `', define(HDMI_BE_ID_BASE, `5')' ) +# Define pipeline id for intel-generic-dmic.m4 +# to generate dmic setting +ifelse(CHANNELS, `0', +` +' +, +` +define(DMIC_PCM_48k_ID, `10') +define(DMIC_PCM_16k_ID, `11') +define(DMIC_PIPELINE_48k_ID, `10') +define(DMIC_PIPELINE_16k_ID, `11') + +define(DMIC_DAI_LINK_48k_ID, `4') +define(DMIC_DAI_LINK_16k_ID, eval(DMIC_DAI_LINK_48k_ID+1)) +include(`platform/intel/intel-generic-dmic.m4') +undefine(`HDMI_BE_ID_BASE') +define(HDMI_BE_ID_BASE, eval(DMIC_DAI_LINK_16k_ID+1)) +' +) + + DEBUG_START dnl Configure demux From 0e75475533729331715ba5cdc7524d1ff4f76bdd Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Thu, 19 Dec 2024 10:12:30 +0800 Subject: [PATCH 156/161] topology1: add sof-adl-rt1316-l02-4ch support The configuration has no jack and use rt1316 amps and PCH DMIC. Signed-off-by: Bard Liao --- tools/topology/topology1/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 7b473939066e..2f5f0eeaa4e4 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -159,6 +159,7 @@ set(TPLGS "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l12-rt714-l0\;-DPLATFORM=adl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l3\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt1316-l12-rt714-l0\;-DPLATFORM=rpl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0\;-DDYNAMIC=1" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l02-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DEXT_AMP_REF\;-DNOJACK\;-DNOHDMI4\;-DNO_LOCAL_MIC\;-DAMP_1_LINK=0\;-DAMP_2_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" ## end SoundWire NOJACK topologies "sof-ehl-rt5660\;sof-ehl-rt5660\;-DHDMI=1" From a255d458c9f355d3fe006087a70dffbf91dd97d0 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Sat, 1 Mar 2025 19:12:17 +0000 Subject: [PATCH 157/161] scripts: add a script to build a local alsa tools This script builds a local installation of ALSA lib and associated ALSA utilities that does not impact the system ALSA installation. This will enable a later update to locally build topologies without using the docker container. Signed-off-by: Liam Girdwood (cherry picked from commit ac86714b3c5841bb3249760800dea70d926a57ff) Signed-off-by: Kai Vehmanen --- scripts/build-alsa-tools.sh | 127 ++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100755 scripts/build-alsa-tools.sh diff --git a/scripts/build-alsa-tools.sh b/scripts/build-alsa-tools.sh new file mode 100755 index 000000000000..5e1e7f75d39d --- /dev/null +++ b/scripts/build-alsa-tools.sh @@ -0,0 +1,127 @@ +#!/bin/bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2025 Intel Corporation. All rights reserved. + +# fail immediately on any errors +set -e + +# Array of ALSA Git repository URLs. Add or remove repositories as needed. +declare -a REPOS=( + "https://github.com/thesofproject/alsa-lib.git" + "https://github.com/thesofproject/alsa-utils.git" + # Add more repositories here... +) + +# Commit ID to check for (optional). If specified, the script will update +# the repository if this commit ID is not found. Leave empty to skip. +# This array order must align with REPO array above. +declare -a COMMIT_ID=( + "df8f1cc1ec9d9ee15be5e2c23ad25b9389fd8766" + "09550cd393b1a7d307ee6f26637b1ed7bd275e38" + # Add more IDs here... +) + +# Directory where repositories will be cloned/updated. +if [[ -z "$SOF_WORKSPACE" ]]; then + # Environment variable is empty or unset so use default + BASE_DIR="$HOME/work/sof" +else + # Environment variable exists and has a value + BASE_DIR="$SOF_WORKSPACE" +fi + +# Arguments to pass to ./configure for each repository. Add or remove +declare -a CONFIGURE_ARGS=( + "--prefix=${BASE_DIR}/tools" + "--prefix=${BASE_DIR}/tools \ + --with-alsa-prefix=${BASE_DIR}/tools \ + --with-alsa-inc-prefix=${BASE_DIR}/tools/include \ + --with-sysroot=${BASE_DIR}/tools \ + --with-udev-rules-dir=${BASE_DIR}/tools \ + PKG_CONFIG_PATH=${BASE_DIR}/tools \ + LDFLAGS=-L${BASE_DIR}/tools/lib \ + --with-asound-state-dir=${BASE_DIR}/tools/var/lib/alsa \ + --with-systemdsystemunitdir=${BASE_DIR}/tools/lib/systemd/system" +) + +# Arguments to pass to make for each repository. Add or remove arguments as needed. +declare -a TARGET_ARGS=( + "--disable-old-symbols" + "--enable-alsatopology" +) + +# Function to check if a commit ID exists in a repository +check_commit() { + local repo_dir="$1" + local commit_id="$2" + + if [ -z "$commit_id" ]; then + return 0 # Skip check if no commit ID is provided + fi + + if ! git -C "$repo_dir" rev-parse --quiet --verify "$commit_id" >/dev/null 2>&1; then + return 1 # Commit ID not found + else + return 0 # Commit ID found + fi +} + + +# Function to update the repository +update_repo() { + local repo_dir="$1" + echo "Updating repository: $repo_dir" + git -C "$repo_dir" fetch --all + git -C "$repo_dir" pull +} + +# Function to build and install the repository +build_and_install() { + local repo_dir="$1" + local configure_args="$2" + local target_args="$3" + + echo "Building and installing: $repo_dir $configure_args $target_args" + + if [ ! -f "$repo_dir/gitcompile" ]; then + echo "Error: gitcompile not found in $repo_dir" >&2 + exit 1 + fi + + # if Makefile exists then we can just run make + if [ ! -f "$repo_dir/Makefile" ]; then + (cd "$repo_dir" && ./gitcompile $configure_args $target_args) || \ + { echo "configure failed in $repo_dir"; exit 1; } + else + (cd "$repo_dir" && make -j) || { echo "make failed in $repo_dir"; exit 1; } + fi + + (cd "$repo_dir" && make install) || { echo "make install failed in $repo_dir"; exit 1; } + + echo "Build and installation complete for $repo_dir" +} + +# Main script logic +mkdir -p "$BASE_DIR" + +for ((i = 0; i < ${#REPOS[@]}; i++)); do + echo "Counter: $i, Value: ${REPOS[i]}" + repo_url=${REPOS[i]} + + repo_name=$(basename "$repo_url" .git) # Extract repo name + repo_dir="$BASE_DIR/$repo_name" + + if [ ! -d "$repo_dir" ]; then + echo "Cloning repository: $repo_url" + git clone "$repo_url" "$repo_dir" || { echo "git clone failed for $repo_url"; exit 1; } + elif ! check_commit "$repo_dir" "${COMMIT_ID[i]}"; then + update_repo "$repo_dir" + else + echo "Repository $repo_name is up to date." + fi + + build_and_install "$repo_dir" "${CONFIGURE_ARGS[i]}" + +done + +echo "All repositories processed." From d03638a6be822526366c2457a7b991fae1575b03 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Wed, 5 Mar 2025 12:50:23 +0000 Subject: [PATCH 158/161] scripts: build-tools: Add option to build alsa tools Add a command line option to rebuild the ALSA libraries and tools required to build all topologies. Signed-off-by: Liam Girdwood (cherry picked from commit cee63f4f79338ce205b29b30726ecda885ac9c16) Signed-off-by: Kai Vehmanen --- scripts/build-tools.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/build-tools.sh b/scripts/build-tools.sh index 496ca4c2d7cc..658c8279045a 100755 --- a/scripts/build-tools.sh +++ b/scripts/build-tools.sh @@ -16,7 +16,7 @@ Attention: the list below is _not_ exhaustive. To re-build _everything_ from scratch don't select any particular target; this will build the CMake's default target "ALL". -usage: $0 [-c|-f|-h|-l|-p|-t|-T] +usage: $0 [-c|-f|-h|-l|-p|-t|-T|-A] -h Display help -c Rebuild ctl/ @@ -25,6 +25,7 @@ usage: $0 [-c|-f|-h|-l|-p|-t|-T] -p Rebuild probes/ -T Rebuild topology/ (not topology/development/! Use ALL) -t Rebuild test/topology/ (or tools/test/topology/tplg-build.sh directly) + -A Clone and rebuild local ALSA lib and utils. -C No build, only CMake re-configuration. Shows CMake targets. EOFUSAGE @@ -101,6 +102,7 @@ main() DO_BUILD_ctl=false DO_BUILD_fuzzer=false + DO_BUILD_alsa=false DO_BUILD_logger=false DO_BUILD_probes=false DO_BUILD_tests=false @@ -109,7 +111,7 @@ main() # eval is a sometimes necessary evil # shellcheck disable=SC2034 - while getopts "cfhlptTC" OPTION; do + while getopts "cfhlptTCA" OPTION; do case "$OPTION" in c) DO_BUILD_ctl=true ;; f) DO_BUILD_fuzzer=true ;; @@ -118,6 +120,7 @@ main() t) DO_BUILD_tests=true ;; T) DO_BUILD_topologies=true ;; C) CMAKE_ONLY=true ;; + A) DO_BUILD_alsa=true ;; h) print_usage; exit 1;; *) print_usage; exit 1;; esac @@ -125,6 +128,10 @@ main() shift "$((OPTIND - 1))" reconfigure_build + if "$DO_BUILD_alsa"; then + $SOF_TOP/scripts/build-alsa-tools.sh + fi + if "$CMAKE_ONLY"; then print_build_info exit From bd7775fb81abf3c461ebb73621308d89da945e8e Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Sun, 2 Mar 2025 10:43:38 +0000 Subject: [PATCH 159/161] topology: cmake: use local ALSA utilities to build topology Dont use the system ALSA installation which may be out of date with current topology development. Use the locally installed ALSA lib and utils installed in the SOF workspace. Signed-off-by: Liam Girdwood (cherry picked from commit 47dd8d33fc9ead3ee2d3e378a9ad93e889d41e68) Signed-off-by: Kai Vehmanen --- tools/ctl/CMakeLists.txt | 4 +++ tools/topology/CMakeLists.txt | 48 +++++++++++++++++++++++++++++++++-- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/tools/ctl/CMakeLists.txt b/tools/ctl/CMakeLists.txt index 70735f88da65..5c4c2dd315b5 100644 --- a/tools/ctl/CMakeLists.txt +++ b/tools/ctl/CMakeLists.txt @@ -4,6 +4,9 @@ add_executable(sof-ctl ctl.c ) +target_link_directories(sof-ctl BEFORE + PRIVATE "${SOF_ROOT_SOURCE_DIRECTORY}/../tools/lib") + target_link_libraries(sof-ctl PRIVATE "-lasound" ) @@ -13,6 +16,7 @@ target_compile_options(sof-ctl PRIVATE ) target_include_directories(sof-ctl PRIVATE + "${SOF_ROOT_SOURCE_DIRECTORY}/../tools/include" "${SOF_ROOT_SOURCE_DIRECTORY}/src/include" "${SOF_ROOT_SOURCE_DIRECTORY}" ) diff --git a/tools/topology/CMakeLists.txt b/tools/topology/CMakeLists.txt index 4b7b36d1a2a1..be032f730dde 100644 --- a/tools/topology/CMakeLists.txt +++ b/tools/topology/CMakeLists.txt @@ -1,4 +1,48 @@ set(SOF_TOPOLOGY_BINARY_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") +set(SOF_ALSA_TOOLS_DIR "${SOF_ROOT_SOURCE_DIRECTORY}/../tools/bin") +set(ALSATPLG_CMD "${SOF_ALSA_TOOLS_DIR}/alsatplg") + +function(alsatplg_version OUT_STATUS OUT_VERSION) + execute_process(COMMAND ${ALSATPLG_CMD} --version + RESULT_VARIABLE status + OUTPUT_VARIABLE stdout + OUTPUT_STRIP_TRAILING_WHITESPACE) + message(DEBUG "${ALSATPLG_CMD} --version: status=${status}, output=${stdout}") + + set(${OUT_STATUS} "${status}" PARENT_SCOPE) + + # Some error messages have already been printed on stderr + if(NOT status EQUAL 0) + message(WARNING "${ALSATPLG_CMD} --version returned status: ${status}, +${stdout}") + return() + endif() + + string(REPLACE "\n" ";" ALSA_VERSION_LIST ${stdout}) + list(GET ALSA_VERSION_LIST 0 ALSATPLG_VERSION) + string(REGEX MATCH "[0-9]\.[0-9]\.*[0-9]*" ALSATPLG_VERSION_NUMBER ${ALSATPLG_VERSION}) + + set(${OUT_VERSION} "${ALSATPLG_VERSION_NUMBER}" PARENT_SCOPE) +endfunction() + + +# Being written in C, `alsatplg` silently ignores some invalid inputs +# and produces an corrupt .tplg file instead of returning an error code +# that fails the build. For instance, alsatplg versions < 1.2.5 silently +# corrupt `codec_consumer` and turn it into `codec_master` instead. +# Longer story in #5192. +alsatplg_version(STATUS ALSATPLG_VERSION_NUMBER) +if(NOT STATUS EQUAL 0) + message(WARNING "${ALSATPLG_CMD} failed: ${STATUS}; all topologies skipped") + return() +else() + if(${ALSATPLG_VERSION_NUMBER} VERSION_LESS "1.2.5") + message(WARNING "All topologies skipped: minimum alsatplg version 1.2.5,\ + found ${ALSATPLG_VERSION_NUMBER}.") + return() + endif() + # success +endif() # This use of VERBOSE relies on original CMake behavior. # From the add_custom_command() manual: @@ -23,7 +67,7 @@ macro(add_alsatplg_command) # permissions are hardcoded and only the user can read # the -o(utput) file. # See bug https://github.com/alsa-project/alsa-utils/issues/126 - COMMAND alsatplg \$\${VERBOSE:+-v 1} -c ${ARGV0} -o ${ARGV1} + COMMAND ${ALSATPLG_CMD} \$\${VERBOSE:+-v 1} -c ${ARGV0} -o ${ARGV1} USES_TERMINAL ) endmacro() @@ -41,7 +85,7 @@ macro(add_alsatplg2_command input_file output_file include_path) MAIN_DEPENDENCY ${input_file} OUTPUT ${output_file} # -p to pre-process Topology2.0 conf file - COMMAND ALSA_CONFIG_DIR=${CMAKE_SOURCE_DIR}/topology/topology2 alsatplg \$\${VERBOSE:+-v 1} + COMMAND ALSA_CONFIG_DIR=${CMAKE_SOURCE_DIR}/topology/topology2 ${ALSATPLG_CMD} \$\${VERBOSE:+-v 1} -I ${include_path} -D "'${defines}'" -p -c ${input_file} -o ${output_file} USES_TERMINAL ) From c3bf722b2bcaf7126a3fe6cf064a7a8f55431d2a Mon Sep 17 00:00:00 2001 From: Fred Oh Date: Tue, 21 May 2024 13:56:10 -0700 Subject: [PATCH 160/161] scripts/docker-run.sh: thesofproject/sof:latest to default latest_ubuntu22.04 was used when upgrading to Ubuntu 22.04. Now it is time to go back to the latest. Signed-off-by: Fred Oh (cherry picked from commit 4cbff552bfd59cd9bdb814f28d947e581b8346fa) Signed-off-by: Kai Vehmanen --- scripts/docker-run.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/docker-run.sh b/scripts/docker-run.sh index 4b3d64fe1c12..a34f10fb1d57 100755 --- a/scripts/docker-run.sh +++ b/scripts/docker-run.sh @@ -33,8 +33,6 @@ test "$(id -u)" = 1000 || >&2 printf "Warning: this script should be run as user ID 1000 to match the container's account\n" set -x -# FIXME: During the transition to sudo-cwd.sh, the tag will be "latest_ubuntu22.04". -# Later it will be back to latest docker run -i -v "${SOF_TOP}":/home/sof/work/sof.git \ -v "${SOF_TOP}":/home/sof/work/sof-bind-mount-DO-NOT-DELETE \ --env CMAKE_BUILD_TYPE \ @@ -45,4 +43,4 @@ docker run -i -v "${SOF_TOP}":/home/sof/work/sof.git \ --env http_proxy="$http_proxy" \ --env https_proxy="$https_proxy" \ $SOF_DOCKER_RUN \ - thesofproject/sof:latest_ubuntu22.04 ./scripts/sudo-cwd.sh "$@" + thesofproject/sof:latest ./scripts/sudo-cwd.sh "$@" From c192676749ae8ba864787d3c61dd32fc0774488b Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Wed, 4 Mar 2026 16:37:04 +0200 Subject: [PATCH 161/161] Tools: Topology1: Fix topologies build with new alsa-lib This patch fixes build error with alsa-lib commit 541427761292. ALSA lib ops.c:47:(lookup_ops) [error.topology] wrong kcontrol ops value string '' It impacts build of sof-mt8195-mt6359-max98390-rt5682-rtnr.tplg and sof-mt8195-mt6359-max98390-rt5682-google-aec-rtnr.tplg. In the created .conf from m4 conversion, the value of put is an empty string in SectionControlBytes. # control uses bespoke driver get/put/info ID for ext ops extops."extctl" { #258 binds the mixer control to bytes get handlers get "258" put "" } The use of m4 macro CONTROLBYTES_OPS() requires three parameters while originally there was only two. All other usages of CONTROLBYTES_EXTOPS() in SOF are with 258, 258 as 2nd and 3rd parameters, so it is assumed it should be same for RTNR controls also. Signed-off-by: Seppo Ingalsuo (cherry picked from commit 8f98a4e55046129528f42cdda5c17b6f49a01a94) Signed-off-by: Kai Vehmanen --- tools/topology/topology1/sof/pipe-rtnr-capture.m4 | 2 +- .../sof/pipe-rtnr-google-rtc-audio-processing-capture.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/topology/topology1/sof/pipe-rtnr-capture.m4 b/tools/topology/topology1/sof/pipe-rtnr-capture.m4 index 5a4b6650cfd1..c5d180f4567e 100644 --- a/tools/topology/topology1/sof/pipe-rtnr-capture.m4 +++ b/tools/topology/topology1/sof/pipe-rtnr-capture.m4 @@ -40,7 +40,7 @@ CONTROLBYTES_PRIV(DEF_RTNR_PRIV, # RTNR Bytes control with max value of 255 C_CONTROLBYTES_READONLY(DEF_RTNR_BYTES, PIPELINE_ID, CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get handlers, 258), - CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get handlers, 258), + CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258), , , , CONTROLBYTES_MAX(, 256), , diff --git a/tools/topology/topology1/sof/pipe-rtnr-google-rtc-audio-processing-capture.m4 b/tools/topology/topology1/sof/pipe-rtnr-google-rtc-audio-processing-capture.m4 index 38b7fb77be5f..8ea4352e724c 100644 --- a/tools/topology/topology1/sof/pipe-rtnr-google-rtc-audio-processing-capture.m4 +++ b/tools/topology/topology1/sof/pipe-rtnr-google-rtc-audio-processing-capture.m4 @@ -42,7 +42,7 @@ CONTROLBYTES_PRIV(DEF_RTNR_PRIV, # RTNR Bytes control with max value of 255 C_CONTROLBYTES_READONLY(DEF_RTNR_BYTES, PIPELINE_ID, CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258), - CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258), + CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258), , , , CONTROLBYTES_MAX(, 256), ,