(In reply to Zhang Heng from comment #56)
> https://bugzilla.kernel.org/show_bug.cgi?id=220694
> 
> This is very similar to the issue I handled, but I only got the speakers and
> headphones to work properly—there are still some issues after
> suspend/resume. The sound card ID and comment #53 might refer to the same
> machine. You can refer to my comments in this bug report and either continue
> building on my patch, or simply remove my fix and apply the correct one
> instead.

right... the fix does not survive suspend or hibernate
Anyway using according again to Opus5

"This is expected in retrospect but is worth recording explicitly, since
anyone using the userspace workaround will hit it: the vendor processing
coefficients on NID 0x20 are volatile register state. The snd_hda_intel
resume path restores pin configuration, amp gains and mixer state from
its internal cache, but it has no knowledge of these vendor COEFs
because they are not part of any fixup, so they revert to their power-on
defaults. Everything the driver knows about is restored correctly; the
one thing that actually enables the amplifier path is not.

Observed on both:
- systemctl suspend
- systemctl hibernate

WORKAROUND

Extending the systemd oneshot unit to also run after resume is
sufficient. The relevant part of the unit file:

  [Unit]
  Description=ALC274 HP AiO speaker amp init
  After=sound.target suspend.target hibernate.target hybrid-sleep.target 
suspend-then-hibernate.target

  [Service]
  Type=oneshot
  ExecStartPre=/bin/sleep 2
  ExecStart=/usr/local/bin/alc274-hp-fix.sh

  [Install]
  WantedBy=multi-user.target suspend.target hibernate.target 
hybrid-sleep.target suspend-then-hibernate.target

The combination of After= and WantedBy= on the sleep targets causes the
unit to run after resume rather than before suspend. systemctl reenable
is required after editing, so that the symlinks are created for the
additional targets. The script re-applies the four COEF writes on NID
0x20, the pin/EAPD/amp verbs on 0x17 and 0x21, and the mixer unmute
steps.

Verified working after both a suspend/resume cycle and a
hibernate/resume cycle, with no manual intervention.

ENVIRONMENT

Manjaro Linux, kernel 7.2.0-1-MANJARO, KDE Plasma 6.7.4 on Wayland,
PipeWire, snd_hda_intel with power_save=0."

So it works perfectly now, thanks again to wurs10's comment
https://bugzilla.kernel.org/show_bug.cgi?id=216139#c53 and to Opus5

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1982483

Title:
  No sound from built-in speakers HP Pavilion All-in-One Desktop
  27-ca1xxx (ALC274)

To manage notifications about this bug go to:
https://bugs.launchpad.net/linux/+bug/1982483/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to