Linux on Macbook 12" early 2016

PvdM

New Member
Joined
May 30, 2024
Messages
11
Reaction score
1
Credits
99
Hello all, I've installed Ubuntu (latest stable distro) on my Macbook 12" Retina (core m5, 8 Gig memory).

I've managed to get it all working (including Bluetooth and sound over internal speakers) but one bug is annoying the xxx out of me.
Whenever I close the lid, or leave it too long =it suspends/hibernates, I cannot start it up again. I do get a screen to log in, but it does not work. The only thing I can do is restart the laptop....

I've also tried installing Linux Mint (19.3). It seemed to work fine. I could close the lid and it would fire up again after opening it. But then neither the Bluetooth nor the internal speakers wore working.....

Mmmmm, anybody out there with a Macbook 12 inch and a working distro??

Regards, Peter van der Maas.
 


This is a known I/O problem with Macbook pros and most of the time it has nothing to do with the operating systems. Usually the manufacturer's (Apples's) solution would be to replace that circuit for a couple of hundred dollars. However, since you are running Ubuntu, you are in luck, because you can tell your machine not to go to sleep when the lid is closed. To do so,

You need to edit a file, named logind.conf in /etc/systemd/logind.conf , but it can be edited using this command in your terminal:sudo -H gedit /etc/systemd/logind.conf

At the bottom of the text, add: HandleLidSwitch=ignore

Execute this command to restart your systemd daemon and have the command settle in, otherwise it won't work. sudo service systemd-logind restart or Reboot your machine

I strongly advise you don't run your Macbook pro on closed lid for a long time as it will cause ventilation problems and quickly heats up the system. The best thing to do is just to simply shut it down when not in use
 
Thanks for the swift reply (GatorsFan). I hope you don't mind me not following up your solution.

The laptop is functioning wonderfully when it is running MacOs. It goes in suspend mode after closing the lid and wakes up instantly when I open it. The same on Linux Mint. So I am not convinced it is a hardware problem.

For me the instant wake up is very important. It is the main reason I prefer MacOs over Windows. BTW, it is not a MacBook Pro, but a MacBook. A very small, thin premium laptop. I love its portability, its hires screen, its battery (still around six hours, for a laptop over eight years old..) and the fact it has no fan. But it gets too slow after eight years. An Intel core m5 processor has its limits. I would like to revive it with a Linux distro. And Ubuntu almost did the trick. Everything was functioning OK, accept for the suspend/hibernate function.

So thanks for your solution, but I'll keep on trying to revive it with the closing of the lid making it go in suspension mode....
 
And Ubuntu almost did the trick. Everything was functioning OK, accept for the suspend/hibernate function.
try MX-Linux often works where others don't
 
Unfortunately, this distro doesn´t help. I've found a way....in Linux Mint. If I run a little script in the terminal (sudo echo 0 > /sys/bus/pci/devices/0000\:01\:00.0/d3cold_allowed) the suspend mode does work. But after the first suspend....the sound doesn´t work anymore. Sound over bluetooth keeps functioning....so I am halfway there....
Anybody any suggestions??
 
Hello all, I've installed Ubuntu (latest stable distro) on my Macbook 12" Retina (core m5, 8 Gig memory).

I've managed to get it all working (including Bluetooth and sound over internal speakers) but one bug is annoying the xxx out of me.
Whenever I close the lid, or leave it too long =it suspends/hibernates, I cannot start it up again. I do get a screen to log in, but it does not work. The only thing I can do is restart the laptop....

I've also tried installing Linux Mint (19.3). It seemed to work fine. I could close the lid and it would fire up again after opening it. But then neither the Bluetooth nor the internal speakers wore working.....

Mmmmm, anybody out there with a Macbook 12 inch and a working distro??

Regards, Peter van der Maas.
Hello, I also have a MacBook 9.1 and now I'm using Ubuntu, but I don't know how to get the sound to work, I've tried a lot of methods. can you please tell me how you fix it.
 
Hi there, try the following and let me know if it works.

Open a terminal and run:
apt install dkms gcc linux-headers-generic make wget

After that run:
git clone https://github.com/leifliddy/macbook12-audio-driver.git

cd macbook12-audio-driver/


# run the following command as root or with sudo
./install.cirrus.driver.sh

After all this reboot your system....and in my system sound over the speakers worked again. Not the headphone-plug. But the speakers and sound over Bluetooth work fine.

Good luck!
 
Hi there, try the following and let me know if it works.

Open a terminal and run:
apt install dkms gcc linux-headers-generic make wget

After that run:
git clone https://github.com/leifliddy/macbook12-audio-driver.git

cd macbook12-audio-driver/


# run the following command as root or with sudo
./install.cirrus.driver.sh

After all this reboot your system....and in my system sound over the speakers worked again. Not the headphone-plug. But the speakers and sound over Bluetooth work fine.

Good luck!
hmm this is very strange because I have already tried this on many systems such as ubuntu manjaro lmde debian, maybe it also depends on DE since I haven't tried it on gnome

edited: I installed default ubuntu with gnome then installed these drivers and it still doesn't work (
 
Last edited:
I've installed this on my Macbook 12 inch running Linux Mint (21.3) and also running on Ubuntu (latest stable version). Both times it worked like a charm. Sorry it did't work for you. Is your system a Macbook (12 inch screen, no fan) or a Macbook Pro?
 
Hello all, I've installed Ubuntu (latest stable distro) on my Macbook 12" Retina (core m5, 8 Gig memory).

I've managed to get it all working (including Bluetooth and sound over internal speakers) but one bug is annoying the xxx out of me.
Whenever I close the lid, or leave it too long =it suspends/hibernates, I cannot start it up again. I do get a screen to log in, but it does not work. The only thing I can do is restart the laptop....

I've also tried installing Linux Mint (19.3). It seemed to work fine. I could close the lid and it would fire up again after opening it. But then neither the Bluetooth nor the internal speakers wore working.....

Mmmmm, anybody out there with a Macbook 12 inch and a working distro??
Regards, Peter van der Maas.
Hi, I switched from macOS to Fedora this summer, on a macbook 12 retina (2016), I believe the same machine as you. After a lot of difficulties I managed to find a solution to almost every problem I had (sound, buggy sleep mode, then sound not working after sleep, poor sound quality ...) and it kinda works fine.

What about you ? would you mind sharing the solutions you found ? Is there a distro that works better with this macbook in the end ?

Also if you are interested I can share the fixes I found.

Cheers
 
Hi there, I am certainly interested in sharing the solutions I found. But so far I could not make them ALL work. So I did fix the sound, and the bluetooth and in the end I even got the sleep mode working. But after one-time coming back from sleep mode.....the sound doesn't work over the speakers anymore. Over BT sound is working properly....

So....how did you manage to get the sound working after sleep???? If that's solved... my Macbook would be working like a charm. I even got Word, Excel and PowerPoint working (with Wine).

I am using Linux Mint. You seem to have it all working....anything I can share with you?
Regards, Peter.
 
Hi there, I am certainly interested in sharing the solutions I found. But so far I could not make them ALL work. So I did fix the sound, and the bluetooth and in the end I even got the sleep mode working. But after one-time coming back from sleep mode.....the sound doesn't work over the speakers anymore. Over BT sound is working properly....
foun
So....how did you manage to get the sound working after sleep???? If that's solved... my Macbook would be working like a charm. I even got Word, Excel and PowerPoint working (with Wine).

I am using Linux Mint. You seem to have it all working....anything I can share with you?
Regards, Peter.
Hello again.

So, here is what problems I was facing and how I solved these problems (I take credit for nothing, only found online and in forums). (I am using Fedora, Idk if some command lines might be different on Mint. You might have to install crontab if it exists on Mint for example but I think everything here is possible on another distro even if it requires changing it a bit)

1 - no sound
2 - system was broken after sleep mode
3- no sound after sleep mode even after fixing sleep mode problem
and then making all the solutions automatized at boot so I dont have to type stuff in the terminal every time.

Here are the solutions:
1 - no sound: simply install this driver leifliddy macbook 12 audio driver
2 - sleep mode bug:
sudo su then
echo 0 > /sys/bus/pci/devices/0000\:01\:00.0/d3cold_allowed

To make it permanent and automatic at boot:
crontab will make the command line execute itself every time you boot. source

terminal:
sudo su
crontab -e
@reboot echo 0 > /sys/bus/pci/devices/0000\:01\:00.0/d3cold_allowed



3 - to make sound work after sleep mode, I changed the sleep mode from "deep" to "s2idle" (different sleep system, saves less power among other things, but it works):
solution is from here
to make it simple, open terminal and:
echo s2idle | sudo tee /sys/power/mem_sleep
cat /sys/power/mem_sleep
[s2idle] deep


Then it works !

To make it permanent and automatic at every boot: source
just add the kernel parameter

To add the kernel parameter. terminal:
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


And here you go ! after these steps, when my macbook boots on Fedora I dont have to enter any command. Sound works, sleep works, sound works after sleep.
Let me know if it works for you.
May I ask what problem did you have with bluetooth ? mine works fine but just wont turn on sometimes at boot and I have to reboot. I have no fix for this currently (edit: I installed leifliddy's bluetooth driver from github and it seems to work fine today, though I might just be lucky, I'll wait a few days and see if the bug comes back)
 
Last edited:
Thanks for sharing your solutions. They work like a charm. There is just one thing I can't get fixed....making it permanent and add the kernel parameter. The command "grubby" is not recognized .... I think it has something to do with me using Linux Mint and you using Fedora. I have the same problem as you with bluetooth. Now and then (once in every 10 boots or so) bluetooth just isn't started. Sorry, I don't have solution for that .... and just reboot.

Thanks a lot, it is somewhat of a one-way street (you giving me solutions, me not having anything to share with you)....you've helped me a lot...

Regards... Peter.
 
Thanks for sharing your solutions. They work like a charm. There is just one thing I can't get fixed....making it permanent and add the kernel parameter. The command "grubby" is not recognized .... I think it has something to do with me using Linux Mint and you using Fedora. I have the same problem as you with bluetooth. Now and then (once in every 10 boots or so) bluetooth just isn't started. Sorry, I don't have solution for that .... and just reboot.

Thanks a lot, it is somewhat of a one-way street (you giving me solutions, me not having anything to share with you)....you've helped me a lot...

Regards... Peter.
Hi, no problem. Im glad to help. I would have loved to find a simple guide to make my macbook work on Linux out of the box !
Bluetooth has worked fine for a few days here; since I installed Leifliddy's bluetooth driver. Easy to do just like his audio driver. Havent got a bluetooth problem since (just reboot after installing it). Hope it helps.

About the grubby command to make the sound after sleep fix permanent, I asked on the forum where I had the solution how to make the command work for Linux Mint. I'll let you know if anyone answers !

Enjoy !
 
Thanks again. .....
Actually there might be a thing or two that give me trouble and maybe you have a solution:
  • sometimes after sleep the screen flickers/lightly flashs (kinda fast). Not that much of a problem and it quickly fades out but its still a bit annoying.
  • When I type, the lightest touch from the palm of my hand or by a finger (unintentionally) messes with everything. I tried disabling trackpad while Im writing but it seems like it doesnt work ...
 
Both problems I do not recognize. The flickering of the screen doesn´t happen and the touchpad does not respond on my palms. Sorry, I don´t have any solutions....again...

By the way, how is the status of your battery? Mine is depleted within an hour or three/four. I am thinking about replacing the battery. How long does your battery last?

Regards,
Peter
 
Both problems I do not recognize. The flickering of the screen doesn´t happen and the touchpad does not respond on my palms. Sorry, I don´t have any solutions....again...

By the way, how is the status of your battery? Mine is depleted within an hour or three/four. I am thinking about replacing the battery. How long does your battery last?

Regards,
Peter
No problem !
Another one, about the sound: quality is way below what it was with mac os. I use JamesDSP for adding an equalizer and its kinda ok but not awesome and it often crashes. What about you ?

My battery might hold for a day if computer is on sleep mode, otherwise, if Im using it, its gonna empty maybe as fast as yours. But be aware s2idle sleep mode saves less power than the deep default setting, sadly its the only way to have working sound after sleep.
 

Members online


Top