2017-07-06 23:39:29 +08:00
|
|
|
# Tone Generator
|
|
|
|
#
|
|
|
|
# Multi Frequency Tone Generator.
|
|
|
|
#
|
|
|
|
# Pipeline Endpoints for connection are :-
|
|
|
|
#
|
|
|
|
# Tone --B0--> volume --B1--> Endpoint Pipeline
|
|
|
|
#
|
|
|
|
|
|
|
|
# Include topology builder
|
2018-03-06 06:17:12 +08:00
|
|
|
include(`utils.m4')
|
|
|
|
include(`buffer.m4')
|
|
|
|
include(`pga.m4')
|
|
|
|
include(`tone.m4')
|
|
|
|
include(`mixercontrol.m4')
|
|
|
|
include(`pipeline.m4')
|
2017-07-06 23:39:29 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# Controls
|
|
|
|
#
|
|
|
|
|
2018-03-06 05:58:29 +08:00
|
|
|
# Volume Mixer control with max value of 32
|
2018-03-28 20:43:20 +08:00
|
|
|
C_CONTROLMIXER(Tone Volume, PIPELINE_ID,
|
2018-03-06 05:58:29 +08:00
|
|
|
CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256),
|
|
|
|
CONTROLMIXER_MAX(, 32),
|
|
|
|
false,
|
|
|
|
CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB, vtlv_m90s3),
|
|
|
|
Channel register and shift for Front Left/Right,
|
|
|
|
LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), KCONTROL_CHANNEL(FR, 1, 1)))
|
|
|
|
|
|
|
|
# Switch type Mixer Control with max value of 1
|
2018-03-28 20:43:20 +08:00
|
|
|
C_CONTROLMIXER(Tone Switch, PIPELINE_ID,
|
2018-06-13 02:32:59 +08:00
|
|
|
CONTROLMIXER_OPS(volsw, 259 binds the mixer control to switch get/put handlers, 259, 259),
|
2018-03-06 05:58:29 +08:00
|
|
|
CONTROLMIXER_MAX(max 1 indicates switch type control, 1),
|
|
|
|
false,
|
|
|
|
,
|
|
|
|
Channel register and shift for Front Left/Right,
|
|
|
|
LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), KCONTROL_CHANNEL(FR, 2, 1)))
|
2018-03-06 05:58:27 +08:00
|
|
|
|
2017-07-06 23:39:29 +08:00
|
|
|
#
|
|
|
|
# Components and Buffers
|
|
|
|
#
|
|
|
|
|
2017-08-09 21:54:03 +08:00
|
|
|
# "Tone 0" has 2 sink period and 0 source periods
|
2018-03-06 05:58:27 +08:00
|
|
|
W_TONE(0, PIPELINE_FORMAT, 2, 0, 0, LIST(` ', "Tone Switch PIPELINE_ID"))
|
2017-08-09 21:54:03 +08:00
|
|
|
|
|
|
|
# "Tone Volume" has 2 sink period and 2 source periods
|
2018-03-06 05:58:26 +08:00
|
|
|
W_PGA(0, PIPELINE_FORMAT, 2, 2, 0, LIST(` ', "Tone Volume PIPELINE_ID"))
|
2017-08-09 21:54:03 +08:00
|
|
|
|
|
|
|
# Low Latency Buffers
|
|
|
|
W_BUFFER(0,COMP_BUFFER_SIZE(2,
|
2018-03-05 21:38:12 +08:00
|
|
|
COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES),
|
|
|
|
PLATFORM_COMP_MEM_CAP)
|
2017-08-09 21:54:03 +08:00
|
|
|
W_BUFFER(1, COMP_BUFFER_SIZE(2,
|
2018-03-05 21:38:12 +08:00
|
|
|
COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES),
|
|
|
|
PLATFORM_COMP_MEM_CAP)
|
2017-07-06 23:39:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Pipeline Graph
|
|
|
|
#
|
|
|
|
# Tone --B0--> volume --B1--> Endpoint Pipeline
|
|
|
|
#
|
|
|
|
|
2018-03-06 05:58:30 +08:00
|
|
|
P_GRAPH(pipe-tone-PIPELINE_ID, PIPELINE_ID,
|
|
|
|
LIST(` ',
|
|
|
|
`dapm(N_BUFFER(0), N_TONE(0))',
|
|
|
|
`dapm(N_PGA(0), N_BUFFER(0))',
|
|
|
|
`dapm(N_BUFFER(1), N_PGA(0))'))
|
2017-07-06 23:39:29 +08:00
|
|
|
|
2017-08-09 21:54:03 +08:00
|
|
|
#
|
|
|
|
# Pipeline Source and Sinks
|
|
|
|
#
|
|
|
|
indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(1))
|
|
|
|
|
2017-07-06 23:39:29 +08:00
|
|
|
#
|
|
|
|
# Pipeline Configuration.
|
|
|
|
#
|
|
|
|
|
2018-05-30 03:15:01 +08:00
|
|
|
W_PIPELINE(N_TONE(0), SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, 0, pipe_tone_schedule_plat)
|