MacOS X Information

Screen Tools

Display Menu - Easy resize display to full retina pixels

Screen Capture tools

getKap https://getkap.co Open Source Screen Capture tool!!! background music https://github.com/kyleneideck/BackgroundMusic Very cool and Open Source!!! - Allows KAP to listen to system audio and record it.

Notes

Some video may have DRM and advise MacOS X to not be part of the screen recording. I’ve found this on Safari and Google Chrome.

Video Tools

Video Download tools

Due to browser extensions being a little risky, as I don’t know the developer and the extension has access to everything I see and do in a web browser, which is a LOT.. I’ve moved to: https://github.com/yt-dlp/yt-dlp#installation brew install yt-dlp yt-dlp ‘https://www.youtube.com/watch?v=TGN0w-R3Hy8'

I was using the below, but its very slow as Youtube has bandwidth limited the downloads. https://github.com/ytdl-org/youtube-dl example: youtube-dl -f mp4 ‘https://www.youtube.com/watch?v=TGN0w-R3Hy8' Or remove the -f mp4 to get a higher quality version, but it requires VLC to play.

Browser video downloads

For Browser content, I’ve found this to be the best plugin for Chrome https://cococut.net/ I still don’t trust it, so I turn it ON when I need it in Chrome. I use Safari for everything and Chrome when I need to download something.

How to set a window to be HD ie 1080P to then screen capture it.


(* This AppleScript will resize the current application window to the height specified below and center it in the screen. Compiled with code from Natanial Wools and Amit Agarwal *)

set the_application to (path to frontmost application as Unicode text)
set appHeight to 1080
set appWidth to 1920

tell application "Finder"
	set screenResolution to bounds of window of desktop
end tell

set screenWidth to item 3 of screenResolution
set screenHeight to item 4 of screenResolution

tell application the_application
	activate
	reopen
	set yAxis to (screenHeight - appHeight) / 2 as integer
	set xAxis to (screenWidth - appWidth) / 2 as integer
	set the bounds of the first window to {xAxis, yAxis, appWidth + xAxis, appHeight + yAxis}
end tell

FFMPEG on MacOS X

My ffmpeg HDR MOV to MP4 conversion won’t play in Quicktime

I have a MOV video that was shot on an iPhone 14 as Portrait. The video details are:

  • Dimensions: 1080×1920
  • Codecs: MPEG-4 AAC, Timed
  • Metadata, HEVC
  • Colour profile: BT.2020 HLG

When converted using: ffmpeg -i ./IMG_0368.mov -c:v libx264 my-video.mp4 Quicktime won’t play nor preview. Properties are:

  • Dimensions: 1080×1920
  • Codecs: MPEG-4 AAC, H.264

Tried many options until I found: ffmpeg -i yourvideo.mov -codec copy -vtag hvc1 yourvideo.mp4 Its almost instant in the copy and it now plays.

Filesystem tools

Sync folders and external drives

Primary Archive -> Secondary

  • -u skip files that are newer on the destination. ie don’t overwrite a changed file on Secondary

rsync -auv –exclude=.DS_Store /Volumes/PrimaryArchiveDrive/ /Volumes/SecondaryArchiveCopy/

Phase 2 after everything works and confirmed: -c, –checksum skip based on checksum, not mod-time & size (I assume this will take a long time on 1TB) –delete-after https://www.computerhope.com/unix/rsync.htm

Keyboard Hot Keys

Apple Mail

I’ve changed Archive from the stupid Control, Command A to: Control-Shift A - Archive. - So much easier on the fingers and less issues with Select All.

Espanso text replace

:dt - 2023-06-12 inserts the date. emailend - Inserts my signature. This allows the signature to be added to contact forms etc.

Macbook Pro Problems

Disable Apple MDM - Device Enrolment Profiles

This was done for a clean install without connecting to the Internet. So MDM has not been enrolled. There is no need to disable SIP via recovery and csrutil disable via this method. HOWEVER this is for Mac OS X Catalina. Open Terminal sudo vim /etc/hosts scroll to end i for insert Enter:

0.0.0.0 iprofiles.apple.com
0.0.0.0 mdmenrollment.apple.com
0.0.0.0 deviceenrollment.apple.com
# May not be required as this blocks System Updates - remove # if enrollment message continues to further block updates.
# 0.0.0.0 gdmf.apple.com

ESC :wx to write and exit.

After enabling WIFI again, test with:

$ profiles status -type enrollment
Enrolled via DEP: No
MDM enrollment: No

To upgrade to MacOS X Sonoma 14.0 , additional steps are required and will require csrutil disable during the process.

  • Restart Mac (tested on Intel Macbook Pro 16")
  • Hold down “Command + R” during boot
  • Select Utilities Menu then Terminal
  • enter “csrutil disable” then enter
  • Apple Menu, select Restart
  • Boot up normally and login
  • Open Terminal and enter
  • sudo launchctl disable system/com.apple.ManagedClient.enroll
  • sudo rm /var/db/ConfigurationProfiles/Settings/.cloudConfigHasActivationRecord
  • sudo rm /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound
  • sudo touch /var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled
  • sudo touch /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound
  • Restart Mac
  • Hold down “Command + R” during boot
  • Select Utilities Menu then Terminal
  • enter “sudo csrutil enable” then enter
  • Apple Menu, select Restart
  • Boot normally and upgrade to MacOS X Sonoma 14.0

GPU Panic: [3:0:0][PPLIB] Failed Power Play Resume.

This is happening on my Macbook Pro 16" Intel. Every morning it won’t start up from sleep. Similar issues:

panic(cpu 0 caller 0xffffff7fa861a749): GPU Panic: [3:0:0][PPLIB] Failed Power Play Resume. Shutting back down. TTL Error Message: {} –> {7472309764796:[3:0:0] Error SW_IP_CLIENT_ID__SMU: event_id=0xc0140406 event_info:type=3 hw_id=0 event_specific_tag=0x6 pData=0 data_size=0 %s %s %d %s}.

Timeline:

  • 2022-Dec-21 - Tried resetting PRAM. - Nope.
  • 2022-Dec-22 - Uninstalled Soundsource ACE driver - as they said there was a known issue with latest MacOSX 13.1. - Nope
  • 2022-Dec-24 - sudo pmset restoredefaults - https://apple.stackexchange.com/questions/85603/default-settings-for-pmset-g (as its a GPU issue and a Wake issue) gpuswitch = 2 I could try turning off the GPU https://discussions.apple.com/thread/8160651?answerId=32574288022#32574288022
  • 2022-Dec-26 - sudo pmset gpuswitch 1 - 1 is dedicated gpu only with charge cord connected/battery power would switch it to integrated - Nope
    • Trying -a to make sure its stuck “-a (all, default) adjust settings for all scenarios”
  • 2022-Dec-28 - sudo pmset -a gpuswitch 0 # “forced integrated graphics card” - Seems to be getting worse.
  • 2022-Dec-30 - sudo pmset restoredefaults. Changed Settings “Enable power nap to Always was Adapter only” “Wake for Network Access - Always was Adapter only” “Automatic graphics switching - Yes - Was No.” Still doing it. Trying to stop hibernation. https://mackeeper.com/blog/mac-sleep-modes-explained/ https://apple.stackexchange.com/questions/126669/how-to-add-hibernate-mode-to-macbook-pro Trying sudo pmset -a hibernatemode 25
  • 2022-Dec-31 Wakes slower. And crash happened. But not as often now.
    • What is com.apple.driver.AppleMuxControl2 ?
    • I removed an Audio device from MIDI Audio Setup that I added a little while ago.
  • 2023-Jan-05 Still happening. Can I turn off Hibernate?
  • 2023-Feb-17 13.2.1 (22D68) Update - Still happening. Turned off Graphics switching.
  • Trying out https://apps.apple.com/us/app/amphetamine/id937984704?mt=12 and running caffeinate on the command line to stop mac sleeping and then crashing.
  • 2023-Apr-12 Laptop crashed on boot 5 times until I held down Command + V then it booted fine… weird.
  • 2023-Apr-13 Check kextstat and only Apple kernel extensions are loaded. So far it takes 3 reboots to start up. Turned on Automatic Graphics Switching (since turning it off didn’t help)
  • 2023-06-12 Finally got another laptop and WOW, In australia, Apple honoured the Warranty to 3Years!! So the laptop is being repairs?!!?! Why the F did I spend 6 months trying to keep it alive?!

Found from pmset -g log Time stamp Domain Message Duration Delay ========== ====== ======= ======== ===== UUID: Unknown UUID 2023-01-05 15:19:06 +1100 Sleep Entering Sleep state due to ‘’: Using AC (Charge:0%) 2023-01-05 15:19:06 +1100 Failure Failure during wake: PEG0() : Some drivers failed to handle setPowerState Sleep/Wakes since boot at 2023-01-05 09:15:07 +1100 :0 Dark Wake Count in this sleep cycle:3

Following these steps to try https://support.apple.com/en-us/HT201295 Trying “Press and hold the power button for 10 seconds, then release the button.” Also sudo pmset -a restoredefaults

  • 2023-Jan-08 - List kernel modules “kextstat -l | grep -v com.apple” only Apple kext.
    • Going back to sudo pmset -a hibernatemode 25 as this stopped it from happening during the day.
  • 2023-Jan-09 - Happened at night, but it didn’t happen through the day with hibernatemode 25. Turning off Watch for Network Access and Power Nap.

Reference:

Intel Macbook Pro How to fix the Fan Speed Noise when recording video

I’ve found that my Intel Macbook pro fan goes full speed and noisy when I’m trying to record video, especially when also recording the screen. I’ve found that the issue happens due to the AMD Radeon Video Card kicking in and creating extra heat. As I’m not using the GPU, this is a waste of heat output.

My solution was to remove the external USB-C Monitor and to record using the built in laptop display. This stopped the AMD Radeon from switching in and using the extra Watts.

##How to upgrade SSD on MacBook Pro 13-inch, 2017, A1708

Tools:

Don’t buy the normal M.2 drives as they are too long. I purchased the $40 enclosure to make sure the drive was formatted to GUID and that I can install MacOS X before swapping out the drive.

Personal Note: Confirm sleep issue is resolved before installing Apps again.

How do I turn off Hibernate in MacOS X?

Install Amphetamine and Amphetamine Enhancer. This is the only way to stop the MacBook Pro from sleeping when the LID is closed and no external monitor + keyboard is connected.

I have a flacky SSD that takes a while to appear when powering on my MacBook Pro 2017 13" A1708. So the Laptop goes into Hibernation and powers off the SSD, it won’t start back up unless I reset PRAM 4+ times. I’m ordering a new SSD, until then, Amphetamine.

I have a trigger set to start Amphetamine on Adapter being removed and I’ve told it to stop MacOS X Sleep when LID is closed.

This allows movement of MacBook Pro again, as I’ve left it powered for last 6+ months, which means as a Laptop, its useless.

Thank you to LEAN (Stop and FIX) to force a fix on this issue.

Technical Information from my playing:

pmset -g | grep hibernatemode

Shows " hibernatemode 3"

hibernatemode = 3 by default on supported portables. The system will store a copy of memory to persistent storage (the disk), and will power memory during sleep. The system will wake from memory, unless a power loss forces it to restore from disk image.

pmset -g
System-wide power settings:
Currently in use:
 lidwake              1  - wake the machine when the laptop lid is opened (value = 0/1)
 autopoweroff         1 - autopoweroff is enabled by default on supported platforms as an implementation of Lot 6 to the European Energy-related Products Directive. After sleeping for <autopoweroffdelay> seconds, the system will write a hibernation image and go into a lower power chipset sleep. Wakeups from this state will take longer than wakeups from regular sleep.
 lowpowermode         0
 standbydelayhigh     86400 (24 Hours) - standbydelayhigh and standbydelaylow specify the delay, in seconds, before writing the hibernation image to disk and powering off memory for Standby.  standbydelayhigh is used when the remaining battery capacity is above highstandbythreshold , and standbydelaylow is used when the remaining battery capacity is below highstandbythreshold.
 standbydelaylow      0 - See above
 autopoweroffdelay    259200 (72 Hours) - specifies the delay, in seconds, before entering autopoweroff mode.
 proximitywake        1
 standby              1 - standby causes kernel power management to automatically hibernate a machine after it has slept for a specified time period.
 ttyskeepawake        1
 hibernatemode        3 -  3 by default on portables. The system will store a copy of memory to persistent storage (the disk), and will power memory during sleep. The system will wake from memory, unless a power loss forces it to restore from hibernate image.
 powernap             1
 gpuswitch            2
 hibernatefile        /var/vm/sleepimage
 highstandbythreshold 50
 displaysleep         0
 womp                 0 WakeOnMagicPacket
 networkoversleep     0
 sleep                0 (sleep prevented by sharingd) (Due to Bluetooth being on.. Mousepad) - system sleep timer (value in minutes, or 0 to disable)
 tcpkeepalive         1
 halfdim              1
 acwake               0
 disksleep            10 - disk spindown timer; (Does this do anything for SSDs?)

References:

Last modified December 14, 2023: Moving to /notes (3bbb5be)