Skip to content
This repository was archived by the owner on Jan 17, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions topology/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ MACHINES = \
sof-apl-wm8804.tplg \
sof-apl-da7219.tplg \
sof-glk-da7219.tplg \
sof-icl-nocodec.tplg
sof-icl-nocodec.tplg \
sof-apl-eq-pcm512x.tplg

# Uncomment the following line if you want to debug conf files
.PRECIOUS: %.conf
Expand Down Expand Up @@ -71,4 +72,5 @@ EXTRA_DIST = \
sof-apl-wm8804.m4 \
sof-apl-da7219.m4 \
sof-glk-da7219.m4 \
sof-icl-nocodec.m4
sof-icl-nocodec.m4 \
sof-apl-eq-pcm512x.m4
62 changes: 62 additions & 0 deletions topology/m4/bytecontrol.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
divert(-1)

dnl Define macro for byte control

dnl CONTROLBYTES_MAX(comment, value)
define(`CONTROLBYTES_MAX',
`#$1'
` max STR($2)')

dnl CONTROLMIXER_TLV(comment, value)
define(`CONTROLBYTES_TLV',
`#$1'
` tlv STR($2)')

dnl CONTROLMIXER_OPS(info, comment, get, put)
define(`CONTROLBYTES_OPS',
`ops."ctl" {'
` info STR($1)'
` #$2'
` }')

dnl CONTROLMIXER_OPS(info, comment, get, put)
define(`CONTROLBYTES_EXTOPS',
`extops."extctl" {'
` #$1'
` get STR($2)'
` put STR($3)'
` }')

define(`CONTROLBYTES_PRIV',
`SectionData.STR($1) {'
` $2'
`}')

dnl C_CONTROLMIXER(name, index, ops, base, num_regs, mask, max, tlv, priv)
define(`C_CONTROLBYTES',
`SectionControlBytes.STR($1) {'
`'
` # control belongs to this index group'
` index STR($2)'
`'
` # control uses bespoke driver get/put/info ID for io ops'
` $3'
` # control uses bespoke driver get/put/info ID for ext ops'
` $4'
`'
` base STR($5)'
` num_regs STR($6)'
` mask STR($7)'
` $8'
` $9'
` access ['
` tlv_write'
` tlv_read'
` tlv_callback'
` ]'
` data ['
` $10'
` ]'
`}')

divert(0)dnl
53 changes: 53 additions & 0 deletions topology/m4/eq_fir.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
divert(-1)

dnl Define macro for Eq effect widget

dnl EQ name)
define(`N_EQ_FIR', `EQFIR'PIPELINE_ID`.'$1)

dnl W_EQ(name, format, periods_sink, periods_source, preload, kcontrols_list)
define(`W_EQ_FIR',
`SectionVendorTuples."'N_EQ_FIR($1)`_tuples_w" {'
` tokens "sof_comp_tokens"'
` tuples."word" {'
` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($3)
` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($4)
` SOF_TKN_COMP_PRELOAD_COUNT' STR($5)
` }'
`}'
`SectionData."'N_EQ_FIR($1)`_data_w" {'
` tuples "'N_EQ_FIR($1)`_tuples_w"'
`}'
`SectionVendorTuples."'N_EQ_FIR($1)`_tuples_str" {'
` tokens "sof_comp_tokens"'
` tuples."string" {'
` SOF_TKN_COMP_FORMAT' STR($2)
` }'
`}'
`SectionData."'N_EQ_FIR($1)`_data_str" {'
` tuples "'N_EQ_FIR($1)`_tuples_str"'
`}'
`SectionVendorTuples."'N_EQ_FIR($1)`_tuples_str_type" {'
` tokens "sof_effect_tokens"'
` tuples."string" {'
` SOF_TKN_EFFECT_TYPE' "EQFIR"
` }'
`}'
`SectionData."'N_EQ_FIR($1)`_data_str_type" {'
` tuples "'N_EQ_FIR($1)`_tuples_str_type"'
`}'
`SectionWidget."'N_EQ_FIR($1)`" {'
` index "'PIPELINE_ID`"'
` type "effect"'
` no_pm "true"'
` data ['
` "'N_EQ_FIR($1)`_data_w"'
` "'N_EQ_FIR($1)`_data_str"'
` "'N_EQ_FIR($1)`_data_str_type"'
` ]'
` bytes ['
$6
` ]'
`}')

divert(0)dnl
53 changes: 53 additions & 0 deletions topology/m4/eq_iir.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
divert(-1)

dnl Define macro for Eq effect widget

dnl EQ name)
define(`N_EQ_IIR', `EQIIR'PIPELINE_ID`.'$1)

dnl W_EQ(name, format, periods_sink, periods_source, preload, kcontrols_list)
define(`W_EQ_IIR',
`SectionVendorTuples."'N_EQ_IIR($1)`_tuples_w" {'
` tokens "sof_comp_tokens"'
` tuples."word" {'
` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($3)
` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($4)
` SOF_TKN_COMP_PRELOAD_COUNT' STR($5)
` }'
`}'
`SectionData."'N_EQ_IIR($1)`_data_w" {'
` tuples "'N_EQ_IIR($1)`_tuples_w"'
`}'
`SectionVendorTuples."'N_EQ_IIR($1)`_tuples_str" {'
` tokens "sof_comp_tokens"'
` tuples."string" {'
` SOF_TKN_COMP_FORMAT' STR($2)
` }'
`}'
`SectionData."'N_EQ_IIR($1)`_data_str" {'
` tuples "'N_EQ_IIR($1)`_tuples_str"'
`}'
`SectionVendorTuples."'N_EQ_IIR($1)`_tuples_str_type" {'
` tokens "sof_effect_tokens"'
` tuples."string" {'
` SOF_TKN_EFFECT_TYPE' "EQIIR"
` }'
`}'
`SectionData."'N_EQ_IIR($1)`_data_str_type" {'
` tuples "'N_EQ_IIR($1)`_tuples_str_type"'
`}'
`SectionWidget."'N_EQ_IIR($1)`" {'
` index "'PIPELINE_ID`"'
` type "effect"'
` no_pm "true"'
` data ['
` "'N_EQ_IIR($1)`_data_w"'
` "'N_EQ_IIR($1)`_data_str"'
` "'N_EQ_IIR($1)`_data_str_type"'
` ]'
` bytes ['
$6
` ]'
`}')

divert(0)dnl
55 changes: 55 additions & 0 deletions topology/sof-apl-eq-pcm512x.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#
# Topology for generic Apollolake UP^2 with pcm512x codec.
#

# Include topology builder
include(`utils.m4')
include(`dai.m4')
include(`pipeline.m4')
include(`ssp.m4')

# Include TLV library
include(`common/tlv.m4')

# Include Token library
include(`sof/tokens.m4')

# Include Apollolake DSP configuration
include(`platform/intel/bxt.m4')

#
# Define the pipelines
#
# PCM0 ----> volume -----> SSP5 (pcm512x)
#

# Low Latency playback 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-eq-volume-playback.m4,
1, 0, 2, s32le,
48, 1000, 0, 0)

#
# DAIs configuration
#

# playback DAI is SSP5 using 2 periods
# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0
DAI_ADD(sof/pipe-dai-playback.m4,
1, SSP, 5, SSP5-Codec,
PIPELINE_SOURCE_1, 2, s24le,
48, 1000, 0, 0)

# PCM Low Latency, id 0
PCM_PLAYBACK_ADD(Port5, 0, PIPELINE_PCM_1)

#
# BE configurations - overrides config in ACPI if present
#

DAI_CONFIG(SSP, 5, 0, SSP5-Codec,
SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24576000, codec_mclk_in),
SSP_CLOCK(bclk, 3072000, codec_slave),
SSP_CLOCK(fsync, 48000, codec_slave),
SSP_TDM(2, 32, 3, 3),
SSP_CONFIG_DATA(SSP, 5, 24)))
97 changes: 97 additions & 0 deletions topology/sof/pipe-eq-fir-volume-playback.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Low Latency Passthrough with volume Pipeline and PCM
#
# Pipeline Endpoints for connection are :-
#
# host PCM_P --> B0 --> EQ 0 --> B1 --> Volume 0 --> B2 --> sink DAI0

# Include topology builder
include(`utils.m4')
include(`buffer.m4')
include(`pcm.m4')
include(`pga.m4')
include(`dai.m4')
include(`mixercontrol.m4')
include(`bytecontrol.m4')
include(`pipeline.m4')
include(`eq_fir.m4')

#
# Controls
#
# 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 -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)))

# EQ initial parameters, in this case flat response
CONTROLBYTES_PRIV(EQFIR_priv,
` bytes "0x18,0x00,0x00,0x00,0x02,0x00,0x01,0x00,'
` 0x00,0x00,0x00,0x00,0x04,0x00,0xff,0xff,'
` 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00"'
)

# EQ Bytes control with max value of 255
C_CONTROLBYTES(EQFIR, 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(, 316),
,
EQFIR_priv)

#
# Components and Buffers
#

# Host "Passthrough Playback" PCM
# with 2 sink and 0 source periods
W_PCM_PLAYBACK(PCM_ID, Passthrough Playback, 2, 0, 2)

# "Volume" has 2 source and 2 sink periods
W_PGA(0, PIPELINE_FORMAT, 2, 2, 2, LIST(` ', "Master Playback Volume PIPELINE_ID"))

# "EQ 0" has 2 sink period and 2 source periods
W_EQ_FIR(0, PIPELINE_FORMAT, 2, 2, 2, LIST(` ', "EQFIR"))

# Playback 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_HOST_MEM_CAP)
W_BUFFER(2, COMP_BUFFER_SIZE(2,
COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES),
PLATFORM_DAI_MEM_CAP)

#
# Pipeline Graph
#
# host PCM_P --> B0 --> EQ 0 --> B1 --> Volume 0 --> B2 --> sink DAI0

P_GRAPH(pipe-pass-vol-playback-PIPELINE_ID, PIPELINE_ID,
LIST(` ',
`dapm(N_PCMP(PCM_ID), Passthrough Playback PCM_ID)',
`dapm(N_BUFFER(0), N_PCMP(PCM_ID))',
`dapm(N_EQ_FIR(0), N_BUFFER(0))',
`dapm(N_BUFFER(1), N_EQ_FIR(0))',
`dapm(N_PGA(0), N_BUFFER(1))',
`dapm(N_BUFFER(2), N_PGA(0))'))

#
# Pipeline Source and Sinks
#
indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(2))
indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Playback PCM_ID)


#
# PCM Configuration

#
PCM_CAPABILITIES(Passthrough Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 8, 2, 16, 192, 16384, 65536, 65536)

Loading