Jump to content

Editing custom personalities for ATI Radeon HD[45]xx


bcc9
 Share

775 posts in this topic

Recommended Posts

Yes, I get video output through HDMI.

post-125711-1299771154_thumb.jpg

 

I'm using 10.7's kext. The 10.7's ATIFramebuffer is different than 10.6's Framebuffer. So I'm unable to test the senseid.

 

With 10.6's kexts & ATIFramebuffer patched, no output on external monitor (connected to HDMI). The display just sleep. However, monitor does detected in IORegistry with correct EDID & correct connector-type (0x800). When checked via VNC, I found QE/CI are enabled.

 

These are screenshots of the HDAU device:-

post-125711-1299771671_thumb.jpgpost-125711-1299771695_thumb.jpgpost-125711-1299771715_thumb.jpg

 

 

Regarding your screen shot, specifically the one with HDAU highlighted. Where is GFX0? Normally you would see

 

P0P2 (same as PEGP)

>IOPCI2PCIBridge

->GFX0

--->ATIxxxxController

--->ATIRadeon

--->.......

--->HDAU

 

In your IOReg, It looks like M86 is in place of GFX0. If M86 does not have hda-gfx <"onboard-1"> there won't be HDMI audio. Verify you have GFX0 functionality (in addition to HDAU) as noted by tmongkol in his reply above.

Link to comment
Share on other sites

hda-gfx does matched up between audio & video. You did checked my ioreg earlier.

 

That assertion failure:

"Sound assertion "0 == hdaGfxCandidate" failed in "/SourceCache/AppleHDA/AppleHDA-179.1.4/AppleHDAController/AppleHDAController.cpp" at line 889 goto Exit"

is what you get if the audio code finds the hda-gfx string under HDEF or HDAU but can't find any hda-gfx for the video device.

 

In the above message I can see that you're running a pretty old version of AppleHDA - 10.6.2. Antique AppleHDA mixed with 10.7 video drivers is just begging for trouble IMO. The class structure may have changed enough to break the matching. Try 10.6.6 at least.

Link to comment
Share on other sites

That assertion failure:

"Sound assertion "0 == hdaGfxCandidate" failed in "/SourceCache/AppleHDA/AppleHDA-179.1.4/AppleHDAController/AppleHDAController.cpp" at line 889 goto Exit"

is what you get if the audio code finds the hda-gfx string under HDEF or HDAU but can't find any hda-gfx for the video device.

 

In the above message I can see that you're running a pretty old version of AppleHDA - 10.6.2. Antique AppleHDA mixed with 10.7 video drivers is just begging for trouble IMO. The class structure may have changed enough to break the matching. Try 10.6.6 at least.

The screenshot error message was taken when I tried AppleHDA from 10.6.2. In the process to get HDMI audio working, I tried AppleHDA from 10.6.2 to 10.6.6. With all version, I got the above assertion failure. I don't know why the error occurred because in HDAU & M86 (video) devices, both have "hda-gfx=onboard-1", as you saw in my IORegistry I posted in a couple post back. I'm guessing the assertion failure occurred because I'm using 10.7 kexts. I also tried, which I don't believe will make any different, renamed the M86 device to GFX0 in DSDT. The result is the same assertion error occurred. So, I think 10.7 kext have something to do with the error.

 

EDIT: Going to try a couple of things & I'll post the IORegistry again.

Link to comment
Share on other sites

This is my latest IORegistry & also System Profiler dump if anyone want to examine it too.

kizwan_macbook.ioreg.zip

kizwan_macbook.spx.zip

 

Remember, I'm using:-

  1. 10.7 kexts:-
    • ATI4600Controller.kext
    • ATIFramebuffer.kext
    • ATISupport.kext

[*]Kabyl's boot file - add ATI graphic card device ID in ATI.C:-

  • { 0x9553,	0x02BD1028,	CHIP_FAMILY_RV710,		"ATI Radeon 4500 Mobility Series",	kPeregrine	},


 

These are screenshots I taken for quick look:-

post-125711-1299909755_thumb.jpgpost-125711-1299909778_thumb.jpgpost-125711-1299909576_thumb.jpg

post-125711-1299909625_thumb.jpgpost-125711-1299909702_thumb.jpgpost-125711-1299909731_thumb.jpg

post-125711-1299909666_thumb.jpgpost-125711-1299910615_thumb.jpg

 

Any idea or suggestion please let me know. I'll try them.

 

EDIT: To anyone who only read this post might have a couple of questions.

FAQ:-

  1. Why are you using 10.7 kexts?
    • I got no output on the external monitor with 10.6.6 kexts but the monitors are properly recognized in IORegistryExplorer & System Profiler (checked via VNC). When using 10.7 kexts, I got output on the external monitor.

[*]Do you realized this thread is about patching 10.6 ATIFramebuffer to get HDMI audio working?

  • Yes, I realized that but I have plan later to test 10.6.6 kexts again to see whether I can get HDMI audio working with it or not.

Link to comment
Share on other sites

@ kizwan

 

I looked at a picture of Display's System Profiler and it told me that you connected to SMB2330H. Then, I searched information of SMB2330H and found out that this monitor doesn't have built-in speakers. Need to connect to an LCD TV or a receiver that supports HDMI audio.

post-93383-1299938285_thumb.jpg

post-93383-1299938304_thumb.jpg

 

 

I have no idea why you got sound assertion. Could you disconnect HDMI cable and see what's going on?

Link to comment
Share on other sites

@ kizwan

 

I looked at a picture of Display's System Profiler and it told me that you connected to SMB2330H. Then, I searched information of SMB2330H and found out that this monitor doesn't have built-in speakers. Need to connect to an LCD TV or a receiver that supports HDMI audio.

post-93383-1299938285_thumb.jpg

post-93383-1299938304_thumb.jpg

 

 

I have no idea why you got sound assertion. Could you disconnect HDMI cable and see what's going on?

There is an audio out port at the back of the monitor. This shouldn't be a problem right? The monitor can accept audio through HDMI link. I just need to plugged in speaker to my monitor.

 

Sure. I'll get back to you on this (disconnect HDMI cable). I just tried with 10.6.6 kexts, I got the same assertion error but this is debatable since there is no video output on the external monitor even though the external monitor is properly recognized in IORegistry (EDID is correct).

Link to comment
Share on other sites

There is an audio out port at the back of the monitor. This shouldn't be a problem right? The monitor can accept audio through HDMI link. I just need to plugged in speaker to my monitor.

 

Sure. I'll get back to you on this (disconnect HDMI cable). I just tried with 10.6.6 kexts, I got the same assertion error but this is debatable since there is no video output on the external monitor even though the external monitor is properly recognized in IORegistry (EDID is correct).

 

post-93383-1299946724_thumb.jpg

Please try and let me know.

Thanks.

Link to comment
Share on other sites

post-93383-1299946724_thumb.jpg

Please try and let me know.

Thanks.

Disconnecting the HDMI cable doesn't help either. The same assertion error occurred. Connecting HDMI cable after boot also doesn't make it to work. I already connected speaker to it. In windows it's working perfectly though.

 

Thank you for your help. I'll need to examine my DSDT again. Probably something else in it that prevent HDMI audio from working. My DSDT is fresh/new, just added few basic fix (HPET, RTC, HDEF, AppleLPC, SBUS & hda-gfx for HDAU & GFX0) in it.

Link to comment
Share on other sites

Guys I hope someone can understand what's happening here...

 

I've got a mobility 5650 and I've got some good results with Lion's kexts, but I wanted to try with 10.6.6 stock kexts.

 

So I read bbc9 guide and chose to use Vervet because it has 01 as senseid for HDMI just like my card.

 

So I attached my HDMI monitor and rebooted. The very strange thing is: I got desktop on my internal display while my HDMI remains black, but if I deattach my HDMI my internal turns black too..

 

So...OSX is convinced to "send images" to my HDMI (system profiler reports my HDMI monitor), but images arrive on my laptop! How can it be?

Link to comment
Share on other sites

Guys I hope someone can understand what's happening here...

 

I've got a mobility 5650 and I've got some good results with Lion's kexts, but I wanted to try with 10.6.6 stock kexts.

 

So I read bbc9 guide and chose to use Vervet because it has 01 as senseid for HDMI just like my card.

 

So I attached my HDMI monitor and rebooted. The very strange thing is: I got desktop on my internal display while my HDMI remains black, but if I deattach my HDMI my internal turns black too..

 

So...OSX is convinced to "send images" to my HDMI (system profiler reports my HDMI monitor), but images arrive on my laptop! How can it be?

Please post your connection table (Vervet). This is original connection table for Vervet:-

VERVET:-
0000000	00  04  00  00  00  04  00  00  00  01  00  00  12  04  04  02  
0000010	04  00  00  00  14  00  00  00  00  01  00  00  01  12  01  04  
0000020	00  02  00  00  14  00  00  00  00  01  00  00  00  00  06  03  
0000030	00  08  00  00  00  02  00  00  00  01  00  00  22  05  05  01

Also the readout from the ROM file also can be helpful, for example:-

ATOM BIOS Rom: 
SubsystemVendorID: 0x1028 SubsystemID: 0x02bd
IOBaseAddress: 0x0000
Filename: BR034783.006
BIOS Bootup Message: 
BR034783-006 M92 DDR3 64bit 500e/800m									   

Connector at index 0 type: VGA (1)
Connector's i2cid: 95
Connector at index 1 type: HDMI-A (11)
Connector's i2cid: 91
Connector at index 2 type: LVDS (7)
Connector's i2cid: 90

With these information help will come to you faster. :)

Link to comment
Share on other sites

Something very strange is happening to my pc...

 

This is stock Vervet from 10.6.6

0000000	00  04  00  00  00  04  00  00  00  01  00  00  12  04  04  02
0000010	04  00  00  00  14  00  00  00  00  01  00  00  01  12  01  04
0000020	00  02  00  00  14  00  00  00  00  01  00  00  00  00  06  03
0000030	00  08  00  00  00  02  00  00  00  01  00  00  22  05  05  01

and this is my mobility 5650 rom:

ATOM BIOS Rom: 
SubsystemVendorID: 0x103c SubsystemID: 0x1448
IOBaseAddress: 0x4000
Filename: BR38421.001 
BIOS Bootup Message: 
MADISON Lenovo-Yx60-Madison Pro DDR3 64Mx16 500E/600M					   
Connector at index 0 type: LVDS (7)
Connector's i2cid: 96
Connector at index 1 type: HDMI-A (11)
Connector's i2cid: 90
Connector at index 2 type: VGA (1)
Connector's i2cid: 97

Since senseid for my HDMI is 01, I booted with AtiConfig=Vervet without patching ATIFramebuffer expecting to have OSX to recognize my HDMI...

 

Instead...

 

I got images on my internal display, my HDMI monitor was black but system profiler said it was plugged.

Unplugging the external monitor resulted in black screen on internal laptop too... Why?

 

I'm kinda a newbie experimenting, so I'm going to say something stupid probably but...maybe some of this numbers

0000030	00  08  00  00  00  02  00  00  00  01  00  00  22  05  05  01

says OSX where to "send" images???

Link to comment
Share on other sites

Kizwan also to add to this. My ATI Mobility 5650 works using Eulemur with 3D acceleration using 10.7 kexts however when installing Lion and trying to use Eulemur I get blank screen. It is like it goes to change resolution then screen switches black.

 

I have made a DSDT but i cannot test it until someone gets a bootloader to work with Lion.

 

Evoenabler produces blank screen.

ATY 5600 edition that netkas made causes CPU panic.

 

DSDT i was thinking was my only solution.

 

What I would like to find out is what is the difference between using 10.7 kexts inside 10.6.6 and using 10.7 kexts inside 10.7? Would it be the IOGraphicsFamily.kext causing something.

 

ATI5000Controller loads in Lion.

ATIRadeonX3000 loads in Lion.

ATISupport loads in Lion.

ATIFramebuffer does not load. However I can use this in 10.6.6 fine?

 

Startup says CARD in Slot 1 without using any injectors, but nothing happens desktop loads 800x600, sometimes 1024x768.

 

10.6.6 Injects through PCI0 --> P0P2@3 --> VGA@0 (This makes my LVDA (Laptop screen working and VGA port) Haven't tested HDMI.

 

@bbc9 this is awsome, will look into editing the Framebuffer personality. I will be reading this section thoroughly. :)

Link to comment
Share on other sites

Well I have a rom dump, and my ioreg from 10.6.6 and ioreg from 10.7.

 

OK figured out radeondump, reads rom file.

ATOM BIOS Rom: 
SubsystemVendorID: 0x103c SubsystemID: 0x1448
IOBaseAddress: 0x4000
Filename: BR38421.001 
BIOS Bootup Message: 
MADISON Lenovo-Yx60-Madison Pro DDR3 64Mx16 500E/600M					   

Connector at index 0 type: LVDS (7)
Connector's i2cid: 96
Connector at index 1 type: HDMI-A (11)
Connector's i2cid: 90
Connector at index 2 type: VGA (1)
Connector's i2cid: 97

 

Archive.zip

Link to comment
Share on other sites

Something very strange is happening to my pc...

 

This is stock Vervet from 10.6.6

0000000	00  04  00  00  00  04  00  00  00  01  00  00  12  04  04  02
0000010	04  00  00  00  14  00  00  00  00  01  00  00  01  12  01  04
0000020	00  02  00  00  14  00  00  00  00  01  00  00  00  00  06  03
0000030	00  08  00  00  00  02  00  00  00  01  00  00  22  05  05  01

You should try patch the Vervet connection table. There is a script at first post which you can use to gather required information. OR you can do it manually. All required information to do it manually is also available at first post.

 

This is an example how to patch the connection table manually:-

(Run the commands in /System/Library/Extensions/ATIFramebuffer.kext/Contents/MacOS/ folder OR in the same folder where ATIFramebuffer binary file located)

lipo -detailed_info ATIFramebuffer

==

Fat header in: ATIFramebuffer
fat_magic 0xcafebabe
nfat_arch 2
architecture x86_64
cputype CPU_TYPE_X86_64
cpusubtype CPU_SUBTYPE_X86_64_ALL
offset 4096					--> start_offset_for_architecture = 4096 (for 64bit)
size 149936
align 2^12 (4096)
architecture i386
cputype CPU_TYPE_I386
cpusubtype CPU_SUBTYPE_I386_ALL
offset 155648					  --> start_offset_for_architecture = 155648 (for 32bit)
size 148908
align 2^12 (4096)

otool -arch i386 -vt ATIFramebuffer | c++filt

== (for example Vervet)

VervetInfo::createInfo(unsigned char, PlatformParameters&):
0000d488	pushl	%ebp
0000d489	movl	%esp,%ebp
0000d48b	movl	0x0c(%ebp),%ecx
0000d48e	movl	$0x0000ece8,0x08(%ecx)
0000d495	movb	$0x04,0x03(%ecx)	--> (4 connection)
0000d499	xorl	%edx,%edx
0000d49b	movl	%edx,%eax
0000d49d	shll	$0x04,%eax
0000d4a0	addl	$0x00011200,%eax	--> virtual_address = 0x00011200
0000d4a5	movl	%eax,0x0c(%ecx,%edx,4)
0000d4a9	incl	%edx
0000d4aa	movzbl	0x03(%ecx),%eax
0000d4ae	cmpl	%edx,%eax
0000d4b0	jg	0x0000d49b
0000d4b2	xorl	%eax,%eax
0000d4b4	leave
0000d4b5	ret

otool -arch i386 -l ATIFramebuffer

== (I only show the section where virtual_address (0x00011200) is in the range of addr to addr+size)

Section
 sectname __data
  segname __DATA
  addr 0x000111c0				--> start_address_for_segment = 0x000111c0
  size 0x00000494
offset 70904				--> offset_for_segment = 70904
 align 2^5 (32)
reloff 93996
nreloc 2
 flags 0x00000000
reserved1 0
reserved2 0

 

start_offset_for_architecture + offset_for_segment + virtual_address - start_address_for_segment = offset_in_file

32bit: 155648 + 70904 + 0x00011200 - 0x000111c0 = 0x26000 + 0x114F8 + 0x00011200 - 0x000111c0 = 0x37538

(correction - original connection table)

--> 00037538	 00 04 00 00 00 04 00 00 00 01 00 00 12 04 04 02  
--> 00037548	 04 00 00 00 14 00 00 00 00 01 00 00 01 12 01 04  
--> 00037558	 00 02 00 00 14 00 00 00 00 01 00 00 00 00 06 03  
--> 00037568	 00 08 00 00 00 02 00 00 00 01 00 00 22 05 05 01

 

ATOM BIOS Rom:
SubsystemVendorID: 0x103c SubsystemID: 0x1448
IOBaseAddress: 0x4000
Filename: BR38421.001
BIOS Bootup Message:
MADISON Lenovo-Yx60-Madison Pro DDR3 64Mx16 500E/600M					  

Connector at index 0 type: LVDS (7)
Connector's i2cid: 96
Connector at index 1 type: HDMI-A (11)
Connector's i2cid: 90
Connector at index 2 type: VGA (1)
Connector's i2cid: 97

 

senseid = (i2cid And 0xf) +1

LVDS: (96 And 0xf) + 1 = 7

HDMI: (90 And 0xf) + 1 = 1

VGA: (97 And 0xf) + 1 = 8

 

Patched senseid:-

(correction)

--> 00037538	 00 04 00 00 00 04 00 00 00 01 00 00 12 04 04 07	 (LVDS but with wrong connector-type 0x400. Correct connector-type is 0x2)
--> 00037548	 00 08 00 00 00 02 00 00 00 01 00 00 22 05 05 01	 (HDMI connector-type 0x800 - change the first 15 bytes with the one from 4th row***)
--> 00037558	 00 02 00 00 14 00 00 00 00 01 00 00 00 00 06 08	 (VGA but with wrong connector-type 0x200. Possible correct connector-type is 0x10**)
--> 00037568	 00 08 00 00 00 02 00 00 00 01 00 00 22 05 05 02	 (Change the senseid from 01 to something else for example 02 to prevent duplicate entry in IORegistry for display which connected to HDMI)

** Please refer to this post.

*** Actually not necessary to move the connection entry, just need to change the senseid. Meaning, the 4th connection (4th row) is already for HDMI since connector-type is 0x800. Just need to patch senseid with your HDMI senseid. In this example, the original senseid (01) already matched yours, so no need to patch.

 

In this example, we only change/patch Vervet connection table for 32bit mode which means you'll need to boot to 32bit (arch=i386). If you want to patch connection table for 64bit mode, you'll need run the above commands for 64bit architecture (-arch x86_64) & recalculate the offsets. At least external monitor connected to HDMI port will work. To get LVDS working you'll need to patch the first 15 bytes (LVDS 0x2: 02 00 00 00 XX XX XX XX XX XX XX XX XX XX XX 07). Try use any framebuffer which support LVDS as reference.

Link to comment
Share on other sites

@kizwan thanks for your post, but I dont think you've read mine :( I know perfectly how to patch...this is what I don't understand:

 

The fourth line of Vervet has HDMI and 01 as senseid, and that's perfect for my card without patching... But I've got images on my internal monitor, not HDMI monitor! But if I unplug my external HDMI monitor, I lose images on internal too...

Link to comment
Share on other sites

@kizwan thanks for your post, but I dont think you've read mine :( I know perfectly how to patch...this is what I don't understand:

 

The fourth line of Vervet has HDMI and 01 as senseid, and that's perfect for my card without patching... But I've got images on my internal monitor, not HDMI monitor! But if I unplug my external HDMI monitor, I lose images on internal too...

 

@Kizwan or BBC9

 

 

How would I go about patching ATIFramebuffer in 10.7 if 10.7 kext has no personalities inside of the file? Maybe it autoselects?

 

ATY,RadeonFramebuffer i think is the new one which handles all FB's.

 

@Checcco i think we are on same boat here, your connections look like they match with mine, Your probably more knowledgeable with all this numbers and stuff and how to convert hex back and forth, haven't done patch since AppleHDA quite a while ago.

Link to comment
Share on other sites

@Kizwan or BBC9

 

 

How would I go about patching ATIFramebuffer in 10.7 if 10.7 kext has no personalities inside of the file? Maybe it autoselects?

 

ATY,RadeonFramebuffer i think is the new one which handles all FB's.

 

@Checcco i think we are on same boat here, your connections look like they match with mine, Your probably more knowledgeable with all this numbers and stuff and how to convert hex back and forth, haven't done patch since AppleHDA quite a while ago.

 

I'm gonna give up... I've tried EVERYTHING....I've found no way to make osx to work on my LVDS...And I haven't read any case of success on HP laptops... So maybe HP laptops have something "different"...

Link to comment
Share on other sites

@Kizwan or BBC9

 

 

How would I go about patching ATIFramebuffer in 10.7 if 10.7 kext has no personalities inside of the file? Maybe it autoselects?

As of 10.7, the hardcoded personalities have moved from ATIFramebuffer to the platform specific kexts (ATI1300Controller, ATI1600Controller, etc.)

You can see them with the same

otool -arch i386 -vt <kext-name> | c++filt | grep createInfo

command that I showed in post #1, where <kext-name> represents the ATI*Controller.kext you wish to examine.

Not all the ATIController kexts have hardcoded personalities so perhaps some autodetect.Actually all the ones I looked at do have hardcoded personalities.

 

I have been unable to get [url=&quot;http://www.insanelymac.com/forum/topic/279450-why-insanelymac-does-not-support-tonymacx86/&quot;]#####[/url] to run on any of my systems so I have not been able to install 10.7, so I can't write definitively about how the driver is behaving.

Perhaps someone can help me with [url=&quot;http://www.insanelymac.com/forum/topic/279450-why-insanelymac-does-not-support-tonymacx86/&quot;]#####[/url] :wacko:

 

I got images on my internal display, my HDMI monitor was black but system profiler said it was plugged.

Unplugging the external monitor resulted in black screen on internal laptop too... Why?

That suggests that you have in fact found the senseid for your hdmi port but the other bytes (I'd suspect bytes 12,13,14) are not right for your hardware.

I think you should start with a closer match to your actual hardware (vervet doesn't even have an LVDS entry), and modify the senseid byte of that table's HDMI connector to match the value you discovered.

Link to comment
Share on other sites

Can you add any clarity on the last section?

 

byte link_i2cid;	/* Bits 0-3: i2cid
				   Bits 4-7: link transmitter link */
		byte dac_digidx;	/* Bits 0-3: link encoder number
				   Bits 4-7: link dac number */
		byte hotplugid;
		byte senseid;	/* Sense line is bits 0-3
				  Use hw i2c flag is bit 4 */
		/* i2cid = (senseid & 0xf-1)+0x90 */
		/* senseid = (i2cid & 0xf) +1*/

New user mucha seems to have figured out the remaining 3 digits in this section.

http://www.insanelymac.com/forum/index.php?showtopic=252061

Link to comment
Share on other sites

Thank you Kizwan i will follow the above post as it looks like the same setup for me :)

Sorry, I put wrong connection table in the post. The Vervet connection table which supposedly original was actually already modified. I use modified ATIFramebuffer as reference. :P

Link to comment
Share on other sites

Great, will be happy to update the docs if some concrete details are posted.

I can give you step by step instructions how to get 10.7 running, PM me i'm here all day, all you need is [url=&quot;http://www.insanelymac.com/forum/topic/279450-why-insanelymac-does-not-support-tonymacx86/&quot;]#####[/url] 1.4 and 2 kexts fakesmc and nullcpupowermanagement kexts.

 

if 10.7 is hardcoded in ATI5000Controller then in 10.7, 3 kexts load ATI5000Controller, ATISupport, ATIRadeonX3000 but the Framebuffer kext don't load, what would be stopping this, I'm guessing if i change the config of port allocation this issue will still exist?

 

I'm gonna give up... I've tried EVERYTHING....I've found no way to make osx to work on my LVDS...And I haven't read any case of success on HP laptops... So maybe HP laptops have something "different"...

 

@Checcco I won't give up, i will use all the information here and figure something out, I can get my card to work using Eulemur in 10.6.6 using 10.7 kexts so there must be a way to get something working in 10.7. Lion would be lovely accelerated.

 

Just downloading Xcode 4.1 atm huge blody thing :)

Link to comment
Share on other sites

 Share

×
×
  • Create New...