-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drivers: DAI: Intel: DMIC: Program start symmetrically for PDMx #86308
base: main
Are you sure you want to change the base?
Drivers: DAI: Intel: DMIC: Program start symmetrically for PDMx #86308
Conversation
01a30f6
to
9b87c0a
Compare
I rebased this patch and dropped commit for spinlock set move. A SOF PR test for this patch runs now in thesofproject/sof#9859 . |
This change is assumed to fix the random corruption of 4ch capture for PDM1 channels 3-4 in PTL platform. There are no solid facts behind this change but assumption that PDMx controllers are not in sync if the start sequence for PDM1 is further away from PDM0. The PDM0 internal state may be different from PDM1 The single for loop to handle the CIC and FIR start sequence is split into two for loops to handle same registers update tasks symmetrically for all stereo PDM controllers. E.g. two PDMs for four microphones. First loop programs the CIC_CONTROL and MIC_CONTROL registers of the PDMx controllers. These features belong to the CIC block in DMIC IP. Second loop programs the FIR_CONTROL registers of the PDMx controllers. In a stress test of 100 times repeated commands: arecord -Dhw:0,6 -fS32_LE -r48000 -c4 -d 10 dmic_test_1.wav; \ sleep 0.5; \ arecord -Dhw:0,6 -fS32_LE -r48000 -c4 -d 10 dmic_test_2.wav; \ sleep 1 The corruption occurrence with xt-clang build was e.g. 87/200 fails in one of wav files giving 43.5% occurrence. The test was done with Zephyr commit fe29c40 ("llext: add inspection API test suite"). In a gcc build the occurrence of corruption is lower, around 6% but it is seen that the channels 3-4 pdm1 are swapping randomly. With this fix the corruption occurred zero times in xt-clang and gcc builds with same 100 repeats. Signed-off-by: Seppo Ingalsuo <[email protected]>
9b87c0a
to
326def7
Compare
I dropped the cAVS patch. The issue is more difficult to repeat than the issue with PTL. I'm using this Octave script for stress testing the issue.
|
With the failing version, with xt-clang, the trimmed output looks like this. The -132.2 dB levels are from disconnected microphones in DUT for channels 2 and 4. In the end there is 43.5% failures.
With gcc build, there is channels swapping happening. It can be seen with channels 3-4 levels . The disconnected level of -73 dB is due to different version of equalizer for gcc build. In the end 5.5% are failed. The channels swaps are not counted in the script.
|
I lost PTL device while stress testing this patch with xt-clang build. The gcc build test completed for 100 loops without corruptions and channels swaps.
|
The PTL xt-clang build of this patch passed 500 loops without corruption or channels swap.
|
This PR contains proposed improvements to ACE and cAVS DMIC start sequence to avoid possible PDMx controllers out-of-sync start.