Fixing headphone audio on Libreboot T480s

I’m going to post this in case anyone else has this problem.

On Thinkpad T480s, you can install Li
breboot. The information about general compatibility with Libreboot is on this page: Libreboot – Install Libreboot on Lenovo ThinkPad T480 and/or T480s

Note that there is a section about using the headphone jack. It says that there is a bug, however it works fine, as long as you use pulseaudio; it specifically notes that it doesn’t work for pipewire.

Unfortunately, as of Qubes r4.2, dom0 comes with pipewire installed, and it’s not recommended to install different packages. And so, the headphone jack doesn’t work properly. To be specific:

  • Plugging into the headphone jack results in audio playing on speakers to halt
  • However, (as also noted on the Libreboot page), pavucontrol doesn’t automatically switch from Speakers to Headphones.
  • Although it doesn’t switch automatically, and there is no sound coming out of either speakers or headphones, the playback indicator in pavucontrol continues to move in response to the audio signal.
  • Manually switching to Headphones (Undetected) in pavucontrol causes audio to play very briefly in the headphones, then it goes silent. The playback indicator also stops moving.
  • With Headphones selected in pavucontrol, if you run speaker-test in dom0, it will fail with the error: unable to set hw params for playback: Input/output error

The solution I found is this:

  • Switch pavucontrol back to Speakers
  • Start alsamixer
  • Press F6 and instead of - (default) pick the second option that reads default:0 HDA Intel PCH. This will cause additional sliders to appear in the interface
  • Unmute the slider called Headphone, by clicking on the MM label below it. Also adjust the volume

This fixed the problem for me. The parts I don’t understand are:

  • why the headphones are muted in the first place
  • why alsamixer displays different sliders when selecting the second entry in the F6 menu; it’s not like there are actually different sound cards in the laptop. Plus, both entries in the menu have the keyword default anyway. It seems like the second entry activates a more advanced view of the first one?
  • I also don’t get why the same settings don’t seem to be exposed by pavucontrol

In dom0, you can use the qubes-dom0-update command to switch between pulseaudio and pipewire:

> 
> [user@dom0 ~]$ qubes-dom0-update --help
> This tool is used to download packages for dom0. Without package list
> it checks for updates for installed packages
> 
> Usage: /usr/bin/qubes-dom0-update [options] [<pkg list>]
>     --clean      clean dnf cache before doing anything
>     [...]
>     --switch-audio-server-to=(pulseaudio|pipewire) switch audio daemon to pipewire or pulseaudio
>                  it will be done after requested action (update by default)
>     [...]
1 Like

but it’s not recommended to install packages in dom0, except security updates.

Both pulseaudio and pipewire come from the QubesOS repositories; there is no extra package involved, just switching from one audio framework to another.

I also found a trick a while ago: it takes only few clicks. Please see the heads report for t480. It should work for libreboot machines too

Could you please elaborate on what “the heads report for t480” means?

Heads is a payload for coreboot: https://osresearch.net/. The post is from 11.03 in the link in previous post.