Revert "Add patch to fix initial AU sample rate mismatch"

This reverts commit f76d931127.
This commit is contained in:
falkTX 2022-09-19 00:47:15 +01:00
parent f76d931127
commit 5f918cf0b1
2 changed files with 0 additions and 53 deletions

View file

@ -532,7 +532,6 @@ jobs:
if [ "${{ env.WITH_LTO }}" != "true" ]; then export PAWPAW_SKIP_LTO=1; fi
pushd deps/PawPaw; source local.env macos; popd
git clone --depth=1 -b 6.1.6 https://github.com/juce-framework/JUCE.git jucewrapper/JUCE
patch -d jucewrapper/JUCE -p1 -i ../bf85b6dcc7d17d35ed31dc9761a46eb510a668ac.patch
sed -i -e 's/kAudioUnitProperty_SupportsMPE/kAudioUnitProperty_ignore_SupportsMPE/' jucewrapper/JUCE/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h
mkdir -p jucewrapper/build
pushd jucewrapper/build; cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.8 -DCMAKE_OSX_SYSROOT="macosx" -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 -j $(sysctl -n hw.logicalcpu); popd
@ -622,7 +621,6 @@ jobs:
if [ "${{ env.WITH_LTO }}" != "true" ]; then export PAWPAW_SKIP_LTO=1; fi
pushd deps/PawPaw; source local.env macos-universal; popd
git clone --depth=1 -b 6.1.6 https://github.com/juce-framework/JUCE.git jucewrapper/JUCE
patch -d jucewrapper/JUCE -p1 -i ../bf85b6dcc7d17d35ed31dc9761a46eb510a668ac.patch
mkdir -p jucewrapper/build
pushd jucewrapper/build; cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 -DCMAKE_OSX_SYSROOT="macosx" -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 -j $(sysctl -n hw.logicalcpu); popd
mv jucewrapper/build/*_artefacts/Release/AU/*.component bin/

View file

@ -1,51 +0,0 @@
From bf85b6dcc7d17d35ed31dc9761a46eb510a668ac Mon Sep 17 00:00:00 2001
From: Sebastian Kraft <sebastian.kraft@nektartech.com>
Date: Fri, 6 May 2022 09:09:34 +0200
Subject: [PATCH] Always set sample rate of hosted AU plugins, fixes a bug with
plugins reporting incorrect sample rates
---
.../juce_AudioUnitPluginFormat.mm | 25 ++++++++-----------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
index 59c0e06d368..8ee8f9a465c 100644
--- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
+++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
@@ -1057,25 +1057,22 @@ void prepareToPlay (double newSampleRate, int estimatedSamplesPerBlock) override
AudioUnitGetProperty (audioUnit, kAudioUnitProperty_SampleRate, scope, static_cast<UInt32> (i), &sampleRate, &sampleRateSize);
- if (sampleRate != sr)
+ if (isAUv3) // setting kAudioUnitProperty_SampleRate fails on AUv3s
{
- if (isAUv3) // setting kAudioUnitProperty_SampleRate fails on AUv3s
- {
- AudioStreamBasicDescription stream;
- UInt32 dataSize = sizeof (stream);
- auto err = AudioUnitGetProperty (audioUnit, kAudioUnitProperty_StreamFormat, scope, static_cast<UInt32> (i), &stream, &dataSize);
+ AudioStreamBasicDescription stream;
+ UInt32 dataSize = sizeof (stream);
+ auto err = AudioUnitGetProperty (audioUnit, kAudioUnitProperty_StreamFormat, scope, static_cast<UInt32> (i), &stream, &dataSize);
- if (err == noErr && dataSize == sizeof (stream))
- {
- stream.mSampleRate = sr;
- AudioUnitSetProperty (audioUnit, kAudioUnitProperty_StreamFormat, scope, static_cast<UInt32> (i), &stream, sizeof (stream));
- }
- }
- else
+ if (err == noErr && dataSize == sizeof (stream))
{
- AudioUnitSetProperty (audioUnit, kAudioUnitProperty_SampleRate, scope, static_cast<UInt32> (i), &sr, sizeof (sr));
+ stream.mSampleRate = sr;
+ AudioUnitSetProperty (audioUnit, kAudioUnitProperty_StreamFormat, scope, static_cast<UInt32> (i), &stream, sizeof (stream));
}
}
+ else
+ {
+ AudioUnitSetProperty (audioUnit, kAudioUnitProperty_SampleRate, scope, static_cast<UInt32> (i), &sr, sizeof (sr));
+ }
if (isInput)
{