Skip to content

[BUG] [MTL] Playback clips captured from mock RTC AEC device is double speeded #8022

Closed

Description

@yongzhi1

Describe the bug

Playback the file captured from "device 27: DMIC0 RTC AEC" with CONFIG_GOOGLE_RTC_AUDIO_PROCESSING_MOCK=y, and hear the speed is doubled.

To Reproduce

Start spk playback:

aplay -Dhw:0,1 -c2 -r48000 -fS16_LE /home/LR.wav -vv

Start spk feedback capture:

arecord -Dhw:0,29 /tmp/tmp.wav -c2 -r48000 -fs32_le -vv

Start AEC capture:

arecord -Dhw:0,27 /tmp/mock_aec.wav -c4 -r48000 -fs32_le -vv -d20

Reproduction Rate
100%

Environment

  1. Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).

  2. Name of the topology file

  3. Name of the platform(s) on which the bug is observed.

    • Platform: {MTL/Rex}

Please also include the relevant sections from the firmware log and kernel log in the report (and attach the full logs for complete reference).

mtrace.txt
dmesg-mock-aec.txt
mock_aec.zip

Activity

  1. added
    bugSomething isn't working as expected
    MTLApplies to Meteor Lake platform
    on Aug 9, 2023
  2. lgirdwood commented on Aug 16, 2023

    @lgirdwood
    Member

    @yongzhi1 can you confirm if its SPK feedback or AEC that is double speed or both ?
    @mwasko @abonislawski fyi.

  3. yongzhi1 commented on Aug 16, 2023

    @yongzhi1
    ContributorAuthor

    Hi, @lgirdwood , to confirm, both spk playback and EchoRef ( spk loopback for capture) work normally w/o speed or glitch issue, thanks!

  4. abonislawski commented on Aug 21, 2023

    @abonislawski
    Member

    Please verify on newest chromeos, I cannot reproduce on main and 005

  5. RDharageswari commented on Aug 22, 2023

    @RDharageswari

    hi Adrian,
    i can repro the issue still on mtl-005

  6. serhiy-katsyuba-intel commented on Aug 28, 2023

    @serhiy-katsyuba-intel
    Contributor

    Looks like the problem is caused by wrong host-copier.27.capture output format configuration. It is configured to receive 2-channel audio on source and output 4-channel audio to host. See dmesg log:

    [  666.200835] sof-audio-pci-intel-mtl 0000:00:1f.3: Init input audio formats for host-copier.27.capture
    [  666.200836] sof-audio-pci-intel-mtl 0000:00:1f.3: Pin index #0: 48000Hz, 32bit (ch_map 0xffffff10 ch_cfg 1 interleaving_style 0 fmt_cfg 0x2002) buffer size 384
    [  666.200837] sof-audio-pci-intel-mtl 0000:00:1f.3: Output audio format for host-copier.27.capture
    [  666.200838] sof-audio-pci-intel-mtl 0000:00:1f.3: Pin index #0: 48000Hz, 32bit (ch_map 0xffff3210 ch_cfg 4 interleaving_style 0 fmt_cfg 0x2004) buffer size 768
    [  666.200839] sof-audio-pci-intel-mtl 0000:00:1f.3: copier host-copier.27.capture, IPC size is 84
    [  666.200839] sof-audio-pci-intel-mtl 0000:00:1f.3: COPIER (UUID: 9BA00C83-CA12-4A83-943C-1FA2E82F9DDA): No CPC match in the firmware file's manifest (ibs/obs: 384/768)
    [  666.217456] sof-audio-pci-intel-mtl 0000:00:1f.3: host-copier.27.capture: ibs / obs / cpc: 384 / 768 / 0
    

    Current version of copier does not support remapping of channels. So, basically, host-copier.27.capture just copy its input data to output DMA buffer and so host receives 2 times less data when expected.

    Is it a mistake that host-copier.27.capture is configured with 4-channel output instead of 2? Or is this intentional and for some reason 4 channels are required?

    cc: @ranj063.

  7. lgirdwood commented on Aug 30, 2023

    @lgirdwood
    Member

    @RDharageswari I'm assuming the 4 channel output is not needed by userspace here ?

  8. ranj063 commented on Aug 31, 2023

    @ranj063
    Collaborator

    @yongzhi1 @RDharageswari Do you still see this issue with #8101

  9. yongzhi1 commented on Aug 31, 2023

    @yongzhi1
    ContributorAuthor

    Hi, @ranj063 with #8101 and the mock module, the speed issue is still there when 4xch is enabled. The speed issue is not reproducible with 2xch DMIC (i.e. sof-mtl-max98357a-rt5682-ssp2-ssp0-2ch-pdm1). Thanks @serhiy-katsyuba-intel for the hint!!

  10. ranj063 commented on Sep 1, 2023

    @ranj063
    Collaborator

    @serhiy-katsyuba-intel the current aec pipeline in topology is missing support for 4ch capture. I am working with @yongzhi1 to fix this.

  11. yongzhi1 commented on Sep 6, 2023

    @yongzhi1
    ContributorAuthor

    With #8101, #8172 and thesofproject/linux#4550, the issue can be closed, thanks @ranj063 for the prompt support!!

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

Metadata

Metadata

Labels

Echo ReferenceApplies to echo referenceMTLApplies to Meteor Lake platformP1Blocker bugs or important featuresbugSomething 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