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

68 comments:

  1. 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?

    ReplyDelete
  2. Looks like what need as well.

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

    Thanks!

    ReplyDelete
  3. 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?

    ReplyDelete
  4. 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?

    ReplyDelete
  5. 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.

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

    ReplyDelete
  7. 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!

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

    ReplyDelete
  9. 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 :^)

    ReplyDelete
  10. 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?

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

    ReplyDelete
  12. 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.

    ReplyDelete
  13. 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"

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

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

    ReplyDelete
  16. Hi Paul,

    you are the Greatest!
    After buying a 4x2 switch for my Mac mini (which is just plugged to my beamer without any other display) I had the same problems as described above. Today I was searching the internet for a couples of hours and found always the solution to buy a EDID detector (that costs 100 EUR!!!). Than I found this website and downloaded and installed your small tool.
    It's fantastic!
    It's running great! No problems.. no errors... perfectly!
    My hardware:
    Modellname: Mac mini
    Modell-Identifizierung: Macmini1,1
    Prozessortyp: Intel Core Duo
    Prozessorgeschwindigkeit: 1,83 GHz
    Anzahl der Prozessoren: 1
    Gesamtzahl der Kerne: 2
    L2-Cache: 2 MB
    Speicher: 1 GB
    Busgeschwindigkeit: 667 MHz
    Boot-ROM-Version: MM11.0055.B08
    SMC-Version (System): 1.3f4
    I'm running Snow Leo 10.6.2

    Why didn't you sell this app as Shareware? I'm sure a lot of Mac users would pay for a tool like that? - I would!
    And a lot of users would find this tool at versiontracker.com!
    I'd saved 100 EUR the last hour AND I just can say THANK YOU VERY VERY MUCH!

    Stefan

    ReplyDelete
  17. 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

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

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

    Thanks!

    ReplyDelete
  20. 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!

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

    Help.

    ReplyDelete
  22. 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 :)

    ReplyDelete
  23. @ 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"));

    ReplyDelete
  24. where do we make the change?

    ReplyDelete
  25. 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.

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

    ReplyDelete
  27. 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.

    ReplyDelete
  28. 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.

    ReplyDelete
  29. 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.

    ReplyDelete
  30. 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 :-)

    ReplyDelete
  31. 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

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

    ReplyDelete
  33. OMG I sooooo needed this for my Mac mini media server hooked up to a TV!

    ReplyDelete
  34. Hi Paul: I think I've got this working when running manually. However, for some reason, I do not see any messages in console.log except for when I get the parameters incorrect.

    Im in some way expecting to see the first message in the program ("Looking for display ... on framebuffer NVDA every 5 seconds") in the console log. However, I do not. I only see the message if I add an extra space (like " NVDA").

    Thoughts?

    ReplyDelete
  35. Matt, I can reproduce that behavior. Weird- it seems like some sort of launchd behavior. You can do "ps -ax | grep HDMI" and you should see that your task is running.

    ReplyDelete
  36. Jus wanted to say thank you.

    You're little app is exactly what i've been looking for since i bought my first hd tv and quickly found the 'no signal' issue.

    Now what to do with all the extra cables and adapters I bought
    trying to fix the issue with hardware.

    Great thinking outside of the box.

    Dustin

    ReplyDelete
  37. Paul,

    This is a godsend & works a treat. I have all my kit hidden away and used to have to go rummage about to sleep & awaken my mini every time my AV receiver was powered down, which is every time my monitor is turned off. No more!!!!

    The only minor glitch is that although it picks up the EDID it appears to revert to a lower resolution, 10248768, rather than my normal settings of 1920*1080.

    This isn't the end of the word at all but if you have any thoughts they'd be appreciated.

    Cheers
    Colin

    ReplyDelete
  38. I found your post while we were working with someone using the Kylo browser on a MacMini. Is this code something we could potentially use as well?

    ReplyDelete
  39. Jim, you are welcome to use the code if it suits your needs. Credit to me somewhere would be cool, but not required- the source is free for any use.

    ReplyDelete
  40. AWESOME. If you come to New York, I'll buy you a beer.

    ReplyDelete
  41. This is EXACTLY what I need, but the script doesn't seem to be executing on my Mini running 10.4.11. Here's what the shell says:

    Last login: Sat Jul 10 11:55:38 on ttyp1
    Welcome to Darwin!
    Mac-Mini-2:~ craig$ /Applications/HDMIReviver; exit
    dyld: lazy symbol binding failed: Symbol not found: _getopt$UNIX2003
    Referenced from: /Applications/HDMIReviver
    Expected in: /usr/lib/libSystem.B.dylib

    dyld: Symbol not found: _getopt$UNIX2003
    Referenced from: /Applications/HDMIReviver
    Expected in: /usr/lib/libSystem.B.dylib

    Trace/BPT trap
    logout
    [Process completed]

    Any suggestions on what to change to get this running? Thanks a heap...much appreciated.

    ReplyDelete
  42. Craig, it looks like Tiger is missing some system calls that are available in Leopard or later. You'll need to update the OS. (or if you know how you can edit the code to remove the getopt() stuff...)

    ReplyDelete
  43. Paul, thanks for replying. I did the easier thing and removed the Mini from my system altogether. I had a spare WD TV, so that's serving quite capably in its place as a media player. Too bad...now I have a Mini with no purpose...and you know how much computers like to have a purpose. Best...

    ReplyDelete
  44. Hi Paul,
    I setup HDMI reciever as instructed but im finding that the screen remains blank when switching hdmi inputs. I also noticed that cpu usage does not spike when switched to a different view as if it the display has not actually been switched. Im using a Yamaha AV receiver so not sure if its something to do with this. Restarting the mac seems to initiate the handshake successfully and display reappears. But once switched to another input and switched back the display goes black. Note i have modifed -d argument for my display as Panasonic-TV. sleep and wake doesnt work for me as it has for others. HDMIReceiver reports no errors so i think its working fine. I am using mac mini with intel graphics.

    ReplyDelete
  45. found an issue with front row.
    hdmireviver gets k.o. by frontrow.
    I switched to from mac mini to a new apple tv device. When using the IR remote of apple tv the mac mini switched to frontrow in the backround. Therefore it was impossible to get back to the mini via hdmi switch and hdmireviver.
    Now I paired the mac mini remote with the mini in the savety tab so the apple tv remote doesnt affect the mini anymore..

    ReplyDelete
  46. Works perfectly! Thanks so much for this. Alex
    For info, Mac Mini 1.6 Core Duo Gen 1, 10.6.5, Sony Bravia, Syvio 3 port HDMI splitter.

    ReplyDelete
  47. Works perfectly with my mac mini and hdmi switch. Thank you very much! :-)

    ReplyDelete
  48. Thanks for the great review! We should add DVI cables to our inventory... Anyway, I'll try that little program and tell you how it goes.

    ReplyDelete
  49. I've been looking for something to do this for ages. Works like a charm. Thanks *very* much

    ReplyDelete
  50. Used to work on my old Intel GMA Mac Mini, doesn't work with my 2009 Nvidia dual-video output Mini when outputting Mini-DVI (have not tried Mini-DisplayPort).

    Using -f NVDA.

    Any ideas?

    ReplyDelete
  51. Thanks alot! This saved my hdmi port on my receiver!

    ReplyDelete
  52. Hi there,

    This sounds great - same issue for me with Mini (2006) DVI - HDMI switch into a Samsung. Works fine if direct into TV, but not when via switch.

    I dl'd your zip file, unzipped, put the com.1000klub.hdmireviver into ~/Library/LaunchAgents. BUT, when you say put the "app" in the applications folder, I don't see an app, just a folder with some files in it. How do I make it into an app that I can "run"?

    I did manage to get the file HDMIReviver to run by right clicking and opening in terminal and it said it was scanning every 5 secs but nothing actually happened.

    Any help would be appreciated.





    Andrew

    ReplyDelete
  53. AD, the app the instructions refer to is the HDMIReviver program. Unfortunately since you tried running it and it had no effect it sounds like it's not working for your config. Try reading through some of the posts where people mention the parameters they use for different hardware.

    ReplyDelete
  54. Wow, thanks!! Cool program. How about enchancing it with a preferences panel to turn it on/off and set the polling interval when the display is off? Its really strange why apple doesnt have this feature built in. Its quite normal to keep the pc on when downloading stuff etc. and turn off your amp/display to conserve power.

    ReplyDelete
  55. Hello Paul,
    I experience exactly the same problem as described above : my Mac Mini connected to HD projector is working OK when connected directly but is losing the signal when connected through an 4x2 HDMI switch.
    After googling hours on the Web for a solution, I found your program which I believed would save me. Unfortunately, it did not work for me which I must say was very disappointing. One question : how do you find the framebuffer name? I have searched in the output of the ioreg -l command line but I am not sure where this should be located. Any help would be appreciated.

    ReplyDelete
  56. Hello to everyone. It was perfect for my MAN mini with Snow OS but now with Lion it doesn't work! Any ideas?

    ReplyDelete
  57. I have an "Early 2009" Mac mini. It was hooked up to an HD TV thru a Sony amp that handles 4 HDMI sources. The mini became unresponsive every time I switched to a different component (interestingly, its shared files were still available thru the network, and iTunes was active and could play through AirPlay but not the computer's speaker). SO - I downloaded your hdmiriviver app --and voilĂ ! Works perfectly! Dude -- thank you!

    ReplyDelete
  58. OOPS. Spoke too soon. It worked when the disconnect lasted a few seconds. Beyond 5 minutes the mini locked up again.

    Ideas?

    ReplyDelete
  59. I have a Mac Mini running 10.7.2, but can't get this to work with my Pioneer AV Receiver.

    I seemed to get the application to run using:

    ./HDMIReceiver -f IOFramebuffer

    But screen just blanks when I run through the AV receiver.

    Any help would be much appreciated,

    ReplyDelete
  60. I feel like this is an issue apple should but will never for some reason fix. Will this work for new model Mac minis running lion? I know nothing of the process involved what is /library? and I'd rather not mess things up if there's no hope to begin with. Wish there was just some program I could download and pay $5 for. Stupid apple.

    ReplyDelete
  61. I think there is nothing wrong with the Mac behavior, it is going into sleep because the switch tells the Mac it is no longer connected.

    The harware solution is "simply" to force a 5v signal on the Mac HDMI Autodetect pin. This was easily done on my switch by lifting a pin from the switch microcontroller.

    Try at your own risk

    ReplyDelete
  62. Genius! Thank you.

    ReplyDelete
  63. Holy man... I'll call you the definition of MY MAN!!!
    Thank you sooooo much... This has been a pain in the .... for soo long now...

    You're my man!!!

    ReplyDelete
  64. Hi, Running a 2012 Mac Mini with ATI Radeon graphics and OSX 10.7. Cant find any of the strings in my IO reg listing. Anyone got it working with similar?

    Looks like it is exactly what I want if I can get it to work

    ReplyDelete
  65. You just saved me the cost of a DVI Detective and a power outlet! This is awesome, just what I needed to use an HDMI switcher with my 2009 MacMini running 10.6. Thanks!

    ReplyDelete
  66. You rule!! Thank you thank you thank you!!

    ReplyDelete
  67. I know this is a really old post, but I've just got a 2012 mac mini and am having problems where I get no display when I switch to the mini input on my sound-bar.

    My question is, what do I look for in the ioreg output?

    ReplyDelete
  68. about this subject and I think that it would be really interesting to create such discussion with other this website visitors. Anyway thanks a lot one more time for the great and informative publication RCA stereo cable

    ReplyDelete