Jump to content

getcodecid - Command line tool to detect codec id


Andy Vandijck
 Share

124 posts in this topic

Recommended Posts

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)

getcodecid.zip

post-100023-0-86286800-1356634853_thumb.png

getcodecid_NoARC.zip

  • Like 9
Link to comment
Share on other sites

@slice:

Which version of xcode are you using?

It builds fine with xcode 4.5.2...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Added a new autorelease pool...

Sources + binary for Lion/Snow Leopard...

Slice, try this one and let me know if it still leaks... ;)

getcodecid_new.zip

Link to comment
Share on other sites

OK, I will update my XCode installation to recent version.

As I see Xcode 4.4.1 is more recent then 4.5.2?!

Screen Shot 2012-12-30 at 20.15.36.png

 

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.

Link to comment
Share on other sites

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$

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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/

 

getcodecid.h.zip

 

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

  • Like 4
Link to comment
Share on other sites

  • 1 year later...

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.7, but  always set a  SDK greater than or equal to 10.7...to use the obj-c Automatic Reference Counting

 

Micky

  • Like 1
Link to comment
Share on other sites

  • 6 months later...

As requested by someone (broken file), I've attached the getcodecid project by AnV that work under ARC, with the fix described above (post 19), so non more memory leak.

The deployment target is set to 10.7 (due to the ARC technology you need at least Lion to compile it) but it should work in 10.6 on (was tested) and probably in 10.5 too where the Obj-C 2.0 was introduced (not tested).

I dont't have the non-ARC project, AnV probably have a copy of it's own work  :P

 

EDIT

 

project contain  a pre-built getcodecid command ready to use

getcodecid.zip

  • Like 1
Link to comment
Share on other sites

As requested by someone (broken file), I've attached the getcodecid project by AnV that work under ARC, with the fix described above (post 19), so non more memory leak.

The deployment target is set to 10.7 (due to the ARC technology you need at least Lion to compile it) but it should work in 10.6 on (was tested) and probably in 10.5 too where the Obj-C 2.0 was introduced (not tested).

I dont't have the non-ARC project, AnV probably have a copy of it's own work  :P

 

EDIT

 

project contain  a pre-built getcodecid command ready to use

Thank you micky ,, working awesome ..

Link to comment
Share on other sites

  • 2 weeks later...
 Share

×
×
  • Create New...