Skip to content

Adjust Virtual Clock

Devin Roth edited this page Feb 6, 2023 · 1 revision

BlackHole allows its sample rate, or pitch, to be adjusted. This is useful for matching the rates of BlackHole and another device. The pitch can be adjusted by ±1%. By continuously adjusting the pitch, it's possible to lock the rate of BlackHole to another device without the need for aggregate devices and drift compensation (which performs asynchronous resampling).

Use case

An example use case is when using BlackHole to provide some audio processing for audio from some player app in a chain such as this:

Player app -> BlackHole -> DSP app -> Audio out device

For this chain to work reliably, BlackHole and the audio out device must run at the same speed. If BlackHole runs slower than the audio output device, the DSP app will eventually drain it's buffers and will have to termporarily stop playback until more audio data is available. The result tends to be periodic dropouts. If BlackHole instead runs faster, this instead overfills the buffers and will make the app periodically drop some audio. This is less audible but no less desirable.

By monitoring the difference in rates of BlackHole and the output device, the BlackHole pitch can be fine-tuned to keep the two in sync.

Instructions

1. Open Audio Midi Setup

Use Spotlight command+space and type Audio Midi Setup. Click on the Audio Midi Setup app to open.

Spotlight Search for Audio Midi Setup

2. Open Audio Devices Window

If the Audio Devices window does not immediately appear when opening Audio MIDI Setup select Audio Devices from the Windows drop down menu in Audio MIDI Setup.

Audio MIDI Setup Windows Menu

Select the BlackHole device in the list. Audio Device Window

Enable pitch adjust

Click the Clock Source dropdown. This will show the two options Internal Fixed and Internal Adjustable.

  • Internal Fixed is the default setting, where the pitch is fixed at 100%.
  • Internal Adjustable enables the pitch adjust. Selecting this makes a new slider appear under Output, called Balance. This is the control used to select the pitch. Leaving the slider in the middle, at 0.5, means the pitch is 100%. Dragging it all the way to the left (to 0.0) slows the pitch to 99%, while dragging to the right (to 1.0) brings it to 101%.

Troubleshooting

Changing the pitch gives perdiodic audio dropouts

This means that BlachHole is now running too slow or too fast compared to some other device. Make smaller adjustments and fine-tune the pitch until no dropouts occur.

How large pitch changes are normal?

The allowed range of ±1% is considerably larger than needed to match rates in nearly all cases. It's rare to require more than ±0.1%, and often the range ±0.01% is sufficent. For a 48 kHz clock this means that the actual rate tends to be no more than a few Hz off.