iOS AVAudioUnitSampler only outputs to receiver not speaker

I've tried all the category/option combinations I could find, but nothing I do will send audio from AVAudioUnitSampler to the built-in speaker. The audio does play, but only from the reciever. This is from the init in my controller/manager class.


        sqSampler = AVAudioUnitSampler()
        let bundlePath = Bundle.main.bundlePath
        let soundPath = ("\(bundlePath)/Sounds/sawPad1")
        var exsPath: URL = URL(fileURLWithPath: soundPath)
        if soundPath.hasPrefix("/") && FileManager.default.fileExists(atPath: soundPath + "." + "exs") {
            exsPath = URL(fileURLWithPath: soundPath + "." + "exs")
        } else if let url = Bundle.main.url(forResource: soundPath, withExtension: "exs") {
            exsPath = url
        }
        engine.attach(sqSampler)
        engine.connect(sqSampler, to: engine.outputNode)
        do { _ = try sqSampler.loadInstrument(at: exsPath) } catch { print("Error loading exs") }
        do { _ = try session.setCategory(AVAudioSessionCategoryMultiRoute) }
        catch { print("Error setting category and options.") }
        let cat = session.category
       let output = session.currentRoute
        print("Running category = \(cat), output = \(output)")
        engine.prepare()
        do { _ = try engine.start() } catch { print("Error starting engine!") }


"MutliRoute" is just my latest attempt; I've tried the default (SoloAmbient?), Playback, PlayAndRecord with defaultToSpeaker, etc. I was originally using AudioKit when I hit this problem, and at that time I was able to play a simple oscillator to the speaker without issue. So it's seems to be specific to the sampler. I pulled out the AudioKit code to try to isolate the problem, leaving me with only the AVFoundation stuff above.


I should note that our interface does have an SCNView running, and I was a bit curious whether this was perhaps overriding an audio mode, or changing settings somehow? There are no audio environment calls, or anything audio-related in that code. Also note that the "Running category" is reported correctly, and the "output" indicates that is should be playing to the speaker, i.e. (from my log):


Running category = AVAudioSessionCategoryMultiRoute, output = <AVAudioSessionRouteDescription: 0x1d40079a0,
inputs = (
    "<AVAudioSessionPortDescription: 0x1d40079d0, type = MicrophoneBuiltIn; name = iPhone Microphone; UID = Built-In Microphone; selectedDataSource = Bottom>"
);
outputs = (
    "<AVAudioSessionPortDescription: 0x1d4007a80, type = Speaker; name = Speaker; UID = Speaker; selectedDataSource = (null)>"
)>


I can't seem to get to the bottom of this, so any thoughts will be greatly appreciated.