This library contains protocols used by the ffx audio
tool.
PROTOCOLS
DeviceControl
Defined in fuchsia.audio.controller/device.fidl
Enumerate, query, and control audio devices from clients.
DeviceSetGainState
Sets the gain of the stream in decibels.
Request
Name | Type |
---|---|
payload |
DeviceControlDeviceSetGainStateRequest
|
Response
Name | Type |
---|---|
payload |
DeviceControl_DeviceSetGainState_Result
|
Player
Defined in fuchsia.audio.controller/play.fidl
Play
Read audio data from a socket in WAV format and play it to a destination.
Returns when all bytes have been read from the socket.
Request
Name | Type |
---|---|
payload |
PlayerPlayRequest
|
Response
Name | Type |
---|---|
payload |
Player_Play_Result
|
RecordCanceler
Defined in fuchsia.audio.controller/record.fidl
Cancels a Recorder.Record
request.
Cancel
Stop recording and writing data on the output socket.
Request
<EMPTY>
Response
Name | Type |
---|---|
payload |
RecordCanceler_Cancel_Result
|
Recorder
Defined in fuchsia.audio.controller/record.fidl
Record
Record audio data and write it to a socket in WAV format.
Request
Name | Type |
---|---|
payload |
RecorderRecordRequest
|
Response
Name | Type |
---|---|
payload |
Recorder_Record_Result
|
STRUCTS
Devfs
Defined in fuchsia.audio.controller/device.fidl
Field | Type | Description | Default |
---|---|---|---|
name |
fuchsia.io/Name
|
Name of this device's devfs node, e.g. |
No default |
device_type |
fuchsia.audio.device/DeviceType
|
Device type. |
No default |
DeviceControl_DeviceSetGainState_Response
Defined in fuchsia.audio.controller/device.fidl
<EMPTY>
DeviceRingBuffer
Defined in fuchsia.audio.controller/device.fidl
Identifies a device ring buffer for playing/recording.
Field | Type | Description | Default |
---|---|---|---|
selector |
DeviceSelector
|
The device that has a ring buffer. |
No default |
ring_buffer_element_id |
fuchsia.hardware.audio.signalprocessing/ElementId
|
The ID of an ENDPOINT (with type RING_BUFFER) signal processing element of the desired ring buffer. For Dai and StreamConfig devices, this should be
|
No default |
Flexible
Defined in fuchsia.audio.controller/settings.fidl
<EMPTY>
Loopback
Defined in fuchsia.audio.controller/record.fidl
<EMPTY>
RecordCanceler_Cancel_Response
Defined in fuchsia.audio.controller/record.fidl
<EMPTY>
SystemMonotonic
Defined in fuchsia.audio.controller/settings.fidl
<EMPTY>
UltrasoundCapturer
Defined in fuchsia.audio.controller/record.fidl
<EMPTY>
ENUMS
Error flexible
Type: uint32
Defined in fuchsia.audio.controller/types.fidl
Error Codes for fuchsia.audio.controller methods.
Name | Value | Description |
---|---|---|
NOT_SUPPORTED |
1 |
The operation is not implemented, supported, or enabled. |
UNKNOWN_FATAL |
2 |
Some other problem occurred that cannot be classified using one of the more specific statuses. Future requests to this method will also fail. |
UNKNOWN_CAN_RETRY |
3 |
Some other problem occurred, but there is reason to believe this operation may succeed in the future. Client can retry this request. |
ARGUMENTS_MISSING |
4 |
Necessary arguments missing on request. |
INVALID_ARGUMENTS |
5 |
Unsupported arguments on request. |
DEVICE_NOT_FOUND |
6 |
Could not find a device matching client request parameters. |
DEVICE_NOT_REACHABLE |
7 |
Could not connect to device at specified location. |
TABLES
CustomClockConfig
Defined in fuchsia.audio.controller/settings.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
rate_adjust |
int32
|
Frequency rate adjustment to a clone of the system monotonic clock, in parts per million relative to the system monotonic rate. Must fall within [ZX_CLOCK_UPDATE_MIN_RATE_ADJUST, ZX_CLOCK_UPDATE_MAX_RATE_ADJUST].
For more info, see Optional. If not specified, the reference clock's default rate is used. |
2 |
offset |
int32
|
Starting delta between the reference clock passed to AudioRenderer or Capturer and the system monotonic clock. Optional. If not specified, the reference clock offset is unchanged. |
DeviceControlDeviceSetGainStateRequest resource
Defined in fuchsia.audio.controller/device.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
device |
DeviceSelector
|
Id of the device to set the gain state. Required. |
2 |
gain_state |
fuchsia.hardware.audio/GainState
|
Desired gain state. Required. |
GainSettings
Defined in fuchsia.audio.controller/settings.fidl
Gain settings.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
mute |
bool
|
Whether to mute the audio stream. If unspecified, do not adjust the existing mute value. Optional. |
2 |
gain |
float32
|
Gain level in dB. If unspecified, do not adjust stream or device gain. Optional. |
PlayerPlayRequest resource
Defined in fuchsia.audio.controller/play.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
wav_source |
handle<socket>
|
Socket for the client to send audio data in WAV format. The client should transmit an entire file, then close the socket. Required. |
2 |
destination |
PlayDestination
|
The destination to which to play the audio. Required. |
3 |
gain_settings |
GainSettings
|
Play settings. Optional. If not specified, use unity gain unmuted, and no other gain processing enabled. |
4 |
active_channels_bitmask |
uint64
|
Channels to enable during playback. Optional. If not specified, the active-channels configuration is not changed. |
Player_Play_Response resource
Defined in fuchsia.audio.controller/play.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
bytes_processed |
uint64
|
Total number of bytes sent to destination. |
RecorderRecordRequest resource
Defined in fuchsia.audio.controller/record.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
source |
RecordSource
|
The source from which to record the audio. Required. |
2 |
stream_type |
fuchsia.media/AudioStreamType
|
The stream format in which to record the audio. Required. |
3 |
duration |
zx/Duration
|
Duration in nanoseconds to record audio data. If not specified, If present, the record request is still cancelable via Optional. |
4 |
canceler |
server_end:RecordCanceler
|
Handle to signal when to stop sending data back to the client. Required. |
5 |
gain_settings |
GainSettings
|
Record gain settings. Only used for the Optional. |
6 |
buffer_size |
uint64
|
Buffer size. Optional. If not specified, defaults to a size that is enough to hold one second of audio data. |
7 |
wav_data |
handle<socket>
|
Sink for audio data. The captured data here will be written here as a complete WAV file. Required. |
Recorder_Record_Response resource
Defined in fuchsia.audio.controller/record.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
bytes_processed |
uint64
|
Total number of bytes read from the source. |
2 |
packets_processed |
uint64
|
If applicable, number of packets read from an |
3 |
late_wakeups |
uint64
|
If applicable, number of times the capturer woke up too late to read valid data from the device. If this is non-zero, some data was lost and replaced with silence. |
StandardCapturerConfig
Defined in fuchsia.audio.controller/record.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
usage |
fuchsia.media/AudioCaptureUsage
|
The usage of the audio stream. Required. |
2 |
clock |
ClockType
|
The reference clock type used by the stream. Optional. If not specified, the default reference clock provided by the capturer is used. |
StandardRendererConfig
Defined in fuchsia.audio.controller/play.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
usage |
fuchsia.media/AudioRenderUsage
|
The usage of the audio stream. Required. |
2 |
clock |
ClockType
|
The reference clock type used by the stream. Optional. If not specified, the default reference clock provided by the renderer is used. |
3 |
packet_count |
uint32
|
How many packets to use when sending data to the Optional. If not specified, defaults to four packets. |
UltrasoundRendererConfig
Defined in fuchsia.audio.controller/play.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
packet_count |
uint32
|
How many packets to use when sending data to the Optional. If not specified, defaults to four packets. |
UNIONS
CapturerConfig flexible
Defined in fuchsia.audio.controller/record.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
standard_capturer |
StandardCapturerConfig
|
|
2 |
ultrasound_capturer |
UltrasoundCapturer
|
|
ClockType flexible
Defined in fuchsia.audio.controller/settings.fidl
Reference clock options for an AudioRenderer
or AudioCapturer
.
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
flexible |
Flexible
|
Use a flexible clock. |
2 |
system_monotonic |
SystemMonotonic
|
Use the system monotonic clock. |
3 |
custom |
CustomClockConfig
|
Use a monotonic clock with possible rate adjustment and offset relative to the system monotonic clock. |
DeviceControl_DeviceSetGainState_Result strict
Defined in fuchsia.audio.controller/device.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
DeviceControl_DeviceSetGainState_Response
|
|
2 |
err |
zx/Status
|
|
3 |
framework_err |
internal
|
DeviceSelector flexible
Defined in fuchsia.audio.controller/device.fidl
Identifies an audio device.
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
devfs |
Devfs
|
Driver node in devfs, e.g. |
2 |
registry |
fuchsia.audio.device/TokenId
|
A device available through the |
PlayDestination flexible
Defined in fuchsia.audio.controller/play.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
renderer |
RendererConfig
|
Create an |
2 |
device_ring_buffer |
DeviceRingBuffer
|
A device ring buffer. |
Player_Play_Result strict resource
Defined in fuchsia.audio.controller/play.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Player_Play_Response
|
|
2 |
err |
Error
|
|
3 |
framework_err |
internal
|
RecordCanceler_Cancel_Result strict
Defined in fuchsia.audio.controller/record.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
RecordCanceler_Cancel_Response
|
|
2 |
err |
zx/Status
|
RecordSource flexible
Defined in fuchsia.audio.controller/record.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
capturer |
CapturerConfig
|
An audio_core |
2 |
loopback |
Loopback
|
An audio_core |
3 |
device_ring_buffer |
DeviceRingBuffer
|
A device ring buffer. |
Recorder_Record_Result strict resource
Defined in fuchsia.audio.controller/record.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Recorder_Record_Response
|
|
2 |
err |
Error
|
|
3 |
framework_err |
internal
|
RendererConfig flexible
Defined in fuchsia.audio.controller/play.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
standard_renderer |
StandardRendererConfig
|
Renderer for standard frequencies. |
2 |
ultrasound_renderer |
UltrasoundRendererConfig
|
Renderer for ultrasonic frequencies. |