|
| 1 | +# Low Latency Passthrough with volume Pipeline and PCM |
| 2 | +# |
| 3 | +# Pipeline Endpoints for connection are :- |
| 4 | +# |
| 5 | +# host PCM_P --> B0 --> EQ 0 --> B1 --> Volume 0 --> B2 --> sink DAI0 |
| 6 | + |
| 7 | +# Include topology builder |
| 8 | +include(`utils.m4') |
| 9 | +include(`buffer.m4') |
| 10 | +include(`pcm.m4') |
| 11 | +include(`pga.m4') |
| 12 | +include(`dai.m4') |
| 13 | +include(`mixercontrol.m4') |
| 14 | +include(`bytecontrol.m4') |
| 15 | +include(`pipeline.m4') |
| 16 | +include(`eq.m4') |
| 17 | + |
| 18 | +# |
| 19 | +# Controls |
| 20 | +# |
| 21 | +# Volume Mixer control with max value of 32 |
| 22 | +C_CONTROLMIXER(Master Playback Volume, PIPELINE_ID, |
| 23 | + CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), |
| 24 | + CONTROLMIXER_MAX(, 32), |
| 25 | + false, |
| 26 | + CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3), |
| 27 | + Channel register and shift for Front Left/Right, |
| 28 | + LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), KCONTROL_CHANNEL(FR, 1, 1))) |
| 29 | + |
| 30 | +# EQ Bytes control with max value of 255 |
| 31 | +C_CONTROLBYTES(EQ, PIPELINE_ID, |
| 32 | + CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258, 258), |
| 33 | + CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258), |
| 34 | + , , , |
| 35 | + CONTROLBYTES_MAX(, 10)) |
| 36 | + |
| 37 | +# |
| 38 | +# Components and Buffers |
| 39 | +# |
| 40 | + |
| 41 | +# Host "Passthrough Playback" PCM |
| 42 | +# with 2 sink and 0 source periods |
| 43 | +W_PCM_PLAYBACK(PCM_ID, Passthrough Playback, 2, 0, 2) |
| 44 | + |
| 45 | +# "Volume" has 2 source and 2 sink periods |
| 46 | +W_PGA(0, PIPELINE_FORMAT, 2, 2, 2, LIST(` ', "Master Playback Volume PIPELINE_ID")) |
| 47 | + |
| 48 | +# "EQ 0" has 2 sink period and 2 source periods |
| 49 | +W_EQ(0, PIPELINE_FORMAT, 2, 2, 2, LIST(` ', "EQ")) |
| 50 | + |
| 51 | +# Playback Buffers |
| 52 | +W_BUFFER(0, COMP_BUFFER_SIZE(2, |
| 53 | + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES), |
| 54 | + PLATFORM_HOST_MEM_CAP) |
| 55 | +W_BUFFER(1, COMP_BUFFER_SIZE(2, |
| 56 | + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES), |
| 57 | + PLATFORM_HOST_MEM_CAP) |
| 58 | +W_BUFFER(2, COMP_BUFFER_SIZE(2, |
| 59 | + COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES), |
| 60 | + PLATFORM_DAI_MEM_CAP) |
| 61 | + |
| 62 | +# |
| 63 | +# Pipeline Graph |
| 64 | +# |
| 65 | +# host PCM_P --> B0 --> EQ 0 --> B1 --> Volume 0 --> B2 --> sink DAI0 |
| 66 | + |
| 67 | +P_GRAPH(pipe-pass-vol-playback-PIPELINE_ID, PIPELINE_ID, |
| 68 | + LIST(` ', |
| 69 | + `dapm(N_PCMP(PCM_ID), Passthrough Playback PCM_ID)', |
| 70 | + `dapm(N_BUFFER(0), N_PCMP(PCM_ID))', |
| 71 | + `dapm(N_EQ(0), N_BUFFER(0))', |
| 72 | + `dapm(N_BUFFER(1), N_EQ(0))', |
| 73 | + `dapm(N_PGA(0), N_BUFFER(1))', |
| 74 | + `dapm(N_BUFFER(2), N_PGA(0))')) |
| 75 | + |
| 76 | +# |
| 77 | +# Pipeline Source and Sinks |
| 78 | +# |
| 79 | +indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(2)) |
| 80 | +indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Playback PCM_ID) |
| 81 | + |
| 82 | + |
| 83 | +# |
| 84 | +# PCM Configuration |
| 85 | + |
| 86 | +# |
| 87 | +PCM_CAPABILITIES(Passthrough Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 8, 2, 16, 192, 16384, 65536, 65536) |
| 88 | + |
0 commit comments