Skip to content
This repository was archived by the owner on Jan 17, 2019. It is now read-only.

Topology: Add DMIC capture pipeline with gain and high-pass filter#95

Merged
lgirdwood merged 1 commit intothesofproject:masterfrom
singalsu:tplg_add_iir_dmic_pipe
Oct 14, 2018
Merged

Topology: Add DMIC capture pipeline with gain and high-pass filter#95
lgirdwood merged 1 commit intothesofproject:masterfrom
singalsu:tplg_add_iir_dmic_pipe

Conversation

@singalsu
Copy link
Copy Markdown
Collaborator

@singalsu singalsu commented Oct 9, 2018

This patch adds topology sof-apl-eq-dmic to help testing acoustical
audio capture via DMIC or work as example for other machine drivers. The
capture format is set as four channels, S32_LE, 48 kHz. The IIR EQ is
a 2nd order Butterworth high-pass with cut-off frequency at 50 Hz to
suppress non-audible lowest frequencies. The EQ provides additional
+20 dB gain to avoid the recording to sound too silent.

The IIR EQ or additional FIR EQ instance can when needed provide other
form factor specific equalization.

Signed-off-by: Seppo Ingalsuo seppo.ingalsuo@linux.intel.com

@singalsu singalsu requested review from juimonen and lgirdwood October 9, 2018 12:15
Comment thread topology/sof-apl-eq-dmic.m4 Outdated
@@ -0,0 +1,75 @@
#
# Topology for generic Apollolake board with no codec.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this comment wrong ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it should be e.g. "Apollo Lake board with direct attach digital microphones array"

Comment thread topology/sof/pipe-eq-capture.m4 Outdated
# Controls
#

# 50 Hz 2nd order high-pass and +20 dB gain 09-Oct-2018
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, can we load this from file yet ? or alternatively include it as a M4 macro (from coefficient generator script) ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the "bytes" field in eqiir_priv can be a "file". So same bytes as now written to file should work. I think Seppo's octave script can write the binary file already.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of m4 is automatically generated by the EQ tool, function eq_tplg_write(). I just copy & pasted it into this place. It could be an include as well if you prefer. No editing need would avoid risk to manually corrupt the blob so maybe it would be better.

I don't know myself how the binary file would be set up but that should be possible too.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, you can just change the bytes = 0x12 etc to file = eq_response. The eq_response is a binary file containing the same bytes as now. When you compile the m4 with alsa_tplg you need to set environment variable ALSA_CONFIG_TPLG to point to the directory you have the binary response file.

This patch adds topology sof-apl-eq-dmic to help testing acoustical
audio capture via DMIC or work as example for other machine drivers. The
capture format is set as four channels, S32_LE, 48 kHz. The IIR EQ is
a 2nd order Butterworth high-pass with cut-off frequency at 50 Hz to
suppress non-audible lowest frequencies. The EQ provides additional
+20 dB gain to avoid the recording to sound too silent.

The IIR EQ or additional FIR EQ instance can when needed provide other
form factor specific equalization.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@singalsu singalsu force-pushed the tplg_add_iir_dmic_pipe branch from bc85f61 to 27281d7 Compare October 11, 2018 14:15
@singalsu
Copy link
Copy Markdown
Collaborator Author

@lgirdwood @juimonen I just pushed fix for this PR. I corrected the comment and moved the the filter coefficients into a separate included file. Those .m4 files are generated directly by EQ tool. I feel the text ASCII for coefficients is nicer than binary since it's possible to "decode" the header by looking the bytes value. I added also flat response coefficients for FIR and IIR so it's then easy to replace the response to flat by just altering the include statement.

If this approach looks OK I can update the playback topology to use the same coefficients for the default flat setup that's used there.

@lgirdwood lgirdwood merged commit 6efe3d4 into thesofproject:master Oct 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants