Bug 218409 - [Realtek ALC 1220] No sound from internal speakers on Kernel 6.7.0
Summary: [Realtek ALC 1220] No sound from internal speakers on Kernel 6.7.0
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: All Linux
: P3 normal
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-23 01:12 UTC by Evert Vorster
Modified: 2024-03-08 12:23 UTC (History)
2 users (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments
output from alsa-info.sh (64.63 KB, text/plain)
2024-01-23 01:15 UTC, Evert Vorster
Details
dmesg output (89.36 KB, text/plain)
2024-01-23 01:16 UTC, Evert Vorster
Details
dmesg output broken (89.71 KB, text/plain)
2024-01-23 01:17 UTC, Evert Vorster
Details
output from alsa-info.sh working (64.31 KB, text/plain)
2024-01-23 01:18 UTC, Evert Vorster
Details
output from alsa-info.sh broken (64.61 KB, text/plain)
2024-01-23 01:19 UTC, Evert Vorster
Details
alsa-info output with kernel parameters (68.88 KB, text/plain)
2024-03-03 13:22 UTC, Evert Vorster
Details

Description Evert Vorster 2024-01-23 01:12:51 UTC
Hi there!

When I got this laptop, I had to run a modprobe:
```
options snd-hda-intel model=clevo-p950
```
to get sound from the internal speakers. This worked fine up until Linux kernel version 6.6.10. When I upgraded to Linux kernel version 6.7.0, the sound from the speakers stopped working. 

With a little detective work, we could see that the cards detected have now changed order, where card0 used to the the Realteck one, on kernel 6.7 if was the nvidia HDMI one. 

I was finally able to get the card order right, and can see that the clevo-p950 codec is loaded with the following modprobe line:
```
options snd-hda-intel index=1,0 model=clevo-p950
```

Unfortunately, this still did not resolve the no sound from the internal speakers.
About the only thing I can see different on the alsa-info outputs is that the IRQ has changed for the sound card. 
I will of course attach all the logs I have. 

Any help in resolving this issue would be highly appreciated.
Comment 1 Evert Vorster 2024-01-23 01:15:14 UTC
Created attachment 305748 [details]
output from alsa-info.sh

This file is the latest I have, and was done with modprobe 

options snd-hda-intel index=1,0 model=clevo-p950

Still there is no sound from the speakers
Comment 2 Evert Vorster 2024-01-23 01:16:34 UTC
Created attachment 305749 [details]
dmesg output

This is a capture of the dmesg output from when the sound was working on kernel 6.6.10
Comment 3 Evert Vorster 2024-01-23 01:17:21 UTC
Created attachment 305750 [details]
dmesg output broken

The is the dmesg output with broken sound
Comment 4 Evert Vorster 2024-01-23 01:18:16 UTC
Created attachment 305751 [details]
output from alsa-info.sh working

This is the alsa-info output when the sound was working on kernel 6.6.10
Comment 5 Evert Vorster 2024-01-23 01:19:24 UTC
Created attachment 305752 [details]
output from alsa-info.sh broken

This is the output of alsa-info.sh just after the sound stopped working, and with the card0 and card1 reversed.
Comment 6 Evert Vorster 2024-01-23 19:15:00 UTC
Not sure if this matters, but I am adding it for completeness. 

When the system is reverted to Kernel version 6.6.10, the sound works again. 

It appears that the order in which the sound cards are assigned in the two differend kernels also differ, and that it does not matter to the older kernel if the order is reversed, the sound works anyways. 
On the new kernel, I could not get sound coming from the laptop speakers, no matter what I try.
Comment 7 Bagas Sanjaya 2024-01-26 08:16:01 UTC
(In reply to Evert Vorster from comment #6)
> Not sure if this matters, but I am adding it for completeness. 
> 
> When the system is reverted to Kernel version 6.6.10, the sound works again. 
> 
> It appears that the order in which the sound cards are assigned in the two
> differend kernels also differ, and that it does not matter to the older
> kernel if the order is reversed, the sound works anyways. 
> On the new kernel, I could not get sound coming from the laptop speakers, no
> matter what I try.

Then please bisect the kernel (see [1]).

[1]: https://lore.kernel.org/linux-doc/c763e15e-e82e-49f8-a540-d211d18768a3@leemhuis.info/
Comment 8 Evert Vorster 2024-01-26 12:32:46 UTC
Hi there!

Thanks for the link in the reply. 
Unfortunately that's not gonna happen anytime soon from me, as I lack the time, skills and inclination to compile a custom kernel for my linux box. 

In a month or so, if this has not been fixed from somewhere else I will have some free time and a better internet connection and might attempt it.
Comment 9 Takashi Iwai 2024-01-26 15:05:29 UTC
The order of the modules does matter when you pass the module option.
The model option is an array per card, hence you'd have to adjust the values depending on the loaded order.

Try to change the option to model=,clevo-p950

Or better to patch your kernel to apply the quirk statically.  If adding the quirk table still doesn't help, we need to recheck in more details.
Comment 10 Evert Vorster 2024-01-27 20:33:23 UTC
Hi there, and thanks for looking into this. 

I noticed that if I get the order wrong, it disables my Realtek card, and since I do not use the HDMI output, I normally have the nVidia card turned off in my system settings. So, then I am left without any sound output options until I connect some bluetooth speakers or something. 

Anyways, from the logs attached to this report, it looks like the clevo-p950 quirk is applied to the correct card, but since kernel 6.7.0 it does not seem to help with sound output anymore, hence this bug report.
Comment 11 Takashi Iwai 2024-01-28 09:01:41 UTC
Please double-check that this isn't about the lack of quirk.  i.e. apply the quirk statically in the code and verify that it still doesn't work.
If yes, you'd need to perform git-bisect to identify the culprit as the next step.
Comment 12 Evert Vorster 2024-01-30 00:09:33 UTC
Thanks for looking into this. 

Unfortunately I won't be able to compile the kernel for at least four weeks, and even after that I might not have enough free time. 

From a very high level, in kernel version 6.6.10 this used to work, and now with kernel 6.7.0 it does not work, so something definitely has changed. 

From the logs that I attached to this ticket, it certainly *appears* like the quirk is applied.
Comment 13 Evert Vorster 2024-01-31 20:19:41 UTC
Just upgraded to kernel 6.7.2, with the hopes that this issue was a transient one. 

I could see from the kernel changelogs that there was some work on the audio part of the realtek driver, specifically enabling patches for some specific brands of audio cards. 

Unfortunately, 6.7.2 did not bring me any joy either. 
I guess I'll be running LTS for a while until I can get time to look at this issue closer.
Comment 14 Evert Vorster 2024-03-03 13:20:12 UTC
It is possible to get sound output from the laptop speakers on the 6.7 series of kernels by passing the snd_hda_core.gpu_bind=0 kernel parameter. 

Unfortunately, that disables sound output through HDMI. 

In the 6.6 series of kernels, there is both sound output from the laptop's speakers, and it is able to output sound through HDMI. 


I got to this kernel parameter from this forum post:
https://bbs.archlinux.org/viewtopic.php?id=292453

Which then referred to this kernel commit:
https://github.com/torvalds/linux/commit/2e8c90386db48e425997ca644fa40876b2058b30


I have tried passing -1 and 1 as arguments to the snd_hda_core.gpu_bind paramater, but in both cases there is HDMI output that works, but no sound from the laptop speakers.

Is there any way of getting both sound output from the laptop speakers, as well as HDMI output from the card?
Comment 15 Evert Vorster 2024-03-03 13:22:49 UTC
Created attachment 305953 [details]
alsa-info output with kernel parameters

This is the output of alsa-info with the kernel parameter snd_hda_core.gpu_bind=0

With this set, there is sound output from the laptop speakers, but no HDMI output.
Comment 16 Takashi Iwai 2024-03-08 11:29:45 UTC
Have you done the git bisection?  The option is just a hint, and the problem could be something else.

But, above all, the fact that you needed a model option was already problematic.  You should add the static quirk table entry to point that quirk at first.
Comment 17 Evert Vorster 2024-03-08 12:01:31 UTC
I have not done the git bisection. It is well beyond my technical abilities.

I agree with you that this could be something else, but I have added it to this bug because if I don't bind the GPU to the card, the sound output works on the latest kernels with the model option. This tells me that the model option is not the problem, but rather the sound disappearing down some other rabbit hole. 


So, with my limited abilities, I can only report on what I see. 

In summary:
Without the model option this system does not output sound to the laptop speakers at all, no matter what kernel version I run. 

This seems to be a "feature" of the Realtek ALC1220 that is used in a lot of different configurations, and the kernel does not know how the output is wired without that model option. In clevo laptops, it seems that they are wired the same for different models from the same manufacturer.


On 6.6 version of the kernel, with the model option, sound output can be switched between laptop speakers and HDMI.

On the 6.7 version of the kernel I am able to get sound output to the laptop speakers, but only if I pass the snd_hda_core.gpu_bind=0 kernel parameter, but then the HDMI output option disappears.


So, definitely something has changed, and reading through the email list on that kernel commit, a lot of things have changed. I am really sorry that I can't help you with the bisection to see exactly what the breaking change was. 
Hopefully someone with similar hardware and more technical know-how runs into the same issue and can use this ticket as a starting point for their troubleshooting.
Comment 18 Evert Vorster 2024-03-08 12:23:57 UTC
Oh, and one other small point that may or may not have been considered when these changes were made to the kernel. 

In quite a few laptops you have two GPUs, one powersaving one which is typically an i915 in laptops with an Intel CPU, and an external power hungry CPU which in my case was made by nVidia. 
The internal GPU drives the laptop display, and must never be disabled or turned off. 

The power hungry GPU is typically switched off unless needed for its extra rendering capabilities. 

It seems that both these GPU uses the snd-hda-intel driver and it appears that I can't initialize the driver one way for one GPU and another way for the other GPU.

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