Bass speakers not enabled on Lenovo Yoga 9i

Bug #1926165 reported by Jussi Pakkanen
48
This bug affects 8 people
Affects Status Importance Assigned to Milestone
alsa-driver (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The Lenovo Yoga 9i has two sets of speakers: regular ones and bass speakers. The former work but while latter are detected and show up in alsamixer, they play no sound. Plugging headphones in and out or toggling any of the volume options does not fix the issue.

A possibly related issue for a different Yoga version: https://bugzilla.kernel.org/show_bug.cgi?id=205755

ProblemType: Bug
DistroRelease: Ubuntu 21.04
Package: alsa-base 1.0.25+dfsg-0ubuntu7
ProcVersionSignature: Ubuntu 5.11.0-16.17-generic 5.11.12
Uname: Linux 5.11.0-16-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu65
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: ubuntu 4466 F.... pulseaudio
                      ubuntu 6219 F.... alsamixer
 /dev/snd/pcmC0D0p: ubuntu 4466 F...m pulseaudio
CasperMD5CheckResult: pass
CasperVersion: 1.461
CurrentDesktop: ubuntu:GNOME
Date: Mon Apr 26 15:10:05 2021
LiveMediaBuild: Ubuntu 21.04 "Hirsute Hippo" - Release amd64 (20210420)
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: alsa-driver
Symptom: audio
Symptom_AlsaPlaybackTest: ALSA playback test through plughw:sofhdadsp successful
Symptom_Card: Tiger Lake-LP Smart Sound Technology Audio Controller - sof-hda-dsp
Symptom_Jack: Speaker, Internal
Symptom_PulsePlaybackTest: PulseAudio playback test successful
Symptom_Type: None of the above
Title: [82BG, Realtek ALC287, Speaker, Internal] Playback problem
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 01/28/2021
dmi.bios.release: 1.40
dmi.bios.vendor: LENOVO
dmi.bios.version: EHCN40WW
dmi.board.asset.tag: No Asset Tag
dmi.board.name: LNVNB161216
dmi.board.vendor: LENOVO
dmi.board.version: SDK0J40697WIN
dmi.chassis.asset.tag: No Asset Tag
dmi.chassis.type: 31
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Yoga 9 14ITL5
dmi.ec.firmware.release: 1.40
dmi.modalias: dmi:bvnLENOVO:bvrEHCN40WW:bd01/28/2021:br1.40:efr1.40:svnLENOVO:pn82BG:pvrYoga914ITL5:rvnLENOVO:rnLNVNB161216:rvrSDK0J40697WIN:cvnLENOVO:ct31:cvrYoga914ITL5:
dmi.product.family: Yoga 9 14ITL5
dmi.product.name: 82BG
dmi.product.sku: LENOVO_MT_82BG_BU_idea_FM_Yoga 9 14ITL5
dmi.product.version: Yoga 9 14ITL5
dmi.sys.vendor: LENOVO

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in alsa-driver (Ubuntu):
status: New → Confirmed
Revision history for this message
Hui Wang (hui.wang) wrote :

I checked the log, looks there is no problem on the speakers.

The bass speaker and main speaker work together, if you play some sound from the speaker, the sound will be played by bass speaker and main speaker together.

How do you expect the bass speaker to work?

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

> The bass speaker and main speaker work together, if you play some sound from the speaker, the sound will be played by bass speaker and main speaker together.

That is not what happens in real life. The sound is tinny and poor compared to playing the exact same sound clip on Windows. This is especially noticeable if you lift the laptop up and point the bottom side towards you. On Windows you can sense that the bottom firing speakers are working but on Linux they remain still.

> How do you expect the bass speaker to work?

I would expect it to work exactly how you described above, but it does not behave like that.

Revision history for this message
Tim Ryder (ryder-tim) wrote :

No sound comes out of the bass speakers. This is an issue with the c940, c930 and yoga 9i. Not sure if the cause is the same on all.

Revision history for this message
Hui Wang (hui.wang) wrote :

Oh, Looks like the the bass speaker and main speaker assignment are different from other Lenovo X1 series.

Revision history for this message
Hui Wang (hui.wang) wrote :

Please install, reboot and test this testing kernel. https://people.canonical.com/~hwang4/lp1926165/

And generate and upload the alsa-info.txt with the testing kernel.

thx.

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

Unfortunately I can only run live cd:s on this machine due to reasons. Maybe someone else with the issue can give it a go?

Revision history for this message
Tim Ryder (ryder-tim) wrote :

I'm running fedora 34, but I'm more then happy to install ubuntu back today and try these kernels if it will help resolve the issue. Just need some time to get that done.

Revision history for this message
Tim Ryder (ryder-tim) wrote :

Here it is.

Revision history for this message
Tim Ryder (ryder-tim) wrote :

This kernel also does not produce sound from the bottom bass speakers

Revision history for this message
Hui Wang (hui.wang) wrote :

@Tim and Jussi,

I tried to find the same machine as yours in our office, but there is no 9i, c930 or c940. Please do one more test, then I will ask for help from Realtek according to the test result.

Boot with the standard kernel (not my testing kernel), play some music through the speaker, open a terminal, run alsamixer,

1st test: set the DAC1 volume to minimum, and set the DAC2 volume to maximum, could you still hear the music? Does the sound comes from front speaker or rear speaker?

2nd test: set the DAC1 voluem to maximum, and set the DAC2 volume to minimum, could you still hear the music? Does the sound comes from front speaker or rear speaker?

thx.

Revision history for this message
Tim Ryder (ryder-tim) wrote :

Not sure if it helps, but when i run speaker-test -c 5, all 5 channels get sent to the speaker bar up top.

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

> 1st test: set the DAC1 volume to minimum, and set the DAC2 volume to maximum, could you still hear the music? Does the sound comes from front speaker or rear speaker?

Music works, bass speakers are not enabled.

> 2nd test: set the DAC1 voluem to maximum, and set the DAC2 volume to minimum, could you still hear the music? Does the sound comes from front speaker or rear speaker?

There is no sound at all.

Revision history for this message
Tim Ryder (ryder-tim) wrote :

DAC1 - no sound
DAC2 - sound(only through the top speaker bar)

Revision history for this message
Hui Wang (hui.wang) wrote :

OK, wrote an email to realtek codec expert to ask for help.

Revision history for this message
Hui Wang (hui.wang) wrote :

Please test with generic kernel, and set both DAC1 and DAC2 to maximum, download the attached set-verb.sh, chmod a+x set-verb.sh, sudo ./set-verb.sh. Check if the bass spk could output sound?

thx.

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

After running that script the bass speakers work correctly.

Revision history for this message
Tim Ryder (ryder-tim) wrote :

You are awesome! I ran the script with Fedora 34 as well(no changes to the kernel) and the speaker works perfect now.

Revision history for this message
Tim Ryder (ryder-tim) wrote :

do you think this is a patch to alsa or a kernel patch?

Revision history for this message
Hui Wang (hui.wang) wrote :

The fix should be put into the kernel driver. I will build a testing kernel with this fix tomorrow.

Revision history for this message
Andrew Somerville (andy-somerville) wrote :

@hui.wang is my hero!

I can't wait to test this when I get home tonight!

Revision history for this message
Peter F. Patel-Schneider (pfpschneider) wrote :

I have a Yoga C940, which is the precursor to the 9i. It has the soundbar and two speakers under the body of the laptop. Out of the box the body speakers did't work but there is a special BIOS for the C940 (only) that activates an amplifier for these speakers. I think that the C940 only has two-channel sound, with something (alsa?, pulse?) mixing the five channels down to two and the sound chip distributing sound to the speakers.

When I look at the built-in sound card with alsamixer I see a Bass Speaker double toggle, that may be the result of the special BIOS. This toggle controls the two speakers under the laptop body. The laptop's sound is much better with the body speakers turned on, but I have heard that the sound is even better using the Windows drivers.

Is the intent of the shell script to turn on the amplifier for the body speakers? If this is the case it should be possible to ditch the special BIOS, which would be nice. I'm sure that there are users who don't want to run an unofficial BIOS.

The C930 has a similar setup. Should this patch fix its speaker problems?

It would be nice to get some documentation on the verbs in the shell script and what they do to the sound chip.

Revision history for this message
Tim Ryder (ryder-tim) wrote :

Will the fix be able to be compiled as a module for any kernel?

Revision history for this message
Hui Wang (hui.wang) wrote :

The testing kernel for yoga 9i: https://people.canonical.com/~hwang4/lp1926165/v2/, install this v2 testing kernel, don't need to run the script, check if the bass spk works or not.

For c930 and c940, the testing kernel is not suitable for them, they only defines main speaker, this is different from yoga 9i, need to do more change than 9i. Let us fix the issue on 9i first, then try to fix the issue on c930 and c940.

Revision history for this message
Andrew Somerville (andy-somerville) wrote :

Another confirmation for the 9i.

After set-verb.sh script my bass speaker is working.

Thanks Hui Wang! You're such a helpful person. I've heard you've managed to fix a bunch of these, where people would just be frustrated for months and years without you.

If you're ever in Pittsburgh, I'll buy you a beer or a dinner or whatever!

Thanks again!

Revision history for this message
Hui Wang (hui.wang) wrote :

Hello, Does anyone could help test the testing kernel in the #25?

thx.

Revision history for this message
Tim Ryder (ryder-tim) wrote :

I can test today, just have to install ubuntu again(its unusable on this laptop do to outdated libinput). Will install shortly and test the kernel.

Revision history for this message
Tim Ryder (ryder-tim) wrote :

OK tested. Kernel works, I'm getting sound from both speaker bar and the bass speakers on the bottom. Thank you.

Is it possible to get the code for the driver so I can compile it into my kernel source for my laptop?

Revision history for this message
Tim Ryder (ryder-tim) wrote :

Also let me know if you need me to test anything else before I restore my machine.

Revision history for this message
I And (ivandrs) wrote :

@Hui Wang

if you will have time to make the same script for Lenovo C930 i'll be glad to help with testing

Revision history for this message
Hui Wang (hui.wang) wrote :

@Tim,

No need to do more test on the Yoga 9i, feel free to restore your machine. thx. After I send the kernel patch to alsa-devel, I will add the patch URL here.

@ivandrs,

About the c930, could you please upload an alsa-info.txt first, and I will try to find a fix for c930 after fixing the 9i.

Revision history for this message
Hui Wang (hui.wang) wrote :
Revision history for this message
I And (ivandrs) wrote :

@Hui Wang,
the alsa-info.txt for Yoga C930 is here
http://alsa-project.org/db/?f=1ffb1551a46965865ee272cef105769e879397c7

Revision history for this message
Hui Wang (hui.wang) wrote :

@ivandrs,

Since it is not ubuntu linux on your machine, I don't know how to build kernel for your distro. Please apply this patch to the kernel source, build and install the testing kernel. boot with "snd_hda_intel.dmic_detect=0", after booting up, please run alsamixer, please make sure master, DAC1 and DAC2 are all at maximum volume, then test speakers. And upload the alsa-info.txt with testing kernel.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "0001-test-c930-and-c940-dual-speaker.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
I And (ivandrs) wrote (last edit ):

@Hui Wang
Eventually, i have applied your patch to the kernel.
I have DAC1 and DAC2 now and somehow sound is better now than before, but rear speakers are not working.
If i change the level of DAC1 - the sound volume changes, but the changing of DAC2 level does nothing.

Update:
The alsa-info is here
http://alsa-project.org/db/?f=08f7b48d840592556650cb156e51831780127958

Revision history for this message
Hui Wang (hui.wang) wrote :

@ivandrs,

Looks like the patch works as expected, the Bass spk is assigned to NID 0x17 with the patched kernel.

Now let us test the verbs. First, boot with the patched kernel, then run verbs in the #17, check if the bass spk works.

If not work, please power off the machine then boot the machine with the patched kernel, then run the attached verbs (set-verbs-c930.sh, this verbs is composed according to hda-log-win.txt in the https://bugzilla.kernel.org/show_bug.cgi?id=205755) and check if the bass spk works or not.

Revision history for this message
I And (ivandrs) wrote :

@Hui Wang
I've tested. Verbs from #17 have no effect, verbs from set-verbs-c930.sh completely disable all speakers, no sound.

Revision history for this message
I And (ivandrs) wrote :

@Hui Wang

Any chance to get working verbs for Yoga C930? )
I have managed to run Win10 into QEMU with working bass speakers and got the RtHDDump.txt
Maybe it will be useful..

Revision history for this message
Hui Wang (hui.wang) wrote :

@ivandrs,

only RtHDDump.txt is not enough, Please refer to: https://github.com/ryanprescott/realtek-verb-tools/wiki/How-to-sniff-verbs-from-a-Windows-sound-driver and https://github.com/thesofproject/linux/issues/2748, If could find a workable verb sequence to initialize the I2S amplifier, it will be more helpful.

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-focal' to 'verification-done-focal'. If the problem still exists, change the tag 'verification-needed-focal' to 'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-focal
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-hirsute' to 'verification-done-hirsute'. If the problem still exists, change the tag 'verification-needed-hirsute' to 'verification-failed-hirsute'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-hirsute
Hui Wang (hui.wang)
tags: added: verification-done-hirsute
removed: verification-needed-hirsute
Revision history for this message
Daniel Bushey (dna-bushey) wrote :

Thank you Hui Wang this fixed poor speaker quality on my 9i.

Revision history for this message
Nicholas Garth (flyingewok) wrote :

Thanks for posting the fix, I tired it out on my Yoga 9 14ITL5 on both the Fedora 35 5.14.18-300.fc35.x86_64 kernel and the Ubuntu 21.10 5.13.0-19-generic kernel with minimal luck. With DAC1 and DAC2 at maximum, the rear speaker sounds like nothing is coming out of it. When DAC1 is turned down to 0, there is audio coming out of the rear speaker, however, the audio output quality is rather poor and tinny.

Looking at the kernel source, https://github.com/torvalds/linux/commit/9ebaef0540a981093bce5df15af32354d32391d9 it appears that the kernel version the fix was first released in was 5.13rc4 and looks to appear in all newer tags, so the fix should be in use on my system. Based on the experiences shown above, what I'm experiencing doesn't seem to be the right behaviour.

Revision history for this message
Artem (artemb) wrote :

Yoga Slim 9 14ITL5 Ubuntu 20.04 kernel 5.13.0-30-generic
No sound on front speakers

Revision history for this message
Philipp Jungkamp (pjungkamp) wrote :

I am experiencing a similar problem to the one described here, but on the more recent "Yoga 9 14IAP7".
It does also use the ALC287 in a similar configuration.

The speaker-bar above the keyboard works out of the box, but the bass speakers do not work.

'$ cat /sys/class/sound/hwC0D0/subsystem_id' yields '0x17aa3801'.
With this I also tried to apply the 'ALC287_FIXUP_IDEAPAD_BASS_SPK' and 'ALC269_FIXUP_HEADSET_MODE' pci quirks by adding a corresponding 'SND_PCI_QUIRK(0x17aa, 0x3801, "Yoga 9 14IAP7", ...)' to 'sound/pci/hda/patch_realtek.c'.

But neither made a difference.

I can also provide a dump of the HDA verbs send by a Windows 10 VM which were captured according to https://github.com/ryanprescott/realtek-verb-tools/wiki/How-to-sniff-verbs-from-a-Windows-sound-driver

I tried to apply these verbs to /dev/snd/hwC0D0 using '$ hda-verb', but that did not work either.

I tried Ubuntu first but am currently running Arch Linux since I am more familiar with building a kernel for it.

Then I found this thread and compared the '$ alsa-info' output to mine (attached) and noticed that I am missing the 'DAC1', 'DAC2' and 'Bass Speaker Playback Switch' device nodes that were mentioned previously.

I tried to use '$ hdajackretask' to reassign the the pins but I did not get it to work either.

I don't think I am familiar enough with the linux sound stack to fix it myself and would be grateful for any help or further information on how to get Linux/Alsa to initialize/recognize the speakers.

Revision history for this message
clem schum (clerusch) wrote :

I have the same problem as philipp jungkamp and would also be very interested in a solution.
(It's actually even the reason why I'll switch back to windows for the time being.)

Revision history for this message
Tim Woelfle (teadoub) wrote :

I have the same problem as Philipp Jungkamp and Clem Schum on the Yoga 9 14IAP7 on Ubuntu 22.04. Hope this can get fixed soon, thank you very much to everyone who is involved!

Revision history for this message
Philipp Jungkamp (pjungkamp) wrote :

I found a fix for the speakers and several other issues.
I submitted the patch to the alsa-devel mailing list, where it was applied by one of the sound subsystem maintainers. It will now slowly travel towards mainline.

https://mailman.alsa-project.org/pipermail/alsa-devel/2022-July/204315.html

As I'm more familiar with Arch Linux than Ubuntu I opted to run a patched kernel on Arch.
I uploaded the patches I currently use to https://github.com/PJungkamp/yoga9-linux.

If you stick with Ubuntu and are familiar with patching Ubuntu/Debian kernels you can try to apply those yourself.

Revision history for this message
Saverio Miroddi (64kramsystem) wrote (last edit ):

(edited the comment)

I experience the same problem on the Yoga 7 Gen 7 AMD, but it has a slightly different chip (ALC245), and the patch has no effect on it (it made it into the kernel 6.0, BTW).

Revision history for this message
Tim Woelfle (teadoub) wrote :

I'm now on Ubuntu 23.04 (incl. new kernel) and managed to make the bass work on my Lenovo Yoga 9 14IAP7 through this trick: https://wiki.archlinux.org/title/Lenovo_Yoga_9i_2022_(14AiPI7)#Audio

Revision history for this message
anthony (9anthony8) wrote :

@Tim Woelfle (teadoub) which kernel version do you have? And for you make a file /etc/modprobe.d/snd conf and paste "options snd-sof-intel-hda-common hda_model=alc287-yoga9-bass-spk-pin" was enaugh?

Thx

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.