Jump to content

getcodecid - Command line tool to detect codec id

getcodecid command line tool codec AppleHDA VoodooHDA

  • Please log in to reply
18 replies to this topic

#1
Andy Vandijck

Andy Vandijck

    InsanelyMac Deity

  • Coders
  • 1,630 posts
  • Gender:Male
  • Location:Tienen
  • Interests:Programming stuff for Mac OS X...
    Hacking...
    Hard rock (also really big Metallica...
On demand of Uphuck I have created a command line tool to detect the codec id.
It requires VoodooHDA / AppleHDA to be present...
This tool will get the codec id from the drivers and print them...
Cheers Uphuck...
Source included ;)
Binary is under Release :D
EDIT: Made a version for Lion + Mountain Lion and can be compiled for Snow Leopard too... ;) (This one doesn't use ARC and is 32 + 64 bit)

Attached Files



#2
bertmannaustria

bertmannaustria

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 211 posts
  • Gender:Male
  • Location:Vienna, Austria
thx

#3
uphuck

uphuck

    osx86.Türk team

  • Donators
  • 254 posts
  • Gender:Male
Andy it is very good news!
I finished the audio autodetection script which is using your terminal program 8)

Party time soon :yoji:
Cheers Andy!!!

#4
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 3,021 posts
  • Gender:Male
  • Location:Moscow
MacBook:Projects slice$ /Users/slice/Downloads/getcodecid/Release/getcodecid
Illegal instruction
MacBook:Projects slice$
Attached File  Снимок экрана 2012-12-28 в 11.18.23.png   123.44KB   70 downloads

#5
Andy Vandijck

Andy Vandijck

    InsanelyMac Deity

  • Coders
  • 1,630 posts
  • Gender:Male
  • Location:Tienen
  • Interests:Programming stuff for Mac OS X...
    Hacking...
    Hard rock (also really big Metallica...
@slice:
Which version of xcode are you using?
It builds fine with xcode 4.5.2...

#6
rhada

rhada

    InsanelyMac Protégé

  • Members
  • Pip
  • 13 posts
Works well with Xcode 4.5.2, detects AL889 and my Nvidia HDMI output :) (GTX 560 ti)

#7
Zenith432

Zenith432

    InsanelyMac Sage

  • Developers
  • 424 posts
  • Gender:Male
When run under VMware, it says "Unknown Codec".
Following is IOHDACodecDevice

+-o IOHDACodecDevice@1,0 <class IOHDACodecDevice, id 0x1000002e6, registered, matched, active, busy 0 (2948 ms), retain 7>
| {
| "IOHDACodecVendorID" = 0x15ad1975
| "IOHDACodecRevisionID" = 0x100103
| "IOHDACodecAddress" = 0x0
| }

With device ID 0x15ad1975 that's not in the list. However, when dumping AppleHDAController...

+-o AppleHDAController@1 <class AppleHDAController, id 0x1000002dd, registered, matched, active, busy 0 (2948 ms), retain 8>
| {
| "IOClass" = "AppleHDAController"
| "CFBundleIdentifier" = "com.apple.driver.AppleHDAController"
| "IOProviderClass" = "IOPCIDevice"
| "DPAudioDeviceExclusion" = ({"ManufacturerID"=0x610,"ProductID"=0x2792})
| "IOPCIClassMatch" = "0x04020000&0xFFFE0000"
| "DPAlwaysDisplayRouting" = (0x3,0x21,0x23,0x58)
| "IOPMUnattendedWakePowerState" = 0x0
| "IOProbeScore" = 0x1
| "CodecAddressFilterArray" = ({"CodecAddressMask"=<01000000>,"PCIVendorDeviceID"=0x10de0ac0,"LayoutID"=0x4008},{"CodecAddressMask"=<01000000>,"PCIVendorDeviceID"=0x10de0ac0,"LayoutID"=0x0},{"CodecAddressMask"=<09000000>,"PCIVendorDeviceID"=0x10de0ac0,"LayoutID"=0x41},{"CodecAddressMask"=<01000000>,"PCIVendorDeviceID"=0x10de0ac0,"LayoutID"=0x49})
| "IOPowerManagement" = {"ChildrenPowerState"=0x2,"DevicePowerState"=0x2,"CurrentPowerState"=0x2,"MaxPowerState"=0x2}
| "IOMatchCategory" = "IODefaultMatchCategory"
| "RequireMaxBusStall" = ({"Layouts"=(),"MaxBusStall"=0x3a98})
| "HDAControllerIndex" = 0x0
| "CodecList" = ({"RevisionID"=0x100103,"VendorProductID"=0x15ad1975})
| "HwFactoryPrefixTranslation" = ({"LayoutID"=0x4e,"StandInDID"=0xaa30,"SourceDID"=0xaa40,"VID"=0x1002},{"LayoutID"=0x4e,"StandInDID"=0xaa30,"SourceDID"=0xaa38,"VID"=0x1002},{"LayoutID"=0x4f,"StandInDID"=0xaa30,"SourceDID"=0xaa40,"VID"=0x1002},{"LayoutID"=0x4f,"StandInDID"=0xaa30,"SourceDID"=0xaa38,"VID"=0x1002})
| }

it lists 0x10de0ac0 (Nvidia MCP79) in the CodecAddressFilterArray.

Update: CodecAddressFilterArray is hardwired in Info.plist for AppleHDAController, so 0x10de0ac0 is not relevant. 0x15ad1975 is the right ID, it's just not in the list.

#8
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 3,021 posts
  • Gender:Male
  • Location:Moscow

@slice:
Which version of xcode are you using?
It builds fine with xcode 4.5.2...

3.2.5 on OSX10.6.8
Tomorrow I will try with XCode4

#9
Regi Yassin

Regi Yassin

    Who am I ?

  • Members
  • PipPipPipPipPip
  • 278 posts
  • Gender:Not Telling
works fine on Xcode 4.5.2

Attached Files



#10
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 3,021 posts
  • Gender:Male
  • Location:Moscow
Also fail in 10.7.5
Attached File  Screen Shot 2012-12-28 at 19.52.31.png   234.4KB   26 downloads

#11
Andy Vandijck

Andy Vandijck

    InsanelyMac Deity

  • Coders
  • 1,630 posts
  • Gender:Male
  • Location:Tienen
  • Interests:Programming stuff for Mac OS X...
    Hacking...
    Hard rock (also really big Metallica...
It's because it uses ARC
I'll make a version too for SL + Lion (32 + 64 bit)
Keep you posted Slice ;)
@ Slice: It's made... it's the NoARC zip... can be built with Xcode 3.2 and later...

#12
Andy Vandijck

Andy Vandijck

    InsanelyMac Deity

  • Coders
  • 1,630 posts
  • Gender:Male
  • Location:Tienen
  • Interests:Programming stuff for Mac OS X...
    Hacking...
    Hard rock (also really big Metallica...
Added a new autorelease pool...
Sources + binary for Lion/Snow Leopard...
Slice, try this one and let me know if it still leaks... ;)

Attached Files



#13
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 3,021 posts
  • Gender:Male
  • Location:Moscow

Added a new autorelease pool...
Sources + binary for Lion/Snow Leopard...
Slice, try this one and let me know if it still leaks... ;)

Sorry, but exactly the same issue
Attached File  Screen Shot 2012-12-30 at 0.19.00.png   203.03KB   29 downloads

#14
Poco

Poco

    InsanelyMac Plumber

  • Administrators
  • 1,485 posts
  • Gender:Male
  • Location:Canada
What version of Xcode are you trying to compile on? You have to be running Xcode 4.4+ (Apple LLVM 4.0+ compiler) to compile code that uses Objective-C literals for objects other than simple strings.

You can read more about it here http://clang.llvm.or...eCLiterals.html

#15
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 3,021 posts
  • Gender:Male
  • Location:Moscow
OK, I will update my XCode installation to recent version.
As I see Xcode 4.4.1 is more recent then 4.5.2?!
Attached File  Screen Shot 2012-12-30 at 20.15.36.png   82.75KB   16 downloads

EDITED.
Yes, with Xcode 4.4.1 the project is compilable. The version also contains 4.5.2 tools and libraries to compile under Lion for ML.
Thanks iPoco for the note.

#16
Slice

Slice

    InsanelyMacaholic

  • Local Moderators
  • 3,021 posts
  • Gender:Male
  • Location:Moscow

Added a new autorelease pool...
Sources + binary for Lion/Snow Leopard...
Slice, try this one and let me know if it still leaks... ;)

Yes, it still leaks
iHack:~ Slice$ /Users/Slice/Downloads/getcodecid\ 2/DerivedData/Build/Products/Debug/getcodecid
objc[614]: Object 0x103017ef0 of class __NSArrayM autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
Realtek ALC887/888b
ATI R6xx HDMI
iHack:~ Slice$


#17
Micky1979

Micky1979

    I realized that I am lucky

  • Moderators
  • 1,817 posts
  • Gender:Male
  • Location:a 100m dal Tevere, vicino a Peppe

Added a new autorelease pool...
Sources + binary for Lion/Snow Leopard...
Slice, try this one and let me know if it still leaks... ;)

Compiling well in Mountain Lion also
xCode Version 4.5.2 (4G2008a)


Micky

#18
ErmaC

ErmaC

    127.0.0.1

  • Supervisors
  • 4,695 posts
  • Gender:Male
  • Location:Canary Islands
Hi Andy.
works fine here.
localhost:Release ErmaC$ ./getcodecid
Analog Devices AD2000b
localhost:Release ErmaC$

I add some more "codecs"source from here:
http://people.freebs.../sound/pci/hda/

Attached File  getcodecid.h.zip   5.31KB   40 downloads

Also would be nice add the revision.
I have a second motherboard with ALC1200 (getcodecid not tested yet on it)
but I think his Audio codec will be recognized as ALC888
localhost:Release Isa$ ./getcodecid
Realtek ALC888
localhost:Release Isa$

as you can see from the source above the device revision id is used for evaluating the device (ALC)
http://people.freebs...pci/hda/hdacc.c
mine example is one there is more...
{ HDA_CODEC_ALC888, 0x0101, "Realtek ALC1200" },
{ HDA_CODEC_ALC888, 0, "Realtek ALC888" },
{ HDA_CODEC_ALC861, 0x0340, "Realtek ALC660" },
{ HDA_CODEC_ALC861, 0, "Realtek ALC861" },

Fabio

#19
Micky1979

Micky1979

    I realized that I am lucky

  • Moderators
  • 1,817 posts
  • Gender:Male
  • Location:a 100m dal Tevere, vicino a Peppe

On demand of Uphuck I have created a command line tool to detect the codec id.
 

Anv in the project that use ARC, fix the autorelease pool error by  moving the @autoreleasepool as below

 

from:

int main(int argc, const char * argv[])
{
        io_iterator_t itThis;
        io_service_t service;
        io_service_t parent;
        io_name_t name;
        NSString *pciFormat = @"0x%04lX%04lX";
        NSMutableArray *temp = [NSMutableArray array];
        
        
     @autoreleasepool {  

to

int main(int argc, const char * argv[])
{
    @autoreleasepool {

or

int main(int argc, const char * argv[])
{
        io_iterator_t itThis;
        io_service_t service;
        io_service_t parent;
        io_name_t name;
        NSString *pciFormat = @"0x%04lX%04lX";

    @autoreleasepool { 
        NSMutableArray *temp = [NSMutableArray array];
        
        
     

In short before the "temp" mutable array, and it will work as expect in 10.7 on by setting the "OSX Deployment target" to 10.7 and using the latest 10.10 SDK (i have all SDK). I've compiled in 10.7.5

 

Can I use your code in Pandora, obviously with credits?

 

EDIT

 

it work in Snow Leopard also keeping the "OSX Deployment target" to 10.6, but  always set a  SDK greater than or equal to 10.7...to use the obj-c Automatic Reference Counting

 

Micky


Edited by Micky1979, 07 September 2014 - 02:40 PM.
Snow test






Also tagged with one or more of these keywords: getcodecid, command line tool, codec, AppleHDA, VoodooHDA


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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