No sound after sleep mode

I am using a 2016 macbook retina.
Sound didn’t work at first but it does now thanks to this driver on github
I had major issues with sleep mode (bugs and crashs when resuming) but its almost fixed by again, github (a command line)

But now my problem is I dont have sound when coming back from sleep mode. But it works just fine after a reboot. How do I fix this ? Is this because of the driver, the command line Im using? Cant I just use a command line to reboot the sound system or maybe prevent it from going to sleep mode ?
Thanks

Added 3rd-party-software, macbook, suspend-resume

I would say start by asking the devs. The driver may be a kernel module (havent looked) not loaded correctly on resume.

You may want to compare some things before and after sleep:
lspci | grep -i -E 'audio' | cut -b1-7 | xargs -i lspci -ks {}
cat /proc/asound/cards
wpctl status

Do the suspend issues happen with a certain suspend mode? If issues happen on deep S3 sleep, I wonder if switching to s2idle would work better?

The kernel boot option mem_sleep_default=s2idle can do that

Ok thanks Im gonna try, but I should have specified Im a total noob. So … in which file do I have to write this or what command line do I type ?

so here is the output before sleep:

 Citation lucas@device-98:~$ lspci | grep -i -E 'audio' | cut -b1-7 | xargs -i lspci -ks {}
00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
	Subsystem: Intel Corporation Device 7270
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel, snd_soc_skl, snd_soc_avs, snd_sof_pci_intel_skl
lucas@device-98:~$ cat /proc/asound/cards
 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0x92820000 irq 40
lucas@device-98:~$ wpctl status
PipeWire 'pipewire-0' [1.0.7, lucas@device-98.home, cookie:261231260]
 └─ Clients:
        31. uresourced                          [1.0.7, lucas@device-98.home, pid:1922]
        32. WirePlumber                         [1.0.7, lucas@device-98.home, pid:1960]
        40. WirePlumber [export]                [1.0.7, lucas@device-98.home, pid:1960]
        53. gnome-shell                         [1.0.7, lucas@device-98.home, pid:2004]
        54. pipewire                            [1.0.7, lucas@device-98.home, pid:2555]
        55. GNOME Shell Volume Control          [1.0.7, lucas@device-98.home, pid:2004]
        56. GNOME Volume Control Media Keys     [1.0.7, lucas@device-98.home, pid:2170]
        57. xdg-desktop-portal                  [1.0.7, lucas@device-98.home, pid:2596]
        58. Mutter                              [1.0.7, lucas@device-98.home, pid:2004]
        59. Firefox                             [1.0.7, lucas@device-98.home, pid:3117]
        65. Firefox                             [1.0.7, lucas@device-98.home, pid:3117]
        66. wpctl                               [1.0.7, lucas@device-98.home, pid:3817]
Audio
 β”œβ”€ Devices:
 β”‚      41. Audio interne                       [alsa]
 β”‚  
 β”œβ”€ Sinks:
 β”‚  *   42. Audio interne StΓ©rΓ©o analogique   [vol: 0.34]
 β”‚  
 β”œβ”€ Sources:
 β”‚  
 β”œβ”€ Filters:
 β”‚  
 └─ Streams:
        60. Firefox                                                     
             61. output_FL       > Analog:playback_FL	[active]
             62. output_FR       > Analog:playback_FR	[active]
Video
 β”œβ”€ Devices:
 β”‚  
 β”œβ”€ Sinks:
 β”‚  
 β”œβ”€ Sources:
 β”‚  
 β”œβ”€ Filters:
 β”‚  
 └─ Streams:
Settings
 └─ Default Configured Devices:
         0. Audio/Sink    alsa_output.pci-0000_00_1f.3.analog-surround-40

and after sleep

 Citation lucas@device-98:~$ lspci | grep -i -E 'audio' | cut -b1-7 | xargs -i lspci -ks {}
00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
	Subsystem: Intel Corporation Device 7270
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel, snd_soc_skl, snd_soc_avs, snd_sof_pci_intel_skl
lucas@device-98:~$ cat /proc/asound/cards
 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0x92820000 irq 40
lucas@device-98:~$ wpctl status
PipeWire 'pipewire-0' [1.0.7, lucas@device-98.home, cookie:1052035885]
 └─ Clients:
        31. uresourced                          [1.0.7, lucas@device-98.home, pid:1918]
        32. WirePlumber                         [1.0.7, lucas@device-98.home, pid:1958]
        40. WirePlumber [export]                [1.0.7, lucas@device-98.home, pid:1958]
        53. gnome-shell                         [1.0.7, lucas@device-98.home, pid:2000]
        54. pipewire                            [1.0.7, lucas@device-98.home, pid:2542]
        55. GNOME Shell Volume Control          [1.0.7, lucas@device-98.home, pid:2000]
        56. GNOME Volume Control Media Keys     [1.0.7, lucas@device-98.home, pid:2167]
        57. xdg-desktop-portal                  [1.0.7, lucas@device-98.home, pid:2589]
        58. libcanberra                         [1.0.7, lucas@device-98.home, pid:2167]
        62. Firefox                             [1.0.7, lucas@device-98.home, pid:3112]
        65. gsd-power                           [1.0.7, lucas@device-98.home, pid:2170]
        67. wpctl                               [1.0.7, lucas@device-98.home, pid:5631]
        74. Mutter                              [1.0.7, lucas@device-98.home, pid:2000]
        76. Firefox                             [1.0.7, lucas@device-98.home, pid:3112]
Audio
 β”œβ”€ Devices:
 β”‚      41. Audio interne                       [alsa]
 β”‚  
 β”œβ”€ Sinks:
 β”‚  *   45. Audio interne StΓ©rΓ©o analogique   [vol: 0.34]
 β”‚  
 β”œβ”€ Sources:
 β”‚  
 β”œβ”€ Filters:
 β”‚  
 └─ Streams:
        64. Firefox                                                     
             59. output_FR       > Analog:playback_FR	[active]
             60. output_FL       > Analog:playback_FL	[active]
Video
 β”œβ”€ Devices:
 β”‚  
 β”œβ”€ Sinks:
 β”‚  
 β”œβ”€ Sources:
 β”‚  
 β”œβ”€ Filters:
 β”‚  
 └─ Streams:
Settings
 └─ Default Configured Devices:
         0. Audio/Sink    alsa_output.pci-0000_00_1f.3.analog-surround-40

Id gladly do that but dont know where to access some sort of contact option on github (or should I do it elsewhere)

They have Github issues. Report an issue there, state your exact problem, how to reproduce, hardware and software details, kernel version, which kernel worked, which didnt anymore.

In opensource this is always done in public, if not security critical

You wanted to automate the the command you have to put always by hand when booting right?

If yes, please give this a try:
Linux cannot wake up after closing the lid Β· Issue #37 Β· Dunedan/mbp-2016-linux Β· GitHub

If you want to get in contact on Github, you generally just need an account there. Then on the app/driver you need help, you can go thru the open and closed issues to see if you find what you want to know.

Otherwise you can try to open a new issue.

Ok thanks this gave me part of the solution: github has (almost) all the answers.
Long story short, if anybody has the same problem:

1 - put back sound on your macbook using this driver
work of leifliddy

2 - solve the bugs caused by sleep mode (except for sound - but wait) by typing (under sudo su, I dont know better)

echo 0 > /sys/bus/pci/devices/0000:01:00.0/d3cold_allowed

3 - solve the β€œno sound after sleep mode” issue with this method
(I type these 3 lines:

$ echo s2idle | sudo tee /sys/power/mem_sleep
$ cat /sys/power/mem_sleep
[s2idle] deep

This solved my problems, even if the speakers sound is a bit downgraded now. My ONLY PROBLEM now is that I absolutely fail at making these commands automatic on boot, I tried multiple times with cron and stuff but I miserably fail. I need a noob-friendly solution if there is one.

Hope this helps somebody and also I hope somebody can help me with the automation ! Cheers and thanks

To add the kernel parameter.
sudo grubby --args="mem_sleep_default=s2idle" --update-kernel=ALL

To remove the kernel paramater.
sudo grubby --remove-args="mem_sleep_default=s2idle" --update-kernel=ALL

You can check the parameters with
sudo grubby --info=ALL

You could also try restarting wireplumber/pipewire after waking up.
systemctl --user restart wireplumber.service pipewire\*

Thank you !
So, adding the kernel parameter works for automatizing the fix to the β€œno sound after sleep” bug.
(No luck with restarting wireplumber but I already trying this way. thanks anyway)

Last remaining problem, making

echo 0 > /sys/bus/pci/devices/0000:01:00.0/d3cold_allowed

automatic at boot. I still have to go to terminal each boot to enter this one. I totally failed with cron. Is there a simple way to do this, maybe adding to kernel or something, like with the command line you gave me ?

Thanks a lot again !

Hi, this works, thanks again. Do you mind telling me what I would need to change to make this command work on Linux Mint ? The grubby part doesnt work. Thanks again !

I think you have to edit /etc/default/grub and run update-grub

I would recommend checking on their forums.

Thank you !

On a side note regarding your other question you could try something a udev rule

ACTION=="add", KERNEL=="0000:01:00.0", SUBSYSTEM=="pci", RUN+="/bin/sh -c 'echo 0 > /sys/bus/pci/devices/0000:01:00.0/d3cold_allowed'"
1 Like

will do thanks ! It works with crontab though

1 Like