CodySchrank / gSwitch

macOS menu bar app that allows control over the gpu on dual gpu macbooks
MIT License
887 stars 46 forks source link

Stay on Integrated Only when using Airplay Display #19

Closed andytran93 closed 5 years ago

andytran93 commented 6 years ago

When I'm on "Integrated Only" mode and connect to Airplay display, gSwitch changes to dynamic switching mode. This causes all the currently running "hungry" apps to become dependancies. I understand that connecting a physical external display requires high perf. GPU, but the Airplay display feature on MacOS doesn't require the high perf. GPU at all (it runs off the video decoders on the iGPU and doesn't turn on the high perf. GPU)

If possible, please could you implement a way for gSwitch to stay on integrated only mode when Airplay display is connected, instead of changing to dynamic switching? Thanks! :)

CodySchrank commented 6 years ago

When you connect an Airplay display is "External Display" listed as a dependency? If not what is?

andytran93 commented 6 years ago

"External Display" is listed as a dependency, but the high perf GPU isn't required. I've attached some screenshots of the menubar while using airplay display. The iStat one shows the high perf. GPU being off (0.09W).

screen shot 2018-06-16 at 11 02 10 screen shot 2018-06-16 at 11 02 48
CodySchrank commented 6 years ago

The dgpu might not be required, but it looks like the OS treats it the same way as an external display. I'm not sure how I would be able to differentiate between the two, unless airplay spawns a specific process that I could look for.

andytran93 commented 6 years ago

I found this process that appears every time airplay display is used. Hope this helps!

Analysis of sampling com.apple.CGXPCServicesAgent (pid 18405) every 1 millisecond Process: com.apple.CGXPCServicesAgent [18405] Path: /System/Library/PrivateFrameworks/Mangrove.framework/Versions/A/XPCServices/com.apple.CGXPCServicesAgent.xpc/Contents/MacOS/com.apple.CGXPCServicesAgent Load Address: 0x10451e000 Identifier: com.apple.CGXPCServicesAgent Version: 1.0 (1) Code Type: X86-64 Parent Process: launchd [1]

screen shot 2018-06-16 at 23 43 39
CodySchrank commented 6 years ago

Cool! I will look into that to see if I can use it. If I can then I will add in this feature.

andytran93 commented 6 years ago

Thanks! :)

CodySchrank commented 5 years ago

I was unable to determine if that process is ONLY used for Airplay so I'm hesitant to add in this feature if it could negatively affect something else. Adding help wanted if someone can otherwise confirm it is only used for airplay (or really any process that is only used for airplay)

CodySchrank commented 5 years ago

As far as I can tell the OS forces dynamic mode and it's something I can't control so I'm gonna close this. However I'm fixing #16 so the computer will go back to whatever mode you were on when you started airplay