|
| 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_fir.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 initial parameters, in this case flat response |
| 31 | +CONTROLBYTES_PRIV(EQFIR_priv, |
| 32 | +` bytes "0x18,0x00,0x00,0x00,0x02,0x00,0x01,0x00,' |
| 33 | +` 0x00,0x00,0x00,0x00,0x04,0x00,0xff,0xff,' |
| 34 | +` 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00"' |
| 35 | +) |
| 36 | + |
| 37 | +# EQ Bytes control with max value of 255 |
| 38 | +C_CONTROLBYTES(EQFIR, PIPELINE_ID, |
| 39 | + CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258, 258), |
| 40 | + CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258), |
| 41 | + , , , |
| 42 | + CONTROLBYTES_MAX(, 316), |
| 43 | + , |
| 44 | + EQFIR_priv) |
| 45 | + |
| 46 | +# |
| 47 | +# Components and Buffers |
| 48 | +# |
| 49 | + |
| 50 | +# Host "Passthrough Playback" PCM |
| 51 | +# with 2 sink and 0 source periods |
| 52 | +W_PCM_PLAYBACK(PCM_ID, Passthrough Playback, 2, 0, 2) |
| 53 | + |
| 54 | +# "Volume" has 2 source and 2 sink periods |
| 55 | +W_PGA(0, PIPELINE_FORMAT, 2, 2, 2, LIST(` ', "Master Playback Volume PIPELINE_ID")) |
| 56 | + |
| 57 | +# "EQ 0" has 2 sink period and 2 source periods |
| 58 | +W_EQ_FIR(0, PIPELINE_FORMAT, 2, 2, 2, LIST(` ', "EQFIR")) |
| 59 | + |
| 60 | +# Playback Buffers |
| 61 | +W_BUFFER(0, COMP_BUFFER_SIZE(2, |
| 62 | + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES), |
| 63 | + PLATFORM_HOST_MEM_CAP) |
| 64 | +W_BUFFER(1, COMP_BUFFER_SIZE(2, |
| 65 | + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES), |
| 66 | + PLATFORM_HOST_MEM_CAP) |
| 67 | +W_BUFFER(2, COMP_BUFFER_SIZE(2, |
| 68 | + COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES), |
| 69 | + PLATFORM_DAI_MEM_CAP) |
| 70 | + |
| 71 | +# |
| 72 | +# Pipeline Graph |
| 73 | +# |
| 74 | +# host PCM_P --> B0 --> EQ 0 --> B1 --> Volume 0 --> B2 --> sink DAI0 |
| 75 | + |
| 76 | +P_GRAPH(pipe-pass-vol-playback-PIPELINE_ID, PIPELINE_ID, |
| 77 | + LIST(` ', |
| 78 | + `dapm(N_PCMP(PCM_ID), Passthrough Playback PCM_ID)', |
| 79 | + `dapm(N_BUFFER(0), N_PCMP(PCM_ID))', |
| 80 | + `dapm(N_EQ_FIR(0), N_BUFFER(0))', |
| 81 | + `dapm(N_BUFFER(1), N_EQ_FIR(0))', |
| 82 | + `dapm(N_PGA(0), N_BUFFER(1))', |
| 83 | + `dapm(N_BUFFER(2), N_PGA(0))')) |
| 84 | + |
| 85 | +# |
| 86 | +# Pipeline Source and Sinks |
| 87 | +# |
| 88 | +indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(2)) |
| 89 | +indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Playback PCM_ID) |
| 90 | + |
| 91 | + |
| 92 | +# |
| 93 | +# PCM Configuration |
| 94 | + |
| 95 | +# |
| 96 | +PCM_CAPABILITIES(Passthrough Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 8, 2, 16, 192, 16384, 65536, 65536) |
| 97 | + |
0 commit comments