1000Klub

Saturday, April 11, 2009

Mac Mini HDMI Detection Woes

I have a mac mini as a media player connected via HDMI to my tv. I recently added a cool auto-detecting HDMI switch to the works and everything seemed great, except I'd get no video when switching from one of the other inputs to the mac. If I slept and woke the mac, video would appear, but that was a lame option.
I searched around and found lots of forums where people had similar problems. Some were resorting to buying a $60 "DVI Detective" which sits between the mac and display and tricks the mac so it never sees the display go away.
Aside from blowing another 60 bucks I was bothered by the notion of adding yet another device to the mounting list of boxes and contraptions it seems to take just to watch some tv these days. I decided to try a software approach. The result is a tiny program I've attached (source included) that I call HDMI Reviver. It watches for when the physical display goes away at which point it asks the graphics hardware to check for a new display every 5 seconds. So when the mac is connected to the display or the switch input is set, within 5 seconds the picture returns.
UPDATE 2010/02/23 With feedback from a couple commenters to allow for use on macs with different hardware I modified the program to take the graphic hardware and display device as parameters. You'll need to know a bit about the "ioreg" command though to figure out what those values might be for your hardware. Also, use at your own risk- I can't think of any reason why there would be a problem, but there's no guarantees.

hdmireviver.zip

Labels:

31 Comments:

At July 21, 2009 4:13 PM , Anonymous Bryan said...

Hi, Paul,

This looks like just what I need to fix my HDMI switch problem.

I've downloaded your program but don't know enough about shell scripts to have it running properly. Can you help with that?

 
At August 23, 2009 10:50 PM , OpenID sanejohn said...

Looks like what need as well.

Is this only for the Mac Mini?
Does it run on Tiger?

Thanks!

 
At August 27, 2009 9:02 PM , Blogger Paul Chinn said...

Oops- I didn't have comment notification emails enabled so I didn't realize people were commenting. So, Bryan, put the file com.1000klub.hdmireviver into your ~/Library/LaunchAgents and put the HDMIReviver app into /Applications. That'll cause it to automatically run whenever you login.
Sanejohn- it currently is looking for video hardware that is on the mini. What model are you running?

 
At September 12, 2009 12:18 AM , Anonymous Jorge said...

ohh man, since I bought my hdmi switch I've had problems switching back from my xbox360 back to my mini mac.
this little script solved everything!

THANK YOU!!!

P.S. Does it work under Mac OS X Leopard?

 
At September 13, 2009 12:03 PM , Blogger Paul Chinn said...

Jorge- I developed it on Leopard so yes it works there. If you meant "does it work on snow leopard", I have not tried it but the program doesn't do that much so I'd expect it would.

 
At September 16, 2009 9:40 AM , Anonymous Anonymous said...

Doesn't seem to be working for me. Says something about a bus error?

 
At September 21, 2009 1:40 AM , Anonymous Anonymous said...

It works great, and I think it should be the default behaviour of Mac OS X. Thx a lot for a very handy fix to my problem!

 
At September 25, 2009 5:49 AM , Anonymous Anonymous said...

neat "script" :)
How does it affect cpu load?

 
At September 25, 2009 9:53 AM , Blogger Paul Chinn said...

When the display is attached the program has no effect on cpu, it is totally idle. Once the display is gone the program starts kicking the video hardware every 5 seconds. So the cpu hit is spikey- you'll see the total cpu time consumed by the program increasing over time, but I don't think it's anything you'd notice while running programs. Especially since there's no display to interact with anyway :^)

 
At November 7, 2009 12:45 AM , Anonymous Matt Berther said...

Paul: On Snow Leopard (2 separate machines), I am getting the following error: Can't find a framebuffer.

Looking through the code, I see that its trying to locate the AppleIntelFramebuffer, but I'm not sure what that is in SL.

Thoughts?

 
At November 7, 2009 7:41 AM , Blogger Paul Chinn said...

Matt, did it work on either machine with Leopard? And are you using minis?

 
At November 7, 2009 10:02 AM , Anonymous Matt Berther said...

Paul: Curiously, it doesnt work on my wife's 10.5.8 installation either. We've tried a Mac Mini with Snow Leopard, a 15" MBP with Snow Leopard, and a 13" MB with Leopard.

 
At November 9, 2009 6:13 PM , Blogger Paul Chinn said...

Matt,
The code is looking for hardware specific to mini so it's expected it won't work as-is on your macbooks. From terminal, email me the output of "ioreg -l"

 
At December 7, 2009 5:09 AM , Blogger Maarten said...

This is great Paul! I'll try this out tonight when I get home! Have the same issue as described in the initial post.

 
At December 23, 2009 11:57 AM , Anonymous Anonymous said...

I'm also having the cant find a framebuffer issue. I'm running snow leopard on my mac mini.

 
At January 14, 2010 8:47 AM , Anonymous Anonymous said...

Hi Paul!

This sounds like what I need for my mac mini (with snow leopard) to onkyo receiver. However, I'm not very computer savy and would like to get very specific instruction on how to implement your nifty little program. I'm afraid that I'll screw up something. What if anything could go wrong? Not being very knowledgeable about this kind of stuff, should I not do it?

Thanks in advance! :-)
MikeC

 
At January 14, 2010 11:44 AM , Anonymous Anonymous said...

Paul.. I love you! Thank you very much for solving all my problems..
Nick

 
At February 8, 2010 5:27 AM , Anonymous Anonymous said...

Fantastic, works perfectly on my old mini with intel chipset.

Thanks!

 
At February 16, 2010 9:44 PM , Blogger Michael said...

I was pumped when I switched over from my Satellite to Mac mini and I saw something, but what I saw was static, followed by my Mac mini screen, followed by static, etc.... it just switched back and forth every 3 seconds or so.

Anyone else experience this?

thx!

 
At February 16, 2010 10:08 PM , Blogger Michael said...

Now I see.... frame buffer thing as well.

Help.

 
At February 17, 2010 6:48 PM , Blogger Keith Ganger said...

Paul having the same frame buffer issue.

I am on a 2009 mac mini running snow leopard.

This shows such promise and is exacly what I need. I would really appreciate help getting it working. I would pay pal you a donation :)

 
At February 20, 2010 2:49 PM , Anonymous Anonymous said...

@ Mac mini late 2009 / early 2010 MBP 2009 users; AppleIntelFramebuffer has been renamed NVDA

78c78
< frameBufferService = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("AppleIntelFramebuffer"));
---
> frameBufferService = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("NVDA"));

 
At February 22, 2010 2:51 PM , Anonymous Anonymous said...

where do we make the change?

 
At February 22, 2010 8:59 PM , Blogger Keith Ganger said...

That fixed it for me Thanks anonymous!!

You make the change in main.c, and then recompile using xcode.

If Paul doesn't update this week I can post the exe.

 
At February 22, 2010 9:01 PM , Blogger Keith Ganger said...

Paul perhaps the above change could be added to the plist file to make this more portable.

 
At February 22, 2010 9:07 PM , Blogger Paul Chinn said...

Thanks anonymous. I will modify the program to take the framebuffer device name as a parameter. That'll allow people to use with their hardware much more easily. I'll try to update with that in the next couple days.

 
At February 23, 2010 6:09 PM , Anonymous Anonymous said...

I wonder if that's why the app hasn't been working for me? My system profiler says the chipset model is GMA 950, which I believe is the Intel chip. I wonder what other reasons may be causing it to not work. I'll try once more.

 
At February 23, 2010 10:07 PM , Blogger Paul Chinn said...

I've updated the program. Please take a look at the readme for details which allow for specifying the hardware being checked for without recompiling the program.

 
At February 27, 2010 2:01 PM , Anonymous Anonymous said...

Thanks man! I justed switched from VGA to HDMI (DVI to HDMI cable) and my mac mini always "forgot" about the TV when i switeched the TV off. So i had to reboot the mac mini all the time.
Your program works like a charm :-)

 
At March 3, 2010 1:34 AM , Anonymous Anonymous said...

Hi Paul,
Thanks for the clever programming.

I understand some of us (like myself) need to run specify the -f NDVA flag to run it correctly on our system.

I got it running manually, and it seems to work as advertised :-)

I'm unsure how to set this flag if I want to automatically run the program at system login. Can you please explain that?

Cheers,
Geert

 
At March 3, 2010 8:59 PM , Blogger Paul Chinn said...

Geert, glad it works for you. I've updated the README.txt in the zip file.

 

Post a Comment

Links to this post:

Create a Link

<< Home