Repository navigation
DMIC: Support capture from different microphones for DAI 0 and 1 - #1432
Conversation
|
@keyonjie Can you please test this feature add for issue #1412. I've set this as [RFC][Do not merge] because I haven't completed all tests. I've also found one bug. The bug in overlapping capture is such that if new capture uses less microphones than ongoing capture, the ongoing capture gets an error because the filter engine part to feed them date gets stopped. I need to improve the logic of dmic_start() function to be aware of shared decimator blocks. Capture from e.g. 4ch FIFO A and 2 ch FIFO B should work with this if the capture tasks do not overlap. |
There was a problem hiding this comment.
Seppo, something like this?
swap[i] = (dmic_prm[0]->pdm[i].enable_mic_b || dmic_prm[1]->pdm[i].enable_mic_b) && !cnt;
There was a problem hiding this comment.
Yes, it's tricky but I'm leaning towards your proposal. I need to test these mono microphone scenarios to see which one is right. The FIR processes mono signal in left channel slot so right channel mono must be swapped to left channel. The swap is common for FIFO A and B paths so need to fail a conflicting request from topology.
There was a problem hiding this comment.
I did this but I'm not able to test mono capture (created a mono dmic topology for it). The arecord -c 1 attempt fails in kernel driver before any request arrives to firmware. Could the new mux component convert captured mono to double-mono in a test topology to work around the apparent SOF ASoC limitation?
But since we do not have mono use case requirements I think it's safe to keep this as open.
bea8320 to
0f04b7a
Compare
|
I just updated this PR. This version survives my overlapping captures test, so there's no bugs known at the moment. |
can you please update the title? it sounds not a RFC and DNM any more. |
There was a problem hiding this comment.
Can we replace 4 with define?
There was a problem hiding this comment.
OK, it belongs then to dmic.h where the registers details are defined.
There was a problem hiding this comment.
It would leave the stereo and swap arrays processing incomplete and add complexity & code size. I'd keep it as is since it's in most platforms just two iterations.
There was a problem hiding this comment.
Yep will be in dmic.h.
There was a problem hiding this comment.
Functionally doesn't change anything, but better to check for ret < 0 for the error sake.
There was a problem hiding this comment.
OK, it's not increasing code size to do so.
0f04b7a to
221bac3
Compare
|
I pushed an update after surviving my first tests. I'm continuing testing with variations of topology (correct and intentionally faulty ones) and will update this PR if I find issues. |
|
Test topology "sof-apl-dmic-a2ch-b4ch.tplg" is a duplicate of other. I need to fix it to test such configuration. New PR coming... |
221bac3 to
bb33436
Compare
|
The wrong topology is now updated. I completed OK the tests with the topologies that this PR added. |
jajanusz
left a comment
There was a problem hiding this comment.
LGTM, but I'd preffer to have it in 2 commits, where 1 is adding new feature to FW and another is adding topologies that use it (if it's possible).
|
@jajanusz I'll do the update, it's fast to do. |
This patch allows to configure the two DMIC DAIs for different used microphones, e.g. DAI 0 for 4ch and DAI 1 for 2ch capture. The common decimator core is programmed for combined max. request and the FIFOs are configured to match the desired microphones. In case of not a possible configuration an error is returned. The patch also cleans up the magic value of four that was used in determining IPM bit fields setting. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The example and test topologies demonstrate new non-symmetrical microphones/channels setup for capture via FIFOs A and B. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
bb33436 to
89f947f
Compare
This patch allows to configure the two DMIC DAIs for different
used microphones, e.g. DAI 0 for 4ch and DAI 1 for 2ch capture.
The common decimator core is programmed for combined max. request
and the FIFOs are configured to match the desired microphones. In
case of not a possible configuration an error is returned.
Signed-off-by: Seppo Ingalsuo seppo.ingalsuo@linux.intel.com