Skip to content

Commit 95b1ab1

Browse files
committed
Enabled updating PCI IDs from the app itself, updated audio codecs
1 parent 1e56599 commit 95b1ab1

File tree

5 files changed

+23
-15
lines changed

5 files changed

+23
-15
lines changed

DPCIManager.xcodeproj/project.pbxproj

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
/* Begin PBXBuildFile section */
1010
8716DE1F21285D0D00C47DE6 /* JSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 8716DE1C2128553200C47DE6 /* JSON.m */; };
1111
8726C0E9212ABAB5000177BF /* DataTypeHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 8726C0E8212ABAB5000177BF /* DataTypeHandler.m */; };
12-
876B527321288815003E6A82 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 876B527221288815003E6A82 /* README.md */; };
1312
876B52812129F464003E6A82 /* dd_getopt_long-fbsd.m in Sources */ = {isa = PBXBuildFile; fileRef = 876B52782129F463003E6A82 /* dd_getopt_long-fbsd.m */; };
1413
876B52822129F464003E6A82 /* DDCliApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 876B52792129F463003E6A82 /* DDCliApplication.m */; };
1514
876B52832129F464003E6A82 /* DDCliParseException.m in Sources */ = {isa = PBXBuildFile; fileRef = 876B527B2129F464003E6A82 /* DDCliParseException.m */; };
@@ -292,6 +291,7 @@
292291
developmentRegion = English;
293292
hasScannedForEncodings = 0;
294293
knownRegions = (
294+
English,
295295
en,
296296
);
297297
mainGroup = B02571301601496300B0E1EB;
@@ -311,7 +311,6 @@
311311
isa = PBXResourcesBuildPhase;
312312
buildActionMask = 2147483647;
313313
files = (
314-
876B527321288815003E6A82 /* README.md in Resources */,
315314
B02571561601496400B0E1EB /* MainMenu.xib in Resources */,
316315
B025716A16018D0600B0E1EB /* DPCIManager.icns in Resources */,
317316
B025716C16018D9600B0E1EB /* pci.ids in Resources */,
@@ -333,7 +332,7 @@
333332
);
334333
runOnlyForDeploymentPostprocessing = 0;
335334
shellPath = /bin/sh;
336-
shellScript = "CPV=$[ CURRENT_PROJECT_VERSION+1 ]\nsed -i '' \"s/CURRENT_PROJECT_VERSION = $CURRENT_PROJECT_VERSION/CURRENT_PROJECT_VERSION = $CPV/\" $PROJECT_NAME.xcodeproj/project.pbxproj";
335+
shellScript = "CPV=$[ CURRENT_PROJECT_VERSION+1 ]\nsed -i '' \"s/CURRENT_PROJECT_VERSION = $CURRENT_PROJECT_VERSION/CURRENT_PROJECT_VERSION = $CPV/\" $PROJECT_NAME.xcodeproj/project.pbxproj\n";
337336
showEnvVarsInLog = 0;
338337
};
339338
/* End PBXShellScriptBuildPhase section */
@@ -407,8 +406,8 @@
407406
CLANG_WARN_UNREACHABLE_CODE = YES;
408407
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
409408
COPY_PHASE_STRIP = NO;
410-
CURRENT_MARKETING_VERSION = 1.9;
411-
CURRENT_PROJECT_VERSION = 291;
409+
CURRENT_MARKETING_VERSION = 2.0;
410+
CURRENT_PROJECT_VERSION = 311;
412411
ENABLE_STRICT_OBJC_MSGSEND = YES;
413412
ENABLE_TESTABILITY = YES;
414413
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -457,8 +456,8 @@
457456
CLANG_WARN_UNREACHABLE_CODE = YES;
458457
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
459458
COPY_PHASE_STRIP = YES;
460-
CURRENT_MARKETING_VERSION = 1.9;
461-
CURRENT_PROJECT_VERSION = 291;
459+
CURRENT_MARKETING_VERSION = 2.0;
460+
CURRENT_PROJECT_VERSION = 311;
462461
DEBUG_INFORMATION_FORMAT = dwarf;
463462
DEPLOYMENT_POSTPROCESSING = YES;
464463
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -480,7 +479,6 @@
480479
isa = XCBuildConfiguration;
481480
buildSettings = {
482481
COMBINE_HIDPI_IMAGES = YES;
483-
CURRENT_MARKETING_VERSION = 1.9;
484482
GCC_PRECOMPILE_PREFIX_HEADER = YES;
485483
GCC_PREFIX_HEADER = "DPCIManager/DPCIManager-Prefix.pch";
486484
INFOPLIST_FILE = "DPCIManager/DPCIManager-Info.plist";
@@ -494,7 +492,6 @@
494492
isa = XCBuildConfiguration;
495493
buildSettings = {
496494
COMBINE_HIDPI_IMAGES = YES;
497-
CURRENT_MARKETING_VERSION = 1.9;
498495
GCC_PRECOMPILE_PREFIX_HEADER = YES;
499496
GCC_PREFIX_HEADER = "DPCIManager/DPCIManager-Prefix.pch";
500497
INFOPLIST_FILE = "DPCIManager/DPCIManager-Info.plist";
@@ -540,7 +537,6 @@
540537
buildSettings = {
541538
CLANG_CXX_LIBRARY = "libc++";
542539
CLANG_WARN_EMPTY_BODY = YES;
543-
CURRENT_MARKETING_VERSION = 1.9;
544540
GCC_PRECOMPILE_PREFIX_HEADER = YES;
545541
GCC_PREFIX_HEADER = "DPCIManager/DPCIManager-Prefix.pch";
546542
INFOPLIST_FILE = "$(SRCROOT)/DPCIManager/DPCIManager-Info.plist";
@@ -561,7 +557,6 @@
561557
buildSettings = {
562558
CLANG_CXX_LIBRARY = "libc++";
563559
CLANG_WARN_EMPTY_BODY = YES;
564-
CURRENT_MARKETING_VERSION = 1.9;
565560
GCC_PRECOMPILE_PREFIX_HEADER = YES;
566561
GCC_PREFIX_HEADER = "DPCIManager/DPCIManager-Prefix.pch";
567562
INFOPLIST_FILE = "$(SRCROOT)/DPCIManager/DPCIManager-Info.plist";

DPCIManager/AppDelegate.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ @implementation AppDelegate
3232
#pragma mark ApplicationDelegate
3333
-(void)applicationDidFinishLaunching:(NSNotification *)aNotification{
3434
// Insert code here to initialize your application
35+
NSString *pciIDsCachePath = pciIDsPath;
36+
NSString *pciIDsBundlePath = [NSBundle.mainBundle pathForResource:@"pci" ofType:@"ids"];
37+
if(![NSFileManager.defaultManager fileExistsAtPath:pciIDsCachePath]){
38+
[NSFileManager.defaultManager copyItemAtPath:pciIDsBundlePath toPath:pciIDsCachePath error:nil];
39+
[NSFileManager.defaultManager setAttributes:@{NSFileModificationDate: [[NSFileManager.defaultManager attributesOfItemAtPath:pciIDsBundlePath error:nil] fileModificationDate]} ofItemAtPath:pciIDsCachePath error:nil];
40+
}
3541
self.patch = @"0x00000000";
3642
self.bdmesg = [AppDelegate bdmesg];
3743
self.pcis = [pciDevice readIDs];
@@ -86,7 +92,7 @@ -(IBAction)copy:(id)sender{
8692
}
8793
-(IBAction)updateIDs:(id)sender{
8894
[sender setEnabled:false];
89-
if ([URLTask conditionalGet:[NSURL URLWithString:@"https://pci-ids.ucw.cz/pci.ids"] toFile:[NSBundle.mainBundle pathForResource:@"pci" ofType:@"ids"]]) {
95+
if ([URLTask conditionalGet:[NSURL URLWithString:@"https://pci-ids.ucw.cz/pci.ids"] toFile:pciIDsPath]) {
9096
[sender setLabel:@"Found"];
9197
self.pcis = [pciDevice readIDs];
9298
}

DPCIManager/DPCIManager-Prefix.pch

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#define assignWithNotice(x,y,z) [x willChangeValueForKey:@""#y];y=z;[x didChangeValueForKey:@""#y];
1212
#define muteWithNotice(x,y,z) [x willChangeValueForKey:@""#y];z;[x didChangeValueForKey:@""#y];
1313
#define strHexDec(x) strtol([x UTF8String], NULL, 16)
14+
#define pciIDsPath [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject] stringByAppendingPathComponent:@"pci.ids"]
1415
NS_INLINE NSError* ModalError(NSError *error){
1516
if (error)
1617
[[NSAlert alertWithError:error] runModal];

DPCIManager/PCI.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ -(short)bdf {
151151
return -1;
152152
}
153153
+(NSArray *)readIDs{
154-
FILE *handle = fopen([[NSBundle.mainBundle pathForResource:@"pci" ofType:@"ids"] fileSystemRepresentation], "rb");
154+
FILE *handle = fopen([pciIDsPath fileSystemRepresentation], "rb");
155155
NSMutableDictionary *classes = [NSMutableDictionary dictionary];
156156
NSMutableDictionary *vendors = [NSMutableDictionary dictionary];
157157
NSNumber *currentClass;

DPCIManager/Tables.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,17 @@
6262
#define HDA_CODEC_ALC294 HDA_CODEC_CONSTRUCT(REALTEK, 0x0294)
6363
#define HDA_CODEC_ALC295 HDA_CODEC_CONSTRUCT(REALTEK, 0x0295)
6464
#define HDA_CODEC_ALC298 HDA_CODEC_CONSTRUCT(REALTEK, 0x0298)
65+
#define HDA_CODEC_ALC299 HDA_CODEC_CONSTRUCT(REALTEK, 0x0299)
6566
#define HDA_CODEC_ALC660 HDA_CODEC_CONSTRUCT(REALTEK, 0x0660)
67+
#define HDA_CODEC_ALC861 HDA_CODEC_CONSTRUCT(REALTEK, 0x0861)
6668
#define HDA_CODEC_ALC662 HDA_CODEC_CONSTRUCT(REALTEK, 0x0662)
69+
#define HDA_CODEC_ALC861VD HDA_CODEC_CONSTRUCT(REALTEK, 0x0862)
6770
#define HDA_CODEC_ALC663 HDA_CODEC_CONSTRUCT(REALTEK, 0x0663)
6871
#define HDA_CODEC_ALC665 HDA_CODEC_CONSTRUCT(REALTEK, 0x0665)
6972
#define HDA_CODEC_ALC668 HDA_CODEC_CONSTRUCT(REALTEK, 0x0668)
7073
#define HDA_CODEC_ALC670 HDA_CODEC_CONSTRUCT(REALTEK, 0x0670)
7174
#define HDA_CODEC_ALC671 HDA_CODEC_CONSTRUCT(REALTEK, 0x0671)
7275
#define HDA_CODEC_ALC680 HDA_CODEC_CONSTRUCT(REALTEK, 0x0680)
73-
#define HDA_CODEC_ALC861 HDA_CODEC_CONSTRUCT(REALTEK, 0x0861)
74-
#define HDA_CODEC_ALC861VD HDA_CODEC_CONSTRUCT(REALTEK, 0x0862)
7576
#define HDA_CODEC_ALC880 HDA_CODEC_CONSTRUCT(REALTEK, 0x0880)
7677
#define HDA_CODEC_ALC882 HDA_CODEC_CONSTRUCT(REALTEK, 0x0882)
7778
#define HDA_CODEC_ALC883 HDA_CODEC_CONSTRUCT(REALTEK, 0x0883)
@@ -84,6 +85,7 @@
8485
#define HDA_CODEC_ALC898 HDA_CODEC_CONSTRUCT(REALTEK, 0x0898)
8586
#define HDA_CODEC_ALC899 HDA_CODEC_CONSTRUCT(REALTEK, 0x0899)
8687
#define HDA_CODEC_ALC1150 HDA_CODEC_CONSTRUCT(REALTEK, 0x0900)
88+
#define HDA_CODEC_ALCS1200A HDA_CODEC_CONSTRUCT(REALTEK, 0x0B00) // A = Asus
8789
#define HDA_CODEC_ALCS1220A HDA_CODEC_CONSTRUCT(REALTEK, 0x1168) // A = Asus
8890
#define HDA_CODEC_ALC1220 HDA_CODEC_CONSTRUCT(REALTEK, 0x1220)
8991
#define HDA_CODEC_ALCXXXX HDA_CODEC_CONSTRUCT(REALTEK, 0xffff)
@@ -250,6 +252,7 @@
250252
#define HDA_CODEC_CX8050 HDA_CODEC_CONSTRUCT(CONEXANT, 0x1f72)
251253
#define HDA_CODEC_CX8150 HDA_CODEC_CONSTRUCT(CONEXANT, 0x1fd6)
252254
#define HDA_CODEC_CX8200 HDA_CODEC_CONSTRUCT(CONEXANT, 0x2008)
255+
#define HDA_CODEC_CX8400 HDA_CODEC_CONSTRUCT(CONEXANT, 0x20d0)
253256
#define HDA_CODEC_CX20549 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5045)
254257
#define HDA_CODEC_CX20551 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5047)
255258
#define HDA_CODEC_CX20561 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5051)
@@ -435,6 +438,7 @@ static const struct {UInt32 id; UInt16 rev; char *name;} gCodecList[] = {
435438
{ HDA_CODEC_ALC294, 0x0000, "Realtek ALC294" },
436439
{ HDA_CODEC_ALC295, 0x0000, "Realtek ALC295" },
437440
{ HDA_CODEC_ALC298, 0x0000, "Realtek ALC298" }, // rev 0x100101, 0x100103
441+
{ HDA_CODEC_ALC299, 0x0000, "Realtek ALC299" }, // rev 0x100002
438442
{ HDA_CODEC_ALC660, 0x0000, "Realtek ALC660" },
439443
{ HDA_CODEC_ALC662, 0x0000, "Realtek ALC662" }, // rev 0x100101, 0x100300
440444
{ HDA_CODEC_ALC662, 0x0002, "Realtek ALC662v2" },
@@ -468,6 +472,7 @@ static const struct {UInt32 id; UInt16 rev; char *name;} gCodecList[] = {
468472
{ HDA_CODEC_ALC899, 0x0000, "Realtek ALC899" },
469473
{ HDA_CODEC_ALC1150, 0x0000, "Realtek ALC1150" }, // rev 0x100001
470474
{ HDA_CODEC_ALC1220, 0x0000, "Realtek ALC1220" }, // rev 0x100101, 0x100003
475+
{ HDA_CODEC_ALCS1200A, 0x0000, "Realtek ALCS1200A" }, // rev 0x100001
471476
{ HDA_CODEC_ALCS1220A, 0x0000, "Realtek ALCS1220A" },
472477
{ HDA_CODEC_AD1882, 0x0000, "Analog Devices AD1882" },
473478
{ HDA_CODEC_AD1882A, 0x0000, "Analog Devices AD1882A" },
@@ -592,6 +597,7 @@ static const struct {UInt32 id; UInt16 rev; char *name;} gCodecList[] = {
592597
{ HDA_CODEC_CX8050, 0x0000, "Conexant CX8050" },
593598
{ HDA_CODEC_CX8150, 0x0000, "Conexant CX8150" },
594599
{ HDA_CODEC_CX8200, 0x0000, "Conexant CX8200" },
600+
{ HDA_CODEC_CX8400, 0x0000, "Conexant CX8400" },
595601
{ HDA_CODEC_CX20549, 0x0000, "Conexant CX20549 (Venice)" },
596602
{ HDA_CODEC_CX20551, 0x0000, "Conexant CX20551 (Waikiki)" },
597603
{ HDA_CODEC_CX20561, 0x0000, "Conexant CX20561 (Hermosa)" }, // rev 0x100000

0 commit comments

Comments
 (0)