thiagotei / linux-realtek-alc287

Solutions for sound issues in Linux for Realtek ALC287
47 stars 3 forks source link

Did not work for me :( (Lenovo Legion 7 2021) #4

Open vineet131 opened 3 years ago

vineet131 commented 3 years ago

Tried the main patch, followed the instructions exactly and then rebooted. Opened up Lofi girl but alas. Tested on Ubuntu 20.04.2 with kernel 5.8.0-59-generic. However, it does seem that sound is recognised in Settings -> Sound -> Output (I think it wasn't recognised before this).

As a side note, the alternative 1 also didn't work. (In your instructions, verbs-working.txt is basically verbs-legion.txt right?)

thiagotei commented 3 years ago

This has been tested for the Legion 7 2020. Not sure there is a reliable fix for the Legion 7 2021 yet. What is your model? @cberkenpas any news on that?

Fixed the typo on verbs-legion.txt.

cberkenpas commented 3 years ago

There's nothing as of yet for the 2021 Legion 7. However, it looks like I will have the newer Legion by early August, and I suspect I'll at least have some preliminary fix before the end of that month. Coincidentally, customer service confirmed to me this morning via email that I'm still on track to receive mine early August!

As I go through the process again, I'll update the documentation in my branch to try and make sure it's not missing any important details. If others can help streamline the verbs, it would be greatly appreciated as I'm fairly busy.

On 7/19/21 11:55 AM, Thiago S. F. X. Teixeira wrote:

This has been tested for the Legion 7 2020. Not sure there is a reliable fix for the Legion 7 2021 yet. What is your model? @cberkenpas https://github.com/cberkenpas any news on that?

Fixed the typo on |verbs-legion.txt|.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/thiagotei/linux-realtek-alc287/issues/4#issuecomment-882780675, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASNOIEZACWB2HLTZWUZEQLTYRYJ5ANCNFSM5AR7K7GQ.

hyc commented 3 years ago

I also tried this on my 2021 Lenovo Legion 7 with no success. Wanted to add a bit more info - my alsa-info dump is here http://alsa-project.org/db/?f=75eea5cd869e28c69bf5360a2230fabfc997dc0a

Must point out that the Nvidia GPU's audio controller is in /dev/snd/hwC0D0 and the Realtek is in /dev/snd/hwC1D0. The apply-verbs script will fail as-is because it tries to talk to hwC0D0. However, even after editing it to talk to the right controller, I didn't get any working speakers. Headphones are still fine.

cberkenpas commented 3 years ago

Good catch on the device!

Marcus Aram has done some great work and has determined that a Cirrus Logic amplifier chip (CS35L51) is being used. He found that under Windows a driver is needed for this amp chip in addition to the RealTek codec to get sound working. This is likely why verbs aren't enough to get your sound working. However, it's possible verbs will be needed alongside some sort of driver for the amplifier chip.

I cancelled my order for the 2021 Lenovo Legion 7... and replaced it with another order to a Lenovo Legion 7i which will arrive much sooner. This is simply the 11th gen Intel based version. Looking at the docs, it likely has the same amplifier chip so I'll be able to start lending a hand to this effort soon-ish.

Marcus determined that the CS35L51 is on the i2c bus, but hasn't had time to go much further yet. Hopefully I'll find the time to dig into that soon once I have my Legion 7i in hand.

Neither of us has experience with writing drivers, and I certainly have very little experience with i2c, so we'd certainly appreciate any help.

hyc commented 3 years ago

Sounds like that'll be quite a challenge. I don't even see CS35L51 on Cirrus Logic's product pages. L41 and L45 are there though. How is he going to get data sheets for a chip that the manufacturer doesn't even list as existing?

The CS35L45 was only announced in March 2021 https://www.cirrus.com/products/cs35l45/ is there any chance L51 is an incorrect model number?

cberkenpas commented 3 years ago

Looking at the files in the Cirrus Logic amp Windows driver, you'll see things like: "amplifier_gain": 17.5, "amplifier_model": "CS35L51", "client_name": "LabSuite", "client_tuning_name": "Y760_Luxsh

So that seems pretty accurate.

There's an ASoC driver in progress on alsa-devel for the CS35L41 from a Cirrus Logic employee. Seems Cirrus Logic is supports open source to some extent at least.

marcusaram commented 3 years ago

Hello, Marcus here. I've a Legion 7 2021 AMD (16ACHg6) model. These methods indeed doesn't work on this machine. I've extracted the verbs from the VM but still no sound. Although the keyboard "shows" the audio on the RGB leds keyboard. This is done through the verbs, and it is showing what I was playing on Windows.

@cberkenpas already mentioned my findings. It looks like that the speaker amp needs to be initialized and that the amplifier is connected on the I2C bus (see my DSDT dump below). In Windows there is a Cirrus Logic Awesome Speakers Amp device. This one is on the I2C bus through ACPI CLSA0100.

16achverbs.txt 16achverbs2.txt 16achverbs3.txt 16achverbs4.txt

   Scope (_SB.I2CD)
    {
        Device (SPKR)
        {
            Name (_HID, "CLSA0100")  // _HID: Hardware ID
            Name (_UID, One)  // _UID: Unique ID
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                Name (RBUF, ResourceTemplate ()
                {
                    I2cSerialBusV2 (0x0040, ControllerInitiated, 0x000F4240,
                        AddressingMode7Bit, "\\_SB.I2CD",
                        0x00, ResourceConsumer, , Exclusive,
                        )
                    I2cSerialBusV2 (0x0041, ControllerInitiated, 0x000F4240,
                        AddressingMode7Bit, "\\_SB.I2CD",
                        0x00, ResourceConsumer, , Exclusive,
                        )
                    GpioIo (Exclusive, PullDown, 0x0000, 0x0000, IoRestrictionOutputOnly,
                        "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0006
                        }
                    GpioIo (Shared, PullUp, 0x0064, 0x0000, IoRestrictionInputOnly,
                        "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0054
                        }
                    GpioIo (Exclusive, PullUp, 0x0000, 0x0000, IoRestrictionInputOnly,
                        "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0091
                        }
                    GpioInt (Edge, ActiveBoth, Shared, PullUp, 0x0064,
                        "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0054
                        }
                })
                Return (RBUF) /* \_SB_.I2CD.SPKR._CRS.RBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If ((MCSK == 0x04))
                {
                    Return (0x0F)
                }
                Else
                {
                    Return (Zero)
                }
            }

            Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
            {
            }
        }
    }
nickanderson commented 3 years ago

Just wanted to post my alsa info as well. http://alsa-project.org/db/?f=299b7728ec0d1f000f2ae255b5fbd81ffd762a53

Looks nearly identical to @hyc maybe differing firmware versions.

camberkenpas commented 3 years ago

Hopefully we'll see a driver for the Cirrus Logic CS35L51 amplifier chip at some point within the next few months.

hyc commented 3 years ago

Fingers crossed... Is it driven entirely via ACPI entry points? Or something more lower level?

camberkenpas commented 3 years ago

I have no idea! But it sounds like Cirrus Logic might be working on a driver. That's about the extent of my knowledge on the topic for now.

vineet131 commented 2 years ago

Thanks all for this thread. I was following the updates for the bug over here and I believe they have fixed it.

After building the latest 5.17-rc4 kernel from the kernel-ppa, my sound is being detected in the settings menu!! However my sound still isn't outputting from the speakers. Anyone have any advice on how to debug? Or should I wait for the main release of 5.17?

cberkenpas commented 2 years ago

I don't have this model of laptop so I can't really help you there. If you're applying all the patches correctly you can try asking on that bug.

On 2/18/22 03:49, vineet131 wrote:

Thanks all for this thread. I was following the updates for the bug over here https://bugzilla.kernel.org/show_bug.cgi?id=208555 and I believe they have fixed it.

After building the latest 5.17-rc4 kernel from the kernel-ppa, my sound is being detected in the settings menu!! However my sound still isn't outputting from the speakers. Anyone have any advice on how to debug? Or should I wait for the main release of 5.17?

— Reply to this email directly, view it on GitHub https://github.com/thiagotei/linux-realtek-alc287/issues/4#issuecomment-1044395646, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASNOIHPCSPP5A2UT5SNOM3U3YW4PANCNFSM5AR7K7GQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

vineet131 commented 2 years ago

Sorry about that. My model is 16ACHg6. I didn't ask there since I don't have an account there.

hyc commented 2 years ago

As I wrote there https://bugzilla.kernel.org/show_bug.cgi?id=208555#c554 you need to add the 9 patches in the referenced email thread to the 5.17 sources.

vineet131 commented 2 years ago

As I wrote there https://bugzilla.kernel.org/show_bug.cgi?id=208555#c554 you need to add the 9 patches in the referenced email thread to the 5.17 sources.

I missed that! Thanks for pointing it out. Since I am not experienced in applying patches to the source code, will these be merged and added to a later version of the kernel? Or is doing them manually the only option?

kylelmh commented 2 years ago

Sorry for bumping this. It was announced that the 5.17 kernel will introduce cirrus logic kernels (source)

Using the 5.18 kernel, I can confirm the speakers are finally working on the Legion 7 16ACHg6 on Void Linux.

Ubuntu users... will have to wait I guess.