GithubHelp home page GithubHelp logo

smc_util's Introduction

smc_util

Apple System Management Control (SMC) utility

Forked from original smc_util repository, with a couple of other, slightly modified, SMC-related tools:

How to use

Chances are you're here because of my blog post or SO question, and want to use this to turn an old iMac running Linux into a display.

Note: This was tested on a mid-2010 27" iMac running Yosemite and Ubuntu 16.04. Any other model/OS combo might behave differently.

Note: I don't have the iMac I used for this anymore, so I can't test anything, sorry. That being said, the steps to use this are (on Ubuntu and derivatives):

sudo apt-get install build-essential

git clone https://github.com/floe/smc_util.git
cd smc_util

gcc -O2 -o SmcDumpKey SmcDumpKey.c -Wall
sudo rmmod applesmc # remove the SMC kernel driver to avoid conflicts

sudo ./tdm_on.sh # enable target display mode
sudo ./tdm_off.sh # disable target display mode

IMPORTANT: when you run tdm_on.sh and it works on your iMac, then the display will switch over to the DP input and you won't have the console anymore. Make sure you have a remote shell open first, or maybe a keyboard hotkey set up, so you can also run tdm_off.sh again to switch back to the internal iMac graphics.

smc_util's People

Contributors

alexleigh avatar floe avatar j3tm0t0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smc_util's Issues

Sound transmission

Hello, do you know how to get the sound trough the tdm ?
I know that if I'm on macos, I can send sound to the TDM.

Thanks by advance

Will it work on post High Sierra macOS?

This work on my 2011 iMac 27" under Linux environment. I was wondering if I am able to install a post High Sierra macOS (using OpenCore Patcher) to my 2011 iMac, would this bring back the TDM functionality?

Incompatibility with 2010 iMac

It doesn't look like the entries you found exist on the SMC on my Mac, here's an output of smc_dump_linux.sh on my machine.

It looks like somebody with a similar machine will need to do their own investigation on which keys needed to be changed.

List of iMac's that will do Target Display Mode

These currently work with smc_util ...
27"
A1312 EMC2309 (late 2009)
A1312 EMC2374 (late 2009)
A1312 EMC2390 (mid 2010)

24"
Possibly some of the early 2009 24" iMacs also work but I don't have any to try.

Apple support says the 2011, 2012, 2013, and mid 2014 iMac's also do TDM , but MVHR and MVMR do not appear in the SMC dump. They run Thunderbolt rather than displayport.

If someone has one of those they can do some SMC dumps on in OSX (has to be running OSX High Sierra or earlier) to see what changes when TDM is invoked...

Also, I'm running 2 iMac 27's as external monitors for a Debian 11 Xeon desktop. One running Debian 11, the other running OSX 10.6.8 (Snow Leopard - the last decent version of OSX). The iMac running OSX also appears as an audio sink in Debian. I wonder what would need to be done for the same to happen on the iMac running Linux?

I also use USBIP so I can access the USB ports on the Debian iMac from the Desktop box.

Newer iMacs, Hopefully

Do you have any reason to suspect that this could work on the new iMacs? Thinking that possibly TDM was only disabled by removing the โŒ˜ + F2 shortcut, but all the hardware/software was left alone.

turn_off problem

Hello,

I successfuly used tdm with your script, but when I use the script to turn off, my ubuntu screen never comes back. Do you have an idea how to debug it ?

I'm on ubuntu 20.04 and mac os high sierra.

Thank you anyway for your work.

MVHR: read arg fail

Thanks for the hack! Probably I'm doing something wrong but I get this error after running sudo ./tdm_on.sh on the iMac (running Ubuntu):

send_byte(0x52, 0x0300) fail: 0x40
MVHR: read arg fail

read_smc get_key_type error

send_byte(0x52, 0x0300) fail: 0x40
MVMR: read arg fail

read_smc get_key_type error

warning: output eDP not found; ignoring

Is that normal? The laptop (running Ubuntu as well) is connected but nothing happens.

iMac goes to black, but laptop doesn't detect external display

I've plugged a display port cable to both my 2011 27'' imac and my laptop (running both linux or yosemite). I run ./tdm_on.sh from the package on the imac (running debian) and the screen goes to black. However, the laptop doesn't detect any external display.
Any idea?

I tried to boot the imac on osx (high sierra) and run cmd+f2 without any result either.

many thanks,

Anton

Can't open display :0.0

Using ubuntu 20.04:

  • sudo ./tdm_on.sh === Works fine and I can use my iMac as monitor
  • sudo ./tdm_off.sh
    type="flag" length=1 flags=c0 data="\x00" target value: 01 type="ui8 " length=1 flags=c0 data="\x00" target value: 02 Can't open display :0.0

And screen stays black. I still have ssh control and can turn it on again, but I can not go back to ubuntu.

Thank you for this tool and contribution to open source.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.