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

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

Open
vineet131 opened this issue Jul 18, 2021 · 17 comments
Open

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

vineet131 opened this issue Jul 18, 2021 · 17 comments

Comments

@vineet131
Copy link

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
Copy link
Owner

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
Copy link
Collaborator

cberkenpas commented Jul 19, 2021 via email

@vineet131 vineet131 reopened this Jul 19, 2021
@hyc
Copy link

hyc commented Aug 1, 2021

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
Copy link
Collaborator

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
Copy link

hyc commented Aug 2, 2021

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
Copy link
Collaborator

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
Copy link

marcusaram commented Aug 14, 2021

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
Copy link

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
Copy link

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

@hyc
Copy link

hyc commented Sep 3, 2021

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

@camberkenpas
Copy link

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
Copy link
Author

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
Copy link
Collaborator

cberkenpas commented Feb 18, 2022 via email

@vineet131
Copy link
Author

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

@hyc
Copy link

hyc commented Feb 18, 2022

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
Copy link
Author

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
Copy link

kylelmh commented Jul 6, 2022

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.

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

8 participants