mailman.alsa-project.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Sound-open-firmware

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
sound-open-firmware@alsa-project.org

December 2017

  • 11 participants
  • 66 discussions
[Sound-open-firmware] [PATCH] topology: test: Add simple component test generator.
by Liam Girdwood 13 Dec '17

13 Dec '17
Move testing pipelines into a test directory and reuse test scaffolding so that they can be used to test multiple components on multiple target with multiples configs. Test topology scafolding are now pre-processed using a script to generate the ALSA conf format with the various changes for each test case. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- .gitignore | 1 + configure.ac | 1 + topology/Makefile.am | 11 +-- topology/sof/pipe-src-capture.m4 | 96 ++++++++++++++++++++++ ...hrough-src-playback.m4 => pipe-src-playback.m4} | 23 ++---- ...rough-vol-capture.m4 => pipe-volume-capture.m4} | 0 ...ugh-vol-playback.m4 => pipe-volume-playback.m4} | 0 .../test-passthrough-16bit-48k-ssp2-SSP2-Codec.m4 | 51 ------------ .../test-passthrough-16bit-48k-ssp2-nocodec.m4 | 84 ------------------- topology/test-passthrough-16bit-48k-ssp2.m4 | 51 ------------ topology/test-passthrough-24bit-48k-src-ssp2.m4 | 51 ------------ .../test-passthrough-24bit-48k-ssp2-SSP2-Codec.m4 | 51 ------------ .../test-passthrough-24bit-48k-ssp2-nocodec.m4 | 51 ------------ topology/test-passthrough-24bit-48k-ssp2.m4 | 51 ------------ topology/test-passthrough-24bit-48k-vol-ssp2.m4 | 83 ------------------- topology/test/Makefile.am | 20 +++++ topology/test/test-src-ssp.m4 | 90 ++++++++++++++++++++ topology/test/test-ssp.m4 | 90 ++++++++++++++++++++ topology/test/tplg-build.sh | 67 +++++++++++++++ 19 files changed, 373 insertions(+), 499 deletions(-) create mode 100644 topology/sof/pipe-src-capture.m4 rename topology/sof/{pipe-passthrough-src-playback.m4 => pipe-src-playback.m4} (85%) rename topology/sof/{pipe-passthrough-vol-capture.m4 => pipe-volume-capture.m4} (100%) rename topology/sof/{pipe-passthrough-vol-playback.m4 => pipe-volume-playback.m4} (100%) delete mode 100644 topology/test-passthrough-16bit-48k-ssp2-SSP2-Codec.m4 delete mode 100644 topology/test-passthrough-16bit-48k-ssp2-nocodec.m4 delete mode 100644 topology/test-passthrough-16bit-48k-ssp2.m4 delete mode 100644 topology/test-passthrough-24bit-48k-src-ssp2.m4 delete mode 100644 topology/test-passthrough-24bit-48k-ssp2-SSP2-Codec.m4 delete mode 100644 topology/test-passthrough-24bit-48k-ssp2-nocodec.m4 delete mode 100644 topology/test-passthrough-24bit-48k-ssp2.m4 delete mode 100644 topology/test-passthrough-24bit-48k-vol-ssp2.m4 create mode 100644 topology/test/Makefile.am create mode 100644 topology/test/test-src-ssp.m4 create mode 100644 topology/test/test-ssp.m4 create mode 100755 topology/test/tplg-build.sh diff --git a/.gitignore b/.gitignore index bc827b4..023e264 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ rmbox/rmbox rwav/rwav *.tplg topology/*.conf +topology/test/*.conf diff --git a/configure.ac b/configure.ac index 87c7519..1b4f59b 100644 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,7 @@ AC_OUTPUT([ rimage/Makefile rmbox/Makefile topology/Makefile + topology/test/Makefile ]) echo " diff --git a/topology/Makefile.am b/topology/Makefile.am index 77c146f..3cbc5e6 100644 --- a/topology/Makefile.am +++ b/topology/Makefile.am @@ -3,6 +3,8 @@ # Dependencies # +SUBDIRS = test + DEPS = \ dsps/*.m4 \ common/*.m4 \ @@ -25,14 +27,7 @@ MACHINES = \ reef-byt-rt5645.tplg \ reef-byt-rt5651.tplg \ reef-byt-da7212.tplg \ - reef-hsw-rt5640.tplg \ - test-passthrough-16bit-48k-ssp2-nocodec.tplg \ - test-passthrough-24bit-48k-ssp2-nocodec.tplg \ - test-passthrough-24bit-48k-ssp2.tplg \ - test-passthrough-24bit-48k-ssp2-SSP2-Codec.tplg \ - test-passthrough-16bit-48k-ssp2-SSP2-Codec.tplg \ - test-passthrough-24bit-48k-vol-ssp2.tplg \ - test-passthrough-24bit-48k-src-ssp2.tplg + reef-hsw-rt5640.tplg # Uncomment the following line if you want to debug conf files .PRECIOUS: %.conf diff --git a/topology/sof/pipe-src-capture.m4 b/topology/sof/pipe-src-capture.m4 new file mode 100644 index 0000000..ca2980a --- /dev/null +++ b/topology/sof/pipe-src-capture.m4 @@ -0,0 +1,96 @@ +# Low Latency Passthrough with volume Pipeline and PCM +# +# Pipeline Endpoints for connection are :- +# +# host PCM_P --> SRC --> sink DAI0 + +# Include topology builder +include(`local.m4') + + +# +# Components and Buffers +# + +# Host "Passthrough Playback" PCM uses pipeline DMAC and channel +# with 4 sink and 0 source periods +W_PCM_PLAYBACK(Passthrough Capture, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 4, 0, 2) + +# +# SRC Configuration +# + +SectionVendorTuples."media_src_tokens" { + tokens "sof_src_tokens" + + tuples."word" { + SOF_TKN_SRC_RATE_OUT "48000" + } +} + +SectionData."media_src_conf" { + tuples "media_src_tokens" +} + +# "SRC" has 4 source and 4 sink periods +W_SRC(0, PIPELINE_FORMAT, 4, 4, media_src_conf, 2) + +# Playback Buffers +W_BUFFER(0, COMP_BUFFER_SIZE(4, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES)) +W_BUFFER(1, COMP_BUFFER_SIZE(4, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES)) + +# +# DAI definitions +# +W_DAI_IN(DAI_TYPE, DAI_INDEX, DAI_FORMAT, 0, DAI_PERIODS, + DAI_PERIODS, dai0c_plat_conf) + +# +# DAI pipeline +# +W_PIPELINE(N_DAI_IN, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, + SCHEDULE_CORE, 0, pipe_dai_schedule_plat) + +# +# Pipeline Graph +# +# host PCM_P --> B0 --> SRC 0 --> B1 --> sink DAI0 + +SectionGraph."pipe-pass-src-capture-PIPELINE_ID" { + index STR(PIPELINE_ID) + + lines [ + dapm(Passthrough Capture PCM_ID, N_PCMC) + dapm(N_PCMC, N_BUFFER(0)) + dapm(N_BUFFER(0), N_SRC(0)) + dapm(N_SRC(0), N_BUFFER(1)) + ] +} + +# +# Pipeline Source and Sinks +# +indir(`define', concat(`PIPELINE_SINK_', PIPELINE_ID), N_BUFFER(1)) +indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Capture PCM_ID) + +# +# PCM Configuration +# + +SectionPCMCapabilities.STR(Passthrough Capture PCM_ID) { + + formats "S32_LE,S24_LE,S16_LE" + rate_min "8000" + rate_max "96000" + 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" +} + diff --git a/topology/sof/pipe-passthrough-src-playback.m4 b/topology/sof/pipe-src-playback.m4 similarity index 85% rename from topology/sof/pipe-passthrough-src-playback.m4 rename to topology/sof/pipe-src-playback.m4 index b8fae58..d037543 100644 --- a/topology/sof/pipe-passthrough-src-playback.m4 +++ b/topology/sof/pipe-src-playback.m4 @@ -66,10 +66,14 @@ SectionGraph."pipe-pass-src-playback-PIPELINE_ID" { dapm(N_BUFFER(0), N_PCMP) dapm(N_SRC(0), N_BUFFER(0)) dapm(N_BUFFER(1), N_SRC(0)) - dapm(N_DAI_OUT, N_BUFFER(1)) ] } +# +# 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) # # PCM Configuration @@ -90,20 +94,3 @@ SectionPCMCapabilities.STR(Passthrough Playback PCM_ID) { buffer_size_max "65536" } -# PCM Passthrough Playback -SectionPCM.STR(PCM PCM_ID) { - - index STR(PIPELINE_ID) - - # used for binding to the PCM - id STR(PCM_ID) - - dai.STR(Passthrough Playback PCM_ID) { - id STR(PCM_ID) - } - - pcm."playback" { - - capabilities STR(Passthrough Playback PCM_ID) - } -} diff --git a/topology/sof/pipe-passthrough-vol-capture.m4 b/topology/sof/pipe-volume-capture.m4 similarity index 100% rename from topology/sof/pipe-passthrough-vol-capture.m4 rename to topology/sof/pipe-volume-capture.m4 diff --git a/topology/sof/pipe-passthrough-vol-playback.m4 b/topology/sof/pipe-volume-playback.m4 similarity index 100% rename from topology/sof/pipe-passthrough-vol-playback.m4 rename to topology/sof/pipe-volume-playback.m4 diff --git a/topology/test-passthrough-16bit-48k-ssp2-SSP2-Codec.m4 b/topology/test-passthrough-16bit-48k-ssp2-SSP2-Codec.m4 deleted file mode 100644 index e930416..0000000 --- a/topology/test-passthrough-16bit-48k-ssp2-SSP2-Codec.m4 +++ /dev/null @@ -1,51 +0,0 @@ -# -# Topology for pass through pipeline -# - -# Include topology builder -include(`local.m4') -include(`build.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Baytrail DSP configuration -include(`dsps/byt.m4') - -# -# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! -# - -# DAI Link Name -define(`TEST_DAI_LINK_NAME', `SSP2-Codec') - -# -# Define the pipeline -# -# PCM0 ----> SSP2 -# - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s24le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -# Use DMAC 0 channel 1 for PCM audio playback data - -PIPELINE_PCM_DAI_ADD(sof/pipe-passthrough-playback.m4, - 1, 0, 2, s16le, - 48, 1000, 0, 0, 0, 1, - SSP, 2, s16le, 2) - -# -# BE configurations - overrides config in ACPI if present -# -# Clocks masters wrt codec -# -# 24bit I2S using 25bit sample conatiner on SSP2 -# -DAI_CONFIG(SSP, 2, TEST_DAI_LINK_NAME, I2S, 16, - DAI_CLOCK(mclk, 19200000, slave), - DAI_CLOCK(bclk, 1920000, slave), - DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, 20, 3, 3)) diff --git a/topology/test-passthrough-16bit-48k-ssp2-nocodec.m4 b/topology/test-passthrough-16bit-48k-ssp2-nocodec.m4 deleted file mode 100644 index 76bd75b..0000000 --- a/topology/test-passthrough-16bit-48k-ssp2-nocodec.m4 +++ /dev/null @@ -1,84 +0,0 @@ -# -# Topology for pass through pipeline -# - -# Include topology builder -include(`local.m4') -include(`build.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Baytrail DSP configuration -include(`dsps/byt.m4') - -# -# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! -# - -# DAI Link Name -define(`TEST_DAI_LINK_NAME', `NoCodec') - -# -# Define the pipeline -# -# PCM0 <---> SSP2 -# - -# Passthrough playback pipeline 1 on PCM 0 using max 2 channels of s24le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -# Use DMAC 0 channel 1 for PCM audio playback data - -PIPELINE_PCM_DAI_ADD(sof/pipe-passthrough-playback.m4, - 1, 0, 2, s16le, - 48, 1000, 0, 0, 0, 1, - SSP, 2, s16le, 2) - - -# Passthrough playback pipeline 2 on PCM 0 using max 2 channels of s24le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -# Use DMAC 0 channel 1 for PCM audio playback data - -PIPELINE_PCM_DAI_ADD(sof/pipe-passthrough-capture.m4, - 2, 0, 2, s16le, - 48, 1000, 0, 0, 0, 1, - SSP, 2, s16le, 2) - -# -# DAI configuration -# -# SSP port 2 is our only pipeline DAI -# - -# playback DAI is SSP2 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 1, SSP, 2, - PIPELINE_SOURCE_1, 2, s16le, - 48, 1000, 0, 0) - -# capture DAI is SSP2 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 2, SSP, 2, - PIPELINE_SINK_2, 2, s16le, - 48, 1000, 0, 0) - -# PCM Passthrough -PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) - -# -# BE configurations - overrides config in ACPI if present -# -# Clocks masters wrt codec -# -# 16bit I2S using 20bit sample conatiner on SSP2 -# -DAI_CONFIG(SSP, 2, TEST_DAI_LINK_NAME, I2S, 16, - DAI_CLOCK(mclk, 19200000, slave), - DAI_CLOCK(bclk, 1920000, slave), - DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, 20, 3, 3)) diff --git a/topology/test-passthrough-16bit-48k-ssp2.m4 b/topology/test-passthrough-16bit-48k-ssp2.m4 deleted file mode 100644 index 7bf4aaf..0000000 --- a/topology/test-passthrough-16bit-48k-ssp2.m4 +++ /dev/null @@ -1,51 +0,0 @@ -# -# Topology for pass through pipeline -# - -# Include topology builder -include(`local.m4') -include(`build.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Baytrail DSP configuration -include(`dsps/byt.m4') - -# -# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! -# - -# DAI Link Name -define(`TEST_DAI_LINK_NAME', `Baytrail Audio') - -# -# Define the pipeline -# -# PCM0 ----> SSP2 -# - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s16le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -# Use DMAC 0 channel 1 for PCM audio playback data - -PIPELINE_PCM_DAI_ADD(sof/pipe-passthrough-playback.m4, - 1, 0, 2, s16le, - 48, 1000, 0, 0, 0, 1, - SSP, 2, s16le, 2) - -# -# BE configurations - overrides config in ACPI if present -# -# Clocks masters wrt codec -# -# 16bit I2S using 20bit sample conatiner on SSP2 -# -DAI_CONFIG(SSP, 2, TEST_DAI_LINK_NAME, I2S, 16, - DAI_CLOCK(mclk, 19200000, slave), - DAI_CLOCK(bclk, 1920000, slave), - DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, 20, 3, 3)) diff --git a/topology/test-passthrough-24bit-48k-src-ssp2.m4 b/topology/test-passthrough-24bit-48k-src-ssp2.m4 deleted file mode 100644 index 61c06e1..0000000 --- a/topology/test-passthrough-24bit-48k-src-ssp2.m4 +++ /dev/null @@ -1,51 +0,0 @@ -# -# Topology for pass through pipeline -# - -# Include topology builder -include(`local.m4') -include(`build.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Baytrail DSP configuration -include(`dsps/byt.m4') - -# -# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! -# - -# DAI Link Name -define(`TEST_DAI_LINK_NAME', `Baytrail Audio') - -# -# Define the pipeline -# -# PCM0 ---> volume ---> SSP2 -# - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s24le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -# Use DMAC 0 channel 1 for PCM audio playback data - -PIPELINE_PCM_DAI_ADD(sof/pipe-passthrough-src-playback.m4, - 1, 0, 2, s24le, - 48, 1000, 0, 0, 0, 1, - SSP, 2, s24le, 2) - -# -# BE configurations - overrides config in ACPI if present -# -# Clocks masters wrt codec -# -# 24bit I2S using 25bit sample conatiner on SSP2 -# -DAI_CONFIG(SSP, 2, TEST_DAI_LINK_NAME, I2S, 24, - DAI_CLOCK(mclk, 19200000, slave), - DAI_CLOCK(bclk, 2400000, slave), - DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, 25, 3, 3)) diff --git a/topology/test-passthrough-24bit-48k-ssp2-SSP2-Codec.m4 b/topology/test-passthrough-24bit-48k-ssp2-SSP2-Codec.m4 deleted file mode 100644 index 7e481d3..0000000 --- a/topology/test-passthrough-24bit-48k-ssp2-SSP2-Codec.m4 +++ /dev/null @@ -1,51 +0,0 @@ -# -# Topology for pass through pipeline -# - -# Include topology builder -include(`local.m4') -include(`build.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Baytrail DSP configuration -include(`dsps/byt.m4') - -# -# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! -# - -# DAI Link Name -define(`TEST_DAI_LINK_NAME', `SSP2-Codec') - -# -# Define the pipeline -# -# PCM0 ----> SSP2 -# - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s24le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -# Use DMAC 0 channel 1 for PCM audio playback data - -PIPELINE_PCM_DAI_ADD(sof/pipe-passthrough-playback.m4, - 1, 0, 2, s24le, - 48, 1000, 0, 0, 0, 1, - SSP, 2, s24le, 2) - -# -# BE configurations - overrides config in ACPI if present -# -# Clocks masters wrt codec -# -# 24bit I2S using 25bit sample conatiner on SSP2 -# -DAI_CONFIG(SSP, 2, TEST_DAI_LINK_NAME, I2S, 24, - DAI_CLOCK(mclk, 19200000, slave), - DAI_CLOCK(bclk, 2400000, slave), - DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, 25, 3, 3)) diff --git a/topology/test-passthrough-24bit-48k-ssp2-nocodec.m4 b/topology/test-passthrough-24bit-48k-ssp2-nocodec.m4 deleted file mode 100644 index e0a3d4f..0000000 --- a/topology/test-passthrough-24bit-48k-ssp2-nocodec.m4 +++ /dev/null @@ -1,51 +0,0 @@ -# -# Topology for pass through pipeline -# - -# Include topology builder -include(`local.m4') -include(`build.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Baytrail DSP configuration -include(`dsps/byt.m4') - -# -# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! -# - -# DAI Link Name -define(`TEST_DAI_LINK_NAME', `NoCodec') - -# -# Define the pipeline -# -# PCM0 ----> SSP2 -# - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s24le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -# Use DMAC 0 channel 1 for PCM audio playback data - -PIPELINE_PCM_DAI_ADD(sof/pipe-passthrough-playback.m4, - 1, 0, 2, s24le, - 48, 1000, 0, 0, 0, 1, - SSP, 2, s24le, 2) - -# -# BE configurations - overrides config in ACPI if present -# -# Clocks masters wrt codec -# -# 24bit I2S using 25bit sample conatiner on SSP2 -# -DAI_CONFIG(SSP, 2, TEST_DAI_LINK_NAME, I2S, 24, - DAI_CLOCK(mclk, 19200000, slave), - DAI_CLOCK(bclk, 2400000, slave), - DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, 25, 3, 3)) diff --git a/topology/test-passthrough-24bit-48k-ssp2.m4 b/topology/test-passthrough-24bit-48k-ssp2.m4 deleted file mode 100644 index ca3261d..0000000 --- a/topology/test-passthrough-24bit-48k-ssp2.m4 +++ /dev/null @@ -1,51 +0,0 @@ -# -# Topology for pass through pipeline -# - -# Include topology builder -include(`local.m4') -include(`build.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Baytrail DSP configuration -include(`dsps/byt.m4') - -# -# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! -# - -# DAI Link Name -define(`TEST_DAI_LINK_NAME', `Baytrail Audio') - -# -# Define the pipeline -# -# PCM0 ----> SSP2 -# - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s24le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -# Use DMAC 0 channel 1 for PCM audio playback data - -PIPELINE_PCM_DAI_ADD(sof/pipe-passthrough-playback.m4, - 1, 0, 2, s24le, - 48, 1000, 0, 0, 0, 1, - SSP, 2, s24le, 2) - -# -# BE configurations - overrides config in ACPI if present -# -# Clocks masters wrt codec -# -# 24bit I2S using 25bit sample conatiner on SSP2 -# -DAI_CONFIG(SSP, 2, TEST_DAI_LINK_NAME, I2S, 24, - DAI_CLOCK(mclk, 19200000, slave), - DAI_CLOCK(bclk, 2400000, slave), - DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, 25, 3, 3)) diff --git a/topology/test-passthrough-24bit-48k-vol-ssp2.m4 b/topology/test-passthrough-24bit-48k-vol-ssp2.m4 deleted file mode 100644 index 89775a7..0000000 --- a/topology/test-passthrough-24bit-48k-vol-ssp2.m4 +++ /dev/null @@ -1,83 +0,0 @@ -# -# Topology for pass through pipeline -# - -# Include topology builder -include(`local.m4') -include(`build.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Baytrail DSP configuration -include(`dsps/byt.m4') - -# -# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! -# - -# DAI Link Name -define(`TEST_DAI_LINK_NAME', `Baytrail Audio') - -# -# Define the pipeline -# -# PCM0 <---> volume <---> SSP2 -# - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s24le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -# Use DMAC 0 channel 1 for PCM audio playback data - -PIPELINE_PCM_DAI_ADD(sof/pipe-passthrough-vol-playback.m4, - 1, 0, 2, s24le, - 48, 1000, 0, 0, 0, 1, - SSP, 2, s24le, 2) - -# Low Latency capture pipeline 2 on PCM 0 using max 2 channels of s24le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -# Use DMAC 0 channel 1 for PCM audio playback data - -PIPELINE_PCM_DAI_ADD(sof/pipe-passthrough-vol-capture.m4, - 2, 0, 2, s24le, - 48, 1000, 0, 0, 0, 1, - SSP, 2, s24le, 2) - -# -# DAI configuration -# -# SSP port 2 is our only pipeline DAI -# - -# playback DAI is SSP2 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, 2, - PIPELINE_SOURCE_1, 2, s24le, - 48, 1000, 0, 0) - -# capture DAI is SSP2 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 2, SSP, 2, - PIPELINE_SINK_2, 2, s24le, - 48, 1000, 0, 0) - -# PCM Passthrough -PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) - -# -# BE configurations - overrides config in ACPI if present -# -# Clocks masters wrt codec -# -# 24bit I2S using 25bit sample conatiner on SSP2 -# -DAI_CONFIG(SSP, 2, TEST_DAI_LINK_NAME, I2S, 24, - DAI_CLOCK(mclk, 19200000, slave), - DAI_CLOCK(bclk, 2400000, slave), - DAI_CLOCK(fsync, 48000, slave), - DAI_TDM(2, 25, 3, 3)) diff --git a/topology/test/Makefile.am b/topology/test/Makefile.am new file mode 100644 index 0000000..7da075d --- /dev/null +++ b/topology/test/Makefile.am @@ -0,0 +1,20 @@ + +# +# Dependencies +# + +DEPS = \ + ../dsps/*.m4 \ + ../common/*.m4 \ + ../m4/*.m4 \ + ../sof/*.m4 + +# Uncomment the following line if you want to debug conf files +.PRECIOUS: %.conf + +all : *.m4 ${DEPS} + ./tplg-build.sh + +clean: + rm -f *.conf + rm -f *.tplg diff --git a/topology/test/test-src-ssp.m4 b/topology/test/test-src-ssp.m4 new file mode 100644 index 0000000..318bd74 --- /dev/null +++ b/topology/test/test-src-ssp.m4 @@ -0,0 +1,90 @@ +# +# Topology for pass through pipeline +# + +# Include topology builder +include(`local.m4') +include(`build.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Baytrail DSP configuration +include(`dsps/byt.m4') + +# +# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! +# +# TEST_PIPE_NAME - Pipe name +# TEST_DAI_LINK_NAME - BE DAI link name e.g. "NoCodec" +# TEST_SSP_PORT - SSP port number e.g. 2 +# TEST_SSP_FORMAT - SSP data format e.g s16le +# TEST_PIPE_FORMAT - Pipeline format e.g. s16le +# TEST_SSP_BCLK - SSP BCLK in Hz +# TEST_SSP_PHY_BITS - SSP physical slot size +# TEST_SSP_DATA_BITS - SSP data slot size +# + +# +# Define the pipeline +# +# PCM0 <--> SRC <--> SSP TEST_SSP_PORT +# + +# Passthrough playback pipeline 1 on PCM 0 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data + +PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-playback.m4, + 1, 0, 2, TEST_PIPE_FORMAT, + 48, 1000, 0, 0, 0, 1, + SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2) + + +# Passthrough playback pipeline 2 on PCM 0 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data + +PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-capture.m4, + 2, 0, 2, TEST_PIPE_FORMAT, + 48, 1000, 0, 0, 0, 1, + SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2) + +# +# DAI configuration +# +# SSP port TEST_SSP_PORT is our only pipeline DAI +# + +# playback DAI is SSP TEST_SSP_PORT 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, TEST_SSP_PORT, + PIPELINE_SOURCE_1, 2, TEST_SSP_FORMAT, + 48, 1000, 0, 0) + +# capture DAI is SSP TEST_SSP_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4, + 2, SSP, TEST_SSP_PORT, + PIPELINE_SINK_2, 2, TEST_SSP_FORMAT, + 48, 1000, 0, 0) + +# PCM Passthrough +PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) + +# +# BE configurations - overrides config in ACPI if present +# +# Clocks masters wrt codec +# +# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT +# +DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, I2S, TEST_SSP_DATA_BITS, + DAI_CLOCK(mclk, 19200000, slave), + DAI_CLOCK(bclk, TEST_SSP_BCLK, slave), + DAI_CLOCK(fsync, 48000, slave), + DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3)) diff --git a/topology/test/test-ssp.m4 b/topology/test/test-ssp.m4 new file mode 100644 index 0000000..42f3876 --- /dev/null +++ b/topology/test/test-ssp.m4 @@ -0,0 +1,90 @@ +# +# Topology for pass through pipeline +# + +# Include topology builder +include(`local.m4') +include(`build.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Baytrail DSP configuration +include(`dsps/byt.m4') + +# +# Machine Specific Config - !! MUST BE SET TO MATCH TEST MACHINE DRIVER !! +# +# TEST_PIPE_NAME - Pipe name +# TEST_DAI_LINK_NAME - BE DAI link name e.g. "NoCodec" +# TEST_SSP_PORT - SSP port number e.g. 2 +# TEST_SSP_FORMAT - SSP data format e.g s16le +# TEST_PIPE_FORMAT - Pipeline format e.g. s16le +# TEST_SSP_BCLK - SSP BCLK in Hz +# TEST_SSP_PHY_BITS - SSP physical slot size +# TEST_SSP_DATA_BITS - SSP data slot size +# + +# +# Define the pipeline +# +# PCM0 <---> SSP TEST_SSP_PORT +# + +# Passthrough playback pipeline 1 on PCM 0 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data + +PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-playback.m4, + 1, 0, 2, TEST_PIPE_FORMAT, + 48, 1000, 0, 0, 0, 1, + SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2) + + +# Passthrough playback pipeline 2 on PCM 0 using max 2 channels of s24le. +# Schedule 48 frames per 1000us deadline on core 0 with priority 0 +# Use DMAC 0 channel 1 for PCM audio playback data + +PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-capture.m4, + 2, 0, 2, TEST_PIPE_FORMAT, + 48, 1000, 0, 0, 0, 1, + SSP, TEST_SSP_PORT, TEST_SSP_FORMAT, 2) + +# +# DAI configuration +# +# SSP port TEST_SSP_PORT is our only pipeline DAI +# + +# playback DAI is SSP TEST_SSP_PORT 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, TEST_SSP_PORT, + PIPELINE_SOURCE_1, 2, TEST_SSP_FORMAT, + 48, 1000, 0, 0) + +# capture DAI is SSP TEST_SSP_PORT using 2 periods +# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4, + 2, SSP, TEST_SSP_PORT, + PIPELINE_SINK_2, 2, TEST_SSP_FORMAT, + 48, 1000, 0, 0) + +# PCM Passthrough +PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) + +# +# BE configurations - overrides config in ACPI if present +# +# Clocks masters wrt codec +# +# TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT +# +DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, I2S, TEST_SSP_DATA_BITS, + DAI_CLOCK(mclk, 19200000, slave), + DAI_CLOCK(bclk, TEST_SSP_BCLK, slave), + DAI_CLOCK(fsync, 48000, slave), + DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3)) diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh new file mode 100755 index 0000000..2aa751f --- /dev/null +++ b/topology/test/tplg-build.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +# Utility script to pre-process and compile topology sources into topology test +# binaries. Currently supports simple PCM <-> component <-> SSP style tests +# using simple_test() + +# fail immediately on any errors +set -e + +# M4 preprocessor flags +M4_FLAGS="-I ../ -I ../m4" + +# Simple component test cases +# can be used on components with 1 sink and 1 source. +SIMPLE_TESTS=(test-ssp test-src-ssp) + +# process m4 simple tests - +# simple_test(name, pipe_name, be_name, format, dai_id, dai_format, dai_phy_bits, dai_data_bits dai_bclk) +# 1) name - test filename suffix +# 2) pipe_name - test component pipeline filename in sof/ +# 3) be_name - BE DAI link name in machine driver, used for matching +# 4) format - PCM sample format +# 5) dai_id - SSP port number +# 6) dai_format - SSP sample format +# 7) dai_phy_bits - SSP physical number of BLKCs per slot/channel +# 8) dai_data_bits - SSP number of valid daat bits per slot/channel +# 9) dai_bclk - SSP BCLK in HZ +# +function simple_test { + for i in ${SIMPLE_TESTS[@]} + do + TFILE="$i$5-$4-48k-$1" + echo "M4 pre-processing test $i -> ${TFILE}" + m4 ${M4_FLAGS} \ + -DTEST_PIPE_NAME="$2" \ + -DTEST_DAI_LINK_NAME="$3" \ + -DTEST_SSP_PORT=$5 \ + -DTEST_SSP_FORMAT=$6 \ + -DTEST_PIPE_FORMAT=$4 \ + -DTEST_SSP_BCLK=$9 \ + -DTEST_SSP_PHY_BITS=$7 \ + -DTEST_SSP_DATA_BITS=$8 \ + $i.m4 > ${TFILE}.conf + echo "Compiling test $i -> ${TFILE}.tplg" + alsatplg -v 1 -c ${TFILE}.conf -o ${TFILE}.tplg + done +} + +# Pre-process the simple tests +simple_test nocodec passthrough "NoCodec" s16le 2 s16le 20 16 1920000 +simple_test nocodec passthrough "NoCodec" s24le 2 s24le 25 24 2400000 +simple_test nocodec volume "NoCodec" s16le 2 s16le 20 16 1920000 +simple_test nocodec volume "NoCodec" s24le 2 s24le 25 24 2400000 +simple_test nocodec volume "NoCodec" s16le 2 s24le 25 24 2400000 + +simple_test codec passthrough "SSP2-Codec" s16le 2 s16le 20 16 1920000 +simple_test codec passthrough "SSP2-Codec" s24le 2 s24le 25 24 2400000 +simple_test codec volume "SSP2-Codec" s16le 2 s16le 20 16 1920000 +simple_test codec volume "SSP2-Codec" s24le 2 s24le 25 24 2400000 +simple_test codec volume "SSP2-Codec" s16le 2 s24le 25 24 2400000 + +simple_test baytrail passthrough "Baytrail Audio" s16le 2 s16le 20 16 1920000 +simple_test baytrail passthrough "Baytrail Audio" s24le 2 s24le 25 24 2400000 +simple_test baytrail volume "Baytrail Audio" s16le 2 s16le 20 16 1920000 +simple_test baytrail volume "Baytrail Audio" s24le 2 s24le 25 24 2400000 +simple_test baytrail volume "Baytrail Audio" s16le 2 s24le 25 24 2400000 + -- 2.14.1
1 0
0 0
[Sound-open-firmware] [PATCH] topology: fix 2 typos for capture pipeline
by Keyon Jie 13 Dec '17

13 Dec '17
1. Widget N_PCMC type should be "aif_in", not "aif_out". 2. Widget W_DAI_IN data should be "N_DAI_IN", not "N_DAI_OUT". Signed-off-by: Xiuli Pan <xiuli.pan(a)intel.com> Signed-off-by: Keyon Jie <yang.jie(a)linux.intel.com> --- topology/m4/local.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/topology/m4/local.m4 b/topology/m4/local.m4 index da20e1c..08425ed 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -131,7 +131,7 @@ define(`W_PCM_CAPTURE', `}' `SectionWidget."'N_PCMC`" {' ` index "'PIPELINE_ID`"' -` type "aif_out"' +` type "aif_in"' ` no_pm "true"' ` stream_name "'$1`"' ` data [' @@ -358,7 +358,7 @@ define(`W_DAI_IN', ` "'N_DAI_IN($2)`_data_w"' ` "'N_DAI_IN($2)`_data_w_comp"' ` "'N_DAI_IN($2)`_data_str"' -` "'N_DAI_OUT($2)`_data_comp_str"' +` "'N_DAI_IN($2)`_data_comp_str"' ` "'$7`"' ` ]' `}') -- 2.11.0
1 0
0 0
[Sound-open-firmware] [PATCH] volume: pass format change to downstream components.
by Pierre-Louis Bossart 13 Dec '17

13 Dec '17
The volume component can change the sink data format depending on sink component/pipeline topology configuration. This change is set locally, but not to the host params that are passed downstream. Fix this so that downstream components can check params match their topology configuration. Tested with test-passthrough-48k-vol-ssp2 and reef-byt-rt5651 topology files. Note that there are quite a few underflows likely added by recent changes, more work needed to identify what goes on. (first fix for prepare() from Liam, additional update for the params() case by Pierre) Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart(a)linux.intel.com> Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/audio/volume.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/audio/volume.c b/src/audio/volume.c index 5ae1cce..572c88e 100644 --- a/src/audio/volume.c +++ b/src/audio/volume.c @@ -408,8 +408,13 @@ static void volume_free(struct comp_dev *dev) */ static int volume_params(struct comp_dev *dev) { + struct comp_data *cd = comp_get_drvdata(dev); + trace_volume("par"); + /* rewrite params format for all downstream */ + dev->params.frame_fmt = cd->sink_format; + return 0; } @@ -656,6 +661,8 @@ static int volume_prepare(struct comp_dev *dev) comp_frame_bytes(sinkb->sink); break; } + /* rewrite params format for all downstream */ + dev->params.frame_fmt = cd->sink_format; dev->frame_bytes = cd->sink_period_bytes / dev->frames; -- 2.14.1
2 1
0 0
[Sound-open-firmware] [PATCH] Increase timeout of DMA trace work re-scheduling if local buffer is half full.
by yan.wang@linux.intel.com 12 Dec '17

12 Dec '17
From: Yan Wang <yan.wang(a)linux.intel.com> The timeout of work_reschedule_default() cannot be too short to finish work queue rescheduling. Otherwise, the work will be rescheduled wrong into the next timer loop. Signed-off-by: Yan Wang <yan.wang(a)linux.intel.com> --- src/lib/dma-trace.c | 2 +- src/platform/baytrail/include/platform/platform.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/dma-trace.c b/src/lib/dma-trace.c index 2a5b1a6..e61ac30 100644 --- a/src/lib/dma-trace.c +++ b/src/lib/dma-trace.c @@ -247,7 +247,7 @@ void dtrace_event(const char *e, uint32_t length) /* schedule copy now if buffer > 50% full */ if (trace_data->enabled && buffer->avail >= (DMA_TRACE_LOCAL_SIZE / 2)) - work_reschedule_default(&trace_data->dmat_work, 100); + work_reschedule_default(&trace_data->dmat_work, DMA_TRACE_NOW_US); } void dtrace_event_atomic(const char *e, uint32_t length) diff --git a/src/platform/baytrail/include/platform/platform.h b/src/platform/baytrail/include/platform/platform.h index 4d63f7b..4559288 100644 --- a/src/platform/baytrail/include/platform/platform.h +++ b/src/platform/baytrail/include/platform/platform.h @@ -82,6 +82,12 @@ struct reef; /* the interval of DMA trace copying */ #define DMA_TRACE_US 500000 +/* + * the interval of start DMA trace copying in special case like half fullness + * of local DMA trace buffer + */ +#define DMA_TRACE_NOW_US 5000 + /* DMAC used for trace DMA */ #define PLATFORM_TRACE_DMAC DMA_ID_DMAC0 -- 2.7.4
2 1
0 0
[Sound-open-firmware] [PATCH] byt-ipc: add msg back to empty_list for next use
by Keyon Jie 12 Dec '17

12 Dec '17
The msg pool will be used up as it was not added back to empty_list, here correct it. Signed-off-by: Keyon Jie <yang.jie(a)linux.intel.com> --- src/ipc/byt-ipc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ipc/byt-ipc.c b/src/ipc/byt-ipc.c index 8897bb9..6716cce 100644 --- a/src/ipc/byt-ipc.c +++ b/src/ipc/byt-ipc.c @@ -194,6 +194,9 @@ void ipc_platform_send_msg(struct ipc *ipc) shim_write(SHIM_IPCDL, msg->header); shim_write(SHIM_IPCDH, SHIM_IPCDH_BUSY); + /* add msg back to empty_list for next use */ + list_item_append(&msg->list, &ipc->empty_list); + out: spin_unlock_irq(&ipc->lock, flags); } -- 2.11.0
4 3
0 0
[Sound-open-firmware] [PATCH 1/6] topology: Add passthrough capture pipe
by Liam Girdwood 12 Dec '17

12 Dec '17
Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- topology/sof/pipe-passthrough-capture.m4 | 70 ++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 topology/sof/pipe-passthrough-capture.m4 diff --git a/topology/sof/pipe-passthrough-capture.m4 b/topology/sof/pipe-passthrough-capture.m4 new file mode 100644 index 0000000..2c2a495 --- /dev/null +++ b/topology/sof/pipe-passthrough-capture.m4 @@ -0,0 +1,70 @@ +# Capture Passthrough Pipeline and PCM +# +# Pipeline Endpoints for connection are :- +# +# host PCM_C <-- B0 <-- sink DAI0 + +# Include topology builder +include(`local.m4') + + +# +# Components and Buffers +# + +# Host "Passthrough Capture" PCM uses pipeline DMAC and channel +# with 0 sink and 2 source periods +W_PCM_CAPTURE(Passthrough Capture, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 0, 2, 2) + +# Capture Buffers +W_BUFFER(0, COMP_BUFFER_SIZE(2, + COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES)) + +# +# DAI definitions +# +W_DAI_IN(DAI_TYPE, DAI_INDEX, DAI_FORMAT, 0, 2, 2, dai0c_plat_conf) + +# +# DAI pipeline - always use 0 for DAIs +# +W_PIPELINE(N_DAI_IN, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHEDULE_CORE, 0, pipe_dai_schedule_plat) + +# +# Pipeline Graph +# +# host PCM_C <-- B0 <-- sink DAI0 + +SectionGraph."pipe-pass-capture-PIPELINE_ID" { + index STR(PIPELINE_ID) + + lines [ + dapm(Passthrough Capture PCM_ID, N_PCMC) + dapm(N_PCMC, N_BUFFER(0)) + ] +} + +# +# Pipeline Source and Sinks +# +indir(`define', concat(`PIPELINE_SINK_', PIPELINE_ID), N_BUFFER(0)) +indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Capture PCM_ID) + +# +# PCM Configuration +# + +SectionPCMCapabilities.STR(Passthrough Capture PCM_ID) { + + formats "S32_LE,S24_LE,S16_LE" + 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" +} -- 2.14.1
1 5
0 0
[Sound-open-firmware] Reef, Minnowboard Max or Asus T100
by Chun-ta Lin 11 Dec '17

11 Dec '17
Hello SOF Gurus, This is Peter from ChromeOS@Google. I'm interested in the project and is trying to reproduce/ understanding from the main page <https://www.alsa-project.org/main/index.php/Firmware>. I noticed that in the instruction, the topic is reef w/ 4.8 kernel version. Since I'm quite a newbie in this area, wondering from a learning perspective, what would be recommended hardware for this purpose ? Will it be a bit more complicated to build / debug it with Reef (like kernel need to sign after build), or ASUS T100 (an Windows platform). Looking forward for reply, itsPeter
4 8
0 0
[Sound-open-firmware] [PATCH] dai: prepare does not need to bzero buffers.
by Liam Girdwood 11 Dec '17

11 Dec '17
Already done by pipeline, but prepare still needs to write back. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/audio/dai.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/audio/dai.c b/src/audio/dai.c index cc61e83..2fbfc5f 100644 --- a/src/audio/dai.c +++ b/src/audio/dai.c @@ -442,15 +442,14 @@ static int dai_prepare(struct comp_dev *dev) return -EINVAL; } - /* writeback buffer contents from cache */ + /* initialise buffers */ if (dev->params.direction == SOF_IPC_STREAM_PLAYBACK) { + + /* write back buffer contents from cache for playback */ dma_buffer = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - /* fill playback periods with silence */ - bzero(dma_buffer->r_ptr, dma_buffer->avail); - - dcache_writeback_region(dma_buffer->r_ptr, dma_buffer->avail); + dcache_writeback_region(dma_buffer->addr, dma_buffer->size); } /* dma reconfig not required if XRUN handling */ -- 2.14.1
2 5
0 0
[Sound-open-firmware] [PATCH] dai: fix dma pointer init for passthrough pipelines.
by Liam Girdwood 11 Dec '17

11 Dec '17
Replace the r_ptr == w_ptr check as it was racy on the completion of the host DMA preload. Better to check using the source component type. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/audio/dai.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/audio/dai.c b/src/audio/dai.c index 1afbc87..c50a274 100644 --- a/src/audio/dai.c +++ b/src/audio/dai.c @@ -492,27 +492,34 @@ static int dai_reset(struct comp_dev *dev) return 0; } -/* the configuration of the upstream pipeline is unknown - * to the DAI so we have to check that the r_ptr != w_ptr for the - * DAI DMA buffer. This is not required for capture as the pipeline is - * run after the first period has been copied (i.e. r_ptr != w_ptr). +/* The playback source pipeline must be advanced by one period so that it + * does not write to the period that DMA is reading. The configuration of the + * upstream pipeline is unknown to the DAI but we can check if the source buffer + * is shared with another DMA engine (which preloads the buffer by one period) + * and only advance the write pointer when source component is not another + * DMA engine. */ static void dai_pointer_init(struct comp_dev *dev) { struct comp_buffer *dma_buffer; struct dai_data *dd = comp_get_drvdata(dev); - /* advance w/r pointer by one period if equal at stream start */ + /* not reuquired for capture streams */ if (dev->params.direction == SOF_IPC_STREAM_PLAYBACK) { dma_buffer = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - if (dma_buffer->w_ptr != dma_buffer->r_ptr) - return; - - /* advance source pipeline w_ptr by one period - * this places pipeline w_ptr in period before DAI r_ptr */ - comp_update_buffer_produce(dma_buffer, dd->period_bytes); + switch (dma_buffer->source->comp.type) { + case SOF_COMP_HOST: + case SOF_COMP_SG_HOST: + /* buffer is preloaded and advanced by host DMA engine */ + break; + default: + /* advance source pipeline w_ptr by one period + * this places pipeline w_ptr in period before DAI r_ptr */ + comp_update_buffer_produce(dma_buffer, dd->period_bytes); + break; + } } } -- 2.14.1
1 0
0 0
[Sound-open-firmware] [PATCH] ipc: remove deprecated intel-ipc.h
by Liam Girdwood 10 Dec '17

10 Dec '17
Deprecated old ABI no longer used so can be removed. Signed-off-by: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> --- src/include/uapi/intel-ipc.h | 619 ------------------------------------------- 1 file changed, 619 deletions(-) delete mode 100644 src/include/uapi/intel-ipc.h diff --git a/src/include/uapi/intel-ipc.h b/src/include/uapi/intel-ipc.h deleted file mode 100644 index a0d4c80..0000000 --- a/src/include/uapi/intel-ipc.h +++ /dev/null @@ -1,619 +0,0 @@ -/* - * Copyright (c) 2016, Intel Corporation - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the Intel Corporation nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * Author: Liam Girdwood <liam.r.girdwood(a)linux.intel.com> - * Keyon Jie <yang.jie(a)linux.intel.com> - */ - -#ifndef __INCLUDE_UAPI_INTEL_IPC_H__ -#define __INCLUDE_UAPI_INTEL_IPC_H__ - -#include <stdint.h> -#include <reef/mailbox.h> - -#define IPC_INTEL_NO_CHANNELS 4 -#define IPC_INTEL_MAX_DX_REGIONS 14 -#define IPC_INTEL_DX_CONTEXT_SIZE (640 * 1024) -#define IPC_INTEL_CHANNELS_ALL 0xffffffff - -#define IPC_INTEL_FW_LOG_CONFIG_DWORDS 12 -#define IPC_INTEL_GLOBAL_LOG 15 - -#define IPC_INTEL_PAGE_SIZE 4096 -#define IPC_INTEL_PAGE_TABLE_SIZE IPC_INTEL_PAGE_SIZE - -/** - * Upfront defined maximum message size that is - * expected by the in/out communication pipes in FW. - */ -#define IPC_INTEL_IPC_MAX_PAYLOAD_SIZE 400 -#define IPC_INTEL_MAX_INFO_SIZE 64 -#define IPC_INTEL_BUILD_HASH_LENGTH 40 -#define IPC_INTEL_IPC_MAX_SHORT_PARAMETER_SIZE 500 - -/* Global Message - Generic */ -#define IPC_INTEL_GLB_TYPE_SHIFT 24 -#define IPC_INTEL_GLB_TYPE_MASK (0x1f << IPC_INTEL_GLB_TYPE_SHIFT) -#define IPC_INTEL_GLB_TYPE(x) ((x) << IPC_INTEL_GLB_TYPE_SHIFT) - -/* Global Message - Reply */ -#define IPC_INTEL_GLB_REPLY_SHIFT 0 -#define IPC_INTEL_GLB_REPLY_MASK (0x1f << IPC_INTEL_GLB_REPLY_SHIFT) -#define IPC_INTEL_GLB_REPLY_TYPE(x) ((x) << IPC_INTEL_GLB_REPLY_TYPE_SHIFT) - -/* Stream Message - Generic */ -#define IPC_INTEL_STR_TYPE_SHIFT 20 -#define IPC_INTEL_STR_TYPE_MASK (0xf << IPC_INTEL_STR_TYPE_SHIFT) -#define IPC_INTEL_STR_TYPE(x) ((x) << IPC_INTEL_STR_TYPE_SHIFT) -#define IPC_INTEL_STR_ID_SHIFT 16 -#define IPC_INTEL_STR_ID_MASK (0xf << IPC_INTEL_STR_ID_SHIFT) -#define IPC_INTEL_STR_ID(x) ((x) << IPC_INTEL_STR_ID_SHIFT) - -/* Stream Message - Reply */ -#define IPC_INTEL_STR_REPLY_SHIFT 0 -#define IPC_INTEL_STR_REPLY_MASK (0x1f << IPC_INTEL_STR_REPLY_SHIFT) - -/* Stream Stage Message - Generic */ -#define IPC_INTEL_STG_TYPE_SHIFT 12 -#define IPC_INTEL_STG_TYPE_MASK (0xf << IPC_INTEL_STG_TYPE_SHIFT) -#define IPC_INTEL_STG_TYPE(x) ((x) << IPC_INTEL_STG_TYPE_SHIFT) -#define IPC_INTEL_STG_ID_SHIFT 10 -#define IPC_INTEL_STG_ID_MASK (0x3 << IPC_INTEL_STG_ID_SHIFT) -#define IPC_INTEL_STG_ID(x) ((x) << IPC_INTEL_STG_ID_SHIFT) - -/* Stream Stage Message - Reply */ -#define IPC_INTEL_STG_REPLY_SHIFT 0 -#define IPC_INTEL_STG_REPLY_MASK (0x1f << IPC_INTEL_STG_REPLY_SHIFT) - -/* Debug Log Message - Generic */ -#define IPC_INTEL_LOG_OP_SHIFT 20 -#define IPC_INTEL_LOG_OP_MASK (0xf << IPC_INTEL_LOG_OP_SHIFT) -#define IPC_INTEL_LOG_OP_TYPE(x) ((x) << IPC_INTEL_LOG_OP_SHIFT) -#define IPC_INTEL_LOG_ID_SHIFT 16 -#define IPC_INTEL_LOG_ID_MASK (0xf << IPC_INTEL_LOG_ID_SHIFT) -#define IPC_INTEL_LOG_ID(x) ((x) << IPC_INTEL_LOG_ID_SHIFT) - -/* Module Message */ -#define IPC_INTEL_MODULE_OPERATION_SHIFT 20 -#define IPC_INTEL_MODULE_OPERATION_MASK (0xf << IPC_INTEL_MODULE_OPERATION_SHIFT) -#define IPC_INTEL_MODULE_OPERATION(x) ((x) << IPC_INTEL_MODULE_OPERATION_SHIFT) - -#define IPC_INTEL_MODULE_ID_SHIFT 16 -#define IPC_INTEL_MODULE_ID_MASK (0xf << IPC_INTEL_MODULE_ID_SHIFT) -#define IPC_INTEL_MODULE_ID(x) ((x) << IPC_INTEL_MODULE_ID_SHIFT) - -/* IPC message timeout (msecs) */ -#define IPC_INTEL_TIMEOUT_MSECS 300 - - -/* Firmware Ready Message */ -#define IPC_INTEL_FW_READY (0x1 << 29) -#define IPC_INTL_STATUS_MASK (0x3 << 30) - -#define IPC_EMPTY_LIST_SIZE 8 -#define IPC_MAX_STREAMS 4 - -#define IPC_INTEL_INVALID_STREAM 0xffffffff - -/* dma trace action */ -#define IPC_INTEL_TRACE_ACTION_SHIFT 0 -#define IPC_INTEL_TRACE_ACTION_MASK (0xf << 0) -/* dma trace burst size */ -#define IPC_INTEL_TRACE_BSIZE_SHIFT 0x4 -#define IPC_INTEL_TRACE_BSIZE_MASK (0xfff << 4) - -/* Global Message - Types and Replies */ -enum ipc_glb_type { - IPC_INTEL_GLB_GET_FW_VERSION = 0, /* Retrieves firmware version */ - IPC_INTEL_GLB_PERFORMANCE_MONITOR = 1, /* Performance monitoring actions */ - IPC_INTEL_GLB_ALLOCATE_STREAM = 3, /* Request to allocate new stream */ - IPC_INTEL_GLB_FREE_STREAM = 4, /* Request to free stream */ - IPC_INTEL_GLB_GET_FW_CAPABILITIES = 5, /* Retrieves firmware capabilities */ - IPC_INTEL_GLB_STREAM_MESSAGE = 6, /* Message directed to stream or its stages */ - /* Request to store firmware context during D0->D3 transition */ - IPC_INTEL_GLB_REQUEST_DUMP = 7, - /* Request to restore firmware context during D3->D0 transition */ - IPC_INTEL_GLB_RESTORE_CONTEXT = 8, - IPC_INTEL_GLB_GET_DEVICE_FORMATS = 9, /* Set device format */ - IPC_INTEL_GLB_SET_DEVICE_FORMATS = 10, /* Get device format */ - IPC_INTEL_GLB_SHORT_REPLY = 11, - IPC_INTEL_GLB_ENTER_DX_STATE = 12, - IPC_INTEL_GLB_GET_MIXER_STREAM_INFO = 13, /* Request mixer stream params */ - IPC_INTEL_GLB_DEBUG_LOG_MESSAGE = 14, /* Message to or from the debug logger. */ - IPC_INTEL_GLB_MODULE_OPERATION = 15, /* Message to loadable fw module */ - IPC_INTEL_GLB_REQUEST_TRANSFER = 16, /* < Request Transfer for host */ - IPC_INTEL_GLB_ENABLE_LOOPBACK = 17, /* Set device format */ - IPC_INTEL_GLB_DISABLE_LOOPBACK = 18, /* Get device format */ - IPC_INTEL_GLB_MAX_IPC_MESSAGE_TYPE /* Maximum message number */ -}; - -enum ipc_glb_reply { - IPC_INTEL_GLB_REPLY_SUCCESS = 0, /* The operation was successful. */ - IPC_INTEL_GLB_REPLY_ERROR_INVALID_PARAM = 1, /* Invalid parameter was passed. */ - IPC_INTEL_GLB_REPLY_UNKNOWN_MESSAGE_TYPE = 2, /* Uknown message type was resceived. */ - IPC_INTEL_GLB_REPLY_OUT_OF_RESOURCES = 3, /* No resources to satisfy the request. */ - IPC_INTEL_GLB_REPLY_BUSY = 4, /* The system or resource is busy. */ - IPC_INTEL_GLB_REPLY_PENDING = 5, /* The action was scheduled for processing. */ - IPC_INTEL_GLB_REPLY_FAILURE = 6, /* Critical error happened. */ - IPC_INTEL_GLB_REPLY_INVALID_REQUEST = 7, /* Request can not be completed. */ - IPC_INTEL_GLB_REPLY_STAGE_UNINITIALIZED = 8, /* Processing stage was uninitialized. */ - IPC_INTEL_GLB_REPLY_NOT_FOUND = 9, /* Required resource can not be found. */ - IPC_INTEL_GLB_REPLY_SOURCE_NOT_STARTED = 10, /* Source was not started. */ -}; - -enum ipc_module_operation { - IPC_INTEL_MODULE_NOTIFICATION = 0, - IPC_INTEL_MODULE_ENABLE = 1, - IPC_INTEL_MODULE_DISABLE = 2, - IPC_INTEL_MODULE_GET_PARAMETER = 3, - IPC_INTEL_MODULE_SET_PARAMETER = 4, - IPC_INTEL_MODULE_GET_INFO = 5, - IPC_INTEL_MODULE_MAX_MESSAGE -}; - -/* Stream Message - Types */ -enum ipc_str_operation { - IPC_INTEL_STR_RESET = 0, - IPC_INTEL_STR_PAUSE = 1, - IPC_INTEL_STR_RESUME = 2, - IPC_INTEL_STR_STAGE_MESSAGE = 3, - IPC_INTEL_STR_NOTIFICATION = 4, - IPC_INTEL_STR_STOP = 5, - IPC_INTEL_STR_MAX_MESSAGE -}; - -/* Stream Stage Message Types */ -enum ipc_stg_operation { - IPC_INTEL_STG_GET_VOLUME = 0, - IPC_INTEL_STG_SET_VOLUME, - IPC_INTEL_STG_SET_WRITE_POSITION, - IPC_INTEL_STG_SET_FX_ENABLE, - IPC_INTEL_STG_SET_FX_DISABLE, - IPC_INTEL_STG_SET_FX_GET_PARAM, - IPC_INTEL_STG_SET_FX_SET_PARAM, - IPC_INTEL_STG_SET_FX_GET_INFO, - IPC_INTEL_STG_MUTE_LOOPBACK, - IPC_INTEL_STG_MAX_MESSAGE -}; - -/* Stream Stage Message Types For Notification*/ -enum ipc_stg_operation_notify { - IPC_POSITION_CHANGED = 0, - IPC_INTEL_STG_GLITCH, - IPC_INTEL_STG_MAX_NOTIFY -}; - -enum ipc_glitch_type { - IPC_GLITCH_UNDERRUN = 1, - IPC_GLITCH_DECODER_ERROR, - IPC_GLITCH_DOUBLED_WRITE_POS, - IPC_GLITCH_MAX -}; - -/* Debug Control */ -enum ipc_debug_operation { - IPC_DEBUG_ENABLE_LOG = 0, - IPC_DEBUG_DISABLE_LOG = 1, - IPC_DEBUG_REQUEST_LOG_DUMP = 2, - IPC_DEBUG_NOTIFY_LOG_DUMP = 3, - IPC_DEBUG_MAX_DEBUG_LOG -}; - -/* Stream Allocate Path ID */ -enum ipc_intel_stream_path_id { - IPC_INTEL_STREAM_PATH_SSP0_OUT = 0, - IPC_INTEL_STREAM_PATH_SSP0_IN = 1, - IPC_INTEL_STREAM_PATH_MAX_PATH_ID = 2, -}; - -/* Stream Allocate Stream Type */ -enum ipc_intel_stream_type { - IPC_INTEL_STREAM_TYPE_RENDER = 0, - IPC_INTEL_STREAM_TYPE_SYSTEM = 1, - IPC_INTEL_STREAM_TYPE_CAPTURE = 2, - IPC_INTEL_STREAM_TYPE_LOOPBACK = 3, - IPC_INTEL_STREAM_TYPE_MAX_STREAM_TYPE = 4, -}; - -/* Stream Allocate Stream Format */ -enum ipc_intel_stream_format { - IPC_INTEL_STREAM_FORMAT_PCM_FORMAT = 0, - IPC_INTEL_STREAM_FORMAT_MP3_FORMAT = 1, - IPC_INTEL_STREAM_FORMAT_AAC_FORMAT = 2, - IPC_INTEL_STREAM_FORMAT_MAX_FORMAT_ID = 3, -}; - -/* Device ID */ -enum ipc_intel_device_id { - IPC_INTEL_DEVICE_SSP_0 = 0, - IPC_INTEL_DEVICE_SSP_1 = 1, - IPC_INTEL_DEVICE_SSP_2 = 2, -}; - -/* Device Master Clock Frequency */ -enum ipc_intel_device_mclk { - IPC_INTEL_DEVICE_MCLK_OFF = 0, - IPC_INTEL_DEVICE_MCLK_FREQ_6_MHZ = 1, - IPC_INTEL_DEVICE_MCLK_FREQ_12_MHZ = 2, - IPC_INTEL_DEVICE_MCLK_FREQ_24_MHZ = 3, -}; - -/* Device Clock Master */ -enum ipc_intel_device_mode { - IPC_INTEL_DEVICE_CLOCK_SLAVE = 0, - IPC_INTEL_DEVICE_CLOCK_MASTER = 1, - IPC_INTEL_DEVICE_TDM_CLOCK_MASTER = 2, -}; - -/* DX Power State */ -enum ipc_intel_dx_state { - IPC_INTEL_DX_STATE_D0 = 0, - IPC_INTEL_DX_STATE_D1 = 1, - IPC_INTEL_DX_STATE_D3 = 3, - IPC_INTEL_DX_STATE_MAX = 3, -}; - -/* Audio stream stage IDs */ -enum ipc_intel_fx_stage_id { - IPC_INTEL_STAGE_ID_WAVES = 0, - IPC_INTEL_STAGE_ID_DTS = 1, - IPC_INTEL_STAGE_ID_DOLBY = 2, - IPC_INTEL_STAGE_ID_BOOST = 3, - IPC_INTEL_STAGE_ID_MAX_FX_ID -}; - -/* DX State Type */ -enum ipc_intel_dx_type { - IPC_INTEL_DX_TYPE_FW_IMAGE = 0, - IPC_INTEL_DX_TYPE_MEMORY_DUMP = 1 -}; - -/* Volume Curve Type*/ -enum ipc_intel_volume_curve { - IPC_INTEL_VOLUME_CURVE_NONE = 0, - IPC_INTEL_VOLUME_CURVE_FADE = 1 -}; - -/* Sample ordering */ -enum ipc_intel_interleaving { - IPC_INTEL_INTERLEAVING_PER_CHANNEL = 0, - IPC_INTEL_INTERLEAVING_PER_SAMPLE = 1, -}; - -/* Channel indices */ -enum ipc_intel_channel_index { - IPC_INTEL_CHANNEL_LEFT = 0, - IPC_INTEL_CHANNEL_CENTER = 1, - IPC_INTEL_CHANNEL_RIGHT = 2, - IPC_INTEL_CHANNEL_LEFT_SURROUND = 3, - IPC_INTEL_CHANNEL_CENTER_SURROUND = 3, - IPC_INTEL_CHANNEL_RIGHT_SURROUND = 4, - IPC_INTEL_CHANNEL_LFE = 7, - IPC_INTEL_CHANNEL_INVALID = 0xF, -}; - -/* List of supported channel maps. */ -enum ipc_intel_channel_config { - IPC_INTEL_CHANNEL_CONFIG_MONO = 0, /* mono only. */ - IPC_INTEL_CHANNEL_CONFIG_STEREO = 1, /* L & R. */ - IPC_INTEL_CHANNEL_CONFIG_2_POINT_1 = 2, /* L, R & LFE; PCM only. */ - IPC_INTEL_CHANNEL_CONFIG_3_POINT_0 = 3, /* L, C & R; MP3 & AAC only. */ - IPC_INTEL_CHANNEL_CONFIG_3_POINT_1 = 4, /* L, C, R & LFE; PCM only. */ - IPC_INTEL_CHANNEL_CONFIG_QUATRO = 5, /* L, R, Ls & Rs; PCM only. */ - IPC_INTEL_CHANNEL_CONFIG_4_POINT_0 = 6, /* L, C, R & Cs; MP3 & AAC only. */ - IPC_INTEL_CHANNEL_CONFIG_5_POINT_0 = 7, /* L, C, R, Ls & Rs. */ - IPC_INTEL_CHANNEL_CONFIG_5_POINT_1 = 8, /* L, C, R, Ls, Rs & LFE. */ - IPC_INTEL_CHANNEL_CONFIG_DUAL_MONO = 9, /* One channel replicated in two. */ - IPC_INTEL_CHANNEL_CONFIG_INVALID, -}; - -/* List of supported bit depths. */ -enum ipc_intel_bitdepth { - IPC_INTEL_DEPTH_8BIT = 8, - IPC_INTEL_DEPTH_16BIT = 16, - IPC_INTEL_DEPTH_24BIT = 24, /* Default. */ - IPC_INTEL_DEPTH_32BIT = 32, - IPC_INTEL_DEPTH_INVALID = 33, -}; - -enum ipc_intel_module_id { - IPC_INTEL_MODULE_BASE_FW = 0x0, - IPC_INTEL_MODULE_MP3 = 0x1, - IPC_INTEL_MODULE_AAC_5_1 = 0x2, - IPC_INTEL_MODULE_AAC_2_0 = 0x3, - IPC_INTEL_MODULE_SRC = 0x4, - IPC_INTEL_MODULE_WAVES = 0x5, - IPC_INTEL_MODULE_DOLBY = 0x6, - IPC_INTEL_MODULE_BOOST = 0x7, - IPC_INTEL_MODULE_LPAL = 0x8, - IPC_INTEL_MODULE_DTS = 0x9, - IPC_INTEL_MODULE_PCM_CAPTURE = 0xA, - IPC_INTEL_MODULE_PCM_SYSTEM = 0xB, - IPC_INTEL_MODULE_PCM_REFERENCE = 0xC, - IPC_INTEL_MODULE_PCM = 0xD, - IPC_INTEL_MODULE_BLUETOOTH_RENDER_MODULE = 0xE, - IPC_INTEL_MODULE_BLUETOOTH_CAPTURE_MODULE = 0xF, - IPC_INTEL_MAX_MODULE_ID, -}; - -enum ipc_intel_performance_action { - IPC_INTEL_PERF_START = 0, - IPC_INTEL_PERF_STOP = 1, -}; - -enum ipc_intel_dma_trace_trigger { - IPC_DMA_TRACE_TRIGGER_STOP = 0, - IPC_DMA_TRACE_TRIGGER_START = 1, -}; - -struct ipc_intel_transfer_info { - uint32_t destination; /* destination address */ - uint32_t reverse:1; /* if 1 data flows from destination */ - uint32_t size:31; /* transfer size in bytes.*/ - uint16_t first_page_offset; /* offset to data in the first page. */ - uint8_t packed_pages; /* page addresses. Each occupies 20 bits */ -} __attribute__((packed)); - -struct ipc_intel_transfer_list { - uint32_t transfers_count; - struct ipc_intel_transfer_info transfers; -} __attribute__((packed)); - -struct ipc_intel_transfer_parameter { - uint32_t parameter_id; - uint32_t data_size; - union { - uint8_t data[1]; - struct ipc_intel_transfer_list transfer_list; - }; -} __attribute__((packed)); - -/* SST firmware module info */ -struct ipc_intel_module_info { - uint8_t name[IPC_INTEL_MAX_INFO_SIZE]; - uint8_t version[IPC_INTEL_MAX_INFO_SIZE]; -} __attribute__((packed)); - -/* Module entry point */ -struct ipc_intel_module_entry { - enum ipc_intel_module_id module_id; - uint32_t entry_point; -} __attribute__((packed)); - -/* Module map - alignement matches DSP */ -struct ipc_intel_module_map { - uint8_t module_entries_count; - struct ipc_intel_module_entry module_entries[1]; -} __attribute__((packed)); - -struct ipc_intel_memory_info { - uint32_t offset; - uint32_t size; -} __attribute__((packed)); - -struct ipc_intel_fx_enable { - struct ipc_intel_module_map module_map; - struct ipc_intel_memory_info persistent_mem; -} __attribute__((packed)); - -struct ipc_intel_ipc_module_config { - struct ipc_intel_module_map map; - struct ipc_intel_memory_info persistent_mem; - struct ipc_intel_memory_info scratch_mem; -} __attribute__((packed)); - -struct ipc_intel_get_fx_param { - uint32_t parameter_id; - uint32_t param_size; -} __attribute__((packed)); - -struct ipc_intel_perf_action { - uint32_t action; -} __attribute__((packed)); - -struct ipc_intel_perf_data { - uint64_t timestamp; - uint64_t cycles; - uint64_t datatime; -} __attribute__((packed)); - -/* FW version */ -struct ipc_intel_ipc_fw_version { - uint8_t build; - uint8_t minor; - uint8_t major; - uint8_t type; - uint8_t fw_build_hash[IPC_INTEL_BUILD_HASH_LENGTH]; - uint32_t fw_log_providers_hash; -} __attribute__((packed)); - -/* Stream ring info */ -struct ipc_intel_ipc_stream_ring { - uint32_t ring_pt_address; - uint32_t num_pages; - uint32_t ring_size; - uint32_t ring_offset; - uint32_t ring_first_pfn; -} __attribute__((packed)); - -/* Debug Dump Log Enable Request */ -struct ipc_intel_ipc_debug_log_enable_req { - struct ipc_intel_ipc_stream_ring ringinfo; - uint32_t config[IPC_INTEL_FW_LOG_CONFIG_DWORDS]; -} __attribute__((packed)); - -/* Debug Dump Log Reply */ -struct ipc_intel_ipc_debug_log_reply { - uint32_t log_buffer_begining; - uint32_t log_buffer_size; -} __attribute__((packed)); - -/* Debug Dump Log position update */ -struct sst_hsw_ipc_debug_log_pos_update { - uint32_t log_size; -} __attribute__((packed)); - -/* Stream glitch position */ -struct ipc_intel_ipc_stream_glitch_position { - uint32_t glitch_type; - uint32_t present_pos; - uint32_t write_pos; -} __attribute__((packed)); - -/* Stream get position */ -struct ipc_intel_ipc_stream_get_position { - uint32_t position; - uint32_t fw_cycle_count; -} __attribute__((packed)); - -/* Stream set position */ -struct ipc_intel_ipc_stream_set_position { - uint32_t position; - uint32_t end_of_buffer; -} __attribute__((packed)); - -/* Stream Free Request */ -struct ipc_intel_ipc_stream_free_req { - uint8_t stream_id; - uint8_t reserved[3]; -} __attribute__((packed)); - -/* Set Volume Request */ -struct ipc_intel_ipc_volume_req { - uint32_t channel; - uint32_t target_volume; - uint64_t curve_duration; - uint32_t curve_type; -} __attribute__((packed)); - -/* Device Configuration Request */ -struct ipc_intel_ipc_device_config_req { - uint32_t ssp_interface; - uint32_t clock_frequency; - uint32_t mode; - uint16_t clock_divider; - uint8_t channels; - uint8_t reserved; -} __attribute__((packed)); - -/* Audio Data formats */ -struct ipc_intel_audio_data_format_ipc { - uint32_t frequency; - uint32_t bitdepth; - uint32_t map; - uint32_t config; - uint32_t style; - uint8_t ch_num; - uint8_t valid_bit; - uint32_t period_frames; -} __attribute__((packed)); - -/* Stream Allocate Request */ -struct ipc_intel_ipc_stream_alloc_req { - uint8_t path_id; - uint8_t stream_type; - uint8_t format_id; - uint8_t reserved; - struct ipc_intel_audio_data_format_ipc format; - struct ipc_intel_ipc_stream_ring ringinfo; - struct ipc_intel_module_map map; - struct ipc_intel_memory_info persistent_mem; - struct ipc_intel_memory_info scratch_mem; - uint32_t number_of_notifications; -} __attribute__((packed)); - -/* Stream Allocate Reply */ -struct ipc_intel_ipc_stream_alloc_reply { - uint32_t stream_hw_id; - uint32_t mixer_hw_id; // returns rate ???? - uint32_t read_position_register_address; - uint32_t presentation_position_register_address; - uint32_t peak_meter_register_address[IPC_INTEL_NO_CHANNELS]; - uint32_t volume_register_address[IPC_INTEL_NO_CHANNELS]; -} __attribute__((packed)); - -/* Get Mixer Stream Info */ -struct ipc_intel_ipc_stream_info_reply { - uint32_t mixer_hw_id; - uint32_t peak_meter_register_address[IPC_INTEL_NO_CHANNELS]; - uint32_t volume_register_address[IPC_INTEL_NO_CHANNELS]; -} __attribute__((packed)); - -/* DX State Request */ -struct ipc_intel_ipc_dx_req { - uint8_t state; - uint8_t reserved[3]; -} __attribute__((packed)); - -/* DX State Reply Memory Info Item */ -struct ipc_intel_ipc_dx_memory_item { - uint32_t offset; - uint32_t size; - uint32_t source; -} __attribute__((packed)); - -/* DX State Reply */ -struct ipc_intel_ipc_dx_reply { - uint32_t entries_no; - struct ipc_intel_ipc_dx_memory_item mem_info[IPC_INTEL_MAX_DX_REGIONS]; -} __attribute__((packed)); - - -/* FW info */ -struct fw_info { - uint8_t name[5]; - uint8_t date[11]; - uint8_t time[8]; -} __attribute__((packed)); - -/* Firmware Ready */ -#define IPC_INTEL_FW_RDY_RSVD 32 - -struct sst_intel_ipc_fw_ready { - uint32_t inbox_offset; - uint32_t outbox_offset; - uint32_t inbox_size; - uint32_t outbox_size; - uint32_t fw_info_size; - union { - uint8_t rsvd[IPC_INTEL_FW_RDY_RSVD]; - struct fw_info info; - }; -} __attribute__((packed)); - -/* Stream data */ -struct sst_intel_ipc_stream_vol { - uint32_t peak; - uint32_t vol; -} __attribute__((packed)); - -struct sst_intel_ipc_stream_data { - uint32_t read_posn; - uint64_t presentation_posn; - struct sst_intel_ipc_stream_vol vol[IPC_INTEL_NO_CHANNELS]; -} __attribute__((packed)); -#endif -- 2.14.1
1 3
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • Older →

HyperKitty Powered by HyperKitty version 1.3.8.