Jump to content
Andy Vandijck

getcodecid - Command line tool to detect codec id

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

Share this post


Link to post
Share on other sites
Advertisement

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

Share this post


Link to post
Share on other sites

@slice:

Which version of xcode are you using?

It builds fine with xcode 4.5.2...

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

@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

Share this post


Link to post
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...

Share this post


Link to post
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

Share this post


Link to post
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... ;)

Sorry, but exactly the same issue

Screen Shot 2012-12-30 at 0.19.00.png

Share this post


Link to post
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.

Share this post


Link to post
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$

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

getcodecid.zip

Share this post


Link to post
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 ..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Slice
      Some users claim that using VoodooHDA they hear loud bump at system start and sound in system comes with noise.
      Although this can be repaired with existing drivers I propose a version that do this automatically.
      It started silently and have very clear output. The file is compiled as 32/64 and works from 10.6 up to 10.12.
      VoodooHDA.kext-289.zip
      The sources is in my signature.
       
      There is a VoodooHDA,prefPane compatible with Sierra
      VoodooHDA.prefPane-289.zip

       
      Now there is a version 2.9.0 by Zenith432.
      It can work with multichannel sound and play it on 5.1 analog system.

      VoodooHDA.kext-2.9.0d8.zip
      27.04.2017 
      d10 - Fix issues involving AudioControls
      VoodooHDA.kext-2.9.0d10.zip
       
      20.11.2018
      Fix issue with scratch on slow CPU
      VoodooHDA.kext-291SSE.zip
       
      04.05.2019
      More checks for memory allocation. More clear sound anyway. 
      VoodooHDA.kext-292.zip
      IOAudioFamily.kext.zip
       
       
    • By grisno
      Hi people,
       
      Installer to activate the sound card REALTEK ALC282-v2 (10ec:0282) with LayoutID 1 or 3 in MacOS. This installer does not contain AppleHDA patched Kext. To work properly, it must be installed over vanilla AppleHDA.kext.
       
      I want to thank the whole community for their efforts and content provided, because without these it would not be possible to create this installer.
       
      I would appreciate comments and suggestions!!
       
      Status:
      Speakers : OK Headphones : OK HDMI Audio : OK (Intel HD4K Tested) LineIn : N/A (Model Without LineIn) MicInt : OK MicIntNoiseReduction : OK MicExt : N/A (Model Without MicExt) AutoDetectLineIn : N/A (Model Without LineIn) Sleep : OK WakeUp : OK AutoSleep : OK Hibernate : OK Siri : OK   Tested Laptops:
       
      - HP Pavillion 15-D002SS
       
      Coming Soon:
       
      - Unified installer for the different supported operating systems.
      - Support model with LineIn jack.
       
      Modified Verbs:
      01271C20 01271D00 01271EA0 01271F90 01471C10 01471D00 01471E17 01471F90 01871CF0 01871D00 01871E00 01871F40 01E71CF0 01E71D00 01E71E00 01E71F40 02171C30 02171D10 02171E21 02171F00 01470C02   DSDT:
       
      Patch to apply with MaciASL in your DSDT
      ######################################### HDEF v1.00######################################## into method label _DSM parent_label HDEF remove_entry;into device label HDEF insertbeginMethod (_DSM, 4, NotSerialized)\n{\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "layout-id", Buffer() { 0x01, 0x00, 0x00, 0x00 },\n //"layout-id", Buffer() { 0x03, 0x00, 0x00, 0x00 },\n "hda-gfx", Buffer() { "onboard-1" },\n "PinConfigurations", Buffer() { },\n })\n}\nend;  
    • By grisno
      Hi people,
       
      This is a preliminary installer to activate the sound card IDT 92HD87B2/4 (111D:76D9) in MacOS. This new version of the installer does not contain AppleHDA patched Kext. To work properly, it must be installed over vanilla AppleHDA Kext.
       
      I want to thank the whole community for their efforts and content provided, because without these it would not be possible to create this installer.
       
      I would appreciate comments and suggestions!!
       
      Status:
      Speakers : OK Headphones : OK HDMI Audio : OK (Intel HD3K/4K Tested) LineIn : OK MicInt : OK MicIntNoiseReduction : OK MicExt : OK AutoDetectLineIn : OK Sleep : OK WakeUp : OK AutoSleep : OK Hibernate : OK Siri : OK   Tested Laptops:
       
      - HP Pavillion G6-2209SS
      - HP Probook 4440S
       
      Coming Soon:
       
      - Unified installer for the different supported operating systems
       
      Original Verbs:
      00a71cf0 00a71d00 00a71ef0 00a71f40 00b71c1f 00b71d10 00b71e21 00b71f04 00c71c20 00c71d10 00c71ea1 00c71f04 00d71c10 00d71d01 00d71e17 00d71f90 00f71cf0 00f71d00 00f71ef0 00f71f40 01171c30 01171d01 01171ea3 01171fd5   Modified Verbs Layer ID 3 & 12:
      00A71CF0 00A71D00 00A71EF0 00A71F40 01371C40 01371D10 01371E21 01371F04 00C71C20 00C71D10 00C71E81 00C71F04 01471C10 01471D01 01471E17 01471F90 00F71C50 00F71D00 00F71EF0 00F71F40 01171C30 01171D01 01171EA0 01171F90  
      Modified Verbs Layer ID 2:
      00B71C10 00B71D10 00B71E21 00B71F04 00C71C20 00C71D10 00C71E81 00C71F04 00D71C30 00D71D00 00D71E17 00D71F90 01171C40 01171D00 01171EA0 01171F90  
        AppleHDAHardwareConfigDriver.kext > Info.plist (Layer ID 2, 3 & 12): <key>HDAConfigDefault</key> <array> <dict> <key>AFGLowPowerState</key> <data> AwAAAA== </data> <key>Codec</key> <string>IDT 92HD87B2/4</string> <key>CodecID</key> <integer>287143641</integer> <key>ConfigData</key> <data> AKcc8ACnHQAApx7wAKcfQAE3HEABNx0QATce IQE3HwQAxxwgAMcdEADHHoEAxx8EAUccEAFH HQEBRx4XAUcfkAD3HFAA9x0AAPce8AD3H0AB FxwwARcdAQEXHqABFx+Q </data> <key>FuncGroup</key> <integer>1</integer> <key>LayoutID</key> <integer>2</integer> </dict> <dict> <key>AFGLowPowerState</key> <data> AwAAAA== </data> <key>Codec</key> <string>IDT 92HD87B2/4</string> <key>CodecID</key> <integer>287143641</integer> <key>ConfigData</key> <data> ALccEAC3HRAAtx4hALcfBADHHCAAxx0QAMce gQDHHwQA1xwwANcdAADXHhcA1x+QARccQAEX HQABFx6gARcfkA== </data> <key>FuncGroup</key> <integer>1</integer> <key>LayoutID</key> <integer>3</integer> </dict> <dict> <key>AFGLowPowerState</key> <data> AwAAAA== </data> <key>Codec</key> <string>IDT 92HD87B2/4</string> <key>CodecID</key> <integer>287143641</integer> <key>ConfigData</key> <data> ALccEAC3HRAAtx4hALcfBADHHCAAxx0QAMce gQDHHwQA1xwwANcdAADXHhcA1x+QARccQAEX HQABFx6gARcfkA== </data> <key>FuncGroup</key> <integer>1</integer> <key>LayoutID</key> <integer>12</integer> </dict> </array>   DSDT:
       
      Patch to apply with MaciASL in your DSDT. You must change the value of the layout-id before applying the patch. In MacOS Mojave should always be 0x02
      ######################################### HDEF ######################################## into method label _DSM parent_label HDEF remove_entry; into device label HDEF insert begin Method (_DSM, 4, NotSerialized)\n {\n If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }\n Return (Package()\n {\n "built-in", Buffer () { 0x00 }, \n "hda-gfx", Buffer() { "onboard-1" }, \n "layout-id", Buffer () { 0x03, 0x00, 0x00, 0x00 }, \n "PinConfigurations", Buffer () {}, \n "MaximumBootBeepVolume", Buffer () { 0x4d } \n })\n }\n end;  
    • By markilark
      So I have an HP Envy Notebook (15t-q400) which features two Band & Olufsen speakers (tweeters) and one subwoofer - the audio codec used is the ALC290 (aka the ALC 3241). I'm running on Mojave. So far I've tried AppleALC with Lilu and have no luck - the audio plays through the headphones - although very poorly - but not the external speakers at all, and I've tried everything short of writing my own XML file for it. So I've decided to go for using the VoodooHDA kext.  
       
      While VoodooHDA sees my devices immediately, they are strangely configured, and I cannot use the subwoofer or even see it listed as a device. This is my main problem.
       
      As I'm aware the proper configuration of the laptop is: 
      Three speakers - one left, one right, and one subwoofer module One 3.5mm headphone jack An internal microphone for the webcam (this is one I'm not sure about, I don't know if it is two separate microphones or one as there are two holes in the display chasis)   
       
      In my devices while using the default VoodooHDA kext, I have 
                Output:
      Speaker (Analogue) - Type= Apple speaker port <--- only tweeters work  Headphones (Back Right) - Type= Headphone Port <--- this seems to work well           Input:
      Microphone (Black Right) - Type: Microphone Port <---- this works a little, sounds like it's muffled, not from the webcam Microphone (ATAPI) - Type: Microphone Port  <--- this works well, is definitely the webcam microphone  
       

      Here is my Pin Config (with disabled devices not ignored as I think the subwoofer is one of those devices):

      Here is my Pin Config for the photo above (disabled devices NOT ignored, fix not applied).
      01371c00 01371d00 01371e00 01371f40 01871c10 01871d01 01871e17 01871f90 01a71c20 01a71d10 01a71ea1 01a71f04 01d71c2d 01d71d81 01d71e75 01d71f40 01271c30 01271d01 01271ea3 01271f99 01571c40 01571d10 01571e21 01571f04 01471cf0 01471d11 01471e11 01471f41 01671cf0 01671d11 01671e11 01671f41 01771cf0 01771d11 01771e11 01771f41 01971cf0 01971d11 01971e11 01971f41 01b71cf0 01b71d11 01b71e11 01b71f41 01e71cf0 01e71d11 01e71e11 01e71f41  
       
       
       

      Here is my Pin Config for the photo above (disabled devices ignored, fix not applied):
      01871c10 01871d01 01871e17 01871f90 01a71c20 01a71d10 01a71ea1 01a71f04 01271c30 01271d01 01271ea3 01271f99 01571c40 01571d10 01571e21 01571f04  
      I have been attempting to add the subwoofer as a node in the Info.plist of VoodooHDA but can't seem to get it to work (and frankly I'm not sure which device it is!) . I've tried adding both NID 19 and 20 into my Info.plist file for VoodooHDA but neither have done any good. Am I supposed to add the NID and PinDefault to the Info.plist AFTER Pin Configurator's fix? I was under the impression this only helped with a patched AppleHDA which VoodooHDA overwrites. 

      Thanks for all the help, I hope I conveyed this clearly! 
       
      I've attached my codec dump as well. 
      dumpcodec.rtf
    • By warty
      On 8/20/2018 at 5:22PM, TessereKt said:
       
      On 8/21/2018 at 7:34AM, insanelyDeepak said:
       
      @insanelyDeepak, I would like to try cloverHDA, but I need help understanding how to use it.
       
      I have an Asus laptop that uses Realtek ALC295.
       
      My questions with regard to using cloverHDA:
      1.  I am running High Sierra (10.13.6). Is cloverHDA directly compatible? If not, can it easily be made compatible with adjustments I can apply?
       
      2.  What needs to be done with the original AppleHDA.kext that is already present in /S/L/E? Should it be left alone? Should it be removed? If it is removed, does the AppleHDA.kext that comes with cloverHDA, for example /Vanilla AppleHDA/Mac OS Sierra 10.12.6/AppleHDA.kext, need to be installed in its place?
       
      3.  In the 21 aug 18 reply to TessereKt, you mentioned "there is ALCPluxfix must install this." I noticed that there is a directory for alc_fix in one ALC295 directory (the ALC295_v2 Asus UX430UA directory) but not in the other ALC 295 directory that is provided (the ALC295/3254 directory). In which situation(s) is ALCPlugFix required?
       
      4.  My pathmaps are somewhat different from those in the cloverHDA.kext. Is there an easy way for me to customize the kext? For example, if I just switch the values in the xml files, will that be enough? Or does the whole thing then need to be recompiled?
       
      needed pathmaps:
      33-2
      23-3
      7-36-18
      9-34-19
       
      (My highest priority for the moment is getting headphone working, which is 33-2, and I might even be able to use the 33-3 that is already included. But I would like to eventually get all of them working.)
       
       
×