Bug 219260
Summary: | ThinkBook 13x G4 CS3541L intermittently distorted sound | ||
---|---|---|---|
Product: | Drivers | Reporter: | Dmitry Savin (envelsavinds) |
Component: | Sound(ALSA) | Assignee: | Jaroslav Kysela (perex) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | patches, sbinding |
Priority: | P3 | ||
Hardware: | Intel | ||
OS: | Linux | ||
Kernel Version: | 6.11.0-0.rc6.348.vanilla.fc40.x86_64 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
acpidump
bug_repro.cpp dmesg.txt |
Description
Dmitry Savin
2024-09-10 20:24:31 UTC
Hi, Can you provide the set of steps that you say is able to trigger this issue? Also, can you attach a full dmesg log - from boot to when you hit the issue? Thanks, Stefan Created attachment 306866 [details]
bug_repro.cpp
A code snippet to reproduce the issue, distortion happens usually ~round 5 and 6 of the playback.
Created attachment 306867 [details]
dmesg.txt
I have attached a short snippet (well, as short as it could be with ALSA) to reproduce the problem. The actual scenario is whenever you repeatedly do the following after setting up ALSA device: 1. snd_pcm_prepare 2. Play fragment (write data with writei or use mmap - doesn't matter) 3. snd_pcm_drain / snd_pcm_drop, then repeat from step 1. Full close / open and re-init of the hardware doesn't have the issue. The repro rate on the test code is ~2/10. Hi, Is it possible for you to make an audio recording or video when this issue is reproduced? I noticed that your script generates a full scale sine wave, have you tested this at a lower scale? Do you see this issue with different frequencies? Are you running this at full volume, and do you see differences if you change the volume? Thanks, Stefan Please find the recordings for both the test code attached to the ticket and music fragment played (seeking triggers snd_pcm_prepeare / snd_pcm_start cycle, without format change). https://www.dropbox.com/scl/fo/gvx28987cw6cqcscqfoiv/AMpEekbmVznS_6Dt7DSGjjE?rlkey=y91q9ar6aam3e0xlojzmq3ni6&st=bnim1ggo&dl=0 I use the full scale 440Hz sine wave just for the testing purposes (on the video it was reduced to a half), the issue happens with more complex signal too (i.e. speech or music), i.g. when watching youtube, for example. Reducing the amplitude of the signal doesn't make any difference. I must note, that when playing through pipewire-alsa layer the issue appears significantly less often, however, even in this case I managed to catch it a few times, although did not record. I am not quite sure what this distortion is but it sounds like DSP has some weird gain settings randomly. The overall volume doesn't increase at these moments but some of the frequencies are clearly too loud. Just to note, the issue equally happens when listening through the headphones plugged into the 3.5mm port on side of the laptop which (mechanically) turns of the laptop speakers but doesn't happen when connecting bluetooth headphones. Hm... Interesting. When facing the issue in the headphones disconnecting them from the port makes the sound clear in the speakers, plugging the headphones back in brings back the distortion. Can't reproduce it when tried the second time. I wonder if that could be the laptop defect as well, I've found a few similar reports with Lenovo laptops but those were inconclusive of the root-cause of the issue. ``` g++ bug_repro.cpp -lasound -o bug_repro ``` Looks like a few similar issues in SOF were discussed and marked as fixes as late as March this year. The scenario described is exactly what I am experiencing. https://github.com/thesofproject/sof/issues/8986 Opened a new issue: https://github.com/thesofproject/sof/issues/9502 The fix has been merged last month. Checked that the issue is not happening anymore Fedora 41 release. https://github.com/thesofproject/linux/pull/5197 |