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

MVHR: read arg fail #2

Open
spadarian opened this issue Nov 6, 2019 · 17 comments
Open

MVHR: read arg fail #2

spadarian opened this issue Nov 6, 2019 · 17 comments

Comments

@spadarian
Copy link

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.

@Patrick-Remy
Copy link

Patrick-Remy commented Mar 3, 2020

Unfortunately same here (running Ubuntu 20.04 build on the 27" iMac 2018). Output of smc_dump_linux.sh is here

@sencer
Copy link

sencer commented Mar 4, 2020

Same here on a iMac Late 2012 with macOS Catalina. I think MVMR no longer exists. I suspect Target Display Mode does not work anymore with macOS Catalina.

@spadarian
Copy link
Author

The MVHR and MVMR are not listed. I have a iMac Late 2013 and I think it should be supported, right?

Should those keys always appear? or just only after the connection is detected? I'm trying to connect a Dell computer using a HDMI -> thunderbolt adapter.

Do you have any suggestion on how to get the new keys @floe ?

@floe
Copy link
Owner

floe commented Jun 23, 2020

Hm, I think the only way to solve this would be to run SmcDumpKey on macOS, once with TDM active and once with TDM off, and compare the results... or alternatively, use the dtrace script on the dpd process. However, keep in mind that I tested this with Yosemite on a 2011 iMac, so things may have changed considerably since then...

@codemonkey76
Copy link

I'm getting this same error. I am using a late 2013 iMac 27" running manjaro (was on catalina previously) and have not been able to get TDM to work either on Mac OSX or linux

@jrubbel
Copy link

jrubbel commented Nov 24, 2022

same error here - running Ubuntu 22.10 on an Imac 27" 2011.

running "sudo ./smc_dump_linux.sh |grep MVHR" does not find MVHR...

@jrubbel
Copy link

jrubbel commented Nov 27, 2022

Just an idea - macs before 2011 used to accept display port as in input for TDM - starting with 2011 Apple changed to Thunderbolt 2. Propaby the smc registers for TDM also changed (if handled by smc at all).

Any thoughts or approaches to find the right registers? Is the any mac os source code ot documentation available? I dont have my mac os installed anymore, but maybe somebody could try floes recommended approach above?

@Bellavene
Copy link

Yes, as I remember, TDM on Thunderbolt iMacs even works only with Thunderbolt intel macs, no luck for M series though.

@txgk
Copy link

txgk commented Nov 26, 2023

I'm having a slightly different error. iMac12,2 (2011).

~/.local/smc_util % doas ./tdm_on.sh
doas (user@host) password:
send_byte(0x06, 0x0300) fail: 0x00
MVHR: read len fail

read_smc get_key_type error

send_byte(0x06, 0x0300) fail: 0x00
MVMR: read len fail

read_smc get_key_type error

Authorization required, but no authorization protocol specified

Can't open display :0

@Gelias212
Copy link

similar issue here with an iMac 27" 2009 with geforce graphics and a MacBook Air 2015 running Ventura beautifully with OCLP

Please press Enter to activate this console.
Target Display Mode: send_byte(0x06, 0x0300) fail: 0x00
MVHR: read len fail

read_smc get key type error

enabled, toggling OFF ...
Target Display Mode: send_byte(0x52, 0x0300) fail: 0x00
MVMR: read arg fail

read_smc get _key_type error

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

read_smc get key_type error

disabled.

already tested iMac with a monitor and a miniDP to HDMI adapter to see if the port is working, it is.
I'll buy another mini DP to mini DP since mine's a bit janky (it was bought from miniso) and it is giving me the exact same issue with the cable disconnected, lemme know if you want to test anything specific since this iMac is already running ubuntu 22.04 and I have macOS High Sierra on a separate drive that I can boot the MBA off of.

@spadarian
Copy link
Author

Maybe you can try what floe suggested @Gelias212?

Hm, I think the only way to solve this would be to run SmcDumpKey on macOS, once with TDM active and once with TDM off, and compare the results... or alternatively, use the dtrace script on the dpd process. However, keep in mind that I tested this with Yosemite on a 2011 iMac, so things may have changed considerably since then...

@Gelias212
Copy link

ok, I'll try it as soon as I get the new cable, could be a couple of weeks since I don't wanna waste money on useless cables that won't work.

@mouseos
Copy link

mouseos commented Nov 16, 2024

ok, I'll try it as soon as I get the new cable, could be a couple of weeks since I don't wanna waste money on useless cables that won't work.

Is there any further information?

@RandomInsano
Copy link

RandomInsano commented Dec 11, 2024

Hitting this myself, but I don't think this is a hardware issue.

The System Management Controller (SMC) is the little computer inside the Mac that controls a number of different things. The fact that these commands are failing makes me think that a firmware update patched out this feature. I could be wrong on that.

The reason I think this is that I tried dumping SMC values from within macOS 15.1.1 (OpenCore Legacy Patcher installed) and wasn't able to see either MVHR or MVMR keys listed. I assumed that maybe macOS was masking them off, but that doesn't seem to be the case. I decided to try reading a different key, "TC0c" using SmcDumpKey and while it didn't give me good data (just "/\x00"), it gave me data.

I'd assume that either the values to enable TDM in the SMC changed (this seems to happen) or they were removed. I may try downgrading macOS but I highly doubt it'll make a difference. I don't know if OpenCore Legacy Patcher has changed the SMC in any way, but I recall reading that it should do most of its patching in memory... Just wondering if that might be what's common for us here.

@RandomInsano
Copy link

RandomInsano commented Dec 11, 2024

Hmm. Also read #9. I'm getting a 2009 iMac 27" on Friday for $30 and will do more testing then. I can definitely downgrade the 2012 and re-dump the SMC keys before and after.

I used the smc tool in smcFanControl to do the dump. Hopefully the same diff trick will work as outlined here:
https://floe.butterbrot.org/matrix/hacking/tdm/

Quick update for future folks: (2024-12-16)

  • Downgrading to Mountain Lion didn't make the two SMC keys visible
  • The new iMac (2009 version) does support Target Display Mode over MiniDP and that's perfectly happy booting off a thumb drive I made from https://github.com/gpdm/tinycore-targetdisplaymode
  • I'm waiting on a Thunderbolt cable and should hopefully have one this week to test the 2012 iMac.

I'll test Thunderbolt on the 2012 iMac when I'm able

Update 2024-12-19:

Struggling to get the dtrace script to run on macOS 10.8.5 so I’m upgrading to Yosemite (10.10) because I think the kernel structure has changed. I’m seeing this over and over:

image

I do see regular activity when doing things like changing brightness and volume, both of which seem to use the dpd process which is nice

@RandomInsano
Copy link

@floe, I’ve got everything set up now and can run the dtrace script against dpd but the keys seem unprintable. I’m not sure if the structs changed but I don’t think so…

Would you be interested in working on this now? I can do some work myself (C and low level stuff are pretty familiar to me) but just curious if you’re interested.

I’ll pick this up after the holidays.

For others, I’ve tested both TDM with Sequoia as the display on a pre-Thunderbolt iMac (2010) as well as the source on a 2013 Mac Pro trashcan. Both worked fine. However, I did buy a TB2->TB3 adapter from the Apple Store and that does not work with an AMD Ryzen chip running Linux (Framework 16) with TB4 nor does it work with my M1 MBP.

I have a suspicion that the SMCs on both computers are involved outside of the operating system, so using these as displays without additional hardware or software is quite unlikely. Still! Fun to play with.

@floe
Copy link
Owner

floe commented Dec 26, 2024

@RandomInsano feel free to have a go, but I can only give armchair support, as I don't have any relevant hardware anymore... I assume the SMC itself will not get downgraded if you do a MacOS downgrade, though.

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