AVAudioEngine no sound from Mac mini built-in audio devices

Hi,


I've tried to get some audio things going on a new Mac mini 8,1 macOS 10.14.2 (18C54), and ran into an issue where there is no output from the built-in audio devices when using AVAudioEngine.


Xcode prints this while setting up the AVAudioEngine:

[AudioHAL_Client] HALC_ShellDriverPlugIn.cpp:104:Open:  HALC_ShellDriverPlugIn::Open: opening the plug-in failed, Error: 2003329396 (what)


If the built-in speaker or the headphone jack is selected as sound output device, no sound comes out from my AVAudioEngine app.


If I select output via DisplayPort or AirPlay, sound is working, even though above error is also being printed.


Here's repo with an example project: https://github.com/nsdvr/avaudioengine_basic_output

It just plays a .wav file when you press the button. My own project uses a custom AudioUnit generator, and its internalRenderBlock is getting called, so the engine seems to be running fine, there's just silence at the physical outputs.


Relevant setup code:


- (void) setup {
    self.engine = [AVAudioEngine new];
    self.playerNode = [AVAudioPlayerNode new];
    [self.engine attachNode:self.playerNode];
    [self.engine connect:self.playerNode to:self.engine.mainMixerNode format:nil];
    [self.engine prepare];
    NSError *err;
    [self.engine startAndReturnError:&err];
    if(err) {
        NSLog(@"AVAudioEngine start error: %@", err.localizedDescription);
    }
    
    NSError *fileErr;
    NSURL *fileURL = [[NSBundle mainBundle] URLForResource:@"HUUH" withExtension:@"wav"];
    self.audioFile = [[AVAudioFile alloc] initForReading:fileURL error:&fileErr];
    if(fileErr) {
        NSLog(@"error reading audio file");
        return;
    }
    
    [[NSNotificationCenter defaultCenter] addObserver: self
                                             selector: @selector(handleInterruption:)
                                                 name: AVAudioEngineConfigurationChangeNotification
                                               object: self.engine];
}

- (void) play {
    if(!self.audioFile) {
        NSLog(@"Can't play without audio file");
        return;
    }
    
    [self.playerNode scheduleFile:self.audioFile atTime:nil completionHandler:nil];
    [self.playerNode play];
}



Submitted a bug report (46728117)

I'd like to verify if this issue happens on other machines. I don't have this problem on my old Macbook Air.

Accepted Reply

It's fixed in macOS 10.14.4 🙂

Replies

anyone? At this point I’m not sure if this is an issue with my Mac mini.

I have the exact same error: Mac Mini 2018, i5, macOS 10.14.2. The problem doesn't happen on a MacBook Pro 15" 2013 (same version of macOS). My monitor doesn't have speakers, but I don't get any sound from AVAudioEngine - external headphones, Mac Mini speakers, or external DAC connected via USB.


Has Apple responded to your bug report?

It may be useful to print "[self.engine description]" (or use the command "po self.engine" in the debugger) — at line 09, say. IIRC the description includes a list of all nodes in the node graph and their connections. It would be worth checking that the mixer node is in fact connected to the output node.

thank you - Apple have asked whether I get sound from regular apps such as iTunes etc. (I do, and I replied), and then they went silent. The radar is still open.


@QuinceyMorris

the graph looks fine to me, augn/sspl looks like the file player, aumx/mcmx the mixer, and auou/ahal the output...

here's what engine.description prints out:


2019-01-26 16:47:10.479285+0100 AVAudioEngine mac mini no output[1386:101539] audio engine description: 
________ GraphDescription ________
AVAudioEngineGraph 0x100512eb0: initialized = 1, running = 1, number of nodes = 3

  ******** output chain ********

  node 0x600002c05700 {'auou' 'ahal' 'appl'}, 'I'
  inputs = 1
  (bus0, en1) <- (bus0) 0x600002c14d80, {'aumx' 'mcmx' 'appl'}, [ 2 ch,  44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]

  node 0x600002c14d80 {'aumx' 'mcmx' 'appl'}, 'I'
  inputs = 1
  (bus0, en1) <- (bus0) 0x600003e02f00, {'augn' 'sspl' 'appl'}, [ 2 ch,  44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
  outputs = 1
  (bus0, en1) -> (bus0) 0x600002c05700, {'auou' 'ahal' 'appl'}, [ 2 ch,  44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]

  node 0x600003e02f00 {'augn' 'sspl' 'appl'}, 'I'
  outputs = 1
  (bus0, en1) -> (bus0) 0x600002c14d80, {'aumx' 'mcmx' 'appl'}, [ 2 ch,  44100 Hz, 'lpcm' (0x00000029) 32-bit littlendian float, deinterleaved]
______________________________________

the issue is still present in macOS 10.14.3

It's fixed in macOS 10.14.4 🙂

true, nice 🙂

Still it is with Mac OS Mojave 10.14.6. Any leads ?