iOS 0.2.1: don't touch the engine's input node (microphone privacy crash); log benchmark
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
7f231c8f79
commit
47588990ce
@@ -3,6 +3,13 @@
|
|||||||
Sizzle for iOS/iPadOS (`cc.tiredsysadmin.ios.sizzle`). One entry per version in
|
Sizzle for iOS/iPadOS (`cc.tiredsysadmin.ios.sizzle`). One entry per version in
|
||||||
`../versions.properties` (`ios.versionName` / `ios.versionCode`).
|
`../versions.properties` (`ios.versionName` / `ios.versionCode`).
|
||||||
|
|
||||||
|
## 0.2.1 (build 5)
|
||||||
|
|
||||||
|
- Fix: switching instruments (e.g. to the Wavetable) killed the app. Rewiring the
|
||||||
|
audio graph read the engine's microphone input, which iOS treats as a privacy
|
||||||
|
access the app hadn't declared. The app no longer touches the input.
|
||||||
|
- Benchmark results also go to the system log ("SizzleBench"), readable over USB.
|
||||||
|
|
||||||
## 0.2.0 (build 4)
|
## 0.2.0 (build 4)
|
||||||
|
|
||||||
- All six instruments, now in C++ and matching the Android app sample for sample:
|
- All six instruments, now in C++ and matching the Android app sample for sample:
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ static NSError *hostError(NSString *msg) {
|
|||||||
AVAudioEngine *_engine;
|
AVAudioEngine *_engine;
|
||||||
AVAudioUnit *_instNode;
|
AVAudioUnit *_instNode;
|
||||||
AVAudioUnit *_fxNode;
|
AVAudioUnit *_fxNode;
|
||||||
|
NSMutableArray<AVAudioNode *> *_attached; // what rebuild attached, to detach next time
|
||||||
MIDIClientRef _midiClient;
|
MIDIClientRef _midiClient;
|
||||||
MIDIPortRef _midiPort;
|
MIDIPortRef _midiPort;
|
||||||
NSArray<NSString *> *_midiSources;
|
NSArray<NSString *> *_midiSources;
|
||||||
@@ -87,6 +88,7 @@ static NSError *hostError(NSString *msg) {
|
|||||||
if (!self) return nil;
|
if (!self) return nil;
|
||||||
registerDevices();
|
registerDevices();
|
||||||
_engine = [AVAudioEngine new];
|
_engine = [AVAudioEngine new];
|
||||||
|
_attached = [NSMutableArray array];
|
||||||
_midiSources = @[];
|
_midiSources = @[];
|
||||||
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
|
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
|
||||||
[[AVAudioSession sharedInstance] setActive:YES error:nil];
|
[[AVAudioSession sharedInstance] setActive:YES error:nil];
|
||||||
@@ -109,15 +111,20 @@ static NSError *hostError(NSString *msg) {
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Detach what the last rebuild attached, then wire instrument → effect → mixer.
|
||||||
|
/// Never touch the engine's inputNode: merely reading it opens the microphone,
|
||||||
|
/// which iOS treats as a privacy access (0.2.0 was killed for exactly that).
|
||||||
- (void)rebuild {
|
- (void)rebuild {
|
||||||
[_engine stop];
|
[_engine stop];
|
||||||
for (AVAudioNode *n in [_engine.attachedNodes copy])
|
for (AVAudioNode *n in _attached) [_engine detachNode:n];
|
||||||
if (n != _engine.mainMixerNode && n != _engine.outputNode && n != _engine.inputNode) [_engine detachNode:n];
|
[_attached removeAllObjects];
|
||||||
if (!_instNode) return;
|
if (!_instNode) return;
|
||||||
[_engine attachNode:_instNode];
|
[_engine attachNode:_instNode];
|
||||||
|
[_attached addObject:_instNode];
|
||||||
AVAudioNode *last = _instNode;
|
AVAudioNode *last = _instNode;
|
||||||
if (_fxNode) {
|
if (_fxNode) {
|
||||||
[_engine attachNode:_fxNode];
|
[_engine attachNode:_fxNode];
|
||||||
|
[_attached addObject:_fxNode];
|
||||||
[_engine connect:_instNode to:_fxNode format:nil];
|
[_engine connect:_instNode to:_fxNode format:nil];
|
||||||
last = _fxNode;
|
last = _fxNode;
|
||||||
}
|
}
|
||||||
@@ -295,7 +302,11 @@ static double timeRender(SizzleDeviceAU *au, BOOL instrument, double seconds) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)benchmark:(void (^)(NSString *))line done:(void (^)(void))done {
|
- (void)benchmark:(void (^)(NSString *))line done:(void (^)(void))done {
|
||||||
void (^say)(NSString *) = ^(NSString *s) { dispatch_async(dispatch_get_main_queue(), ^{ line(s); }); };
|
// Also to the system log ("SizzleBench …"), so results can be read over USB.
|
||||||
|
void (^say)(NSString *) = ^(NSString *s) {
|
||||||
|
NSLog(@"SizzleBench %@", s);
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{ line(s); });
|
||||||
|
};
|
||||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
|
||||||
say([NSString stringWithFormat:@"%@ · %lu cores · 10 s of 44.1 kHz audio per device",
|
say([NSString stringWithFormat:@"%@ · %lu cores · 10 s of 44.1 kHz audio per device",
|
||||||
machine(), (unsigned long)NSProcessInfo.processInfo.activeProcessorCount]);
|
machine(), (unsigned long)NSProcessInfo.processInfo.activeProcessorCount]);
|
||||||
|
|||||||
+2
-2
@@ -17,8 +17,8 @@ android.versionCode = 70
|
|||||||
# iOS/iPadOS (cc.tiredsysadmin.ios.sizzle): the AUv3 plugin app in ios/app; the
|
# iOS/iPadOS (cc.tiredsysadmin.ios.sizzle): the AUv3 plugin app in ios/app; the
|
||||||
# Makefile there passes these to Xcode and names the .ipa by versionCode. (The
|
# Makefile there passes these to Xcode and names the .ipa by versionCode. (The
|
||||||
# TrollStore spike in ios/spike keeps its own version in its project.yml.)
|
# TrollStore spike in ios/spike keeps its own version in its project.yml.)
|
||||||
ios.versionName = 0.2.0
|
ios.versionName = 0.2.1
|
||||||
ios.versionCode = 4
|
ios.versionCode = 5
|
||||||
macos.versionName = -
|
macos.versionName = -
|
||||||
linux.versionName = -
|
linux.versionName = -
|
||||||
bsd.versionName = -
|
bsd.versionName = -
|
||||||
|
|||||||
Reference in New Issue
Block a user