The sound on my ThinkPad Yoga X1 used to work a while ago. I'm not sure what changed, but now it doesn't work anymore. It still works continued to work for some time on the parallel installation of ubuntu 18.04 (yes, I have the same distro installed twice). It does still work on the parallel installation of windows 10.
When I press the volume buttons on my keyboard, it changes the volume of a "Dummy Output" device.
lspci
lists the audio device:
$ lspci | grep -A8 Audio
00:1f.3 Audio device: Intel Corporation Device 9dc8 (rev 11)
00:1f.4 SMBus: Intel Corporation Device 9da3 (rev 11)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Device 9da4 (rev 11)
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (6) I219-LM (rev 11)
03:00.0 Non-Volatile memory controller: Micron/Crucial Technology Device 2263 (rev 03)
05:00.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
06:00.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
06:01.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
06:02.0 PCI bridge: Intel Corporation JHL6540 Thunderbolt 3 Bridge (C step) [Alpine Ridge 4C 2016] (rev 02)
But aplay does not find it
sudo aplay -l
[sudo] password for generic:
aplay: device_list:270: no soundcards found...
$ pacmd list-sinks
1 sink(s) available.
* index: 0
name: <auto_null>
driver: <module-null-sink.c>
flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 1000
volume: front-left: 46332 / 71% / -9.04 dB, front-right: 46332 / 71% / -9.04 dB
balance 0.00
base volume: 65536 / 100% / 0.00 dB
volume steps: 65537
muted: no
current latency: 0.00 ms
max request: 344 KiB
max rewind: 344 KiB
monitor source: 0
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
configured latency: 0.00 ms; range is 0.50 .. 2000.00 ms
module: 14
properties:
device.description = "Dummy Output"
device.class = "abstract"
device.icon_name = "audio-card"
I am running ubuntu 18.04 with ZFS on root. That means I can try a solution and roll back if it did not work. Which means I tried several solutions.
Related links that did not help:
What I tried:
sudo apt-get --purge remove linux-sound-base alsa-base alsa-utils && reboot
sudo apt-get install build-essential linux-headers-
uname -ralsa-base alsa-firmware-loaders alsa-oss alsa-source alsa-tools alsa-tools-gui alsa-utils alsamixergui
adding the user
generic
to the groupaudio
the three above combined
both fixes in the linuxuprising post
modprobe snd_hda_intel && modprobe sof_pci_dev
Adding
snd_hda_intel.dmic_detect=0
to the GRUB boot argumentsInstalling a collection of packages from
ppa:nilarimogard/webupd8
as advised hereReinstalling alsa-related packages, using dkms. See here
Reinstalling
pavucontrol
andpulseaudio
as per this QA
My system is
$ uname -r
5.3.0-51-generic
Possibly unrelated, possibly related:
My screen brightness controls have disappeared as well. They were broken once before, and I fixed that by adding acpi_backlight=video
to the GRUB_CMDLINE_LINUX_DEFAULT
in /etc/default/grub
and updating grub and rebooting. But that fix is still in place and still it is broken again.
How can I get the sound working again?
When I boot off a live stick of ubuntu 18.04, the sound does work again.
# live system version:
$ uname -a
Linux ubuntu 5.3.0-28-generic #30-18.04.1-Ubuntu SMP Fri Jan 17 06:14:09 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
# aplay output on live system:
ubuntu@ubuntu:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC285 Analog [ALC285 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4]
Subdevices: 1/1
Subdevice #0: subdevice #0
(On the non-live system)/var/log/apt/term.log
and /var/log/apt/history.log
and /var/log/dpkg.log
are all empty when viewed with sudo vim <filepath>
. But there is a file history.log.1.gz
which contains all the history. I'm reviewing it, but I don't know what to look out for.
I have booted off the oldest zfs snapshot I currently have on the laptop (not incredibly old, due to me getting complications with zfs back then) and the sound does not work there either. It also does not work when I boot with the older kernel version 5.3.0-28
that is the same as on the live usb stick.
git diff --no-index apt_live.txt apt_tank.txt
where the files contain the respective outputs of apt list --installed
gives me too much output. Many version numbers have changed.
I have added the tags 19.04 and 20.04 in retrospect since the fix applies to those as well, according to the sources.
This answer fixes the sound but breaks the brightness control.
I am leaving it here for documentation purposes
and hopefully will be able to review it later when I found a better fix.Please consider this followup answer!
I had already tried that before without success. It has now worked the second time after I not only did the above but also followed Adam's advice to run
pulseaudio --start
after rebooting.Note that this may take a few seconds until the sound starts working.
Because it could have been that only Adam's advice was important, I removed the line
options snd-hda-intel dmic_detect=0
again and rebooted. It stopped working again. So I edited it in again and rebooted another time. And this time the sound worked without needing to runpulseaudio --start
.I don't understand that, but this seems to be the fix. If it turns out that I need to run
pulseaudio --start
every time at startup, I will just add that command to my.profile
or.bashrc
. Although after rebooting a few times to test this, I'm pretty sure you don't actually need thepulseaudio --start
- just wait some time after the boot. Approximately a minute.Regarding the "possibly related" part of my question
Directly after I noticed that the volume keys are now working and making a sound, I pressed a brightness key. And they no longer work. I will try the fix that was linked to in one of my quoted articles in this answer and edit my answer once I know whether it worked.
Regarding the delay after boot until the sound works: Perhaps this has to do with it.
My first attempt was this answer which fixed the sound but breaks the brightness controls.
I later noticed weird behaviour in combination with my different grub bootloader menus and started to write a new question. While writing that question, I performed more testing until it became more of a blog post than a question, since it also contains several answers to implicit questions.
You will find it below the horizontal line.
TL;DR
Removing
nomodeset
andacpi_backlight=video
did the trick for me. Sound and Brightness Controls now work - possibly at the expense of hibernation.Long Writeup of Testing this
This is a new perspective on the question originally posed as Sound card not detected on Ubuntu 18.04. It has become wildly more weird. But for you to understand my utter confusion, you'll need some pretext:
I have three partitions with ubuntu 18.04 on each. In the end, I will get rid of two of them, but they are
EXT 4
,ZFS unencrypted
,ZFS encrypted
. Each has a different background so that I know to which I am logged in.I also have grub installed at two places. Probably because I did not set a separate boot partition for the EXT4 system. So I have
/dev/nvme0n1p8/boot
but also/dev/nvme0n1p5 (boot partition)
. Both contain a kernel and initrd5.3.0-51-generic
. Thep5
contains also5.3.0-53-generic
and thep8/boot
contains also53.0-28-generic
and some old4-15-0-101-generic
. However, I'm not even sure these boot partitions matter much.In order to distinguish the two grubs, I have added a theme to the one on
p5
.When I start the laptop, it boots to the grub GUI on
p5
. It has some problems with correctly listing multiple zfs partitions so I made a custom entry, but that shouldn't matter here either.To open the grub GUI on
p8
, I press Esc to get to the grub terminal and there I enterWhen I boot from grub on
p5
, the brightness keys and the sound are broken.When I boot from grub on
p8
, they work flawlessly.I've made sure to use the same kernel and system in both instances. In fact, I have tried several times in the hopes that it may be due to some kernel boot argument.
The problem is not bound to one of the three ubuntu installations. I can boot any of them so that the sound works and so that it does not, depending on the grub I'm using.
The problem is not bound to one kernel version. I can boot from both
51
and53
into any partition and the sound works or does not, depending on the grub I'm using.The problem is not due to different kernel images of the same version. I can boot from the
p8
grub with the kernel53
located on thep5
partition and the sound will work.Testing
Let us only consider only the simple ext4 partition for now. The encrypted zfs partition behaves the same though (and the unencrypted zfs partition I haven't checked).
First of all, I have tried several combinations of boot arguments, but I think the following three tests should be enough for this question.
old
for the ext4-menuentry with grub onp8
ornew1
for the ext4-menuentry with grub onp5
.kernel partition
was set to8
by editing the menuentry to containset root=(hd0,gpt8)
right before the line starting withlinux
and prefixing the path to the kernel and to the initrd with/boot
.Analogously, the
kernel partition
was set to5
by insertingset root=(hd0,gpt5)
and removing the prefix/boot
from the kernel and initrd paths.]kernel version, sound works?[
is about the presence of the respective kernel boot argument. Those are arguments that were set in at least one of the grub menuentries, but as you can see in the table, the behaviour remained the same without those.I have also tested whether the presence of
quiet splash
has any effect, but it also does not seem to have any.To be absolutely certain that the boot arguments don't have any impact, I tried booting from the grub terminal directly.
Sound and brightness keys work in this way.
Sound and brightness keys do also work in this way! (unexpected at this point)
Sound and brightness keys do also work in this way. (expected since started from grub on
p8
).Sound and brightness keys still work in this way! (unexpected!). Now if I instead don't open the grub terminal and directly go editing the entry, the same behaviour. So there is not some magic involved with the
normal
command.Also, not writing the
set root=(hd0,gpt5)
seems to be fine.When I run the entry as it was generated in the grub GUI on
p5
, the brightness and sound do not work. So I shall now try and build that entry from the ground up. (Prepare for lots of typing)Sound and brightness keys still work.
Sound and brightness keys still work.
Boots into emergency mode with "Failed to mount /boot/efi" (wrong fs type, bad option, bad superblock on /dev/nvme0n1p2 ...)
So I remove the
gfxmode $linux_gfx_mode
again and continue:Sound and brightness keys still work.
Sound and brightness keys still work.
I have inserted the
gfxmode $linux_gfx_mode
again and it still boots well and the Sound and Brightness Keys still work.And the screen brightness and Sound no longer work!
Again, without
nomodeset
:The Sound and Brightness keys still work.
Sound and Brightness keys still work.
Worth noting that I only had
acpi_backlight=video
there in the first place because the brightness keys were not working. And I hadnomodeset
(which currently seems to be the culprit) there because it fixes hibernation. Maybenomodeset
broke my brightness keys and sound, which I then tried to fix usingacpi_backlight=video
?So including
nomodeset
again:The sound and brightness are now not working, so it is unclear to me why the brightness fix with
acpi_backlight=video
worked for me last time. I applied it May 9 and thenomodeset
was already in March... perhaps I removed and re-added that some time and didn't realize the effects it had on the brightness keys.I would prefer having one problem over having two problems, so here's again removing
nomodeset acpi_backlight=video
and adding the final argument:As expected, sound and brightness work again. I have not tested hibernation now. I assume it will either work due to the recent bios and firmware update by lenovo, or still not work in the same way as in my question about it. But that will be a different problem for a different day.
Now for the question that remains: why did it seem like it worked in the old bootloader?
Well... turns out that in most of my tests did not modify "nomodeset". But in one that you can see in the table higher above, the sound did not work with the
p5
bootloader, kernel 51 fromp8
, withoutacpi_backlight
and withoutnomodeset
.I can no longer reproduce that. Perhaps I made a mistake while taking notes.