I have a Xioami notebook pro laptop on Ubuntu 20.04 (same issue on 18.04).
After the laptop goes in sleep/hibernate mode, there is no sound that comes out of the speakers. The system settings (settings>sounds) are detecting music is being played and the headphones are working fine after sleep. The issue is only related to the speakers integrated in the laptop. As a quick fix, I need to reboot to have the speakers to work again.
I have tried the options below without success:
- Open alsamixer and do not see any "muted speaker"
- Enter in the terminal:
sudo alsa force-reload
- Set up the script that reload alsa after sleep as indicated on the Ubuntu help page
pavucontrol
is also install on my laptop- Tried to kill and restart pulseaudio
Let me know if you have any ideas to fix the issue.
I believe it is driver related, but I'm not sure how to resolve this.
Please find below the information mentioned on the hardware.
aplay -l
:
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC256 Analog [ALC256 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
cat /proc/asound/cards
:
0 [PCH ]: HDA-Intel - HDA Intel PCH
HDA Intel PCH at 0xb4214000 irq 147
lspci -nnk | grep -A2 Audio
:
00:1f.3 Audio device [0403]: Intel Corporation Device [8086:02c8]
Subsystem: Xiaomi Device [1d72:1905]
Kernel driver in use: snd_hda_intel
pacmd list-cards
:
1 card(s) available.
index: 0
name: <alsa_card.pci-0000_00_1f.3>
driver: <module-alsa-card.c>
owner module: 7
properties:
alsa.card = "0"
alsa.card_name = "HDA Intel PCH"
alsa.long_card_name = "HDA Intel PCH at 0xb4214000 irq 147"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:00:1f.3"
sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "02c8"
device.form_factor = "internal"
device.string = "0"
device.description = "Built-in Audio"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
Thanks.
I have a success story (thank to Night Str)!
The same hardware. The same situation after sleep mode. First of all get root privileges:
Than discover your devices:
So, my device id is 00:1f.3. Let`s check it:
Here is the trick:
The first command disconnects the driver from the device and detaches the device from the tree. The driver (snd_hda_intel) is not unloaded, just disconnected. The second command rescans pci devices.
As result, sound appears back.
i have same problem. And i find a solution, but it dosn't work in kde i don't known why.
Solution:
To search the device address:
lspci | grep Audio
Update:
Solution to apply commands after wakeup:
You can create new file:
/lib/systemd/system-sleep/99_restart_sound
and insert the following source code:The file must be executable:
type this command:
pulseaudio -k
each time your computer out of sleep.
could be related to this bug: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1888598
This command worked for me
amixer -q -D pulse sset Master toggle
Seems it mutes then unmutes the master audio device
After figuring out all the audio device IDs from
lspci -vvv
(please replace device id according in the below mentioned commands) :