2017-08-22 03:28:08 +08:00
|
|
|
# Low Latency Passthrough with volume Pipeline and PCM
|
|
|
|
#
|
|
|
|
# Pipeline Endpoints for connection are :-
|
|
|
|
#
|
|
|
|
# host PCM_P --> B0 --> Volume 0 --> B1 --> sink DAI0
|
|
|
|
|
|
|
|
# Include topology builder
|
|
|
|
include(`local.m4')
|
|
|
|
|
2017-09-01 06:48:35 +08:00
|
|
|
#
|
|
|
|
# Controls
|
|
|
|
#
|
|
|
|
SectionControlMixer.STR(Master Playback Volume) {
|
|
|
|
|
|
|
|
# control belongs to this index group
|
|
|
|
index STR(PIPELINE_ID)
|
|
|
|
|
|
|
|
# Channel register and shift for Front Left/Right
|
|
|
|
channel."FL" {
|
|
|
|
reg "1"
|
|
|
|
shift "0"
|
|
|
|
}
|
|
|
|
channel."FR" {
|
|
|
|
reg "1"
|
|
|
|
shift "1"
|
|
|
|
}
|
|
|
|
|
|
|
|
# control uses bespoke driver get/put/info ID 0
|
|
|
|
ops."ctl" {
|
|
|
|
info "volsw"
|
|
|
|
get "256"
|
|
|
|
put "256"
|
|
|
|
}
|
|
|
|
|
|
|
|
# TLV 32 steps from -90dB to +6dB for 3dB
|
|
|
|
max "32"
|
|
|
|
invert "false"
|
|
|
|
tlv "vtlv_m90s3"
|
|
|
|
}
|
2017-08-22 03:28:08 +08:00
|
|
|
|
2018-02-10 15:49:17 +08:00
|
|
|
SectionControlMixer.STR(Master Playback Volume Switch) {
|
|
|
|
|
|
|
|
# control belongs to this index group
|
|
|
|
index STR(PIPELINE_ID)
|
|
|
|
|
|
|
|
# Channel register and shift for Front Left/Right
|
|
|
|
channel."FL" {
|
|
|
|
reg "1"
|
|
|
|
shift "0"
|
|
|
|
}
|
|
|
|
channel."FR" {
|
|
|
|
reg "1"
|
|
|
|
shift "1"
|
|
|
|
}
|
|
|
|
|
|
|
|
# control uses bespoke driver get/put/info ID 0
|
|
|
|
ops."ctl" {
|
|
|
|
info "volsw"
|
|
|
|
get "256"
|
|
|
|
put "256"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Volume mute on/off
|
|
|
|
max "1"
|
|
|
|
invert "false"
|
|
|
|
}
|
2017-08-22 03:28:08 +08:00
|
|
|
#
|
|
|
|
# Components and Buffers
|
|
|
|
#
|
|
|
|
|
|
|
|
# Host "Passthrough Playback" PCM uses pipeline DMAC and channel
|
|
|
|
# with 2 sink and 0 source periods
|
|
|
|
W_PCM_PLAYBACK(Passthrough Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 2, 0, 2)
|
|
|
|
|
|
|
|
# "Volume" has 2 source and 2 sink periods
|
2018-03-06 05:58:26 +08:00
|
|
|
W_PGA(0, PIPELINE_FORMAT, 2, 2, 2, LIST(` ', "Master Playback Volume Switch", "Master Playback Volume"))
|
2017-08-22 03:28:08 +08:00
|
|
|
|
|
|
|
# Playback 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_HOST_MEM_CAP)
|
2017-08-22 03:28:08 +08:00
|
|
|
W_BUFFER(1, COMP_BUFFER_SIZE(2,
|
2018-03-05 21:38:12 +08:00
|
|
|
COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES),
|
|
|
|
PLATFORM_DAI_MEM_CAP)
|
2017-08-22 03:28:08 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# DAI definitions
|
|
|
|
#
|
2017-12-07 09:41:05 +08:00
|
|
|
W_DAI_OUT(DAI_TYPE, DAI_INDEX, DAI_FORMAT, 0, DAI_PERIODS,
|
2017-08-22 03:28:08 +08:00
|
|
|
DAI_PERIODS, dai0p_plat_conf)
|
|
|
|
|
|
|
|
#
|
|
|
|
# DAI pipeline - always use 0 for DAIs
|
|
|
|
#
|
|
|
|
W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES,
|
2017-09-11 23:03:57 +08:00
|
|
|
SCHEDULE_CORE, 0, pipe_dai_schedule_plat)
|
2017-08-22 03:28:08 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# Pipeline Graph
|
|
|
|
#
|
|
|
|
# host PCM_P --> B0 --> Volume 0 --> B1 --> sink DAI0
|
|
|
|
|
|
|
|
SectionGraph."pipe-pass-vol-playback-PIPELINE_ID" {
|
|
|
|
index STR(PIPELINE_ID)
|
|
|
|
|
|
|
|
lines [
|
2017-10-02 22:28:24 +08:00
|
|
|
dapm(N_PCMP, Passthrough Playback PCM_ID)
|
|
|
|
dapm(N_BUFFER(0), N_PCMP)
|
2017-09-01 06:48:35 +08:00
|
|
|
dapm(N_PGA(0), N_BUFFER(0))
|
|
|
|
dapm(N_BUFFER(1), N_PGA(0))
|
2017-08-22 03:28:08 +08:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2017-12-12 06:03:50 +08:00
|
|
|
#
|
|
|
|
# Pipeline Source and Sinks
|
|
|
|
#
|
|
|
|
indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(1))
|
|
|
|
indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Playback PCM_ID)
|
|
|
|
|
2017-08-22 03:28:08 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# PCM Configuration
|
|
|
|
#
|
|
|
|
|
|
|
|
SectionPCMCapabilities.STR(Passthrough Playback PCM_ID) {
|
|
|
|
|
2017-09-08 19:51:25 +08:00
|
|
|
formats "S32_LE,S24_LE,S16_LE"
|
2017-08-22 03:28:08 +08:00
|
|
|
rate_min "48000"
|
|
|
|
rate_max "48000"
|
|
|
|
channels_min "2"
|
|
|
|
channels_max "4"
|
|
|
|
periods_min "2"
|
|
|
|
periods_max "16"
|
|
|
|
period_size_min "192"
|
|
|
|
period_size_max "16384"
|
|
|
|
buffer_size_min "65536"
|
|
|
|
buffer_size_max "65536"
|
|
|
|
}
|
|
|
|
|