Bug 216363 - sometimes a short period of noise or silence at beginning of sound
Summary: sometimes a short period of noise or silence at beginning of sound
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: AMD Linux
: P1 normal
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-14 20:21 UTC by qbl
Modified: 2022-10-01 17:59 UTC (History)
2 users (show)

See Also:
Kernel Version: 5.18.8 5.18.9 ... 5.19.1
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Test fix patch (2.00 KB, patch)
2022-08-15 07:16 UTC, Takashi Iwai
Details | Diff
Test fix patch (5.37 KB, patch)
2022-08-15 13:13 UTC, Takashi Iwai
Details | Diff

Description qbl 2022-08-14 20:21:30 UTC
sometimes a short period of noise or silence at beginning of sound or after pausing

Hardware:
00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Kaveri HDMI/DP Audio Controller
00:01.1 0403: 1002:1308
Output: HDMI
Same on Radeon RX560/DP
Sometimes there is a short period of silence or random noise when sound statrts to play ( about a second). This somtimes happens too, after playback paused.
Affected Kernels 5.18.8, 5.18.9, ..., 5.19.1

bisecting showed up d35135ebebe4090f3e0a5fc7f50bd6d8848fda3f as the likely cause.
Since this kind of Bug is not easy to track down, this might be a false positive.
But i've applied a reverse patch to some of the newer Kernels - including 5.19.1 - and it looks like this is the bad boy. Maybe its a solution to implement the trouble causing patch in a per machine fashion, for example via cpuid, so the weakness of Intels Haswell could be worked around.
Comment 1 Takashi Iwai 2022-08-15 07:16:22 UTC
Hmm, it's not really CPU-dependent but rather IOMMU-dependent.

How about the patch below instead?
Comment 2 Takashi Iwai 2022-08-15 07:16:46 UTC
Created attachment 301568 [details]
Test fix patch
Comment 3 Takashi Iwai 2022-08-15 07:45:48 UTC
Scratch the above, it will break things obviously...
Comment 4 Takashi Iwai 2022-08-15 13:12:27 UTC
I guess we have to put back x86-specific workaround again, but in a different way.  Could you try the patch below instead of the previous one?
Comment 5 Takashi Iwai 2022-08-15 13:13:12 UTC
Created attachment 301569 [details]
Test fix patch
Comment 6 qbl 2022-08-15 17:15:59 UTC
I've applied this patch to a vanilla 19.1, which is your intention, i think.
Now we have to wait.
Comment 7 qbl 2022-08-20 14:23:33 UTC
It looks like this patch works.
Comment 8 Pierre Juhen 2022-08-22 07:20:54 UTC
Hi,

also an issue with iommu with chipset AMD 970;

My computer freezes with access to the disk to a disk each second.

Have to stop the PC for some minutes before being able to restart.

Sometimes, when I reboot, BIOS says the main BIOS is corrupted...

iommu=soft in the kernel parameters seems to solve the issue..

Regards,
Comment 9 Takashi Iwai 2022-08-23 08:13:53 UTC
Now the fix is merged to sound git tree (commit a8d302a0b77057568350fe0123e639d02dba0745), possibly included in the upstream 6.0-rc3 or rc4.
Comment 10 Pierre Juhen 2022-08-24 07:16:30 UTC
Shame on me ! 

The troubles I had where not linked to the kernel, but to a dying CMOS battery on the motherboard.

Sorry,

Regards,


(In reply to Pierre Juhen from comment #8)
> Hi,
> 
> also an issue with iommu with chipset AMD 970;
> 
> My computer freezes with access to the disk to a disk each second.
> 
> Have to stop the PC for some minutes before being able to restart.
> 
> Sometimes, when I reboot, BIOS says the main BIOS is corrupted...
> 
> iommu=soft in the kernel parameters seems to solve the issue..
> 
> Regards,
Comment 11 Takashi Iwai 2022-09-04 09:07:01 UTC
It turned out that the fix caused regressions on another machines with AMD GPU.

I posted two possible fix patches below.
Could you check each of them and verify whether it still works with your device?
  https://lore.kernel.org/r/87ilm3vbzq.wl-tiwai@suse.de
  https://lore.kernel.org/r/875yi3froa.wl-tiwai@suse.de

Note that the first one might bring back to the origianl problem.
Comment 12 Takashi Iwai 2022-09-05 05:38:23 UTC
There is a third one, and that should be tested at first:
  https://lore.kernel.org/r/874jxml7a4.wl-tiwai@suse.de

It'd be appreciated if you can confirm that it doesn't bring further regression.
Comment 13 qbl 2022-09-05 11:54:51 UTC
I am going to test the third patch now.
Comment 14 qbl 2022-10-01 17:59:04 UTC
There hasn't been any trouble. So it's time to classify this bug as fixed.
Thanks for your effort, greetings to all maintainers and supporters and keep up the good work.

Note You need to log in before you can comment on or make changes to this bug.