UPDATE! A solution that includes the microphone as well!
The accepted answer is only a temporary solution, as after implementing it, my microphone no longer worked.
A more permanent solution would be to install the SOF firmware binaries from here: https://github.com/thesofproject/sof-bin
Specifically:
Clone the repository: git clone https://github.com/thesofproject/sof-bin.git
Change to directory: cd sof-bin
Follow: https://github.com/thesofproject/sof-bin#install-process-with-installsh
sudo mv /lib/firmware/intel/sof* some_backup_location/
sudo mv /usr/local/bin/sof-* some_backup_location/ # optional
sudo ./install.sh v2.2.x/v2.2
Reboot
After this the sound output as well as the microphone were working (Ubuntu 23.04, Lenovo X1 Gen8)
Note: Make sure that the snd_hda_intel.dmic_detect=0 or snd_intel_dspcfg.dsp_driver=1 settings are not set in GRUB_CMDLINE_LINUX_DEFAULT or /etc/modprobe.d/alsa-base.conf
How to fix my sound card in tuxedo os:
Make sure you have both sof-firmware and alsa-ucm-conf installed. Create the file /etc/modprobe.d/soundfix.conf or name it as you want and be able to identify it. Add this line to it:
options snd-intel-dspcfg dsp_driver=1
Once you reboot, you should have sound.
Discussion