Bug 216861

Summary: sound disappearance on Acer Swift 3 SF314-59-78UR after update to 5.10.157
Product: Drivers Reporter: Sergey (zagagyka)
Component: Sound(ALSA)Assignee: platform_x86_64 (platform_x86_64)
Status: NEW ---    
Severity: normal CC: bp, broonie, carnil, dpalffy, perex, tiwai
Priority: P1    
Hardware: Intel   
OS: Linux   
URL: https://bugzilla.altlinux.org/44690
Kernel Version: 5.10.157 Subsystem:
Regression: Yes Bisected commit-id:
Attachments: pulseaudio.log
dmesg.log

Description Sergey 2022-12-29 10:07:51 UTC
Created attachment 303497 [details]
pulseaudio.log

Sudden sound disappearance was reported for some laptops, e.g.

Acer Swift 3 SF314-59-78UR 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz

# lspci
0000:00:1f.3 Multimedia audio controller: Intel Corporation Tiger Lake-LP Smart Sound Technology Audio Controller (rev 20)
        Subsystem: Acer Incorporated [ALI] Device 148c
        Flags: bus master, fast devsel, latency 32, IRQ 197, IOMMU group 12
        Memory at 601f270000 (64-bit, non-prefetchable) [size=16K]
        Memory at 601f000000 (64-bit, non-prefetchable) [size=1M]
        Capabilities: [50] Power Management version 3
        Capabilities: [80] Vendor Specific Information: Len=14 <?>
        Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Kernel driver in use: sof-audio-pci

I am attaching the pulseaudio and dmesg logs

This bug started reproducing after updating the kernel from 5.10.156 to 5.10.157

Bisection revealed the commit being reverted:

c34db0d6b88b1da95e7ab3353e674f4f574cccee is the first bad commit
commit c34db0d6b88b1da95e7ab3353e674f4f574cccee
Author: Richard Fitzgerald <rf@opensource.cirrus.com>
Date:   Fri Nov 4 13:22:13 2022 +0000

    ASoC: soc-pcm: Don't zero TDM masks in __soc_pcm_open()
    
    [ Upstream commit 39bd801d6908900e9ab0cdc2655150f95ddd4f1a ]
    
    The DAI tx_mask and rx_mask are set by snd_soc_dai_set_tdm_slot()
    and used by later code that depends on the TDM settings. So
    __soc_pcm_open() should not be obliterating those mask values.
    
    The code in __soc_pcm_hw_params() uses these masks to calculate the
    active channels so that only the AIF_IN/AIF_OUT widgets for the
    active TDM slots are enabled. The zeroing of the masks in
    __soc_pcm_open() disables this functionality so all AIF widgets
    were enabled even for channels that are not assigned to a TDM slot.
    
    Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
    Fixes: 2e5894d73789 ("ASoC: pcm: Add support for DAI multicodec")
    Link: https://lore.kernel.org/r/20221104132213.121847-1-rf@opensource.cirrus.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 sound/soc/soc-pcm.c | 5 -----
 1 file changed, 5 deletions(-)

Original bug report: https://bugzilla.altlinux.org/44690
Comment 1 Sergey 2022-12-29 10:08:23 UTC
Created attachment 303498 [details]
dmesg.log
Comment 2 Takashi Iwai 2022-12-30 09:27:00 UTC
Could you verify whether the problem happens with 6.1.x kernel as well?
Comment 3 Daniel Palffy 2023-01-01 22:18:10 UTC
My machine (Thinkpad nano G1, 11th Gen Intel(R) Core(TM) i5-1130G7) had the same issue, bisect pointed at the same commit.

6.1.2 works for me.

Also, apparently, a similar set of machines including mine were affected by another issue in 6.0.x, "ALSA: hda: Fix page fault in snd_hda_codec_shutdown()", reverted in 6.0.4.
Comment 4 Salvatore Bonaccorso 2023-01-02 06:52:37 UTC
Crossreference to another downstream report (Debian): https://bugs.debian.org/1027483
Comment 5 Takashi Iwai 2023-01-02 07:34:54 UTC
If 6.1.x works, it means something else might be needed to cope with the suggested commit.  But I guess it'd be more straightforward to revert the patch from the stable tree.