Linux Mint 20 Upgrade on Lenovo Thinkpad X1 Carbon 7th Sound and Fingerprints

Linux Mint 20 Upgrade on Lenovo Thinkpad X1 Carbon 7th Sound and Fingerprints

Linux Mint 20 has been released some days ago and now there is also the upgrade guide available for you who also have Mint 19.3 running.
I don't want to cover the upgrade itself, as it is very good described in the Linux Mint forum article but rather tell you what I experienced after the upgrade with my Lenovo Thinkpad X1 Carbon 7th Gen - or X1C7 for short.

Sound

So you may have also read my last post regarding the 4 channel sound on the X1C7 on Mint 19.3 here.
Thankfully this isn't needed anymore on Mint 20 which uses Ubuntu 20.04 Focal as a new base system. With the new 5.4.x base kernel and some other enhancements to Alsa and Pulseaudio just one little fix was needed on my X1C7 after the upgrade. If you had almost the same Sound setup that I had before the upgrade, after the upgrade, the sound will work basically* just fine with all 4 channels.

*Basically means you can either totally mute the sound or make it half loud or 100% loud but nothing in between. Let us fix the volume up/down issue now.
Edit the file /usr/share/alsa/ucm2/sof-hda-dsp/HiFi.conf and make the changes according to the patch in the box below. Kudos to gobenji for finding a fix.

+++ /usr/share/alsa/ucm2/sof-hda-dsp/HiFi.conf
@@ -20,9 +20,9 @@ SectionDevice."Headphones1" {
 	Value {
 		PlaybackPriority 200
 		PlaybackPCM "hw:${CardId}"
-		PlaybackMixerElem "Headphone"
+		PlaybackMixerElem "Master"
 		PlaybackMasterElem "Master"
-		PlaybackVolume "Headphone Playback Volume"
+		PlaybackVolume "Master Playback Volume"
 		PlaybackSwitch "Headphone Playback Switch"
 		If.jack {
 			Condition {
@@ -72,9 +72,9 @@ SectionDevice."Speaker" {
 	Value {
 		PlaybackPriority 100
 		PlaybackPCM "hw:${CardId}"
-		PlaybackMixerElem "Speaker"
+		PlaybackMixerElem "Master"
 		PlaybackMasterElem "Master"
-		PlaybackVolume "Speaker Playback Volume"
+		PlaybackVolume "Master Playback Volume"
 		PlaybackSwitch "Speaker Playback Switch"
 	}
 }

With this being fixed, either reboot the machine or run systemctl --user restart pulseaudio.service.

After that we also want to have our 4 channel sound back with a small quirk. You can enable the output of the bass speakers via the "Headphone" channel by running sudo hda-verb /dev/snd/hwC0D0 0x17 SET_CONNECT_SEL 1.

With that, all 4 speakers and volume/up down work again. Use alsamixer to first max out all channels and then normally control the master with your keyboards volume buttons.
To make the hda-verb fix permanent you can either put it into /etc/crontab as @reboot hda-verb... or create a small systemd service that will do it for you upon reboot or suspend/resume. To make this post short, click here for the post and kudos to bleiva for writing the code pieces!

Fingerprints

New to Ubuntu 20.04 is the good support for fingerprint readers. And guess what, also for Mint 20.

Today I got the fingerprint service running very easily and can now use my finger to unlock my PC or instead of entering the password for sudo or tools that require admin privileges.

Here are the steps from installation to enrolling a finger to enabling the PAM module.

# Install necessary packages
~$ sudo apt-get install fprintd libfprint-2-2 libfprint-2-tod1 libpam-fprintd
# Enroll the first (right index) finger in fprintd
~$ fprintd-enroll
# Activate the fingerprint pam module
# Select the Fingerprint module at the top of the list and press OK
~$ sudo pam-auth-update

Now you have installed fprintd, enrolled one finger and activated the PAM module.
Just lock your PC and try to unlock it again just with your finger!

Caveat: I only got it properly running by registering a single finger but as far as I could read this is most likely an open bug in libfprint. Nevertheless I only have one finger that is reasonably usable from a position perspective on my X1C7 anyways.

Conclusion

So far the update from Linux Mint 19.3 to 20 went super smooth. A lot of bugs where fixed and the system is super stable so far. With the small fixes above and the feature that I finally can use my fingerprint reader I am very happy with my X1C7 Mint 20 system overall.

If you find a fix for my limited-finger problem, let me know in the comments.