topology: add volume component to demux topology

Demux topology doesn't have format conversions so playback files need to
be converted to S24 or S32 format. As this is a bit cumbersome add
volume component to demux topology to enable standard 16 bit playback
from alsa. Also change the demux capture pipe PCM format range.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
This commit is contained in:
Jaska Uimonen 2019-05-22 09:36:26 +03:00 committed by Janusz Jankowski
parent 6e82ddf9b1
commit a26c51a43e
4 changed files with 110 additions and 3 deletions

View File

@ -34,7 +34,7 @@ dnl pipe id, pcm, max channels, format,
dnl frames, deadline, priority, core)
# Demux pipeline 1 on PCM 0 using max 2 channels of s32le.
# Schedule 48 frames per 1000us deadline on core 0 with priority 0
PIPELINE_PCM_ADD(sof/pipe-demux-playback.m4,
PIPELINE_PCM_ADD(sof/pipe-volume-demux-playback.m4,
1, 0, 2, s32le,
48, 1000, 0, 0)

View File

@ -45,7 +45,7 @@ dnl frames, deadline, priority, core)
# Demux pipeline 1 on PCM 0 using max 2 channels of s24le.
# Schedule 48 frames per 1000us deadline on core 0 with priority 0
PIPELINE_PCM_ADD(sof/pipe-demux-playback.m4,
PIPELINE_PCM_ADD(sof/pipe-volume-demux-playback.m4,
1, 0, 2, s24le,
48, 1000, 0, 0)

View File

@ -47,4 +47,4 @@ W_PIPELINE(N_PCMC(PCM_ID), SCHEDULE_PERIOD, SCHEDULE_PRIORITY, SCHEDULE_FRAMES,
# PCM Configuration
#
PCM_CAPABILITIES(Passthrough Capture PCM_ID, COMP_FORMAT_NAME(PIPELINE_FORMAT), 48000, 48000, PIPELINE_CHANNELS, PIPELINE_CHANNELS, 2, 16, 192, 16384, 65536, 65536)
PCM_CAPABILITIES(Passthrough Capture PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, PIPELINE_CHANNELS, PIPELINE_CHANNELS, 2, 16, 192, 16384, 65536, 65536)

View File

@ -0,0 +1,107 @@
# Demux Volume Pipeline
#
# Low Latency Playback with demux and volume.
#
# Pipeline Endpoints for connection are :-
#
# Playback Demux
# B2 (DAI buffer)
#
#
# host PCM_P -- B0 --> Demux(M) -- B1 --> volume -- B2 --> sink DAI0
# |
# pipeline n+1 --> DAI
#
# Include topology builder
include(`utils.m4')
include(`buffer.m4')
include(`pcm.m4')
include(`pga.m4')
include(`muxdemux.m4')
include(`mixercontrol.m4')
include(`bytecontrol.m4')
# Use default parameters
include(`demux_coef_default.m4')
# demux Bytes control with max value of 255
C_CONTROLBYTES(DEMUX, PIPELINE_ID,
CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258, 258),
CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258),
, , ,
CONTROLBYTES_MAX(, 304),
,
DEMUX_priv)
# Volume Mixer control with max value of 32
C_CONTROLMIXER(Master Playback Volume, PIPELINE_ID,
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 -64dB to 0dB for 2dB, vtlv_m64s2),
Channel register and shift for Front Left/Right,
LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), KCONTROL_CHANNEL(FR, 1, 1)))
#
# Volume configuration
#
W_VENDORTUPLES(playback_pga_tokens, sof_volume_tokens,
LIST(` ', `SOF_TKN_VOLUME_RAMP_STEP_TYPE "0"'
` ', `SOF_TKN_VOLUME_RAMP_STEP_MS "250"'))
W_DATA(playback_pga_conf, playback_pga_tokens)
#
# Components and Buffers
#
# Host "Low latency Playback" PCM
# with 2 sink and 0 source periods
W_PCM_PLAYBACK(PCM_ID, Low Latency Playback, 2, 0)
# "Master Playback Volume" has 2 source and 2 sink periods for DAI ping-pong
W_PGA(1, PIPELINE_FORMAT, 2, 2, playback_pga_conf, LIST(` ', "PIPELINE_ID Master Playback Volume"))
# Mux 0 has 2 sink and source periods.
W_MUXDEMUX(0, 1, PIPELINE_FORMAT, 2, 2, LIST(` ', "DEMUX"))
# Low Latency Buffers
W_BUFFER(0, COMP_BUFFER_SIZE(2,
COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES),
PLATFORM_HOST_MEM_CAP)
W_BUFFER(1, COMP_BUFFER_SIZE(2,
COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS,SCHEDULE_FRAMES),
PLATFORM_COMP_MEM_CAP)
W_BUFFER(2, COMP_BUFFER_SIZE(2,
COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES),
PLATFORM_COMP_MEM_CAP)
#
# Pipeline Graph
#
# host PCM_P --B0--> Demux --B1--> volume ---B2--> sink DAI0
P_GRAPH(pipe-ll-playback-PIPELINE_ID, PIPELINE_ID,
LIST(` ',
`dapm(N_BUFFER(0), N_PCMP(PCM_ID))',
`dapm(N_MUXDEMUX(0), N_BUFFER(0))',
`dapm(N_BUFFER(1), N_MUXDEMUX(0))',
`dapm(N_PGA(1), N_BUFFER(1))',
`dapm(N_BUFFER(2), N_PGA(1))'))
#
# Pipeline Source and Sinks
#
indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(2))
indir(`define', concat(`PIPELINE_DEMUX_', PIPELINE_ID), N_MUXDEMUX(0))
indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Low Latency Playback PCM_ID)
#
# PCM Configuration
#
# PCM capabilities supported by FW
PCM_CAPABILITIES(Low Latency Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, PIPELINE_CHANNELS, 2, 16, 192, 16384, 65536, 65536)