Skip to content

[TGL][DSM] pop noise happens at the beginning of recording when playback is triggered first  #2054

Closed

Description

@keqiaozhang

Describe the bug
when testing DSM, there's a sharp pop noise at the beginning of recording, this issue only happens when playback is triggered first, delay for a few seconds then trigger capture, you will hear that pop noise. But this pop noise was not captured in the wav file. the waveform of 4 channels are pure, even at the beginning.
DSM

To Reproduce

  1. Enable loopback mode for DSM
    run:
    amp_enable.sh.txt

  2. Trigger playback on speaker:

aplay -Dhw:0,0 -f s32_le -c 2 -r 48000 sine_48k_32bit.wav & 
  1. Delay for a few seconds
sleep 2 
  1. Trigger capture on speaker
arecord -Dhw:0,0 -f s32_le -c 4 -r 48000 dsm.wav 

Reproduction Rate
10/10

Expected behavior
no pop noise.

Environment
Driver: fce7f93 + #1971 + https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?h=for-next&id=914f674bec6efe42f9d6b036850a618fd1698290
Firmware:
SOF branch: tgl-005-drop-stable Commit: 277a9717
TPLG: sof-tgl-max98373-rt5682.tplg

dsm_dmesg.txt
dsm-logger.txt

Activity

  1. added
    bugSomething isn't working
    TGLApplies to Tiger Lake platform
    ChromeRelated to Chrome integration
    Smart AmpSmart Amp or DSM (Dynamic Speaker Management)
    on Apr 26, 2020
  2. keyonjie commented on Apr 28, 2020

    @keyonjie

    This could be Max98373 configuration issue, as there is no change of the data(channel L/R) transmitting from the ASoC SSP to the codec (no noise in the captured file proved this), @sathya-nujella can Dhara help to check this with Maxim engineer, I can't assign this to Dhara as she is not in the SOF group, so assigning it to you.

  3. removed their assignment
    on Apr 28, 2020
  4. sathya-nujella commented on Apr 28, 2020

    @sathya-nujella

    Sure @keyonjie.

    I am not able to assign to Dhara. Not sure what is the issue. When I search for her ID in assignee field.. it does not show up.
    Can you please help why it is happening: this is her GH: https://github.com/RDharageswari

  5. keyonjie commented on Apr 28, 2020

    @keyonjie

    @sathya-nujella please ask Dhara to join the sof-developers team: https://github.com/orgs/thesofproject/people

    @lgirdwood do we need invitation for that?

  6. naveen-manohar commented on Apr 28, 2020

    @naveen-manohar
  7. RDharageswari commented on Apr 28, 2020

    @RDharageswari

    Thanks @naveen-manohar, i couldnt subscribe to the group.

  8. RDharageswari commented on Apr 29, 2020

    @RDharageswari

    was able to capture the register dump when the issue happened.
    exactly During the pop noise I see that the register 0x2024, has a value 0xd8 initially and changes to 0x98 later. Bit 6 & 7 corresponds to PCM_DATA_WIDTH[1:0] . [10 : 24-bit] & [11: 32 bit]. SSP1 on which the playback was ongoing was initially 32bit and when the capture started it changed to 24bit . Both pb & capture share the same I2S bus . this change can cause pop noise. Debugging WIP

  9. keyonjie commented on Apr 29, 2020

    @keyonjie

    good finding @RDharageswari .
    maybe worth to try setting to 24/25 bit in below snippet for a quick try:

    static int max98373_hw_params(struct snd_pcm_substream *substream,
    			      struct snd_pcm_hw_params *params)
    {
    	struct snd_soc_pcm_runtime *rtd = substream->private_data;
    	struct snd_soc_dai *codec_dai;
    	int j;
    
    	for_each_rtd_codec_dais(rtd, j, codec_dai) {
    		if (!strcmp(codec_dai->component->name, MAX_98373_DEV0_NAME)) {
    			/* DEV0 tdm slot configuration */
    -			snd_soc_dai_set_tdm_slot(codec_dai, 0x3, 0x1, 8, 32);
    +			snd_soc_dai_set_tdm_slot(codec_dai, 0x3, 0x1, 8, 25);
    
    		}
    		if (!strcmp(codec_dai->component->name, MAX_98373_DEV1_NAME)) {
    			/* DEV1 tdm slot configuration */
    -			snd_soc_dai_set_tdm_slot(codec_dai, 0xC, 0x2, 8, 32);
    +			snd_soc_dai_set_tdm_slot(codec_dai, 0xC, 0x2, 8, 25);
    
    		}
    	}
    	return 0;
    }
    
  10. RDharageswari commented on Apr 29, 2020

    @RDharageswari

    This worked for me.
    static int max98373_hw_params(struct snd_pcm_substream *substream,
    struct snd_pcm_hw_params *params)
    {
    struct snd_soc_pcm_runtime *rtd = substream->private_data;
    struct snd_soc_dai *codec_dai;
    int j;

    for_each_rtd_codec_dais(rtd, j, codec_dai) {
    	if (!strcmp(codec_dai->component->name, MAX_98373_DEV0_NAME)) {
    		/* DEV0 tdm slot configuration */
    
    •   	snd_soc_dai_set_tdm_slot(codec_dai, 0x3, 0x1, 8, 32);
      
    •   	snd_soc_dai_set_tdm_slot(codec_dai, 0x3, 0x1, 8, 24);
      
        }
        if (!strcmp(codec_dai->component->name, MAX_98373_DEV1_NAME)) {
        	/* DEV1 tdm slot configuration */
      
    •   	snd_soc_dai_set_tdm_slot(codec_dai, 0xC, 0x2, 8, 32);
      
    •   	snd_soc_dai_set_tdm_slot(codec_dai, 0xC, 0x2, 8, 24);
      
        }
      
      }
      return 0;
      }
  11. keyonjie commented on Apr 29, 2020

    @keyonjie

    um, seems the codec doesn't accept 25 bit slot_width, no sure if the unaligned with the FW(25 bit slot_width) side will introduce noise.

  12. RDharageswari commented on Jun 6, 2020

    @RDharageswari

    This patch fixes the issue:
    ebdfc36

  13. RDharageswari commented on Jun 6, 2020

    @RDharageswari
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

    ChromeRelated to Chrome integrationI2SP2Critical bugs or normal featuresSmart AmpSmart Amp or DSM (Dynamic Speaker Management)TGLApplies to Tiger Lake platformbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions