Skip to content

Liquid Glass and Apple Music touches for the Spotify iOS app. A GPL-3.0 fork of spoti.pw 0.21.1.

C

feat: Karaoke's status says if it runs on the Neural Engine or the CPU

My-Name-Is-Jeffc265e82d25e8
diff --git a/tweak/Sources/Shared/Sing/SGSingCard.m b/tweak/Sources/Shared/Sing/SGSingCard.m
index 5d375f19..2a6c17ed 100644
--- a/tweak/Sources/Shared/Sing/SGSingCard.m
+++ b/tweak/Sources/Shared/Sing/SGSingCard.m
@@ -300,8 +300,8 @@ static CGFloat height(float rms) {
NSString *words = SGSingStatusText();
float stored = SGSingLevel();
if (state == SGSingStateSinging) {
- words = stored > 0.001 && stored < 0.999 ? [NSString stringWithFormat:@"On · vocals at %@", SGSingLevelText(stored)]
- : [NSString stringWithFormat:@"On · %@", SGSingLevelText(stored)];
+ words = stored > 0.001 && stored < 0.999 ? [NSString stringWithFormat:@"%@ · vocals at %@", words, SGSingLevelText(stored)]
+ : [NSString stringWithFormat:@"%@ · %@", words, SGSingLevelText(stored)];
}
if (SGSingStatusDetail()) words = [words stringByAppendingString:@" ⓘ"];
if (![_state.text isEqualToString:words]) _state.text = words;
diff --git a/tweak/Sources/Shared/Sing/Sing.x b/tweak/Sources/Shared/Sing/Sing.x
index 60c9ad91..74ee4025 100644
--- a/tweak/Sources/Shared/Sing/Sing.x
+++ b/tweak/Sources/Shared/Sing/Sing.x
@@ -529,7 +529,10 @@ NSString *SGSingStatusText(void) {
}
case SGSingStateWaiting: return sg_resting ? @"As sung" : @"Ready";
case SGSingStateBuffering: return @"Listening ahead";
- case SGSingStateSinging: return @"On";
+ case SGSingStateSinging: {
+ SGSingSeparator *separator = SGSingLoaderSeparator();
+ return separator && [separator stats].fast ? @"On, Neural Engine" : @"On, CPU";
+ }
// The Neural Engine copy on its way: the budget is held (holdBudget), so this is not yet Too slow.
case SGSingStateBehind:
return SGSingLoaderFastState() == SGSingFastLoading ? @"Preparing for the Neural Engine" : @"Too slow";
@@ -961,11 +964,12 @@ static void tick(void) {
NSString *fastPart = !neuralWanted() && SGSingLoaderFastState() == SGSingFastNone ? @"no Neural Engine copy"
: [NSString stringWithFormat:@"Neural Engine copy %@, %llu at %.0f ms",
@[@"not started", @"loading", @"ready", @"skipped", @"failed", @"timed out"][(NSUInteger)SGSingLoaderFastState()], copies.windows[1], copies.averageMS[1]];
- SGLog(@"sing: %@, %llu windows at %.0f ms each (1500 ms keeps up; CPU copy %llu at %.0f ms, %@, %llu redone on the CPU, the last on the %@), "
+ NSString *last = copies.windows[0] + copies.windows[1] == 0 ? @"none run yet" : copies.fast ? @"the last on the Neural Engine" : @"the last on the CPU";
+ SGLog(@"sing: %@, %llu windows at %.0f ms each (1500 ms keeps up; CPU copy %llu at %.0f ms, %@, %llu redone on the CPU, %@), "
@"lead %.2f s of %.2f s (the clock's %.2f s), %.2f s separated ahead, %llu frames dry, %.1f s dropped, %.1f s of 8 s short%@, %llu failures, Spotify %@, "
@"thermal state %s, %@, Runs on %@%@",
SGSingStatusText(), stats.windows, stats.averageMS, copies.windows[0], copies.averageMS[0], fastPart,
- copies.fallbacks, copies.fast ? @"Neural Engine" : @"CPU", stats.lead, stats.targetLead, player ? SGSingLeadOf(player) : 0, stats.ready,
+ copies.fallbacks, last, stats.lead, stats.targetLead, player ? SGSingLeadOf(player) : 0, stats.ready,
stats.dryFrames, stats.dropped, stats.budgetSpent, stats.budgetHeld ? @" (held while the Neural Engine copy loads)" : @"", stats.failures, sg_active ? @"active" : @"not active", SGSingThermalName(),
SGSingMemoryText(), runsOnName(),
sg_spatialListening ? [NSString stringWithFormat:@", the voice %.0f degrees right", stats.voiceAngle * 180 / M_PI] : @"");