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

Patch not working on Lenovo Yoga 7 Gen 7 AMD (14ARB7) #8

Closed
64kramsystem opened this issue Sep 26, 2022 · 11 comments
Closed

Patch not working on Lenovo Yoga 7 Gen 7 AMD (14ARB7) #8

64kramsystem opened this issue Sep 26, 2022 · 11 comments

Comments

@64kramsystem
Copy link

64kramsystem commented Sep 26, 2022

I'm opening this issue just for reference (in case somebody with the same device is looking for a solution).

I've tried to force the bass speaker fix on my device (Yoga 7 Gen 7 AMD (14ARB7)), but it didn't yield any effect:

# rebooted after this change
#
sudo tee /etc/modprobe.d/snd.conf <<CONF
options snd_intel_dspcfg dsp_driver=1
options snd_hda_intel model=alc287-yoga9-bass-spk-pin
CONF

This has been tested on a v6.0-rc7 kernel, without any patch (actually, I've applied the mic fix, which I think should not be in conflict), since I've seen that the patches in this repository have been upstreamed.

@tikkel
Copy link

tikkel commented Sep 29, 2022

My würgaround...

/root/bass-speaker-on.sh
#!/usr/bin/env bash
/usr/sbin/i2cset -y 3 0x48 0x2 0
/usr/sbin/i2cset -y 3 0x48 0x3 0

/etc/systemd/system/customboot.service
[Unit]
Description=Custom Bootup Script
After=tlp.service
[Service]
ExecStart=/root/bass-speaker-on.sh
[Install]
WantedBy=default.target

/etc/tlp.conf
SOUND_POWER_SAVE_ON_AC=0
SOUND_POWER_SAVE_ON_BAT=0
SOUND_POWER_SAVE_CONTROLLER=N

@64kramsystem
Copy link
Author

64kramsystem commented Sep 29, 2022

My würgaround...

/root/bass-speaker-on.sh #!/usr/bin/env bash /usr/sbin/i2cset -y 3 0x48 0x2 0

/etc/systemd/system/customboot.service [Unit] Description=Custom Bootup Script After=tlp.service [Service] ExecStart=/root/bass-speaker-on.sh [Install] WantedBy=default.target

/etc/tlp.conf SOUND_POWER_SAVE_ON_AC=0 SOUND_POWER_SAVE_ON_BAT=0 SOUND_POWER_SAVE_CONTROLLER=N

Wow, it works 🤯 Many thanks 😄

Here's a script, for anybody who wanted to just copy/paste. It assumes that tlp is installed and enabled.

# to run as root

apt install -y i2c-tools

cat > /etc/tlp.d/99_fix_yoga_speakers.conf << 'CONF'
SOUND_POWER_SAVE_ON_AC=0
SOUND_POWER_SAVE_ON_BAT=0
SOUND_POWER_SAVE_CONTROLLER=N
CONF

systemctl restart tlp

cat > /root/bass-speaker-on.sh << 'SH'
#!/usr/bin/env bash
/usr/sbin/i2cset -y 3 0x48 0x2 0
SH

chmod 755 /root/bass-speaker-on.sh

cat > /etc/systemd/system/customboot.service << 'UNIT'
[Unit]
Description=Custom Bootup Script
After=tlp.service
[Service]
ExecStart=/root/bass-speaker-on.sh
[Install]
WantedBy=default.target
UNIT

systemctl daemon-reload
systemctl enable --now customboot

@soupglasses
Copy link

Do you still run it with the snd.conf modprobe? Or have you removed that section before running these steps?

@64kramsystem
Copy link
Author

64kramsystem commented Sep 29, 2022

Do you still run it with the snd.conf modprobe? Or have you removed that section before running these steps?

I've just run it successfully, and I think this workaround works in isolation; I don't think I've previously applied other related changes - I've rolled back the snd.conf change after I found that it didn't work.

I was, rather, surprised that tlp is preinstalled; I think that on Ubuntu they started to preinstall it only recently (verified on 22.04 as dependency of the desktop package).

@64kramsystem
Copy link
Author

64kramsystem commented Sep 29, 2022

This workaround needs a refinement - the ic2set command needs to be rerun after resuming (works on resume from hibernation; didn't test from suspend):

cat > /lib/systemd/system-sleep/fix_yoga_speakers << 'SH'
#!/bin/bash

if [[ $1 == "post" ]]; then
  /root/bass-speaker-on.sh
fi
SH

chmod +x /lib/systemd/system-sleep/fix_yoga_speakers

@tikkel
Copy link

tikkel commented Sep 29, 2022

So, I didn't set any modprobes.
I reinstalled TLP.
apt install tlp
edit: /etc/tlp.conf
systemctl enable tlp
systemctl start tlp

Still important!
The speaker may be driven with too much power!
Therefore set another register, which reduces the power/volume. Better safe than sorry.
(https://bugzilla.kernel.org/show_bug.cgi?id=208555#c695)

/root/bass-speaker-on.sh
#!/usr/bin/env bash
/usr/sbin/i2cset -y 3 0x48 0x2 0
/usr/sbin/i2cset -y 3 0x48 0x3 0

@tikkel
Copy link

tikkel commented Oct 2, 2022

disable sound-powermanagement without tlp.service

/etc/modprobe.d/alsa-base.conf
options snd_hda_intel power_save=0 power_save_controller=N

@64kramsystem
Copy link
Author

64kramsystem commented Oct 2, 2022

disable sound-powermanagement without tlp.service

/etc/modprobe.d/alsa-base.conf options snd_hda_intel power_save=0 power_save_controller=N

This works; note that the customboot service is still needed, including the tlp dependency (After=...).

@tikkel
Copy link

tikkel commented Oct 3, 2022

disable sound-powermanagement
and activate the bass speaker
simpler version
without tlp.service
my system:
lenovo yoga7 14arb7
ubuntu 22.10 mainline-kernel 6.0
(https://kernel.ubuntu.com/~kernel-ppa/mainline/daily/2022-10-03/)

sudo su

/etc/systemd/system/yoga7-bass-speaker-on.service
[Unit]
Description=yoga7 bass speaker on
After=pipewire.service
[Service]
ExecStart=/bin/bash -c '/usr/sbin/i2cset -y 3 0x48 0x2 0 && /usr/sbin/i2cset -y 3 0x48 0x3 0'
[Install]
WantedBy=pipewire.target

/etc/modprobe.d/alsa-base.conf
options snd_hda_intel power_save=0 power_save_controller=N

systemctl daemon-reload
systemctl enable yoga7-bass-speaker-on.service
reboot

@PJungkamp
Copy link
Owner

The mentioned https://github.com/tomsom/yoga-linux/ repo is probably a better place to discuss problems relating to AMD Yogas. Closing this as I'm not able to fix for a device I don't own.

@soupglasses
Copy link

Current audio issues with the 14ARB7 is tracked in this issue for ease of access: tomsom/yoga-linux#3

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

4 participants