Lenovo Yoga Pro 9i



Feature Compatibility Table

FeatureStatusNotes
ScreenWorksRequires linux kernel 6.11 or newer
SpeakersNeeds configuringSubwoofer is disabled by default due to a bug
Nvidia GPUNeeds configuringInstall drivers and enable suspend services (depending on distrobution)
Windows Hello IR CameraNeeds configuringDetected out of the box; configuring howdy can be a bit difficult
BatteryWorksGood battery life; better with refresh rate set to 60Hz; conservative battery limit can be enabled
KeyboardWorksIncludes backlight adjustment in GNOME and KDE
CameraWorks
TouchpadWorks
Intel GPUWorks
MicrophoneWorks*Add Speech processor via EasyEffects for higher volume
PortsWorks
Wifi/BluetoothWorks
Proximity SensorNot supported


Speaker

largely inspired by https://github.com/maximmaxim345/yoga_pro_9i_gen9_linux , but I only had the right side working

This little script find the address of sound card .


for addr in $(seq 3 119); do
  hexaddr=$(printf "0x%02x" $addr)
  echo -n "Probing $hexaddr... "
  sudo i2cget -y 17 $hexaddr 0x00 b 2>/dev/null && echo "Found!" || echo "Nope"
done




0x38 and 0x3e , address are the same of maxim345 code

sudo pacman -Sy i2c-tools

then simplify

#!/bin/bash

i2c_bus=17
amp_addresses=(0x38 0x3e)

for i2c_addr in "${amp_addresses[@]}"; do
 echo "Configuring amp at address $i2c_addr on i2c-$i2c_bus"

 i2cset -f -y $i2c_bus $i2c_addr 0x00 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x7f 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x01 0x01
 i2cset -f -y $i2c_bus $i2c_addr 0x0e 0xc4
 i2cset -f -y $i2c_bus $i2c_addr 0x0f 0x40
 i2cset -f -y $i2c_bus $i2c_addr 0x5c 0xd9
 i2cset -f -y $i2c_bus $i2c_addr 0x60 0x10
 i2cset -f -y $i2c_bus $i2c_addr 0x0a 0x2e
 i2cset -f -y $i2c_bus $i2c_addr 0x0d 0x01
 i2cset -f -y $i2c_bus $i2c_addr 0x16 0x40

 i2cset -f -y $i2c_bus $i2c_addr 0x00 0x01
 i2cset -f -y $i2c_bus $i2c_addr 0x17 0xc8

 i2cset -f -y $i2c_bus $i2c_addr 0x00 0x04
 i2cset -f -y $i2c_bus $i2c_addr 0x30 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x31 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x32 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x33 0x01

 i2cset -f -y $i2c_bus $i2c_addr 0x00 0x08
 i2cset -f -y $i2c_bus $i2c_addr 0x18 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x19 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x1a 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x1b 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x28 0x40
 i2cset -f -y $i2c_bus $i2c_addr 0x29 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x2a 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x2b 0x00

 i2cset -f -y $i2c_bus $i2c_addr 0x00 0x0a
 i2cset -f -y $i2c_bus $i2c_addr 0x48 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x49 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x4a 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x4b 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x58 0x40
 i2cset -f -y $i2c_bus $i2c_addr 0x59 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x5a 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x5b 0x00

 i2cset -f -y $i2c_bus $i2c_addr 0x00 0x00
 i2cset -f -y $i2c_bus $i2c_addr 0x02 0x00

 echo "Done configuring amp at $i2c_addr"
done


and now the sound work perfectly 🙂

create a service :

sudo nano /etc/systemd/system/yoga-16imh9-speakers.service
[Unit]
Description=Turn on speakers using i2c configuration
After=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target

[Service]
User=root
Type=oneshot
ExecStart=/usr/local/bin/speaker.sh
StandardOutput=journal

[Install]
WantedBy=multi-user.target sleep.target
Also=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target
sudo systemctl daemon-reload
sudo systemctl enable yoga-16imh9-speakers.service


Si on veut savoir dans les logs si le son était « faible » ou « normal », il faut :

Logger un message clair : « SON FAIBLE détecté » ou « Son normal »

Lire un registre de l’ampli avant la configuration (i2cget)

Comparer la valeur avec celle attendue

#!/bin/bash

i2c_bus=17
amp_addresses=(0x38 0x3e)
LOGFILE="$HOME/.local/share/speaker-watch.log"

for i2c_addr in "${amp_addresses[@]}"; do
  echo "=== $(date) Checking amp $i2c_addr ===" >> "$LOGFILE"

  # Lire registre volume (exemple 0x02, à confirmer)
  current_val=$(i2cget -y $i2c_bus $i2c_addr 0x02 2>/dev/null)

  echo "Before config, reg 0x02 = $current_val" >> "$LOGFILE"

  if [ "$current_val" != "0x00" ]; then
    echo "!!! SON FAIBLE détecté sur $i2c_addr" >> "$LOGFILE"
  else
    echo "Son normal (avant config)" >> "$LOGFILE"
  fi

  # Appliquer ta config habituelle
  i2cset -f -y $i2c_bus $i2c_addr 0x00 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x7f 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x01 0x01
  i2cset -f -y $i2c_bus $i2c_addr 0x0e 0xc4
  i2cset -f -y $i2c_bus $i2c_addr 0x0f 0x40
  i2cset -f -y $i2c_bus $i2c_addr 0x5c 0xd9
  i2cset -f -y $i2c_bus $i2c_addr 0x60 0x10
  i2cset -f -y $i2c_bus $i2c_addr 0x0a 0x2e
  i2cset -f -y $i2c_bus $i2c_addr 0x0d 0x01
  i2cset -f -y $i2c_bus $i2c_addr 0x16 0x40
  i2cset -f -y $i2c_bus $i2c_addr 0x00 0x01
  i2cset -f -y $i2c_bus $i2c_addr 0x17 0xc8
  i2cset -f -y $i2c_bus $i2c_addr 0x00 0x04
  i2cset -f -y $i2c_bus $i2c_addr 0x30 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x31 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x32 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x33 0x01
  i2cset -f -y $i2c_bus $i2c_addr 0x00 0x08
  i2cset -f -y $i2c_bus $i2c_addr 0x18 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x19 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x1a 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x1b 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x28 0x40
  i2cset -f -y $i2c_bus $i2c_addr 0x29 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x2a 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x2b 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x00 0x0a
  i2cset -f -y $i2c_bus $i2c_addr 0x48 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x49 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x4a 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x4b 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x58 0x40
  i2cset -f -y $i2c_bus $i2c_addr 0x59 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x5a 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x5b 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x00 0x00
  i2cset -f -y $i2c_bus $i2c_addr 0x02 0x00

  # Relire après config
  new_val=$(i2cget -y $i2c_bus $i2c_addr 0x02 2>/dev/null)
  echo "After config, reg 0x02 = $new_val" >> "$LOGFILE"

  echo "Done configuring amp at $i2c_addr" >> "$LOGFILE"
done
tail -n 50 ~/.local/share/speaker-watch.log

Un commentaire sur « Lenovo Yoga Pro 9i »

  1. not work with mixxx

    ~
    ❯ mixxx
    Using preferences ScaleFactor 1
    Selected Qt style: « breeze »
    Loading resources from « /usr/share/mixxx/ »
    Configuration file is at the current version « 2.5.1 »
    BroadcastSettings – Found 1 profile(s)
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
    Cannot connect to server socket err = Aucun fichier ou dossier de ce nom
    Cannot connect to server request channel
    jack server is not running or cannot be started
    JackShmReadWritePtr::~JackShmReadWritePtr – Init not done for -1, skipping unlock
    JackShmReadWritePtr::~JackShmReadWritePtr – Init not done for -1, skipping unlock
    Cannot connect to server socket err = Aucun fichier ou dossier de ce nom
    Cannot connect to server request channel
    jack server is not running or cannot be started
    JackShmReadWritePtr::~JackShmReadWritePtr – Init not done for -1, skipping unlock
    JackShmReadWritePtr::~JackShmReadWritePtr – Init not done for -1, skipping unlock
    ALSA lib pcm_oss.c:404:(_snd_pcm_oss_open) Cannot open device /dev/dsp
    ALSA lib pcm_oss.c:404:(_snd_pcm_oss_open) Cannot open device /dev/dsp
    ALSA lib pcm_a52.c:1036:(_snd_pcm_a52_open) a52 is only for playback
    ALSA lib conf.c:5695:(snd_config_expand) Unknown parameters {AES0 0x6 AES1 0x82 AES2 0x0 AES3 0x2 CARD 0}
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM iec958:{AES0 0x6 AES1 0x82 AES2 0x0 AES3 0x2 CARD 0}
    ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
    ALSA lib pcm_usb_stream.c:481:(_snd_pcm_usb_stream_open) Invalid card ‘card’
    ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
    ALSA lib pcm_usb_stream.c:481:(_snd_pcm_usb_stream_open) Invalid card ‘card’
    Cannot connect to server socket err = Aucun fichier ou dossier de ce nom
    Cannot connect to server request channel
    jack server is not running or cannot be started
    JackShmReadWritePtr::~JackShmReadWritePtr – Init not done for -1, skipping unlock
    JackShmReadWritePtr::~JackShmReadWritePtr – Init not done for -1, skipping unlock
    warning [Main] Output sound device clock reference not set! Using « Flux réseau »
    warning [0x648d103c9440] SoundDeviceNetworkThread: Failed bumping priority
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
    Cannot connect to server socket err = Aucun fichier ou dossier de ce nom
    Cannot connect to server request channel
    jack server is not running or cannot be started
    JackShmReadWritePtr::~JackShmReadWritePtr – Init not done for -1, skipping unlock
    JackShmReadWritePtr::~JackShmReadWritePtr – Init not done for -1, skipping unlock
    Cannot connect to server socket err = Aucun fichier ou dossier de ce nom
    Cannot connect to server request channel
    jack server is not running or cannot be started
    JackShmReadWritePtr::~JackShmReadWritePtr – Init not done for -1, skipping unlock
    JackShmReadWritePtr::~JackShmReadWritePtr – Init not done for -1, skipping unlock
    ALSA lib pcm_oss.c:404:(_snd_pcm_oss_open) Cannot open device /dev/dsp
    ALSA lib pcm_oss.c:404:(_snd_pcm_oss_open) Cannot open device /dev/dsp
    ALSA lib pcm_a52.c:1036:(_snd_pcm_a52_open) a52 is only for playback
    ALSA lib conf.c:5695:(snd_config_expand) Unknown parameters {AES0 0x6 AES1 0x82 AES2 0x0 AES3 0x2 CARD 0}
    ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM iec958:{AES0 0x6 AES1 0x82 AES2 0x0 AES3 0x2 CARD 0}
    ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
    ALSA lib pcm_usb_stream.c:481:(_snd_pcm_usb_stream_open) Invalid card ‘card’
    ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
    ALSA lib pcm_usb_stream.c:481:(_snd_pcm_usb_stream_open) Invalid card ‘card’
    Cannot connect to server socket err = Aucun fichier ou dossier de ce nom
    Cannot connect to server request channel
    jack server is not running or cannot be started
    JackShmReadWritePtr::~JackShmReadWritePtr – Init not done for -1, skipping unlock
    JackShmReadWritePtr::~JackShmReadWritePtr – Init not done for -1, skipping unlock

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Thème : Superposition par Kaira. CopyLerft 2025