briankendall / proxy-audio-device

A virtual audio driver for macOS to sends all audio to another output
The Unlicense
514 stars 33 forks source link

self compiled version looks OK but unable to proxy device audio #20

Closed kasimok closed 1 year ago

kasimok commented 1 year ago

Hi @briankendall Nice Audio Driver. I download your release build, works like a charm. It can smoothly proxy my built-in speaker's sound.

However when I did "sign to run locally" in Xcode. The app client was able to set its proxy parameters to the driver. But the sound proxy is not working(there is no sound at all).

Screen Shot 2022-08-23 at 9 30 04 PM Screen Shot 2022-08-23 at 9 44 37 PM

Note I'm testing on an M1 MBP 2020, with SIP disabled as apple suggested when developing an Audio Server Plugin. Also, I can see the device listed in the MIDI app. So I guess it's not the signing issue.

I checked the log of my Proxy Audio Device:

1418    default 21:23:24.892941+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: ProxyAudio_Initialize
1418    default 21:23:24.893182+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: copyDeviceNameFromStorage
1418    error   21:23:24.893445+0800    com.apple.audio.Core-Audio-Driver-Service.helper    All kCFPreferencesCurrentUser domains in this process will be volatile, because homeDirPath starts with /var/empty
1418    default 21:23:24.895004+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: copyDeviceNameFromStorage finished, device name: Proxy Audio Device
1418    default 21:23:24.895140+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: copyOutputDeviceUIDFromStorage
1418    default 21:23:24.895335+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: copyOutputDeviceUIDFromStorage no output device UID in storage
1418    default 21:23:24.895371+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: retrieveOutputDeviceBufferFrameSizeFromStorage
1418    default 21:23:24.895550+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: retrieveOutputDeviceBufferFrameSizeFromStorage finished returning default buffer frame size
1418    default 21:23:24.895658+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: retrieveOutputDeviceActiveConditionFromStorage
1418    default 21:23:24.895778+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: retrieveOutputDeviceActiveConditionFromStorage finished returning default active condition
1418    default 21:23:25.140834+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: PerformDeviceConfigurationChange
1418    default 21:23:25.140933+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: Setting sample rate to: 88200
1418    default 21:23:25.140958+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: finished PerformDeviceConfigurationChange, will match sample rate
1418    default 21:23:25.140990+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: matchOutputDeviceSampleRate
1418    default 21:23:25.141047+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: matchOutputDeviceSampleRateNoLock
1418    default 21:23:25.141079+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: matchOutputDeviceSampleRateNoLock ... no valid output device
1418    default 21:23:25.506416+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: StartIO
1418    default 21:23:25.506453+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: resetInputData
1418    default 21:23:25.506516+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: StartIO finished
1418    default 21:23:25.913230+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: initializeOutputDevice running in separate thread
1418    default 21:23:25.913268+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: copyDefaultProxyOutputDeviceUID
1418    default 21:23:25.914391+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALPlugInManagement::RegisterPlugIns: skipping in-process plug-ins
1418    error   21:23:25.914408+0800    com.apple.audio.Core-Audio-Driver-Service.helper    AddInstanceForFactory: No factory registered for id <CFUUID 0x12070b5f0> F8BB1C28-BAE8-11D6-9C31-00039315CD46
1418    default 21:23:25.946978+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: copyDefaultProxyOutputDeviceUID returning first viable output device in list
1418    default 21:23:25.947015+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice
1418    default 21:23:25.947038+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: findTargetOutputAudioDevice
1418    default 21:23:25.947062+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: findTargetOutputAudioDevice target UID: BlackHole2ch_UID
1418    default 21:23:25.947083+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: findTargetOutputAudioDevice finished, found output device
1418    default 21:23:25.947256+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice newOutputDevice: 61
1418    default 21:23:25.947287+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice deinitializing old device
1418    default 21:23:25.947304+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: deinitializeOutputDeviceNoLock
1418    default 21:23:25.947323+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: deinitializeOutputDeviceNoLock output device is already invalidated
1418    default 21:23:25.947344+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice setting up new device
1418    default 21:23:25.947360+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: resetInputData
1418    default 21:23:25.947743+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice will match sample rate
1418    default 21:23:25.947766+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: matchOutputDeviceSampleRateNoLock
1418    default 21:23:25.947879+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: matchOutputDeviceSampleRateNoLock changing sample rate to match: 44100.000000
1418    default 21:23:25.947901+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: resetInputData
1418    default 21:23:25.948087+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: matchOutputDeviceSampleRateNoLock about to request device configuration change
1418    default 21:23:25.948117+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupAudioDevicesListener
1418    default 21:23:25.948141+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupAudioDevicesListener finished
1418    default 21:23:25.948453+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: StopIO
1418    default 21:23:25.948477+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: StopIO finished
1418    default 21:23:25.950263+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_IOContext_PauseIO(335)
1418    default 21:23:25.950285+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: -> 0 0 id:335 called from HALC_IOContext_PauseIO
1418    default 21:23:25.950297+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: <- 0 1 id:335
1418    default 21:23:25.952265+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: PerformDeviceConfigurationChange
1418    default 21:23:25.952343+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: Setting sample rate to: 44100
1418    default 21:23:25.952369+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: finished PerformDeviceConfigurationChange, will match sample rate
1418    default 21:23:25.952388+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: matchOutputDeviceSampleRate
1418    default 21:23:25.952406+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: matchOutputDeviceSampleRateNoLock
1418    default 21:23:25.952733+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: detected user is now active
1418    default 21:23:25.952760+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: starting outputDevice
1418    default 21:23:25.969703+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: current input sample rate: [44100.000000] already equals output device's sample rate.
1418    default 21:23:25.977905+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_IOContext_ResumeIO(335)
1418    default 21:23:25.977926+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: -> 0 1 id:335 called from HALC_IOContext_ResumeIO
1418    default 21:23:25.977952+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: <- 0 0 id:335
1418    default 21:23:25.978404+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: -> 0 0 id:335 called from HALC_ShellDevice::RebuildIOContext
1418    default 21:23:25.978415+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: <- 0 1 id:335
1418    default 21:23:25.978529+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_IOContext_PauseIO(335)
1418    default 21:23:25.978549+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: -> 0 1 id:335 called from HALC_IOContext_PauseIO
1418    default 21:23:25.978588+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: <- 0 2 id:335
1418    default 21:23:25.979244+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_IOContext_ResumeIO(335)
1418    default 21:23:25.979304+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: -> 0 2 id:335 called from HALC_ShellDevice::RebuildIOContext
1418    default 21:23:25.979752+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: <- 0 1 id:335
1418    default 21:23:25.980643+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: StartIO
1418    default 21:23:25.980860+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: resetInputData
1418    default 21:23:25.981102+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: StartIO finished
1418    default 21:23:25.983442+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: StopIO
1418    default 21:23:25.983536+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: StopIO finished
1418    default 21:23:25.979957+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: -> 0 1 id:335 called from HALC_IOContext_ResumeIO
1418    default 21:23:25.985796+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: <- 0 0 id:335
1418    default 21:23:25.987680+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: StartIO
1418    default 21:23:25.987808+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: resetInputData
1418    default 21:23:25.987847+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: StartIO finished
1418    default 21:23:26.004590+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: outputDeviceIOProc recalculating inputOutputSampleDelta
1418    default 21:23:38.080193+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: StopIO
1418    default 21:23:38.080349+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: StopIO finished
1418    default 21:23:40.152194+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::IOWorkLoop: skipping cycle due to overload
1418    default 21:23:45.334280+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::IOWorkLoop: skipping cycle due to overload
1418    default 21:24:32.902388+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: detected user is now idle
1418    default 21:24:32.902625+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: stopping outputDevice
1418    default 21:24:32.918596+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: resetInputData
1418    default 21:24:53.444716+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: detected user is now active
1418    default 21:24:53.444901+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: starting outputDevice
1418    error   21:24:53.445055+0800    com.apple.audio.Core-Audio-Driver-Service.helper     11523          HALC_ProxyIOContext.cpp:796   HALC_ProxyIOContext::StartIO: Client running as an adaptive unboosted daemon
1418    error   21:24:53.445173+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALPlugIn::StartIOProc: got an error from the plug-in routine, Error: 1852797029 (nope)
1418    default 21:24:53.445337+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: error: failed to start device 61
1418    default 21:24:53.946805+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: starting outputDevice
1418    default 21:24:57.468656+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: received signal, configurator pid is: 1434
1418    default 21:24:57.469263+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: received signal, will return data on next call to box name: 3
1418    default 21:24:57.469475+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: returning config data type 3 instead of box name
1418    default 21:24:57.473546+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: received signal, will return data on next call to box name: 1
1418    default 21:24:57.473732+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: returning config data type 1 instead of box name
1418    default 21:24:57.481031+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: received signal, will return data on next call to box name: 2
1418    default 21:24:57.481237+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: returning config data type 2 instead of box name
1418    default 21:24:57.481969+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: received signal, will return data on next call to box name: 4
1418    default 21:24:57.482157+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: returning config data type 4 instead of box name
1418    default 21:25:00.756886+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setting box name from configurator process, performing configuration action instead!
1418    default 21:25:03.998663+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setting box name from configurator process, performing configuration action instead!
1418    default 21:25:04.999995+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice
1418    default 21:25:04.000066+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: findTargetOutputAudioDevice
1418    default 21:25:04.000132+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: findTargetOutputAudioDevice target UID: BuiltInSpeakerDevice
1418    default 21:25:04.000195+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: findTargetOutputAudioDevice finished, found output device
1418    default 21:25:04.000643+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice newOutputDevice: 111
1418    default 21:25:04.000710+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice deinitializing old device
1418    default 21:25:04.000758+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: deinitializeOutputDeviceNoLock
1418    default 21:25:04.000802+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: deinitializeOutputDeviceNoLock stopping device
1418    default 21:25:04.000844+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: deinitializeOutputDeviceNoLock removing IO proc
1418    default 21:25:04.001029+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: deinitializeOutputDeviceNoLock invalidating
1418    default 21:25:04.001074+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice setting up new device
1418    default 21:25:04.001115+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: resetInputData
1418    default 21:25:04.001626+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice will match sample rate
1418    default 21:25:04.001681+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: matchOutputDeviceSampleRateNoLock
1418    default 21:25:04.001831+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: matchOutputDeviceSampleRateNoLock changing sample rate to match: 88200.000000
1418    default 21:25:04.001876+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: resetInputData
1418    default 21:25:04.002185+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: matchOutputDeviceSampleRateNoLock about to request device configuration change
1418    default 21:25:04.003161+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_IOContext_PauseIO(335)
1418    default 21:25:04.003213+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: -> 0 0 id:335 called from HALC_IOContext_PauseIO
1418    default 21:25:04.003268+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: <- 0 1 id:335
1418    default 21:25:04.005124+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: PerformDeviceConfigurationChange
1418    default 21:25:04.005183+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: Setting sample rate to: 88200
1418    default 21:25:04.005223+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: finished PerformDeviceConfigurationChange, will match sample rate
1418    default 21:25:04.005326+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: matchOutputDeviceSampleRate
1418    default 21:25:04.005368+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: matchOutputDeviceSampleRateNoLock
1418    default 21:25:04.005860+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: starting outputDevice
1418    default 21:25:04.008860+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: current input sample rate: [88200.000000] already equals output device's sample rate.
1418    default 21:25:04.019409+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_IOContext_ResumeIO(335)
1418    default 21:25:04.019437+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: -> 0 1 id:335 called from HALC_IOContext_ResumeIO
1418    default 21:25:04.019485+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: <- 0 0 id:335
1418    default 21:25:04.021439+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: -> 0 0 id:335 called from HALC_ShellDevice::RebuildIOContext
1418    default 21:25:04.021456+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: <- 0 1 id:335
1418    default 21:25:04.021615+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_IOContext_PauseIO(335)
1418    default 21:25:04.021641+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: -> 0 1 id:335 called from HALC_IOContext_PauseIO
1418    default 21:25:04.021753+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: <- 0 2 id:335
1418    default 21:25:04.022320+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_IOContext_ResumeIO(335)
1418    default 21:25:04.022475+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: -> 0 2 id:335 called from HALC_ShellDevice::RebuildIOContext
1418    default 21:25:04.022931+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: <- 0 1 id:335
1418    default 21:25:04.023147+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: -> 0 1 id:335 called from HALC_IOContext_ResumeIO
1418    default 21:25:04.023329+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: <- 0 0 id:335
1418    default 21:25:05.944973+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setting box name from configurator process, performing configuration action instead!
1418    default 21:25:07.351157+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::IOWorkLoop: skipping cycle due to overload
1418    default 21:25:07.372230+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::IOWorkLoop: skipping cycle due to overload
1418    default 21:25:08.116537+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::IOWorkLoop: skipping cycle due to overload
1418    default 21:25:08.300554+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::IOWorkLoop: skipping cycle due to overload
1418    default 21:25:10.900701+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: StartIO
1418    default 21:25:10.900748+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: resetInputData
1418    default 21:25:10.900795+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: StartIO finished
1418    default 21:25:10.913305+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: outputDeviceIOProc recalculating inputOutputSampleDelta
1418    default 21:28:23.814924+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALB_MachPort::SendMessage: mach_msg() returned error 0x10000003: '(ipc/send) invalid destination port'
1418    error   21:28:23.814959+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::IOWorkLoop: failed to send the final message to the server, Error: 0x10000003
1418    default 21:28:23.817116+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: outputDeviceAliveListener
1418    default 21:28:23.817248+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: outputDeviceAliveListener
1418    default 21:28:23.817293+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: outputDeviceAliveListener output device no longer alive
1418    default 21:28:23.817336+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: deinitializeOutputDevice
1418    default 21:28:23.817380+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: deinitializeOutputDeviceNoLock
1418    default 21:28:23.817843+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: deinitializeOutputDeviceNoLock stopping device
1418    error   21:28:23.817893+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HAL_HardwarePlugIn_DeviceStart: no device
1418    error   21:28:23.817919+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALPlugIn::StopIOProc: got an error from the plug-in routine, Error: 560947818 (!obj)
1418    default 21:28:23.817980+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: error: failed to stop device 111
1418    default 21:28:23.818022+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: deinitializeOutputDeviceNoLock removing IO proc
1418    error   21:28:23.821000+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HAL_HardwarePlugIn_DeviceDestroyIOProcID: no device
1418    error   21:28:23.821046+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALPlugIn::DeviceCreateIOProcID: got an error from the plug-in routine, Error: 560947818 (!obj)
1418    default 21:28:23.821125+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: deinitializeOutputDeviceNoLock invalidating
1418    default 21:28:23.821496+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: devicesListenerProc current devices changed
1418    default 21:28:23.821624+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice
1418    default 21:28:23.821748+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: findTargetOutputAudioDevice
1418    default 21:28:23.821835+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: findTargetOutputAudioDevice target UID: BuiltInSpeakerDevice
1418    default 21:28:23.821939+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: findTargetOutputAudioDevice finished, not not find output device
1418    default 21:28:23.821986+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice newOutputDevice: 0
1418    default 21:28:23.822027+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice deinitializing old device
1418    default 21:28:23.822069+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: deinitializeOutputDeviceNoLock
1418    default 21:28:23.822108+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: deinitializeOutputDeviceNoLock output device is already invalidated
1418    default 21:28:23.822148+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice could not find output device
1418    error   21:28:24.207065+0800    com.apple.audio.Core-Audio-Driver-Service.helper     AudioObjectGetPropertyData: no object with given ID 93
1418    error   21:28:24.207091+0800    com.apple.audio.Core-Audio-Driver-Service.helper     AudioObjectRemovePropertyListener: no object with given ID 93
1418    default 21:28:24.360069+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: devicesListenerProc current devices changed
1418    default 21:28:24.360105+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice
1418    default 21:28:24.360124+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: findTargetOutputAudioDevice
1418    default 21:28:24.360146+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: findTargetOutputAudioDevice target UID: BuiltInSpeakerDevice
1418    default 21:28:24.360167+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: findTargetOutputAudioDevice finished, found output device
1418    default 21:28:24.360310+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice newOutputDevice: 202
1418    default 21:28:24.360335+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice deinitializing old device
1418    default 21:28:24.360352+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: deinitializeOutputDeviceNoLock
1418    default 21:28:24.374959+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_IOContext_PauseIO(247)
1418    default 21:28:24.374994+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: -> 0 0 id:247 called from HALC_IOContext_PauseIO
1418    default 21:28:24.375006+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: <- 0 1 id:247
1418    default 21:28:24.377463+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_IOContext_PauseIO(234)
1418    default 21:28:24.377480+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: -> 0 0 id:234 called from HALC_IOContext_PauseIO
1418    default 21:28:24.377490+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: <- 0 1 id:234
1418    default 21:28:24.379734+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: deinitializeOutputDeviceNoLock output device is already invalidated
1418    default 21:28:24.382051+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_IOContext_ResumeIO(247)
1418    default 21:28:24.382270+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: -> 0 1 id:247 called from HALC_IOContext_ResumeIO
1418    default 21:28:24.382344+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: <- 0 0 id:247
1418    default 21:28:24.383076+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: -> 0 0 id:247 called from HALC_ShellDevice::RebuildIOContext
1418    default 21:28:24.383153+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: <- 0 1 id:247
1418    default 21:28:24.383409+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_IOContext_PauseIO(247)
1418    default 21:28:24.383533+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: -> 0 1 id:247 called from HALC_ShellDevice::RebuildIOContext
1418    default 21:28:24.383543+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_IOContext_ResumeIO(247)
1418    default 21:28:24.383790+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: <- 0 0 id:247
1418    default 21:28:24.384022+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: -> 0 0 id:247 called from HALC_IOContext_PauseIO
1418    default 21:28:24.384130+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: <- 0 1 id:247
1418    default 21:28:24.384360+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: -> 0 1 id:247 called from HALC_IOContext_ResumeIO
1418    default 21:28:24.384624+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: <- 0 0 id:247
1418    default 21:28:24.385879+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice setting up new device
1418    default 21:28:24.386059+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: resetInputData
1418    default 21:28:24.386511+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: setupTargetOutputDevice will match sample rate
1418    default 21:28:24.386593+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: matchOutputDeviceSampleRateNoLock
1418    default 21:28:24.386780+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: starting outputDevice
1418    error   21:28:24.386847+0800    com.apple.audio.Core-Audio-Driver-Service.helper     88583          HALC_ProxyIOContext.cpp:796   HALC_ProxyIOContext::StartIO: Client running as an adaptive unboosted daemon
1418    error   21:28:24.386940+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALPlugIn::StartIOProc: got an error from the plug-in routine, Error: 1852797029 (nope)
1418    default 21:28:24.387001+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: error: failed to start device 202
1418    default 21:28:24.387065+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: current input sample rate: [88200.000000] already equals output device's sample rate.
1418    default 21:28:24.393738+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: -> 0 1 id:234 called from HALC_ShellDevice::RebuildIOContext
1418    default 21:28:24.393757+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: <- 0 2 id:234
1418    default 21:28:24.393831+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_IOContext_PauseIO(234)
1418    default 21:28:24.393848+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: -> 0 2 id:234 called from HALC_IOContext_PauseIO
1418    default 21:28:24.393857+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::PauseIO: <- 0 3 id:234
1418    default 21:28:24.394444+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_IOContext_ResumeIO(234)
1418    default 21:28:24.394469+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: -> 0 3 id:234 called from HALC_IOContext_ResumeIO
1418    default 21:28:24.394483+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: <- 0 2 id:234
1418    default 21:28:24.394603+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_IOContext_ResumeIO(234)
1418    default 21:28:24.394620+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: -> 0 2 id:234 called from HALC_IOContext_ResumeIO
1418    default 21:28:24.394638+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: <- 0 1 id:234
1418    default 21:28:24.394681+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: -> 0 1 id:234 called from HALC_ShellDevice::RebuildIOContext
1418    default 21:28:24.394762+0800    com.apple.audio.Core-Audio-Driver-Service.helper     HALC_ProxyIOContext::ResumeIO: <- 0 0 id:234
1418    error   21:28:24.400958+0800    com.apple.audio.Core-Audio-Driver-Service.helper     AudioObjectGetPropertyData: no object with given ID 0
1418    default 21:28:24.402124+0800    com.apple.audio.Core-Audio-Driver-Service.helper    ProxyAudio: starting outputDevice

One more strange thing I witnessed is that when I switched back to the normal built-in speaker the sound became abnormal, it had small chokes.

Do you have any suggestions?

briankendall commented 1 year ago

Looks like the problem is with lines like this: ProxyAudio: error: failed to start device 202

The proxy device actually does something fairly naughty which is to open a connection to an output device. Core Audio plugins aren't supposed to actually use the CoreAudio API. Normally this would create a deadlock, but the proxy device does it from a separate thread, which seems to work in practice.

However, on line 210 of AudioDevice.cpp, the call to AudioDeviceStart is failing. My debug logging is apparently not very good because I didn't bother to actually have it print the status code being returned from this function. I recommend changing line 213 to:

syslog(LOG_WARNING, "ProxyAudio: error: failed to start device %u with error %d", id, err);

so that it prints the error code, and seeing what kind of failure you're getting. At this point I can't say why this line is working in a release build of the proxy device and not for you, but hopefully that'll give you a clue.

kasimok commented 1 year ago

@briankendall Sure, thanks I'll try it later on. Another interesting thing is that the same self-compiled version runs OK on another mac, which is x86_64 arch. So at first, I thought it may have something to do with different architecture.