<!--
{
  "availability" : [
    "DriverKit: 21.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioDriverKit",
  "identifier" : "/documentation/AudioDriverKit/IOUserAudioClockDevice",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AudioDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOUserAudioClockDevice"
  },
  "title" : "IOUserAudioClockDevice"
}
-->

# IOUserAudioClockDevice

An audio clock device object, used to synchronize and perform I/O.

```
class IOUserAudioClockDevice;
```

## Topics

### Creating a Clock Device

[`static OSSharedPtr<IOUserAudioClockDevice> Create(IOUserAudioDriver *in_driver, bool in_supports_prewarming, OSString *in_device_uid, OSString *in_model_uid, OSString *in_manufacturer_uid, uint32_t in_zero_timestamp_period);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/Create)

Allocates and initializes an instance of the audio clock device class.

[`virtual bool init(IOUserAudioDriver *in_driver, bool in_supports_prewarming, OSString *in_device_uid, OSString *in_model_uid, OSString *in_manufacturer_uid, uint32_t in_zero_timestamp_period);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/init)

Initializes an instance of the audio clock device class.

[`class IOUserAudioDriver;`](/documentation/AudioDriverKit/IOUserAudioDriver)

A DriverKit provider object that manages communications with an audio device.

### Freeing a Clock Device

[`virtual void free();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/free)

Frees the clock device.

### Getting Information About the Class

[`virtual IOUserAudioClassID GetClassID();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetClassID)

Gets the audio class identifier of the object.

[`virtual IOUserAudioClassID GetBaseClassID();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetBaseClassID)

Gets the audio class identifier of the base class object.

[`enum IOUserAudioClassID : uint32_t;`](/documentation/AudioDriverKit/AudioDriverKit/IOUserAudioClassID)

An identifier for the type of audio object.

### Performing I/O

[`virtual kern_return_t StartIO(IOUserAudioStartStopFlags in_flags);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/StartIO)

Tells the clock device to start I/O.

[`virtual kern_return_t StopIO(IOUserAudioStartStopFlags in_flags);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/StopIO)

Tells the clock device to stop I/O.

[`enum IOUserAudioStartStopFlags : uint64_t;`](/documentation/AudioDriverKit/AudioDriverKit/IOUserAudioStartStopFlags)

Values that indicate I/O starts or stops.

### Supporting Device Configuration Changes

[`virtual kern_return_t PerformDeviceConfigurationChange(uint64_t change_action, OSObject *in_change_info);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/PerformDeviceConfigurationChange)

Tells the clock device to handle a configuration change.

[`virtual kern_return_t AbortDeviceConfigurationChange(uint64_t change_action, OSObject *in_change_info);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/AbortDeviceConfigurationChange)

Tells the clock device to stop handling a configuration change.

### Supporting Sample Rate Changes

[`virtual kern_return_t HandleChangeSampleRate(double in_sample_rate);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/HandleChangeSampleRate)

Tells the clock device the sample rate is changing.

### Identifying the Clock Device

[`OSSharedPtr<OSString> GetUID();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetUID)

Gets the unique identifier of the clock device.

### Working with Clock Domain

[`kern_return_t SetClockDomain(uint32_t in_clock_domain);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/SetClockDomain)

Sets the clock domain value of the clock device.

[`uint32_t GetClockDomain();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetClockDomain)

Gets the clock domain value of the clock device.

### Working with Sample Rates

[`kern_return_t SetSampleRate(double in_sample_rate);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/SetSampleRate)

Sets the sample rate for the clock device.

[`double GetSampleRate();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetSampleRate)

Gets the sample rate of the clock device.

[`kern_return_t SetAvailableSampleRates(const double *in_sample_rates, size_t in_num_rates);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/SetAvailableSampleRates)

Sets the available sample rates for the clock device.

[`size_t GetAvailableSampleRates(double *out_sample_rates, size_t in_num_rates);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetAvailableSampleRates)

Gets the available sample rates of the clock device.

[`size_t GetNumberAvailableSampleRates();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetNumberAvailableSampleRates)

Gets the number of available sample rates of the clock device.

### Working with Timing and Latency

[`bool GetSupportsPrewarming();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetSupportsPrewarming)

Returns a Boolean value that indicates clock device’s support for prewarming.

[`kern_return_t SetZeroTimeStampPeriod(uint32_t in_zts_period);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/SetZeroTimeStampPeriod)

Sets the zero time stamp of the clock device.

[`uint32_t GetZeroTimestampPeriod();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetZeroTimestampPeriod)

Gets the zero time stamp of the clock device.

[`kern_return_t SetOutputLatency(uint32_t in_latency);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/SetOutputLatency)

Sets the output latency of the clock device.

[`uint32_t GetOutputLatency();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetOutputLatency)

Gets the output latency of the clock device.

[`kern_return_t SetInputLatency(uint32_t in_latency);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/SetInputLatency)

Sets the input latency of the clock device.

[`uint32_t GetInputLatency();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetInputLatency)

Get the input latency of the clock device.

### Working with Clock Device State

[`bool GetDeviceIsRunning();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetDeviceIsRunning)

Gets a Boolean value that indicates whether the device is running.

[`kern_return_t SetDeviceIsAlive(bool in_is_alive);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/SetDeviceIsAlive)

Sets a Boolean value to represent whether the device is alive.

[`bool GetDeviceIsAlive();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetDeviceIsAlive)

Gets a Boolean value that represents whether the device is alive.

[`kern_return_t SetIsHidden(bool in_is_hidden);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/SetIsHidden)

Sets a Boolean value to indicate whether the device is hidden.

[`bool GetIsHidden();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetIsHidden)

Gets a Boolean value that indicates whether the device is hidden.

### Working with Clock Device Behavior

[`kern_return_t SetClockAlgorithm(IOUserAudioClockAlgorithm in_clock_algorithm);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/SetClockAlgorithm)

Sets the clock algorithm of the clock device.

[`IOUserAudioClockAlgorithm GetClockAlgorithm();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetClockAlgorithm)

Gets the clock algorithm of the clock device.

[`enum IOUserAudioClockAlgorithm : uint32_t;`](/documentation/AudioDriverKit/AudioDriverKit/IOUserAudioClockAlgorithm)

Values that describe clock-smoothing algorithms.

[`kern_return_t SetClockIsStable(bool in_clock_is_stable);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/SetClockIsStable)

Sets a Boolean value to represent the clock’s stability.

[`bool GetClockIsStable();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetClockIsStable)

Gets a Boolean value that represents the clock’s stability.

### Working with Transport Type

[`kern_return_t SetTransportType(IOUserAudioTransportType in_transport_type);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/SetTransportType)

Sets the transport type of the clock device.

[`IOUserAudioTransportType GetTransportType();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetTransportType)

Gets the transport type of the clock device.

[`enum IOUserAudioTransportType : uint32_t;`](/documentation/AudioDriverKit/AudioDriverKit/IOUserAudioTransportType)

The type of transport to deliver audio.

### Communicating with the Host

[`kern_return_t RequestDeviceConfigurationChange(uint64_t in_change_action, OSObject *in_change_info);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/RequestDeviceConfigurationChange)

Instructs the host to initiate a configuration change operation.

### Managing Audio Controls

[`kern_return_t AddControl(IOUserAudioControl *in_control);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/AddControl)

Adds a control to the clock device.

[`kern_return_t RemoveControl(IOUserAudioControl *in_control);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/RemoveControl)

Removes a control from the clock device.

[`class IOUserAudioControl;`](/documentation/AudioDriverKit/IOUserAudioControl)

The base class for audio control objects.

### Accessing Timestamps

[`void UpdateCurrentZeroTimestamp(uint64_t in_sample_time, uint64_t in_host_time);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/UpdateCurrentZeroTimestamp)

Updates the current timestamp value.

[`void GetCurrentZeroTimestamp(uint64_t *out_sample_time, uint64_t *out_host_time);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetCurrentZeroTimestamp)

Gets the current zero timestamp value.

### Accessing Client Status Information

[`void GetCurrentClientSampleTime(uint64_t *out_input_sample_time, uint64_t *out_output_sample_time);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetCurrentClientSampleTime)

Gets the current sample time in the ring buffer that the client has written to or read from.

### Instance Methods

[`IOUserAudioDeviceTransportState GetDeviceTransportState();`](/documentation/AudioDriverKit/IOUserAudioClockDevice/GetDeviceTransportState)

[`void SetWantsControlsRestored(bool in_wants_controls_restored);`](/documentation/AudioDriverKit/IOUserAudioClockDevice/SetWantsControlsRestored)

## Relationships

### Inherited By

[`IOUserAudioDevice`](/documentation/AudioDriverKit/IOUserAudioDevice)

### Inherits From

[`IOUserAudioObject`](/documentation/AudioDriverKit/IOUserAudioObject)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)