|
| 1 | +# Low Latency Passthrough with EQIIR and Waves codec Pipeline |
| 2 | +# |
| 3 | +# Pipeline Endpoints for connection are : |
| 4 | +# |
| 5 | +# host PCM_P -- B0 --> EQIIR0 -> B1 --> Waves -- B2 --> sink DAI0 |
| 6 | +# | |
| 7 | + |
| 8 | +DECLARE_SOF_RT_UUID("Waves codec", waves_codec_uuid, 0xd944281a, 0xafe9, |
| 9 | + 0x4695, 0xa0, 0x43, 0xd7, 0xf6, 0x2b, 0x89, 0x53, 0x8e); |
| 10 | +define(`CA_UUID', waves_codec_uuid) |
| 11 | + |
| 12 | +# Include topology builder |
| 13 | +include(`utils.m4') |
| 14 | +include(`buffer.m4') |
| 15 | +include(`pcm.m4') |
| 16 | +include(`pga.m4') |
| 17 | +include(`bytecontrol.m4') |
| 18 | +include(`dai.m4') |
| 19 | +include(`pipeline.m4') |
| 20 | +include(`codec_adapter.m4') |
| 21 | +include(`eq_iir.m4') |
| 22 | + |
| 23 | +ifelse(PLATFORM, `tgl', ` |
| 24 | + define(SETUP_PARAMS_NAME, `MaxxChrome Setup' PIPELINE_ID)', ` |
| 25 | + define(SETUP_PARAMS_NAME, `Waves Codec Setup' PIPELINE_ID)') |
| 26 | + |
| 27 | +CONTROLBYTES_PRIV(PP_SETUP_CONFIG, |
| 28 | +` bytes "0x53,0x4f,0x46,0x00,' |
| 29 | +` 0x00,0x00,0x00,0x00,' |
| 30 | +` 0x0c,0x00,0x00,0x00,' |
| 31 | +` 0x00,0x10,0x00,0x03,' |
| 32 | +` 0x00,0x00,0x00,0x00,' |
| 33 | +` 0x00,0x00,0x00,0x00,' |
| 34 | +` 0x00,0x00,0x00,0x00,' |
| 35 | +` 0x00,0x00,0x00,0x00,' |
| 36 | +` 0x00,0x00,0x00,0x00,' |
| 37 | +` 0x0c,0x00,0x00,0x00,' |
| 38 | +` 0x00,0x00,0x00,0x00"' |
| 39 | +) |
| 40 | + |
| 41 | +# Post process Bytes control for setup config |
| 42 | +C_CONTROLBYTES(SETUP_PARAMS_NAME, PIPELINE_ID, |
| 43 | + CONTROLBYTES_OPS(bytes), |
| 44 | + CONTROLBYTES_EXTOPS(void, 258, 258), |
| 45 | + , , , |
| 46 | + CONTROLBYTES_MAX(, 8192), |
| 47 | + , |
| 48 | + PP_SETUP_CONFIG) |
| 49 | + |
| 50 | +# |
| 51 | +# EQIIR |
| 52 | +# |
| 53 | +define(DEF_EQIIR_COEF, concat(`eqiir_coef_', PIPELINE_ID)) |
| 54 | +define(DEF_EQIIR_PRIV, concat(`eqiir_priv_', PIPELINE_ID)) |
| 55 | + |
| 56 | +# define filter. eq_iir_coef_flat.m4 is set by default |
| 57 | +ifdef(`PIPELINE_FILTER1', , `define(PIPELINE_FILTER1, eq_iir_coef_flat.m4)') |
| 58 | +include(PIPELINE_FILTER1) |
| 59 | + |
| 60 | +# EQ Bytes control with max value of 255 |
| 61 | +C_CONTROLBYTES(DEF_EQIIR_COEF, PIPELINE_ID, |
| 62 | + CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258, 258), |
| 63 | + CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258), |
| 64 | + , , , |
| 65 | + CONTROLBYTES_MAX(, 1024), |
| 66 | + , |
| 67 | + DEF_EQIIR_PRIV) |
| 68 | + |
| 69 | +# |
| 70 | +# Components and Buffers |
| 71 | +# |
| 72 | + |
| 73 | +# Host "Low latency Playback" PCM |
| 74 | +# with 2 sink and 0 source periods |
| 75 | +W_PCM_PLAYBACK(PCM_ID, Low Latency Playback, 2, 0, SCHEDULE_CORE) |
| 76 | + |
| 77 | +W_CODEC_ADAPTER(0, PIPELINE_FORMAT, DAI_PERIODS, DAI_PERIODS, SCHEDULE_CORE, |
| 78 | + LIST(` ', "SETUP_PARAMS_NAME")) |
| 79 | + |
| 80 | +# "EQIIR0" has 2 sink period and 2 source periods |
| 81 | +W_EQ_IIR(0, PIPELINE_FORMAT, 2, 2, SCHEDULE_CORE, |
| 82 | + LIST(` ', "DEF_EQIIR_COEF")) |
| 83 | + |
| 84 | +# Low Latency Buffers |
| 85 | +W_BUFFER(0, COMP_BUFFER_SIZE(2, |
| 86 | + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), |
| 87 | + PLATFORM_HOST_MEM_CAP) |
| 88 | +W_BUFFER(1, COMP_BUFFER_SIZE(2, |
| 89 | + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), |
| 90 | + PLATFORM_COMP_MEM_CAP) |
| 91 | +W_BUFFER(2, COMP_BUFFER_SIZE(DAI_PERIODS, |
| 92 | + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)), |
| 93 | + PLATFORM_COMP_MEM_CAP) |
| 94 | + |
| 95 | +# |
| 96 | +# Pipeline Graph |
| 97 | +# |
| 98 | +# host PCM_P --> B0 --> EQ_IIR 0 --> B1 --> Waves Codec --> B2 --> sink DAI0 |
| 99 | + |
| 100 | +P_GRAPH(pipe-eq-iir-waves-codec-playback, PIPELINE_ID, |
| 101 | + LIST(` ', |
| 102 | + `dapm(N_BUFFER(0), N_PCMP(PCM_ID))', |
| 103 | + `dapm(N_EQ_IIR(0), N_BUFFER(0))', |
| 104 | + `dapm(N_BUFFER(1), N_EQ_IIR(0))', |
| 105 | + `dapm(N_CODEC_ADAPTER(0), N_BUFFER(1))', |
| 106 | + `dapm(N_BUFFER(2), N_CODEC_ADAPTER(0))')) |
| 107 | + |
| 108 | +# |
| 109 | +# Pipeline Source and Sinks |
| 110 | +# |
| 111 | +indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(2)) |
| 112 | +indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Low Latency Playback PCM_ID) |
| 113 | + |
| 114 | +# |
| 115 | +# PCM Configuration |
| 116 | +# |
| 117 | + |
| 118 | +# PCM capabilities supported by FW |
| 119 | +PCM_CAPABILITIES(Low Latency Playback PCM_ID, CAPABILITY_FORMAT_NAME(PIPELINE_FORMAT), 48000, 48000, 2, PIPELINE_CHANNELS, 2, 16, 192, 16384, 65536, 65536) |
| 120 | + |
| 121 | +undefine(`DEF_EQIIR_COEF') |
| 122 | +undefine(`DEF_EQIIR_PRIV') |
0 commit comments