This library contains protocols used by the ffx audio
tool only.
PROTOCOLS
DeviceControl
Defined in fuchsia.audio.controller/audio_proxy.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
|
GetDeviceInfo
Returns details about a specific audio device.
Request
Name | Type |
---|---|
payload |
DeviceControlGetDeviceInfoRequest
|
Response
Name | Type |
---|---|
payload |
DeviceControl_GetDeviceInfo_Result
|
ListDevices
Lists all available audio devices on target.
Request
<EMPTY>
Response
Name | Type |
---|---|
payload |
DeviceControl_ListDevices_Result
|
Player
Defined in fuchsia.audio.controller/play.fidl
Play
Plays audio data from socket on either an AudioRenderer
or on device ring buffer.
Return 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 an RecordRequest.
Cancel
Finish sending audio data back to the client.
Request
<EMPTY>
Response
Name | Type |
---|---|
payload |
RecordCanceler_Cancel_Result
|
Recorder
Defined in fuchsia.audio.controller/record.fidl
Record
Records audio data from either an AudioCapturer
or device ring buffer.
Returns sockets containing audio data and errors back to host.
Request
Name | Type |
---|---|
payload |
RecorderRecordRequest
|
Response
Name | Type |
---|---|
payload |
Recorder_Record_Result
|
STRUCTS
DeviceControl_DeviceSetGainState_Response
Defined in fuchsia.audio.controller/audio_proxy.fidl
<EMPTY>
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. |
TABLES
CustomClockConfig
Defined in fuchsia.audio.controller/settings.fidl
Configuration for the custom reference clock passed to an AudioRenderer
or AudioCapturer
.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
rate_adjust |
int32
|
Frequency rate adjustment to a clone of the system monotonic clock.
Given 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. |
2 |
offset |
int32
|
Starting delta between the reference clock passed to AudioRenderer or Capturer and the system monotonic clock. If not specified, do not adjust reference clock offset. Optional. |
DeviceControlDeviceSetGainStateRequest resource
Defined in fuchsia.audio.controller/audio_proxy.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. |
DeviceControlGetDeviceInfoRequest resource
Defined in fuchsia.audio.controller/audio_proxy.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
device |
DeviceSelector
|
Id of device to retrieve information about, and whether it is an input or output device. Required. |
DeviceControl_GetDeviceInfo_Response resource
Defined in fuchsia.audio.controller/audio_proxy.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
device_info |
DeviceInfo
|
Information about the device. Required. |
DeviceControl_ListDevices_Response resource
Defined in fuchsia.audio.controller/audio_proxy.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
devices |
vector<DeviceSelector>[256]
|
List of available devices, sorted by name. Required. |
DeviceSelector
Defined in fuchsia.audio.controller/audio_proxy.fidl
Identifies which device to retrieve information about.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
is_input |
bool
|
Whether device is input or output. Required. Future device types may not require this field. |
2 |
id |
fuchsia.io/Path
|
ID of device. Required. |
3 |
device_type |
fuchsia.hardware.audio/DeviceType
|
Device type. If not specified, defaults to StreamConfig. |
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. Should transmit entire file in WAV format. Required. |
2 |
destination |
PlayDestination
|
Play on device ring buffer or AudioRenderer. Required. |
3 |
gain_settings |
GainSettings
|
Play settings. Optional. If not specified, use unity gain unmuted, and no other gain processing enabled. |
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
|
Record from Required. |
2 |
stream_type |
fuchsia.media/AudioStreamType
|
Streamtype. Required. |
3 |
duration |
zx/Duration
|
Duration in nanoseconds to record audio data. If not specified, daemon will send data back to ffx client until it receives a stop signal following a keypress. If present, the record request is still cancelable via handle below. Optional. |
4 |
canceler |
server_end<RecordCanceler>
|
Handle to signal when to stop sending data back to ffx client. Required. |
5 |
gain_settings |
GainSettings
|
Record gain settings. If not specified, AudioCapturer's defaults will apply. Optional. |
6 |
buffer_size |
uint64
|
Buffer size. If not specified, allocate enough to hold one second of audio data. Optional. |
Recorder_Record_Response resource
Defined in fuchsia.audio.controller/record.fidl
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
wav_data |
handle<socket>
|
Contains audio data in the form of a complete WAV file. Required. |
2 |
stderr |
handle<socket>
|
Errors from daemon component for ffx plugin to display. Required. |
StandardCapturerConfig
Defined in fuchsia.audio.controller/record.fidl
Configuration parameters for creating an AudioCapturer
for the standard frequency range.
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. If unspecified, use the default reference clock provided by the capturer. Optional. |
StandardRendererConfig
Defined in fuchsia.audio.controller/play.fidl
Configuration parameters for creating an AudioRenderer
for the standard frequency range.
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. If unspecified, use the default reference clock provided by the renderer. Optional. |
3 |
packet_count |
uint32
|
How many packets to use when sending data to an |
StreamConfigDeviceInfo
Defined in fuchsia.audio.controller/audio_proxy.fidl
Information about a device that supports the fuchsia.hardware.audio/StreamConfig protocol.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
stream_properties |
fuchsia.hardware.audio/StreamProperties
|
Top level static properties of the stream. Required. |
2 |
supported_formats |
vector<fuchsia.hardware.audio/SupportedFormats>[64]
|
Supported formats. Required. |
3 |
gain_state |
fuchsia.hardware.audio/GainState
|
Gain state. Required. |
4 |
plug_state |
fuchsia.hardware.audio/PlugState
|
Plug state. Required. |
UltrasoundRendererConfig
Defined in fuchsia.audio.controller/play.fidl
Configuration parameters for creating an AudioRenderer
for the standard frequency range.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
packet_count |
uint32
|
How many packets to use when sending data to an |
UNIONS
CapturerConfig flexible
Defined in fuchsia.audio.controller/record.fidl
Selection of the frequency range than an AudioCapturer
can read.
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
standard_capturer |
StandardCapturerConfig
|
AudioCapturer for standard frequencies. |
2 |
ultrasound_capturer |
UltrasoundCapturer
|
AudioCapturer for ultrasonic frequencies. |
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/audio_proxy.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
DeviceControl_DeviceSetGainState_Response
|
|
2 |
err |
zx/Status
|
|
3 |
transport_err |
internal
|
DeviceControl_GetDeviceInfo_Result strict resource
Defined in fuchsia.audio.controller/audio_proxy.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
DeviceControl_GetDeviceInfo_Response
|
|
2 |
err |
zx/Status
|
|
3 |
transport_err |
internal
|
DeviceControl_ListDevices_Result strict resource
Defined in fuchsia.audio.controller/audio_proxy.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
DeviceControl_ListDevices_Response
|
|
2 |
err |
zx/Status
|
|
3 |
transport_err |
internal
|
DeviceInfo flexible
Defined in fuchsia.audio.controller/audio_proxy.fidl
Information about a device.
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
stream_config |
StreamConfigDeviceInfo
|
Device supports the fuchsia.hardware.audio/StreamConfig protocol. |
PlayDestination flexible
Defined in fuchsia.audio.controller/play.fidl
Where to output audio data supplied by an ffx client.
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
renderer |
RendererConfig
|
Create an |
2 |
device_ring_buffer |
DeviceSelector
|
Write audio data directly to 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 |
transport_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
Where to read audio data from to send back to an ffx client.
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
capturer |
CapturerConfig
|
Create an audio_core |
2 |
loopback |
Loopback
|
Create an audio_core |
3 |
device_ring_buffer |
DeviceSelector
|
Raad audio data directly from 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 |
zx/Status
|
|
3 |
transport_err |
internal
|
RendererConfig flexible
Defined in fuchsia.audio.controller/play.fidl
Selection of the frequency range than an AudioRenderer
can write.
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
standard_renderer |
StandardRendererConfig
|
Renderer for standard frequencies. |
2 |
ultrasound_renderer |
UltrasoundRendererConfig
|
Renderer for ultrasonic frequencies. |
CONSTANTS
Name | Value | Type | Description |
---|---|---|---|
MAX_COUNT_DEVICES |
256
|
uint32 |
Maximum number of audio devices in the system at any time. |