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

Speaker going crazy #58

Closed
jlo62 opened this issue Mar 18, 2024 · 40 comments
Closed

Speaker going crazy #58

jlo62 opened this issue Mar 18, 2024 · 40 comments

Comments

@jlo62
Copy link

jlo62 commented Mar 18, 2024

Hi, I had this Issue twice recently, the speaker would emit a loud, high pitched noise after booting.
Once It was on the left side, and once on the right, and I don't have this on windows.

Suspending or (in panic) hard-rebooting the machine helped.

Is this somehow normal? What could the cause be? Is anyone else having this issue?

  • J Luke

edit: and nothing abnormal in logs.

@soyersoyer
Copy link

Hey JLo,
That's strange.
Do you have yoga 7 14ARB7?
What is your OS?
What is your kernel version?
What is your linux-firmware package version?

@jlo62
Copy link
Author

jlo62 commented Mar 18, 2024

yup, a 14arb7 running Arch linux with kernel 6.8.1 and firmware 20240312.3b128b60-1.

@soyersoyer
Copy link

Could you run this please?
dmesg|grep -E "snd|tas2781"

And
find /sys/firmware/efi/efivars/ -name *-1f52* -print -exec hexdump -C {} \;

@jlo62
Copy link
Author

jlo62 commented Mar 18, 2024

dmesg|grep -E "snd|tas2781"

[    5.301609] snd_hda_intel 0000:33:00.1: enabling device (0000 -> 0002)
[    5.301669] snd_hda_intel 0000:33:00.1: Handle vga_switcheroo audio client
[    5.301711] snd_hda_intel 0000:33:00.6: enabling device (0000 -> 0002)
[    5.337316] snd_hda_intel 0000:33:00.1: bound 0000:33:00.0 (ops amdgpu_dm_audio_component_bind_ops [amdgpu])
[    5.342454] snd_hda_codec_realtek hdaudioC1D0: bound i2c-INT8866:00 (ops tas2781_hda_comp_ops [snd_hda_scodec_tas2781_i2c])
[    5.342864] snd_hda_codec_realtek hdaudioC1D0: autoconfig for ALC287: line_outs=2 (0x14/0x17/0x0/0x0/0x0) type:speaker
[    5.342879] snd_hda_codec_realtek hdaudioC1D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    5.342882] snd_hda_codec_realtek hdaudioC1D0:    hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[    5.342883] snd_hda_codec_realtek hdaudioC1D0:    mono: mono_out=0x0
[    5.342885] snd_hda_codec_realtek hdaudioC1D0:    inputs:
[    5.342886] snd_hda_codec_realtek hdaudioC1D0:      Mic=0x19

and find /sys/firmware/efi/efivars/ -name '*-1f52*' -print -exec hexdump -C {} \;

00000000  07 00 00 00 00 00 e0 1f                           |........|
00000008
/sys/firmware/efi/efivars/Power_2-1f52d2a1-bb3a-457d-bc09-43a3f4310a92
00000000  07 00 00 00 5d 7f d0 00                           |....]...|
00000008
/sys/firmware/efi/efivars/R0_Low_2-1f52d2a1-bb3a-457d-bc09-43a3f4310a92
00000000  07 00 00 00 f1 c6 c8 18                           |........|
00000008
/sys/firmware/efi/efivars/InvR0_2-1f52d2a1-bb3a-457d-bc09-43a3f4310a92
00000000  07 00 00 00 61 bb c5 1f                           |....a...|
00000008
/sys/firmware/efi/efivars/R0_2-1f52d2a1-bb3a-457d-bc09-43a3f4310a92
00000000  07 00 00 00 7a af 3a 20                           |....z.: |
00000008
/sys/firmware/efi/efivars/TLim_1-1f52d2a1-bb3a-457d-bc09-43a3f4310a92
00000000  07 00 00 00 00 00 e0 1f                           |........|
00000008
/sys/firmware/efi/efivars/Power_1-1f52d2a1-bb3a-457d-bc09-43a3f4310a92
00000000  07 00 00 00 8d 59 e3 00                           |.....Y..|
00000008
/sys/firmware/efi/efivars/R0_Low_1-1f52d2a1-bb3a-457d-bc09-43a3f4310a92
00000000  07 00 00 00 30 cd 57 1b                           |....0.W.|
00000008
/sys/firmware/efi/efivars/InvR0_1-1f52d2a1-bb3a-457d-bc09-43a3f4310a92
00000000  07 00 00 00 db 98 cc 1c                           |........|
00000008
/sys/firmware/efi/efivars/R0_1-1f52d2a1-bb3a-457d-bc09-43a3f4310a92
00000000  07 00 00 00 04 79 8e 23                           |.....y.#|
00000008```

@soyersoyer
Copy link

soyersoyer commented Mar 18, 2024

Thanks. It looks normal.
Is there anything other than the tas2781 driver that communicates with the amplifiers? (e.g. systemd service)

@stuarthayhurst
Copy link
Contributor

Is it a regression since 6.8.0-rc6? I haven't had the same issue on my system, and I've been running it since that release candidate was released.

@jlo62
Copy link
Author

jlo62 commented Mar 18, 2024

I can install 6.8 and run it for a week (since it only occurs sometimes) and see if the problem occurs, if that's what's your asking.
It would also fit from the timing.
This is a problem that will be HORRIBLE to bisect.

@stuarthayhurst
Copy link
Contributor

I was just commenting since I'm on a different version and haven't experienced it, but it's worth a shot if we don't have any other leads

@soyersoyer would know a lot more about this than me anyway

@soyersoyer
Copy link

Nothing has changed on the driver side between 6.8-rc5 and 6.8.1.
@jlo62 How did you use the amplifiers before 6.8? Do you sometimes use Windows?

@jlo62
Copy link
Author

jlo62 commented Mar 18, 2024

@jlo62 How did you use the amplifiers before 6.8? Do you sometimes use Windows?

Once tested the speaker fix a long time ago, but else stock.
And yes, I use windows daily for school.

@soyersoyer
Copy link

Is it possible that the fix is still running at startup?

@jlo62
Copy link
Author

jlo62 commented Mar 18, 2024

No, I cleaned up quite well and I don't have i2ctools installed.

@soyersoyer
Copy link

Do you remember when you hear that high pitched noise? Before the kernel starts?

@jlo62
Copy link
Author

jlo62 commented Mar 18, 2024

No, very shortly before sway starts, so about then when my user session gets initialized.
=> pipewire?

thanks for helping me on this.

@soyersoyer
Copy link

I think it's more of a locking problem in the tas2781 driver. The next time you experience the problem, save the dmesg output. I hope it can help.

@jlo62
Copy link
Author

jlo62 commented Mar 19, 2024

dmesg: http://0x0.st/XrSw.txt
this time it was different: only a short cracking sound on the right (which made me jump because it sounded like something burned through) and some smaller cracks on the left.

@stuarthayhurst
Copy link
Contributor

It's not something to do with Windows' fastboot is it? People in #3 seemed to notice it would start up with the registers still set from Windows sometimes, is it possible that's interfering?

@jlo62
Copy link
Author

jlo62 commented Mar 19, 2024

I can check if fastboot is enabled, but I did actually disable it, but windows sometimes has habits...
It may be that it happens after being booted to windows, I can look out for that.

edit: It was on kernel 6.8 btw

@soyersoyer
Copy link

Do you have the latest BIOS (K5CN42WW)?

@jlo62
Copy link
Author

jlo62 commented Mar 20, 2024

yup, but this can't be the cause, as I upgraded way earlier.
And I just checked: fastboot is disabled.

@soyersoyer
Copy link

soyersoyer commented Mar 23, 2024

Uh, I accidentally reproduced it. This is really scary. My laptop's battery ran out and then the strange sound came out when logging in. Strange, because by then the amplifiers have already been reset. Probably a missing sleep after reset.

@soyersoyer
Copy link

@jlo62
Copy link
Author

jlo62 commented Mar 26, 2024

I built a kernel with it, speakers work properly, but I'll need a couple of days to confirm if it fixes it.

@stuarthayhurst
Copy link
Contributor

I booted my laptop up to install a test build of this and managed to reproduce it before it was installed, so I'll report back if I get it again with the patched kernel, it definitely made me jump lol

@soyersoyer
Copy link

soyersoyer commented Apr 1, 2024

I was able to reproduce it by turning off the laptop and starting it right away.
Some mutexes were missing. While the driver was uploading the firmware alsactl restored the 'Speaker Analog Gain', which is also i2c write.
The patches have been merged into 6.9-rc2.

@stuarthayhurst
Copy link
Contributor

The patches have been merged into 6.9-rc2.

That's what prompted me to rebuild my kernel, you're expected this to be all fixed then?

@soyersoyer
Copy link

I can't reproduce it anymore, so yes :)

@soyersoyer
Copy link

Does 6.9-rc2 work for you? Mine can't start the amdgpu module.

@stuarthayhurst
Copy link
Contributor

Does 6.9-rc2 work for you? Mine can't start the amdgpu module.

It starts, but 6.9-rc1 and 6.9-rc2 both look very washed out, everything is much whiter than it should be

@soyersoyer
Copy link

I have this also, I don't know what is it. It looks good with performance mode.

@stuarthayhurst
Copy link
Contributor

Oh I didn't try performance mode yet, strange that that would be related

Sigh, one day we'll have a kernel where everything just works... I guess your speaker driver / fixes bring us one step closer, thanks for your work on that :)

@jlo62
Copy link
Author

jlo62 commented Apr 1, 2024

Sigh, one day we'll have a kernel where everything just works...

I think we're already very close to that, at least with the patch applied to 6.8.2. The only things I can think of is:

  • Fnlock
  • Audio fix(?)
  • The strange egpu boot issue I have (most likely bios)

Anyway, thx soyer. Hasn't happened here either.

Lets keep this rhread open until it gets merged to mainstream.

@soyersoyer
Copy link

What's wrong with FnLock?

@jlo62
Copy link
Author

jlo62 commented Apr 1, 2024

That we can't toggle it with /sys (or whatever)
So not a real problem, just that we can't make a on-screen thingy.

@soyersoyer
Copy link

This works for me:
echo 1 > /sys/module/ideapad_laptop/drivers/platform\:ideapad_acpi/VPC2004\:00/fn_lock

@jlo62
Copy link
Author

jlo62 commented Apr 1, 2024

nice! I was searching under /sys/class/leds like the keyboard backlight.
Can I actually use udev to poll for a change?

@soyersoyer
Copy link

I don't know, try it :)

There is no LED_FUNCTION_FNLOCK in /include/dt-bindings/leds/common.h yet. It would be a good addition.

@jlo62
Copy link
Author

jlo62 commented Apr 1, 2024

Sigh, one day we'll have a kernel where everything just works...

I officially think "everything just works" now

And no, it doesn't show up with udevadm monitor.

@stuarthayhurst
Copy link
Contributor

Sigh, one day we'll have a kernel where everything just works...

I officially think "everything just works" now

Not in 6.9-rc2 where the speaker fix landed, since the AMD module seems broken, but I'm not all that surprised since it is an RC kernel, hopefully one of the paid AMD devs fixes it quickly

@soyersoyer
Copy link

The patches will be applied to 6.8.3 as well.

@jlo62 jlo62 closed this as completed Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants