Jump to content

Editing custom personalities for ATI Radeon HD[45]xxx


  • Please log in to reply
725 replies to this topic

#1
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,268 posts
  • Gender:Male
The problem:
Under OSX the ATI driver uses a hard-coded set of personalities to define some of the video card's capabilities, most notably the connector layout. This is sufficient to support the limited number of configurations that Apple ships, but leads to non-working monitors (black displays) in many hackintosh configurations. Users have limited success & limited functionality by simply guessing which hard-coded personality best matches their video card.

Some prerequisites:There are currently 26 ATI framebuffer personalities defined in ATIFramebuffer's Info.plist.
Each of these personalities defines a set of hard-coded information about the video card hardware. One of the key pieces that gets defined is the connector information, known as ConnectorInfo within the ATI driver.
There is one ConnectorInfo structure for every potential connector that may be plugged into a video card. (Dual link DVI ports still count as a single ConnectorInfo). Each personality defines a table of these ConnectorInfo structures.

The ConnectorInfo structure can be represented as the following 16 byte structure, in C code:
 
typedef struct {
int ConnectorType; /* known values below */
#define CONNECTORTYPE_LVDS 0x00000002 /* Ie internal Low Voltage display,
such as laptop */
#define CONNECTORTYPE_DVI_DUAL 0x00000004 /* Dual link(?) DVI */
#define CONNECTORTYPE_VGA 0x00000010 /* Per mucha */
#define CONNECTORTYPE_SVIDEO 0x00000080 /* Per mucha */
#define CONNECTORTYPE_DVI 0x00000200 /* Single link DVI(?), Per azimutz */
#define CONNECTORTYPE_DP 0x00000400 /* Displayport */
#define CONNECTORTYPE_HDMI 0x00000800

int controlflags;
int features;
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*/
} ConnectorInfo;
where integers are represented in intel little-endian byte order, and bit 0 is the LSB.

Lets take a look at the driver's 32-bit code for seting up the ConnectorInfo.
otool -arch i386 -vt ATIFramebuffer | c++filt | grep createInfo
gives you the list of the 26 initialization routines.
For all personalities, the initialization routine sets the connector count and a pointer to a static array of ConnectorInfo.

I've written a script which will parse the personality initialization routines for you and calculate the effective address of the ConnectorInfo table, as well as the number of table entries. The script currently outputs information for all personalities found in the ATI Framebuffer kext.
Usage:
perl ati-personality.pl -386
to output 32-bit kext information, or
perl ati-personality.pl
to output 64-bit kext information
As of osx 10.7, the connectorinfo has been separated out across several ATI controller kexts, instead of ATIFramebuffer.
The script detects this automatically for 10.7 or 10.8 and prints information for all the controller kexts. However the 10.6.7 2011 MBP kexts also share this new layout and the script doesn't auto-detect this. For this case only, you should use the -a switch to tell the script to look in the new locations:
perl ati-personality.pl -a
to get the connectorinfo from their new locations with the 10.6.7 2011 MBP kexts.

See finding-patch-address.txt in the attached zip file for instructions if you wish to calculate the effective address & disk address yourself by hand.

Note: ati-personality.pl supports OSX 10.6.x where x >= 4, as well as 10.7 and 10.8. In older versions of OSX the ConnectorInfo structure was a different length (used to be 20 bytes instead of the current 16).

For example purposes lets focus on the 10.6.6 32-bit portion of the kext, and the uakari ConnectorInfo. From ati-personality.pl we learn:
Personality: Uakari
ConnectorInfo count in decimal: 4
Disk offset in decimal 226552
0000000 00 04 00 00 00 04 00 00 00 01 00 00 12 04 04 01
0000010 04 00 00 00 14 00 00 00 00 01 00 00 01 12 01 03
0000020 00 02 00 00 14 00 00 00 00 01 00 00 00 00 06 05
0000030 00 08 00 00 00 02 00 00 00 01 00 00 22 05 05 04
0000040
You can see above that the perl script found the location of the Uakari connector info and has dumped out the contents in hex.
You can also dump the ConnectorInfo yourself, see the xxd example below.

Next we take a look at the ConnectorInfo for this personality:

connector-type 0x00000400=displayport at port 0
connector-type 0x00000004=DVI at port 1
connector-type 0x00000200=single link DVI(probably) at port 2
connector-type 0x00000800=HDMI at port 3

Booting kabyl's chameleon branch on my Sapphire Radeon 5670 with this personality results in working DVI and working HDMI (with no audio). Note that due to a bug in that code, overriding the personality from Baboon (the default with 3 connectors total) to Uakari results in 3 injection strings not 4. So the 5670 hardware's ports are matched against only the first 3 entries in the uakari table.

Looking at the ioregistry, one can see that port-number 1&2 matched and port 0 did not. (ATY_ActiveFlags != 1 when the port is matched).
So my HDMI port was matched but with the wrong connector type (0x0002). This causes HDMI audio to fail.
To fix this I overwrote bytes 0 thru 15 of port 2's table entry with port 3's.
You can do this using your favorite hex editor.
xxd, followed by ascii editing, followed by xxd -r is probably the simplest choice. For example:
% cd /System/Library/Extensions/ATIFramebuffer.kext/Contents/MacOS/
% ls -l ATIFramebuffer
-rw-r--r-- 1 root wheel 304556 Mar 2 16:57 ATIFramebuffer
% dd if=ATIFramebuffer of=/tmp/uakari bs=1 skip=226552 count=64
% cd /tmp
% xxd < uakari > hex
% cat hex
0000000: 0004 0000 0004 0000 0001 0000 1204 0401 ................
0000010: 0400 0000 1400 0000 0001 0000 0112 0103 ................
0000020: 0002 0000 1400 0000 0001 0000 0000 0605 ................
0000030: 0008 0000 0002 0000 0001 0000 2205 0504 ............"...
%
Since there are 4 connectors for this personality, we dump 4*16=64 bytes in the dd command shown above.
Now you edit the ConnectoIinfo table with your favorite text editor and dd the result back in place:
% xxd -r < hex > uakari.new
% dd if=uakari.new of=/System/Library/Extensions/ATIFramebuffer.kext/Contents/MacOS/ATIFramebuffer bs=1 count=64 seek=226552 conv=notrunc
The resulting table with the 3rd row changed:
% cat hex
0000000: 0004 0000 0004 0000 0001 0000 1204 0401 ................
0000010: 0400 0000 1400 0000 0001 0000 0112 0103 ................
0000020: 0008 0000 0002 0000 0001 0000 2205 0505 ............"...
0000030: 0008 0000 0002 0000 0001 0000 2205 0504 ............"...
Note that since the 32bit & 64bit connectorinfo tables are the same, you can simply repeat the last dd step above with the proper disk offset for the 64 bit table, in order to update that table as well.

With the above edit, my HDMI audio port is recognized as type 0x0800, with the usual HDMI flags, but with the expected sense line (0x05). And viola, HDMI audio now works!

Next, my Sapphire radeon 5670 actually has 3 ports - HDMI, DVI and displayport, and, alas, this personality is only working with 2 of them, even though the personality does include a displayport connector. Luckily I was able to find a different personality with which this card's displayport did work, the Vervet personality.

Again from ati-personality.pl, we find Vervet's ConnectorInfo:
Personality: Vervet
ConnectorInfo count in decimal: 4
Disk offset in decimal 226616
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
0000040
My card does in fact match port-number 0 for the DP port, as seen in the ioregistry.
So I copy the working senseid field from the vervet personality into the Uakari personality (replace the 0x01 at byte 15 of the first line with 0x02).
Viola, all 3 ports are now working with my card...

Hope this helps others with non-working ports or with HDMI audio problems.
Questions/comments?

Attached Files



#2
joe75

joe75

    Revolutionary

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 2,022 posts
  • Gender:Male
  • Location:Rochester, NY
Nice job!, bcc9

;)

#3
lastExile

lastExile

    lastExile��

  • Members
  • PipPipPipPipPip
  • 333 posts
  • Gender:Male
  • Interests:netadmin of osx86.hu irc network for the past few years
nice ;)

#4
VCH888

VCH888

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 585 posts
Thank you. ;)

I will ask you if I have a question.

#5
Boombeng

Boombeng

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 598 posts
  • Gender:Male
  • Location:France
Cool!
I gonna try to enable hdmi audio on my HD4850 !

#6
Kabyl

Kabyl

    InsanelyMac Geek

  • Retired Developers
  • 170 posts
  • Gender:Male

The ConnectorInfo structure can be represented as the following 16 byte structure, in C code:

typedef struct {
	   int ConnectorType;	/* known values below */
   #define CONNECTORTYPE_DVI  0x0004
   #define CONNECTORTYPE_DP   0x0400	/* Displayport */
   #define CONNECTORTYPE_HDMI 0x0800
	   int flags;
	   int features;
	   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 */
   } ConnectorInfo;

Thank you bcc9! I was wondering what the other fields are used for.

Booting kabyl's chameleon branch on my Sapphire Radeon 5670 with this personality results in working DVI and working HDMI (with no audio). Note that due to a bug in that code, overriding the personality from Baboon (the default with 3 connectors total) to Uakari results in 3 injection strings not 4. So the 5670 hardware's ports are matched against only the first 3 entries in the uakari table.

I'll have to fix that, thanks.

Hope this helps others with non-working ports or with HDMI audio problems.
Questions/comments?

We need more people like you ;)

#7
VCH888

VCH888

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 585 posts
@ bcc9

How did you connect Displayport from your monitor? Or, do do you have Displayport monitor?

Thanks.

#8
Boombeng

Boombeng

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 598 posts
  • Gender:Male
  • Location:France
I had a look to enable hdmi audio on my HD4850 (2xdvi + s-video)
Here is the atombios connector dump :
Audio chip info: 0
Connector at index 0 type: DVI-I (2)
Connector at index 1 type: DVI-I (2)
Connector at index 2 type: 9 pin DIN (9)
Connector at index 4 type: DVI-I (2)
Connector at index 5 type: DVI-I (2)

Under Windows it is possible to have audio output using a dvi>hdmi dongle
Using Motmot personnality of Atiframebuffer both dvi ports work well but ther is no audio

Following your instructions i found this for motmot :

addl $0x00010d60 (68960)
movb $0x02

offset_for_segment = 61624
start_address_for_segment = 0000ed80 (60800)

total = 225432

at 225432 dec address in bin :

00 04 00 00 04 01 00 00 00 01 00 00 10 00 02 03
04 00 00 00 14 02 00 00 00 01 00 00 01 11 01 04

looking ioregistry i can see port 0 and 1 are matched when i plug 2 displays in dvi

Would that be possible to enable audio or the lack of hdmi connector in atombios is a problem ?

Thanks again

#9
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,268 posts
  • Gender:Male

Thank you bcc9! I was wondering what the other fields are used for.

Thanks. I think I also have a bunch of the feature flag bits mapped but I haven't been able to verify them.

With some more understanding, we might be able to auto-patch these tables for 3rd party cards.

I'll have to fix that, thanks.


We need more people like you -_-

Glad you can pick that up without a real bug report :D
Yes, actual developers are pretty rare around here. It's too bad there isn't a good, active hackintosh developer forum.

How did you connect Displayport from your monitor? Or, do do you have Displayport monitor?

My dell u3011 has displayport. Works for me at 2560x1600.
Maybe I should pick up a DP->HDMI adapter so I can try HDMI audio over DP.

Would that be possible to enable audio or the lack of hdmi connector in atombios is a problem ?

That would depend upon the capabilities of your video card. Your card's DVI ports may carry HDMI audio (but probably not). To know for sure, check your lspci output.
Borrowing from Kabyl's post:
lspci -nnvd 0x1002: | grep -B2 Subsystem
Would show you two PCI devices if your video card supports audio. The second PCI device with audio class (0403) would be the audio device. Example:
lspci -nnvd 0x1002: | grep -B2 Subsystem
  01:00.0 VGA compatible controller [0300]: ATI Technologies Inc Redwood [Radeon HD 5670] [1002:68d8] (prog-if 00 [VGA controller])
		  Subsystem: PC Partner Limited Device [174b:e151]
  --
  
  01:00.1 Audio device [0403]: ATI Technologies Inc Redwood HDMI Audio [Radeon HD 5600 Series] [1002:aa60]
		  Subsystem: PC Partner Limited Device [174b:aa60]


#10
VCH888

VCH888

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 585 posts

My dell u3011 has displayport. Works for me at 2560x1600.
Maybe I should pick up a DP->HDMI adapter so I can try HDMI audio over DP.

Can you get sound out thru 3 audio jacks if connecting to HDMI or DisplayPort?

I tried DP -> HDMI on my Sapphire HD7550 and got duplicate, not mirror. Connecting DVI to LCD monitor and DP -> HDMI to LCD TV. Display in System Profiler showed me only LCD monitor. So, I think I could get DP port working properly if I had a monitor with display port or used either DP2VGA or active DP2DVI.

#11
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,268 posts
  • Gender:Male

Can you get sound out thru 3 audio jacks if connecting to HDMI or DisplayPort?

I tried DP -> HDMI on my Sapphire HD7550 and got duplicate, not mirror. Connecting DVI to LCD monitor and DP -> HDMI to LCD TV. Display in System Profiler showed me only LCD monitor. So, I think I could get DP port working properly if I had a monitor with display port or used either DP2VGA or active DP2DVI.

What do you mean by 3 audio jacks?

Under system profiler, or via "system_profiler SPDisplaysDataType" from the shell, I can see all 3 of my card's ports show up as separate addressable displays.

#12
wmarsh

wmarsh

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 900 posts

Questions/comments?

Very interesting.

Do you see any possibility of enabling LVDS output (as in older FB such as Wormy) in the newer FB (such as Peregrine) so those of us with Mobility Radeons can use laptop display?

http://www.projectos...php?showtopic=9

#13
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,268 posts
  • Gender:Male

Very interesting.

Do you see any possibility of enabling LVDS output (as in older FB such as Wormy) in the newer FB (such as Peregrine) so those of us with Mobility Radeons can use laptop display?

http://www.projectos...php?showtopic=9

And that's an interesting connector table. Assuming it's right about the LVDS ports, that would make:

#define CONNECTORTYPE_LVDS 0x0002
as an addition to post #1, which is actually what I thought but was uncertain.
Since there are apple products shipping with mobile radeons, yes I see no reason why you shouldn't be able to make 3rd party mobile radeons work, at least for gpus sufficiently similar to the genuine apple models.

#14
jsl

jsl

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 203 posts

Some prerequisites:Installation of OSX Developer tools (for examining personalities with otools)
Somewhat working install of ATI radeon HD[45]xx card with Kabyl's chameleon branch: http://www.insanelym...howtopic=231768
Understanding of hex editing
Ability to troubleshoot by looking at ioregistry, understanding how to test ATI personalities using ATIConfig

This is a first draft

There are currently 26 ATI framebuffer personalities defined in ATIFramebuffer's Info.plist.
Each of these personalities defines a set of hard-coded information about the video card hardware. One of the key pieces that gets defined is the connector information, known as ConnectorInfo within the ATI driver.
There is one ConnectorInfo structure for every potential connector that may be plugged into a video card. (Dual link DVI ports still count as a single ConnectorInfo). Each personality defines a table of these ConnectorInfo structures.

The ConnectorInfo structure can be represented as the following 16 byte structure, in C code:

typedef struct {
	   int ConnectorType;	/* known values below */
   #define CONNECTORTYPE_DVI  0x0004
   #define CONNECTORTYPE_DP   0x0400	/* Displayport */
   #define CONNECTORTYPE_HDMI 0x0800
	   int flags;
	   int features;
	   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 */
   } ConnectorInfo;

where integers are represented in intel little-endian byte order, and bit 0 is the LSB.

Lets take a look at the driver's 32-bit code for seting up the ConnectorInfo.
otool -arch i386 -vt ATIFramebuffer | c++filt | grep createInfo
gives you the list of the 26 initialization routines.
For all personalities, the initialization routine sets the connector count and a pointer to a static array of ConnectorInfo.

The address of the ConnectorInfo table can be found by looking at the assembly code for the personality's createInfo routine. Specifically the address can be found in the last addl instruction in the routine. The exception is the case where the table has only one connector. In that case there is no addl instruction, instead look for the movl instruction with 0x0c(%eax) as second operand.
In both cases, the address of the ConnectorInfo structure is the hex address reported in the first operand of the instruction.

The number of connectors can generally be found by looking at the movb instruction whose second operand is 0x03(%ecx). (The Wormy personality is the exception, I'm not sure why).

Now lets take a specific example, the Uakari personality. In UakariInfo::createInfo we see 1 addl instruction, it reads (I'm looking using 10.6.6 driver code as an example from here on):
0000d472 addl $0x000111c0,%eax
and for the number of connectors,
0000d467 movb $0x04,0x03(%ecx)

So 0x111c0 is the address of the ConnectorInfo, and there are 4 of them.

Next we will want to convert this virtual memory address to an offset in the file for our viewing and editing convenience.

  • lipo -detailed_info ATIFramebuffer
    reports file offsets for the FAT binary. In the offset field under i386 architecture, we see 155648 (decimal)
  • otool -arch i386 -l ATIFramebuffer
    Find the section whose address+size includes the above virtual address within its range (111c0). In this case the we have a data segment that starts at 111c0 exactly. otool reports a file offset of 70904 (decimal) for that segment.
  • So the address on disk for this virtual address is:
    offset_in_file = start_offset_for_architecture + offset_for_segment + virtual_address - start_address_for_segment

    where start_offset_for_architecture as reported by lipo above
    start_address_for_segment, offset_for_segment as reported by otool above
    virtual_address is the address obtained from the addl instruction.

    Numerically, the address on disk is:

    155648+70904+0x111c0-0x111c0=226552
Now we take a look at the ConnectorInfo therein. Since there are 4 connectors for this personality, we want to look at 64 bytes:
dd if=ATIFramebuffer of=/tmp/uakari bs=1 skip=226552 count=64
   od -Ax -tx1 /tmp/uakari
   000000 00 04 00 00 00 04 00 00 00 01 00 00 12 04 04 01
   000010 04 00 00 00 14 00 00 00 00 01 00 00 01 12 01 03
   000020 00 02 00 00 14 00 00 00 00 01 00 00 00 00 06 05
   000030 00 08 00 00 00 02 00 00 00 01 00 00 22 05 05 04
   000040
So we have for this personality
connector-type 0x0400=displayport at port 0
connector-type 0x0004=DVI at port 1
connector-type 0x0002=?? at port 2
connector-type 0x0800=HDMI at port 3

Booting kabyl's chameleon branch on my Sapphire Radeon 5670 with this personality results in working DVI and working HDMI (with no audio). Note that due to a bug in that code, overriding the personality from Baboon (the default with 3 connectors total) to Uakari results in 3 injection strings not 4. So the 5670 hardware's ports are matched against only the first 3 entries in the uakari table.

Looking at the ioregistry, one can see that port-number 1&2 matched and port 0 did not. (ATY_ActiveFlags != 1 when the port is matched).
So my HDMI port was matched but with the wrong connector type (0x0002). This causes HDMI audio to fail.
To fix this I overwrote bytes 0 thru 15 of port 2's table entry with port 3's.
You can do this using your favorite hex editor. I used emacs :)
xxd, followed by ascii editing, followed by xxd -r is probably a less awkard choice.

The resulting table with the 3rd row changed:
od -Ax -tx1 /tmp/uakari
   000000 00 04 00 00 00 04 00 00 00 01 00 00 12 04 04 01
   000010 04 00 00 00 14 00 00 00 00 01 00 00 01 12 01 03
   000020 00 08 00 00 00 02 00 00 00 01 00 00 22 05 05 05
   000030 00 08 00 00 00 02 00 00 00 01 00 00 22 05 05 04
   000040
Now my HDMI audio port is recognized as type 0x0800, with the usual HDMI flags, but with the expected sense line (0x05). And viola, HDMI audio now works!

Next, my Sapphire radeon 5670 actually has 3 ports - HDMI, DVI and displayport, and, alas, this personality is only working with 2 of them, even though the personality does include a displayport connector. Luckily I was able to find a different personality with which this card's displayport did work, the Vervet personality.

Using the above procedure, I find Vervet's ConnectorInfo at
0x11200, with 4 connectors. On disk:
155648+70904+0x11200-0x111c0=226616

dd if=ATIFramebuffer of=/tmp/vervet bs=1 skip=226616 count=64
   od -Ax -tx1 /tmp/vervet
   000000 00 04 00 00 00 04 00 00 00 01 00 00 12 04 04 02
   000010 04 00 00 00 14 00 00 00 00 01 00 00 01 12 01 04
   000020 00 02 00 00 14 00 00 00 00 01 00 00 00 00 06 03
   000030 00 08 00 00 00 02 00 00 00 01 00 00 22 05 05 01
   000040
My card does in fact match port-number 0 for the DP port, as seen in the ioregistry.
So I copy the working senseid field from the vervet personality into the Uakari personality (replace the 0x01 at byte 15 of the first line with 0x02).
Viola, all 3 ports are now working with my card...

Hope this helps others with non-working ports or with HDMI audio problems.
Questions/comments?

Thanks for your detailed guide for us.
My EAH5850 has this personality of Uakari FB found by IORegistryExplorer:
connector-type 0x0400=DP at port 0
connector-type 0x0004=DVI at port 1
connector-type 0x0200=DVI at port 2
connector-type 0x0800=HDMI at port 3
Currently only DVI at port 1 and port 2 are working for me by any two of the three (DVI->DVI, DVI->VGA, DVI->HDMI ).
But I can detect two PCI address for my EAH5850: one for VGA and the other for audio device by lspci.
According to your theory what is the best way to change it to get my HDMI audio working with Uakari FB ?

#15
VCH888

VCH888

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 585 posts

What do you mean by 3 audio jacks?

Under system profiler, or via "system_profiler SPDisplaysDataType" from the shell, I can see all 3 of my card's ports show up as separate addressable displays.

I looked at your Dell u3011 specification from this web site, it told me that U3011 has Audio output. So, I asked you whether or you can audio out from the monitor.

Thanks.

#16
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,268 posts
  • Gender:Male

I looked at your Dell u3011 specification from this web site, it told me that U3011 has Audio output. So, I asked you whether or you can audio out from the monitor.

Thanks for reminding me, I had actually forgotten I had those ports on my 3011!!
So yes, I just tested it and I do in fact get working audio out those discrete 5.1 ports when I have hdmi or displayport attached. With displayport attached, the audio device is displayed as "DisplayPort", when the hdmi port is attached, the audio device is displayed as "HDMI", when both are attached, still just "DisplayPort".

Posted Image

Attached Files



#17
VCH888

VCH888

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 585 posts

Thanks for reminding me, I had actually forgotten I had those ports on my 3011!!
So yes, I just tested it and I do in fact get working audio out those discrete 5.1 ports when I have hdmi or displayport attached. With displayport attached, the audio device is displayed as "DisplayPort", when the hdmi port is attached, the audio device is displayed as "HDMI", when both are attached, still just "DisplayPort".

Posted Image


Thanks. This monitor is useful.

#18
bcc9

bcc9

    InsanelyMac Legend

  • Coders
  • 1,268 posts
  • Gender:Male

Thanks for your detailed guide for us.
If my EAH5850 has this personality of Uakari FB:
connector-type 0x0004=DVI at port 0
connector-type 0x0200=DVI at port 1
connector-type 0x0400=DP at port 2
connector-type 0x0800=HDMI at port 3
And currently only DVI at port 0 and port 1 are working for me.
But I can detect two PCI address for my EAH5850: one for VGA and the other for audio device by lspci.
According to your theory what is the best way to change it to get my HDMI audio working with Uakari FB ?

I'm not sure where you get that layout for Uakari, I did decode it in post #1, showing a different layout. When I wrote "ports" in that post I meant as enumerated in the ConnectorInfo array. These are reported as "port-number" = x in the IORegistry where x is numbered starting at 0. For example:
| |   |	 +-o ATY,Uakari@0  <class IOFBStub, id 0x1000002a2, registered, matched, active, busy 0 (223 ms), retain 7>
	 | |   |	 | | {
	 | |   |	 | |   "port-number" = 1
	 | |   |	 | |   "display-type" = "LCD"
	 | |   |	 | |   "connector-type" = 4
	 | |   |	 | |   "ATY,ActiveFlags" = 4
	 | |   |	 | |   "IOFBDependentIndex" = 0
	 | |   |	 | |   "IOFBDependentID" = 117281408
	 | |   |	 | |   "ATY,ControlFlags" = 20
	 | |   |	 | |   "AAPL,gray-page" = <01000000>
	 | |   |	 | |   "av-signal-type" = 2
	 | |   |	 | |   "AAPL,gray-value" = <c38c6400>
	 | |   |	 | |   "display-connect-flags" = <00000000>
	 | |   |	 | |   "name" = <"ATY,Uakari">
	 | |   |	 | |   "AAPL,boot-display" = <01000000>
	 | |   |	 | | }
shows the second Uakari table entry, port number 1:
000010 04 00 00 00 14 00 00 00 00 01 00 00 01 12 01 03
matching as display #0 for my video card. I can see that it successfully matched because ATY,ActiveFlags != 1. Notice also the connector-type = 4 value corresponding to the 04 00 00 00 in the table.

So given that, I assume your video card is the Asus model with displayport and hdmi ports, and they aren't matching the ports in the uakari table due to the senseid.

So in post #1 I recommended that you could find some other personalities where those ports do work to "discover" the working value for the senseid. Another choice would be to guess what that value should be. Or help figure out how to determine the value automatically from the atom bios or directly from the card :)

Thanks. This monitor is useful.

Yes, thanks, now we know displayport audio does work with my example config, no DP->HDMI dongle required to test. Not so useful in practice to have 3 ports all going between the same card and display :)

#19
wmarsh

wmarsh

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 900 posts

And that's an interesting connector table. Assuming it's right about the LVDS ports, that would make:

#define CONNECTORTYPE_LVDS 0x0002
as an addition to post #1, which is actually what I thought but was uncertain.
Since there are apple products shipping with mobile radeons, yes I see no reason why you shouldn't be able to make 3rd party mobile radeons work, at least for gpus sufficiently similar to the genuine apple models.

bcc9, if you otool -arch i386 -vt ATIFramebuffer I can see the addl for each framebuffer, and find the address as you say.

However, otool -arch x86_64 -vt ATIFramebuffer does not show an addl in the CreateInfo section

Are you booting -arch i386 after this mod? Or does making the 1 change in the table still work for you booting into the normal 64 bit mode?

I am not sure you are correct about the LVDS Connector type.
Wormy looks to me like its 1st port is 0x8000 [edit -- error in address]
Iago, and the new Nomascus look like its 0x0200

I will try both and see if either works

#20
cre8r

cre8r

    InsanelyMac Protégé

  • Members
  • Pip
  • 14 posts
I hope that this method can enable LVDS output on mobility 58xx cards...





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   Web hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy