Jump to content

getcodecid - Command line tool to detect codec id


Andy Vandijck
 Share

124 posts in this topic

Recommended Posts

  • 4 months later...

I've had a look at the recent submissions here so I can update the binary in DarwinDumper. After some testing I found:

 
- Mickey's posted binary failed on 10.6 here with 'Illegal instruction'.
- Calibre's posted binary run fine in 10.6 but was x64 only.
- Deepak's posted binary failed with 'dyld: Symbol not found: _OBJC_CLASS_$_NSRegularExpression'. I did manage to compile sources so it worked okay, but only as x64.
- AnV's getcodecid_NoARC binaries were FAT but failed to run on SL without error.
 
As a result I took a frankenstein approach to build a working FAT binary. Steps taken:
 
1 - Started with AnV's getcodecid_NoARC.zip from opening post.
2 - Added the additional codecs from InsanelyDeepak's posted source from post #24
3 - Moved the position of the NSMutableArray as suggested by Mickey1979 in post #19
4 - Build with Xcode 6.3, using 10.10 SDK with a 10.6 deployment target.
 
It might not be pretty but it works.
 
Source and binary:
 
Feel free to clean it up anyone.
  • Like 2
Link to comment
Share on other sites

 

I've had a look at the recent submissions here so I can update the binary in DarwinDumper. After some testing I found:

 
- Mickey's posted binary failed on 10.6 here with 'Illegal instruction'.
- Calibre's posted binary run fine in 10.6 but was x64 only.
- Deepak's posted binary failed with 'dyld: Symbol not found: _OBJC_CLASS_$_NSRegularExpression'. I did manage to compile sources so it worked okay, but only as x64.
- AnV's getcodecid_NoARC binaries were FAT but failed to run on SL without error.
 
As a result I took a frankenstein approach to build a working FAT binary. Steps taken:
 
1 - Started with AnV's getcodecid_NoARC.zip from opening post.
2 - Added the additional codecs from InsanelyDeepak's posted source from post #24
3 - Moved the position of the NSMutableArray as suggested by Mickey1979 in post #19
4 - Build with Xcode 6.3, using 10.10 SDK with a 10.6 deployment target.
 
It might not be pretty but it works.
 
Source and binary:
 
Feel free to clean it up anyone.

 

Yep, my release was done when forum goes down, and all attachments lost (btw now is ok).

Just for curiosity, this kind of binary is still supported in El capitan? (sorry I can't test atm because I made an urgent Windows Installation to do a Job with SolidWorks...I sacrificed it :P )

  • Like 1
Link to comment
Share on other sites

No problem. I just wanted a new file for DarwinDumper.

Yes, a single FAT binary works fine on 10.6.8 thru 10.11 DP6. Though I have not yet tried it on SL booted with kernel in 32-bit mode. I will do later today though.

 

EDIT: works fine with kernel booted in 32-bit mode.

post-331032-0-24096100-1439196153_thumb.jpg

  • Like 2
Link to comment
Share on other sites

Hey mickey1979. 

Sure. If you can add it then that may well be very useful. Thanks

 

I was also thinking of adding back say, HD3000 where InsanelyDeepak changed it to 'Panther Point'. What do you think to that?

 

EDT:

Or if not reverting then adding it.. so maybe we could have output like:

Panther Point (HD3000) (8086:0116)

Link to comment
Share on other sites

Hey mickey1979. 

Sure. If you can add it then that may well be very useful. Thanks

 

I was also thinking of adding back say, HD3000 where InsanelyDeepak changed it to 'Panther Point'. What do you think to that?

 

EDT:

Or if not reverting then adding it.. so maybe we could have output like:

Panther Point (HD3000) (8086:0116)

 

 

To be more versatile and show the correct name associated to the CodecID you need also to parse the RevisionID...

 

Take a look here (Enoch Codec name list)

http://forge.voodooprojects.org/p/chameleon/source/tree/HEAD/branches/ErmaC/Enoch/i386/libsaio/hda.c#L267

 

ex:

ALC888 and ALC1200

http://forge.voodooprojects.org/p/chameleon/source/tree/HEAD/branches/ErmaC/Enoch/i386/libsaio/hda.c#L326

 

	{ HDA_CODEC_ALC887, 0,          "ALC887" },
	{ HDA_CODEC_ALC888, 0x0101,"ALC1200" }, // Revision Id: 0x100101
	{ HDA_CODEC_ALC888, 0,          "ALC888" },
	{ HDA_CODEC_ALC889, 0,          "ALC889" },

Other example... the ALC885 with all his variants...

ErmaC

  • Like 2
Link to comment
Share on other sites

Hey mickey1979. 

Sure. If you can add it then that may well be very useful. Thanks

 

I was also thinking of adding back say, HD3000 where InsanelyDeepak changed it to 'Panther Point'. What do you think to that?

 

EDT:

Or if not reverting then adding it.. so maybe we could have output like:

Panther Point (HD3000) (8086:0116)

"Panther Point" simply is the right one because the Audio controller has nothing to do with the CPU..ie you can find "Panther Point" in a mobo (... like me) with HD 4000 but is not 8086:0116  :P.

getcodec can't show you CPU info, was just AnV that wrote that in the header (regarding a 80862806)... but IMHO is wrong (approach was ok when 6 Series chip came out the first time)

 

try with the one attached, the output is like that:

IDT 92HD91BXX (111d:76e0)
	Controller 8086:1e20 (sub-ven:103c:1818)
Intel Panther Point (8086:2806)
	Controller 8086:1e20 (sub-ven:103c:1818) 

To get something like 8086:1E20 instead of 0x80861E20 require additional work.... EDIT done!

Please before compile re-check the deployment target and the binary options (I've use that in Yosemite). Removed AppKit and Foundation, just imported Cocoa (btw is the same: Foundation +AppKit), but this way only one link for xcode.

 

EDIT II

if you want less output...I'm here just tell me what

getcodecid_NoArc_Full-Output.zip

  • Like 1
Link to comment
Share on other sites

To be more versatile and show the correct name associated to the CodecID you need also to parse the RevisionID...

That would be great but I'm not looking to spend much time on this, instead just working with what we've got here.

"Panther Point" simply is the right one because the Audio controller has nothing to do with the CPU..ie you can find "Panther Point" in a mobo (... like me) with HD 4000 but is not 8086:0116  :P.

Yeah. bad example  :P

 

try with the one attached, the output is like that:

IDT 92HD91BXX (111d:76e0)

    Controller 8086:1e20 (sub-ven:103c:1818)

Intel Panther Point (8086:2806)

    Controller 8086:1e20 (sub-ven:103c:1818) 

To get something like 8086:1E20 instead of 0x80861E20 require additional work.... EDIT done!

That's great!

Thank you Micky1979!

  • Like 1
Link to comment
Share on other sites

THX, the output can be more intresting when a chip audio is present in a discrete video card! :)

I hope there is enough space in DarwinDumper to display everything correctly.

Bye bye :lol:

 

EDIT

the sub-vendor indicate users when they can install a patched AppleHDA for a particular codec because if matching user will be 100% sure that this will work also for him, otherwise same codec can have different pinconfig (a codec have a lot of unused node)...this is OEM depending

Link to comment
Share on other sites

Tiny mod.
Now also scan for the revision id (Only AppleHDA.kext ATM... need to be adapt for VoodooHDA.kext)
And Codec list name with some variant as been ported from Enoch HDA model/codec list.

InsanelyMac:Test ermac$ ./getcodecid
Analog Devices AD2000b
NVIDIA GT440
NVIDIA GT440
NVIDIA GT440
NVIDIA GT440
Analog Devices AD2000b (11d4:989b) Rev.(00100300)
	Controller 8086:3a3e (sub-ven:106b:00a0)
NVIDIA GT440 (10de:0014) Rev.(00100100)
	Controller 10de:0bea (sub-ven:1458:3544)
NVIDIA GT440 (10de:0014) Rev.(00100100)
	Controller 10de:0bea (sub-ven:1458:3544)
NVIDIA GT440 (10de:0014) Rev.(00100100)
	Controller 10de:0bea (sub-ven:1458:3544)
NVIDIA GT440 (10de:0014) Rev.(00100100)
	Controller 10de:0bea (sub-ven:1458:3544)

Source -> source_code_for_getcodecid_with_revid.zip
binary tool -> getcodecid.zip

ErmaC

  • Like 2
Link to comment
Share on other sites

Greet Fabio!!!

anyway you need to comment line 390 :P

 

;)

 

This can be easy rebuilded  :P

 

Anyway... the mod need to be adapted for VoodooHDA.kext too... and I have no idea witch node to look (I don't use it)

for AppleHDA look for IOHDACodecRevisionID entry but I don't know the "equivalent" for the VoodooHDA...

The gCodecList with rev_id is already in place...

 

Sorry is a mod in the middle... or half mod..  :P

 

ErmaC

Link to comment
Share on other sites

Yes, we only need a ioreg with only VoodooHDA installed :)

 

We need also indicate in the source the history of the changes, will be nice, later when I have time I can import changes to the ARC version (we are in 2015 :P )

  • Like 1
Link to comment
Share on other sites

Wait it's not over :hysterical:, I found the way to merge output when you have both VoodooHDA and AppleHDA. This way for matching codec output (because otheirwise will be double), the one from Apple take the precedence...and also the revision is manteined. 

I'm going to try with AppleHDA only, VoodooHDA only and both together! :D

I have to import last ErmaC changes before...

Link to comment
Share on other sites

Ok, this has something new:

1) main code moved to a new Class called HDA. Now both Apple and Voodoo codecs are merged to a single Dictionary easy to be parsed. That method also avoid duplicates.

 

2) Debug mode

 

 

Debug mode has more output, and write two plist inside your Desktop.

For this can't be used with sudo, an error show up.. (simply because Desktop of root user lives in /private/var/root/Desktop, and you can image...).

/* DEBUG_MODE: 

    0 for normal output.

    1 if you want show all output from AppleHDA and VoodooHDA, 

    this also write VODOOHDA.plist and APPLEHDA.plist to your Desktop

 */

#define DEBUG_MODE 0

this must modified in the top of getcodecid-Prefix.pch file.

 

 

 

3) Info and credits

 

 

now accept one argument

getcodecid -i

print info and changes:

--------------------------------------------------------------------------------
getcodecid

Created by Andy Vandijck on 27/12/12.
Copyright (c) 2012-2015 AnV Software. All rights reserved.

topic at:
http://www.insanelymac.com/forum/topic/285277-getcodecid-command-line-tool-to-detect-codec-id/page-1

Changes:

07/11/14
Micky1979:      fixed a bug for an NSMutablearray outside the @autoreleasepool.
03/04/15
InsanelyDeepak: added more codecs to match in getcodecid.h.
09/08/15
blackosx:       corrected the @autoreleasepool in the non-ARC version,
                reimported InsanelyDeepak changes.
10/08/15
Micky1979:      output modified to show also the device-ids and sub vendor-id.
10/08/15
ErmaC:          added the ability to show also the revision of the codec,
                added more codec from Enoch bootloader.
10/08/15
Micky1979:      rework of the main function, added new Class called HDA that
                handle output from both AppleHDA and VoodooHDA together.
                This way possible duplicates are merged in one array.
                Added this info page. Added DEBUG_MODE in the pch file.
                Added both workspace for ARC and non-ARC.
-------------------------------------------------------------------------------- 

w/o arguments works as before, with more then one args is stopped:

gecodecid can have only one argument -i (to show History),
otherwise no argument are required! 

the goal is to track changes

 

 

 

4) Added another ".xcodeproj" with ARC enabled (10.7+ 64 bit only), so you can build different bynary (the old is 32-64 bit..10.6+).

 

Tested with AppleHDA and VoodooHDA *together and not.

*Really appreciated a test with a System really running both AppleHDA and VoodooHDA at same time (the case of Quo motherboard, I think) because my lappy only run one of it at time (though voodoo is loaded but does not much hardware).

 

Micky :)

getcodecid-refactored.zip

  • Like 2
Link to comment
Share on other sites

 Share

×
×
  • Create New...