Skip to content

[BUG] DSM standalone Multicore Stream Stall #4101

Closed

Description

@zrombel

Describe the bug
In DSM test where DSM component is run on CORE 1 and rest of topology on default CORE 0 after triggering pipelines start, playback pipeline stops copying data. Test were performed to check if PR #4088 fixes issue #3947. Root cause seems to be different - error is caused by pipeline XRUN visible in attached trace_logs.

Topology

    +----------------------------------------------+
    | +------+   +---+   +- -+   +---+   +-------+ |
    | | Host |-->|Buf|-->|Dsm|-->|Buf|-->|SSP Dai|-------+
    | +------+   +---+   +---+   +---+   +-------+ |     |
    +------------------+   ^   +-------------------+     |
                       |   |   |                         |
                       | +---+ |                         |
                       | |Buf| |                         |
                       | +---+ |                         |
                       +---^---+                         |
    +----------------------|------------------------+    |
    | +------+   +---+   +-|--+   +---+   +-------+ |    |
    | | Host |<--|Buf|<--|Dmux|<--|Buf|<--|SSP Dai|<-----+
    | +------+   +---+   +----+   +---+   +-------+ |
    +-----------------------------------------------+

To Reproduce
Run Python test:
22_05_TestDsmMulticoreSsp48000Hz24b32b2ch or 22_05_TestDsmMulticoreSsp48000Hz32b32b2ch
with parameters:
--playback-iterations=100

Reproduction Rate
~2/100

Environment

  1. Name of the platform(s) on which the bug is observed.
    • Platform: TGL B0 RVP
  2. Firmware branch name and commit
    • Branch: main
    • Hash: 3500d0e
    • Config: defconfig + chromeconfig
    • Config: defconfig
  3. Python tests branch name and commit
    • Branch: master
    • Hash: 825533f4e0d3ff5e2425abb50e9785916d7d1044

Logs
22_05_TestDsmMulticoreSsp_StreamStall.zip

Activity

  1. added
    bugSomething isn't working as expected
    TGLApplies to Tiger Lake
    chromeChromebooks or ChromeOS
    on Apr 27, 2021
  2. added this to the v1.8 milestone on Apr 27, 2021
  3. keyonjie commented on Apr 30, 2021

    @keyonjie
    Contributor

    @zrombel do you mean PR #4088 is not enough to fix this? Can you help to do a quick check if PR #4089 help?

  4. keyonjie commented on Apr 30, 2021

    @keyonjie
    Contributor

    #4089 can't address this issue, I can reproduce this and have some clue about it, but need to debug it after May vacation.

  5. zrombel commented on Apr 30, 2021

    @zrombel
    Author

    Description updated, bug is also present in build with def_config only.

  6. lgirdwood commented on Apr 30, 2021

    @lgirdwood
    Member

    This is an asynchronous scheduling issue. We have everything running synchronously on core 0 and DSM asynchronously (wrt core 0 pipeline copy status).
    The fix is to make sure that

    1. DSM source/sink buffers are large enough to cope with scheduling differences.
    2. DSM should continue if reference buffer is empty- treat as 0s
    3. Demux should continue if reference buffer is full.
  7. zrombel commented on May 5, 2021

    @zrombel
    Author

    Just to share quick tests results:
    Unfortunately #4089 doesn't fix DSM multicore issue. Results look very similar as main branch results.
    Test info: Simple - 1 iteration, Stress 20 - 20 playback iterations, Stress 200 - 200 playback iterations

        sof_main_c2fe4ff10ba_defconfig sof_main_c2fe4ff10ba_chromeconfig sof_keyon_ll_37f11e33_defconfig sof_keyon_ll_37f11e33_chromeconfig
    22_00_TestDsmSsp48000Hz24b32b2ch Simple PASS PASS PASS PASS
      Stress 20 PASS PASS PASS PASS
      Stress 200 PASS Glitch 1/200 PASS Silent begginig 1/200
    22_00_TestDsmSsp48000Hz32b32b2ch Simple PASS PASS PASS PASS
      Stress 20 PASS PASS PASS PASS
      Stress 200 Glitch 1/200 PASS PASS PASS
    22_05_TestDsmMulticoreSsp48000Hz24b32b2ch Simple PASS PASS PASS PASS
      Stress 20 Glitch 4/20 Stream Stall Stream Stall Stream Stall
      Stress 200 Stream Stall Stream Stall Stream Stall Stream Stall
    22_05_TestDsmMulticoreSsp48000Hz32b32b2ch Simple PASS PASS PASS PASS
      Stress 20 Minor Glitch 1/20 Glitch 4/20 Stream Stall Stream Stall
      Stress 200 Stream Stall Stream Stall Stream Stall Stream Stall
  8. lgirdwood commented on May 5, 2021

    @lgirdwood
    Member

    @zrombel thanks for the valuable info. This looks like a fix for rc2 and TGL12 is needed. @keyonjie we need to fix this in topology to account for the async nature of the work running on core0 and core1 with respect to each other.

  9. keyonjie commented on May 6, 2021

    @keyonjie
    Contributor

    @lgirdwood @zrombel @slawblauciak I just root caused this today, will submit fix tomorrow.

  10. keyonjie commented on May 7, 2021

    @keyonjie
    Contributor

    @zrombel I just updated my PR #4089 which address the stream stall issue at my end, can you help to try it?

  11. zrombel commented on May 7, 2021

    @zrombel
    Author

    Hi @keyonjie unfortunately stress test shows that #4089 doesn't fix this bug and stream stall still occurs.
    Here are logs from the tests. Tests runs 20 playback iterations. Single core tests passes but in multicore tests pipelines stalls.
    I attached single and multicore tests logs for comparison.

    Keyon_ll_DSM_multicore_error.zip

  12. keyonjie commented on May 7, 2021

    @keyonjie
    Contributor

    Thanks @zrombel as talked this only happen when only the DSM component is put on core1 (and all other components of the pipeline in Core 0), we should add logic to invalidate buffers when the producer and consumer of it are run on different cores.

  13. lgirdwood commented on May 10, 2021

    @lgirdwood
    Member

    I'm moving this to v1.9 the DSM feature works when the DSM pipeline is on core 1 but not the DSM component. i.e. the synchronization between DSM as a standalone component and its source and sink buffers needs aligned.

  14. modified the milestones: v1.8, v1.9 on May 10, 2021
  15. changed the title [-][BUG] DSM Multicore Stream Stall[/-] [+][BUG] DSM standalone Multicore Stream Stall[/+] on May 10, 2021
  16. added
    P1Blocker bugs or important features
    and removed
    P3Low-impact bugs or features
    on May 11, 2021
  17. slawblauciak commented on May 11, 2021

    @slawblauciak
    Collaborator

    This is blocking the upcoming TGL release, bumping to P1.

  18. zrombel commented on May 11, 2021

    @zrombel
    Author

    This is fixed by #4089.

  19. lgirdwood commented on May 24, 2021

    @lgirdwood
    Member

    @zrombel @slawblauciak can we close now ?

  20. zrombel commented on May 24, 2021

    @zrombel
    Author

    Yes, closing.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fix confirmedFix for the issue has been found and verifiedP1Blocker bugs or important featuresTGLApplies to Tiger LakebugSomething isn't working as expectedchromeChromebooks or ChromeOSmulticoreIssues observed when not only core#0 is used.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions