Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no sound after sleep/resume (KDE) #18

Open
Madman600 opened this issue Jun 13, 2022 · 18 comments
Open

no sound after sleep/resume (KDE) #18

Madman600 opened this issue Jun 13, 2022 · 18 comments

Comments

@Madman600
Copy link

Sound works until I sleep and resume the macbook (April 2016 12" - Version 9,1)

@leifliddy
Copy link
Owner

Suspend and resume is working for you with the internal nvme ssd?

@Madman600
Copy link
Author

Madman600 commented Jul 3, 2022 via email

@leifliddy
Copy link
Owner

Really!? AFAIK, this issue has never been solved.
REF:
Dunedan/mbp-2016-linux#133
cb22/macbook12-spi-driver#2
cb22/macbook12-spi-driver#30

Can you please provide the details on how you managed to get suspend/resume working while booted to the nvme drive?
How are you suspending and resuming the laptop (via the gui, closing the lid, pressing the power button, command line...etc)
Are you using grub to boot the system?

Can you please post the output of the following commands?

cat /sys/class/dmi/id/product_name
cat /sys/class/dmi/id/bios_version
uname -a
grep PRETTY_NAME /etc/os-release
lsblk

@leifliddy
Copy link
Owner

I'm running kernel 5.18.9 and if I suspend via systemctl suspend and then resume the system -- the filesystems on the nvme drive become read-only and can no longer be written to. This is the same issue we were running into before. As far as I can tell, nothing has changed.

@Madman600
Copy link
Author

I'm booting using efi.

MacBook10,1
447.80.3.0.0
Linux frank 5.18.3-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 09 Jun 2022 16:14:10 +0000 x86_64 GNU/Linux
PRETTY_NAME="Arch Linux"
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 465.9G 0 disk
├─nvme0n1p1 259:1 0 300M 0 part /boot
└─nvme0n1p2 259:2 0 465.6G 0 part /
nvme0n2 259:3 0 8K 0 disk

@leifliddy
Copy link
Owner

So you actually have a MacBook10,1 which is the 2017 model. That shouldn't make a difference though.
>I'm booting using efi.
Can you be more specific? If you run blkid /dev/nvme0n1p1 what is value of TYPE?
Are you using systemd-boot as the bootloader?

@Madman600
Copy link
Author

Madman600 commented Jul 5, 2022 via email

@Madman600
Copy link
Author

Madman600 commented Jul 5, 2022 via email

@leifliddy
Copy link
Owner

I've tried that method before. It doesn't work on the Macbook9,1

@DumbGameMaker
Copy link

tried adding acpiphp.disable=1 to grub?

@leifliddy
Copy link
Owner

It's been years since I last revisited this topic.
So acpiphp.disable=1 doesn't work, but this does

echo 0 > /sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/nvme/nvme0/device/d3cold_allowed

That's pretty cool. So it looks like the audio does not work after resuming from suspend.
Unfortunately, it's been ages since I've worked on this driver and I simply don't have the desire to develop it any further at the moment.

@ronnygroenhaug
Copy link

Hello there, I am not an experienced Linux user, but have managed to get this far on my Early 2016 MacBook - Ubuntu 22.04 installed and (thanks to this github page) I also have sound now, THANK YOU!! I have been looking and trying all sort of things, but this is the one that works for me. As I understand from your comment above, you will no longer work on this project.
As the inexperienced user that I am, what does the echo-command do, and what do you mean by that "its working" ? Can I have this command run on startup, and have sound?
As of now I head into Terminal and run your magic commands+reboot when I need sound (as it dissapears after sleep and reboot).
Sorry for my poor knowledge.

@DumbGameMaker
Copy link

DumbGameMaker commented Jul 26, 2022 via email

@DumbGameMaker
Copy link

DumbGameMaker commented Jul 26, 2022 via email

@leifliddy
Copy link
Owner

leifliddy commented Jul 26, 2022

>As I understand from your comment above, you will no longer work on this project.
I'm not a kernel developer and had a ton of help writing this driver.
I did spend several hours attempting to get resume/suspend working. It's just a really difficult problem (for me anyway), even just reloading the snd_hda_codec_cirrus module causes it to stop working.

>what does the echo-command do
So that echo command prevents the internal nvme drive from going into a low-powered state. Which is the state it normally goes into when suspending a system. So when you run that echo command and then suspend the system, the nvme drive will remain powered on. If I don't run that echo command and try to suspend my 2016 macbook, the nvme drive does not come back online and I have to power cycle the system.

Several MBP models also have this issue:
https://github.com/Dunedan/mbp-2016-linux#suspend--hibernation

>As of now I head into Terminal and run your magic commands+reboot when I need sound (as it dissapears after sleep and reboot).

So when you run those command, it's simply create a new sound module here:
/lib/modules/$(uname -r)/updates/snd-hda-codec-cirrus.ko

when you suspend and resume the system, yes the sound will no longer work. But simply rebooting the system shouldn't affect anything. Try powering down the system and powering it back on (as opposed to just rebooting it) and see if that works.

Also anytime you update your kernel, you'll need to run run those magic commands again (on the next reboot) -- as that module needs to be built for every new kernel that's installed.

@x5444
Copy link

x5444 commented Aug 7, 2022

Suspend-to-RAM breaks audio on my 2017 MacBook 10,1 the same way as reported.

However, I found that Suspend-to-Idle keeps the driver functional! I don't yet know what exactly that means for power consumption but to me it's a better solution than having to reboot on every lid-open. Overall I'm happy with this. I hope this isn't stating the obvious for you all.

Practically, that means replacing the systemd-suspend.service with a call to something like echo freeze > /sys/power/state, since sadly systemd-logind doesn't seem to support Suspend-to-Idle as a target by itself.

I also noticed some weird behavior when closing the lid while audio is playing but I can work around that. Finally, you still seem to need the NVMe fix (disabling it's sleep state) or it'll crash on resume from idle.

Information on the various sleep states can be found in the Kernel doc.

@Madman600
Copy link
Author

Madman600 commented Oct 11, 2022 via email

@Madman600
Copy link
Author

Madman600 commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants