Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
yongzhi1 opened this issue Aug 9, 2023 · 10 comments
Closed
Assignees
Labels
bug Something isn't working as expected Echo Reference Applies to echo reference MTL Applies to Meteor Lake platform P1 Blocker bugs or important features

Comments

@yongzhi1
Copy link
Contributor

yongzhi1 commented Aug 9, 2023

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

@yongzhi1 yongzhi1 added bug Something isn't working as expected MTL Applies to Meteor Lake platform Echo Reference Applies to echo reference labels Aug 9, 2023
@lgirdwood
Copy link
Member

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

@yongzhi1
Copy link
Contributor Author

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

@mengdonglin mengdonglin added the P1 Blocker bugs or important features label Aug 21, 2023
@abonislawski
Copy link
Member

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

@RDharageswari
Copy link

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

@serhiy-katsyuba-intel
Copy link
Contributor

serhiy-katsyuba-intel commented Aug 28, 2023

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.

@lgirdwood
Copy link
Member

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

@ranj063
Copy link
Collaborator

ranj063 commented Aug 31, 2023

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

@yongzhi1
Copy link
Contributor Author

yongzhi1 commented Aug 31, 2023

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!!

@ranj063
Copy link
Collaborator

ranj063 commented Sep 1, 2023

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

@yongzhi1
Copy link
Contributor Author

yongzhi1 commented Sep 6, 2023

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

@yongzhi1 yongzhi1 closed this as completed Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected Echo Reference Applies to echo reference MTL Applies to Meteor Lake platform P1 Blocker bugs or important features
Projects
None yet
Development

No branches or pull requests

7 participants