diff --git a/Audio/Chain/DSPNode.h b/Audio/Chain/DSPNode.h index 50ac1475f..29c37db85 100644 --- a/Audio/Chain/DSPNode.h +++ b/Audio/Chain/DSPNode.h @@ -15,6 +15,8 @@ - (id _Nullable)initWithController:(id _Nonnull)c previous:(id _Nullable)p latency:(double)latency; +- (void)threadEntry:(id _Nullable)arg; + @end #endif /* DSPNode_h */ diff --git a/Audio/Chain/DSPNode.m b/Audio/Chain/DSPNode.m index 59d78313c..4eb8b239d 100644 --- a/Audio/Chain/DSPNode.m +++ b/Audio/Chain/DSPNode.m @@ -37,4 +37,14 @@ return self; } +// DSP threads buffer for low latency, and therefore should have high priority +- (void)threadEntry:(id _Nullable)arg { + @autoreleasepool { + NSThread *currentThread = [NSThread currentThread]; + [currentThread setThreadPriority:0.75]; + [currentThread setQualityOfService:NSQualityOfServiceUserInitiated]; + [self process]; + } +} + @end