Skip to content

[BUG][TGL]Arecord0,0 sound wav files is not smooth. #3092

Closed

Description

@sinahuang

Describe the bug
Arecord0,0 sound wav files is not smooth.

To Reproduce
1.Boot up system
2.aplay -Dhw:0,0 -f s32_le -c 2 -r 48000 sine_48k_32bit_10s_stereo_l5_r2.wav -d 5 & arecord -Dhw:0,0 -f s32_le -c 4 -r 48000 record.wav -d 5
3.Check the arecord files via audacity.

record files.zip
sine_48k_32bit_10s_stereo_l5_r2.zip

Reproduce rate
5/5

Expected result
Arecord0,0 sound wav files is not smooth.

Actual result
Arecord0,0 sound wav files is not smooth.
2

11

Environment
Kernel:https://github.com/thesofproject/linux/commits/topic/sof-dev (commit: 1b2f260)

FW:
https://github.com/thesofproject/sof/tree/releases/tgl/v7.0-rc5 commit: 1dd07a8

TPLG:sof-tgl-max98373-rt5682.tplg
Platform:Chromebook with codec 98373 in I2S mode.

dmesg24.log
sof_trace24.log

Activity

  1. added
    bugSomething isn't working as expected
    TGLApplies to Tiger Lake
    I2SApplies to I2S bus for codec connection
    on Jun 24, 2020
  2. jajanusz commented on Jun 24, 2020

    @jajanusz
    Contributor

    What if you revert all topology changes?
    These : 462acfc
    b36dabe

  3. jajanusz commented on Jun 24, 2020

    @jajanusz
    Contributor

    Or just checkout to e35e91d and use defconfig (not chrome)

  4. sinahuang commented on Jun 24, 2020

    @sinahuang
    Author

    Error also can be seen on tgl-006-drop-stable .

    0062

    006

    2.zip

  5. bkokoszx commented on Jun 24, 2020

    @bkokoszx
    Collaborator

    @sinahuang
    Yours attached tgl-006-drop-stable waves looks correct. We capture current and voltage data from codec and they can be "less smooth".

    On tgl-007-drop-stable (#3092 (comment)), we can see small glithes:
    85505527-1faf9c80-b621-11ea-8a9e-6e371055a310
    which do not exist in tgl-006.

    Can you retest this branch considering @jajanusz comments?

  6. YvonneYang2 commented on Jun 28, 2020

    @YvonneYang2

    Tested fw and tplg with latest tgl-007-stable(1dd07a8) + reverted 462acfc and b36dabe, issue can still be reproduced.
    007 wav file : 007.zip
    image

    and tested tgl-006-stable branch again
    006 wav file: 006.zip
    image

  7. YvonneYang2 commented on Jun 30, 2020

    @YvonneYang2

    Tested it with nocodec kernel and tplg with same test recipe as #3092 (comment) , issue cannot be reproduced.

    wav file: nocodec.zip
    image

  8. bkokoszx commented on Jun 30, 2020

    @bkokoszx
    Collaborator

    @YvonneYang2
    If we cannot reproduce this issue with nocodec topology, it looks rather like some issue codec (wrong configuration?).
    @keyonjie
    What do you think?

  9. YvonneYang2 commented on Jun 30, 2020

    @YvonneYang2

    @YvonneYang2
    If we cannot reproduce this issue with nocodec topology, it looks rather like some issue codec (wrong configuration?).
    @keyonjie
    What do you think?

    The test recipe is same as #3092 (comment), and kconfig please use https://github.com/thesofproject/kconfig/blob/master/kconfig-sof-nocodec.sh .
    And the tplg please select sof-smart-amplifier-nocodec.tplg and rename to sof-tgl-nocodec.tplg.

  10. bkokoszx commented on Jun 30, 2020

    @bkokoszx
    Collaborator

    @YvonneYang2
    Do you have speakers connected to the setup? Can you try to verify the correctness of the streaming wave?

  11. ClarexZhou commented on Jul 1, 2020

    @ClarexZhou

    @YvonneYang2
    Do you have speakers connected to the setup? Can you try to verify the correctness of the streaming wave?

    Yes, speakers are connected. Yvonne used device is the same one which was used by Sina when reporting this bug. But speakers are changed since old speakers are broken.

  12. bkokoszx commented on Jul 1, 2020

    @bkokoszx
    Collaborator

    @ClarexZhou
    Ok, but are you able to hear stream from speakers properly?

  13. ClarexZhou commented on Jul 2, 2020

    @ClarexZhou

    yes, max98373 speakers can output successfully. but has issue L speaker output R channel audio, R speaker output Left channel audio. This issue is tracking in thesofproject/linux#2045 (comment)

  14. bkokoszx commented on Jul 2, 2020

    @bkokoszx
    Collaborator

    @ClarexZhou @YvonneYang2
    Can you try to reproduce this bug with following change?

    diff --git a/tools/topology/sof-smart-amplifier.m4 b/tools/topology/sof-smart-amplifier.m4
    index 593b5afa2..07aa8b568 100644
    --- a/tools/topology/sof-smart-amplifier.m4
    +++ b/tools/topology/sof-smart-amplifier.m4
    @@ -222,7 +222,7 @@ DAI_CONFIG(ALH, eval(SMART_ALH_INDEX + 1), eval(SMART_BE_ID + 1), SMART_ALH_CAPT
     #SSP SSP_INDEX (ID: SMART_BE_ID)
     DAI_CONFIG(SSP, SMART_SSP_INDEX, SMART_BE_ID, SMART_SSP_NAME,
            SSP_CONFIG(DSP_B, SSP_CLOCK(mclk, SSP_MCLK, codec_mclk_in),
    -                     SSP_CLOCK(bclk, 9600000, codec_slave),
    +                     SSP_CLOCK(bclk, 12288000, codec_slave),
                          SSP_CLOCK(fsync, 48000, codec_slave),
                          SSP_TDM(8, 25, 15, 255),
                          SSP_CONFIG_DATA(SSP, SMART_SSP_INDEX, 24, 0, SMART_SSP_QUIRK)))

    With that change I got wave without glitches:
    image

  15. ClarexZhou commented on Jul 3, 2020

    @ClarexZhou

    @ClarexZhou @YvonneYang2
    Can you try to reproduce this bug with following change?

    diff --git a/tools/topology/sof-smart-amplifier.m4 b/tools/topology/sof-smart-amplifier.m4
    index 593b5afa2..07aa8b568 100644
    --- a/tools/topology/sof-smart-amplifier.m4
    +++ b/tools/topology/sof-smart-amplifier.m4
    @@ -222,7 +222,7 @@ DAI_CONFIG(ALH, eval(SMART_ALH_INDEX + 1), eval(SMART_BE_ID + 1), SMART_ALH_CAPT
     #SSP SSP_INDEX (ID: SMART_BE_ID)
     DAI_CONFIG(SSP, SMART_SSP_INDEX, SMART_BE_ID, SMART_SSP_NAME,
            SSP_CONFIG(DSP_B, SSP_CLOCK(mclk, SSP_MCLK, codec_mclk_in),
    -                     SSP_CLOCK(bclk, 9600000, codec_slave),
    +                     SSP_CLOCK(bclk, 12288000, codec_slave),
                          SSP_CLOCK(fsync, 48000, codec_slave),
                          SSP_TDM(8, 25, 15, 255),
                          SSP_CONFIG_DATA(SSP, SMART_SSP_INDEX, 24, 0, SMART_SSP_QUIRK)))

    With that change I got wave without glitches:
    image

    Verified, seems error not seen with tplg update.
    image
    image

    Attach 007 tplg error seen wav and current updated tplg error not seen wav in below
    wav.zip

  16. bkokoszx commented on Jul 3, 2020

    @bkokoszx
    Collaborator

    @keyonjie
    Do you remember the reason why we changed bclk from 9600000 to 12288000 before?

  17. keyonjie commented on Jul 3, 2020

    @keyonjie
    Contributor

    we change from 32/32 bit to 24/25 bit format, that's why we need change the bclk from 12.288M to 9.6M.

    Just checked the codec side, looks the codec expects pure 24bit (not 24bit in 25bit container), @ryans-lee can you confirm this?

  18. sathya-nujella commented on Jul 6, 2020

    @sathya-nujella
    Contributor
  19. bkokoszx commented on Jul 7, 2020

    @bkokoszx
    Collaborator

    @keyonjie
    I've changed only container from 25 to 24 (without bclk) and it did not help.

  20. keyonjie commented on Jul 8, 2020

    @keyonjie
    Contributor

    @keyonjie
    I've changed only container from 25 to 24 (without bclk) and it did not help.

    The reason why we set it to 25 rather than 24 is to avoid using MN divider. We have dependency between bclk and the container, you should change them together.

  21. plbossart commented on Jul 8, 2020

    @plbossart
    Member

    Can you clarify why a 12.288MHz bit clock is required? That's 8 channels of 32-bit data in each direction, do we really have such a configuration?

  22. bkokoszx commented on Jul 14, 2020

    @bkokoszx
    Collaborator

    @ClarexZhou I've updated PR #3142. Can you try to reproduce above issue with updated PR?

    @plbossart There is a codec requirement for bclk/fclk ratio, which should be equal to 256 when the number of channels is equal to 8.

  23. ClarexZhou commented on Jul 17, 2020

    @ClarexZhou

    PR #3142 can fix

  24. keqiaozhang commented on Nov 13, 2020

    @keqiaozhang
    Collaborator

    Verified this issue with tgl 1.0 fix branch https://github.com/bkokoszx/sof/tree/tgl-010-hot-fix-1-revert-97377c3 on TGL Chromebook/I2S mode, this issue is not reproduced.

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

Metadata

Metadata

Labels

I2SApplies to I2S bus for codec connectionP1Blocker bugs or important featuresTGLApplies to Tiger LakebugSomething isn't working as expected

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions