Skip to content

[BUG][APL][KD] Detection signal data a the beginning of drained data #2270

Closed

Description

@zrombel

Describe the bug
BUG found on APL platform in Keyword Detection test incorporating DMIC interface. Test plays 6 second wave file on dmic injector where 3 s is silent and 3 s contain sine signal. When Dummy component detects sine signal on DMIC interface it triggers KPB component to drain history buffer and continue playing realtime data. Recorded wave file should contain ~2.1 s of silence and 3 s of sine signal but at the begging of file there is a short sine signal of exactly 20 ms length (320 samples).

image

image

Topology

        +----------+   +------------------+
        |    OS    |-->|   AUDIO DEVICE   |-----------------------+
        +----------+   +------------------+                       |
                                                                  |
                   +-------------------------+                    |
        +--------+ | +---+   +-----+   +---+ |                    |
        |KD Dummy|<->|Buf|<->|ChSel|<->|Buf|<->+                  |
        +--------+ | +---+   +-----+   +---+ | |  pipe_cap        |
                   +-------------------------+ |                  |
                                               |                  |
                             +-----------------+                  |
        +--------------------|----------------------------------+ |
        |+----+  +------+  +---+  +---+  +---+  +---+  +------+ | |
        ||Host|<-|Buffer|<-|Kpb|<-|Buf|<-|Vol|<-|Buf|<-| DMIC |---+
        |+----+  +------+  +---+  +---+  +---+  +---+  +------+ |
        +-------------------------------------------------------+

To Reproduce
On APL platform run python test:
07_04_TestKdDmic16000Hz16b16b2ch with --playback-iterations > 100

Reproduction Rate
~1%

Environment

  1. SOF master branch hash 79d6ea6 and earlier
  2. Python tests master branch hash 5b92681e5d967d13f89b67cc11730b64fc465816

Logs
07_04_TestKdDmic16000Hz16b16b2ch_APL_KD_BUG.zip

Activity

  1. added
    bugSomething isn't working as expected
    APLApplies to Apollolake platform
    on Jan 9, 2020
  2. lgirdwood commented on Jan 9, 2020

    @lgirdwood
    Member

    @singalsu any inputs ?

  3. singalsu commented on Jan 9, 2020

    @singalsu
    Collaborator

    @lgirdwood DMIC starts with filters muted but there's possibility the FIFOs could contain old samples when started. I'll do some checks with my APL board.

  4. singalsu commented on Jan 9, 2020

    @singalsu
    Collaborator

    Also to be safe the KPB should reject any positive detections for the first 500 ms or so after start. As seen in HDA capture many codecs output some noise in the beginning.

  5. zrombel commented on Jan 10, 2020

    @zrombel
    Author

    @singalsu I was suspecting the same about DMIC containing some old data but in my opinion is not the issue. First of all detection is triggered in right moment - after 3s of playback, if there was some data in DMIC FIFO detection would happen at the very beginning of playback. Second I've modified test so the sine signal fade over time, but data at the beginning still have full amplitude just like data from detection moment. So i my opinion this is a short mismatch between realtime and drain data somewhere in KPB.

    image

  6. lgirdwood commented on Jan 10, 2020

    @lgirdwood
    Member

    @singalsu @zrombel are we sure we have cleared all buffers prior to DMIC trigger start ?
    @singalsu how big is the DMIC FIFO ? does it need cleared prior to start ?

  7. zrombel commented on Jan 10, 2020

    @zrombel
    Author

    @lgirdwood is there a way to explicitly clear buffers? This issue can be reproduced on first iteration, right after ADSP power on and in that case i thing that buffers are empty.

  8. lgirdwood commented on Jan 10, 2020

    @lgirdwood
    Member

    @zrombel pipeline should clear buffer before trigger start. If in doubt check with @tlauda

  9. mrajwa commented on Jan 27, 2020

    @mrajwa
    Contributor

    @zrombel, can you please retest with this patch #2329

    Thanks

  10. added this to the v1.5 milestone on Jan 28, 2020
  11. zrombel commented on Jan 29, 2020

    @zrombel
    Author

    PR #2329 does not fix this bug, Further more I found that this bug is also reproducible with SSP interface, so it's not only DMIC bug.

  12. mrajwa commented on Jan 29, 2020

    @mrajwa
    Contributor

    @zrombel, ok we know what happens. Can you in test change history_depth (the amount of data host requested from history buffer) from 2,1 seconds to 2 seconds? It looks like we have a delay on FW side and new data overwrite oldest data in history buffer.

  13. zrombel commented on Feb 3, 2020

    @zrombel
    Author

    After validating with PR #2343 on APL platform bug no longer can be found. PR #2343 is fixing it.

  14. lgirdwood commented on Feb 20, 2020

    @lgirdwood
    Member

    @mrajwa any update on the Prs ? Is this blocking on @lbetlej returning ?

  15. mrajwa commented on Feb 21, 2020

    @mrajwa
    Contributor

    @lgirdwood yes it's my responsibility, I will submit PR for soon.

  16. slawblauciak commented on Mar 31, 2020

    @slawblauciak
    Collaborator

    @mrajwa any updates on this issue?

  17. mrajwa commented on Apr 1, 2020

    @mrajwa
    Contributor

    @slawblauciak @zrombel the fix should be covered by this PR #2688

  18. mrajwa commented on Apr 7, 2020

    @mrajwa
    Contributor

    Problem no longer reproducible after PR #2688, therefore I am closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

APLApplies to Apollolake platformKeyword DetectionApplies to Keyword DetectionbugSomething isn't working as expected

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions