| <link rel="stylesheet" href="../style.css" /> |
| |
| [TOC] |
| # fuchsia.hardware.audio |
| |
| <div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 7</span></div> |
| |
| ## **PROTOCOLS** |
| |
| ## Codec {#Codec} |
| *Defined in [fuchsia.hardware.audio/codec.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/codec.fidl;l=80)* |
| <p>For an overview see |
| <a href="https://fuchsia.dev/fuchsia-src/concepts/drivers/driver_architectures/audio_drivers/audio_codec">[Audio Codec Interface]</a>.</p> |
| |
| ### GetDaiFormats {#Codec.GetDaiFormats} |
| |
| <p>Retrieves the DAI formats supported by the codec, if not available at the time the codec |
| may reply with an error status and the controller may retry at a later time. |
| Retrieving multiple DaiSupportedFormats allows for cases where exclusive |
| combinations of the parameters in DaiSupportedFormats may be supported.</p> |
| |
| #### Request {#Codec.GetDaiFormats_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Codec.GetDaiFormats_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>result</code></td> |
| <td> |
| <code><a class='link' href='#Codec_GetDaiFormats_Result'>Codec_GetDaiFormats_Result</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### GetGainFormat {#Codec.GetGainFormat} |
| |
| <p>Retrieves gain format.</p> |
| |
| #### Request {#Codec.GetGainFormat_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Codec.GetGainFormat_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>gain_format</code></td> |
| <td> |
| <code><a class='link' href='#GainFormat'>GainFormat</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### GetHealthState {#Codec.GetHealthState} |
| |
| <p>Retrieves top level health state. |
| A driver not responding promptly can be used as an indication of an unhealthy driver.</p> |
| |
| #### Request {#Codec.GetHealthState_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Codec.GetHealthState_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>state</code></td> |
| <td> |
| <code><a class='link' href='#HealthState'>HealthState</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### GetInfo {#Codec.GetInfo} |
| |
| <p>Retrieves textual information about the codec.</p> |
| |
| #### Request {#Codec.GetInfo_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Codec.GetInfo_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>info</code></td> |
| <td> |
| <code><a class='link' href='#CodecInfo'>CodecInfo</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### GetPlugDetectCapabilities {#Codec.GetPlugDetectCapabilities} |
| |
| <p>Retrieves Plug Detect Capabilities.</p> |
| |
| #### Request {#Codec.GetPlugDetectCapabilities_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Codec.GetPlugDetectCapabilities_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>plug_detect_capabilities</code></td> |
| <td> |
| <code><a class='link' href='#PlugDetectCapabilities'>PlugDetectCapabilities</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### IsBridgeable {#Codec.IsBridgeable} |
| |
| <p>Retrieves bridgeable mode from a codec.</p> |
| |
| #### Request {#Codec.IsBridgeable_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Codec.IsBridgeable_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>supports_bridged_mode</code></td> |
| <td> |
| <code>bool</code> |
| </td> |
| </tr> |
| </table> |
| |
| ### Reset {#Codec.Reset} |
| |
| <p>Resets the codec. |
| <code>Reset</code> returns when the reset is completed. If the driver can't successfully reset the |
| codec it will close the codec protocol channel, in this case the client may obtain a new |
| codec protocol channel and retry.</p> |
| |
| #### Request {#Codec.Reset_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Codec.Reset_Response} |
| |
| <EMPTY> |
| |
| ### SetBridgedMode {#Codec.SetBridgedMode} |
| |
| <p>Sets a codec's bridged mode. Only required if the codec supports bridged mode as specified |
| by IsBridgeable's reply.</p> |
| |
| #### Request {#Codec.SetBridgedMode_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>enable_bridged_mode</code></td> |
| <td> |
| <code>bool</code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### SetDaiFormat {#Codec.SetDaiFormat} |
| |
| <p>Sets the DAI format to be used in the interface between the controller and codec, if |
| the codec is not able to support the DAI format anymore, e.g. for a removable component |
| then the function may return an error status.</p> |
| |
| #### Request {#Codec.SetDaiFormat_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>format</code></td> |
| <td> |
| <code><a class='link' href='#DaiFormat'>DaiFormat</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| #### Response {#Codec.SetDaiFormat_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>result</code></td> |
| <td> |
| <code><a class='link' href='#Codec_SetDaiFormat_Result'>Codec_SetDaiFormat_Result</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### SetGainState {#Codec.SetGainState} |
| |
| <p>Client update of the gain state.</p> |
| |
| #### Request {#Codec.SetGainState_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>target_state</code></td> |
| <td> |
| <code><a class='link' href='#GainState'>GainState</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### SignalProcessingConnect {#Codec.SignalProcessingConnect} |
| |
| <p>Connect to a <code>SignalProcessing</code> protocol. |
| Multiple connections may be supported, if a new connection request is not supported, i.e. |
| the maximum number of connections have already been created, for instance one, then the |
| channel will be closed with an ZX_ERR_ALREADY_BOUND epitaph. |
| If signal processing is not supported at all, then the channel will be closed with a |
| ZX_ERR_NOT_SUPPORTED epitaph. |
| This method is named <code>SignalProcessingConnect</code> instead of <code>Connect</code> because this protocol |
| is intended to be composed, and hence the more verbose name allows differentiation and |
| improved clarity.</p> |
| |
| #### Request {#Codec.SignalProcessingConnect_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>protocol</code></td> |
| <td> |
| <code>request<<a class='link' href='../fuchsia.hardware.audio.signalprocessing/'>fuchsia.hardware.audio.signalprocessing</a>/<a class='link' href='../fuchsia.hardware.audio.signalprocessing/#SignalProcessing'>SignalProcessing</a>></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### Start {#Codec.Start} |
| |
| <p>Start/Re-start the codec operation. |
| <code>Start</code> returns when configuring the codec to start is completed but it does not wait for |
| the hardware to actually start playback/capture, i.e. <code>turn_on_delay</code> impact is not |
| taken into account to return from <code>Start</code>. |
| The <code>start_time</code> value (in the CLOCK_MONOTONIC timeline) indicates when when configuring |
| the codec to start is completed. |
| If the driver can't successfully start the codec it will close the codec protocol channel, |
| in this case the client may obtain a new codec protocol channel and retry.</p> |
| |
| #### Request {#Codec.Start_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Codec.Start_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>start_time</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#time'>time</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### Stop {#Codec.Stop} |
| |
| <p>Stops the codec operation. |
| <code>Stop</code> returns when configuring the codec to stop is completed but it does not wait for |
| the hardware to actually stop playback/capture, i.e. <code>turn_off_delay</code> impact is not |
| taken into account to return from <code>Stop</code>. |
| The <code>stop_time</code> value (in the CLOCK_MONOTONIC timeline) indicates when when configuring |
| the codec to stop is completed. |
| If the driver can't successfully configure the codec to stop it will close the codec |
| protocol channel, in this case the client may obtain a new codec protocol channel and retry.</p> |
| |
| #### Request {#Codec.Stop_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Codec.Stop_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>start_time</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#time'>time</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### WatchGainState {#Codec.WatchGainState} |
| |
| <p>Get the gain state via a hanging get. The driver will reply to the first <code>WatchGainState</code> |
| sent by the client and this reply must include a <code>gain_db</code> set to 0dB or lower. The driver |
| will not respond to subsequent client <code>WatchGainState</code> calls until the gain state changes |
| from what was most recently reported.</p> |
| |
| #### Request {#Codec.WatchGainState_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Codec.WatchGainState_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>gain_state</code></td> |
| <td> |
| <code><a class='link' href='#GainState'>GainState</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### WatchPlugState {#Codec.WatchPlugState} |
| |
| <p>Get the plug detect state via a hanging get. The driver will reply to the first |
| <code>WatchPlugState</code> sent by the client. The driver will not respond to subsequent client |
| <code>WatchPlugState</code> calls until the plug state changes from what was most recently reported.</p> |
| |
| #### Request {#Codec.WatchPlugState_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Codec.WatchPlugState_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>plug_state</code></td> |
| <td> |
| <code><a class='link' href='#PlugState'>PlugState</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ## CodecConnector {#CodecConnector} |
| *Defined in [fuchsia.hardware.audio/codec_connector.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/codec_connector.fidl;l=8)* |
| <p>For an overview of the Codec protocols see |
| <a href="//docs/concepts/drivers/driver_architectures/audio_drivers/audio_codec.md">Codec Interface</a></p> |
| |
| ### Connect {#CodecConnector.Connect} |
| |
| <p>Connect to a Codec protocol server. |
| This indirection into the Codec protocol allows us to support independent codec client |
| connections.</p> |
| |
| #### Request {#CodecConnector.Connect_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>codec_protocol</code></td> |
| <td> |
| <code>request<<a class='link' href='#Codec'>Codec</a>></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ## Dai {#Dai} |
| *Defined in [fuchsia.hardware.audio/dai.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai.fidl;l=27)* |
| <p>For an overview see |
| <a href="https://fuchsia.dev/fuchsia-src/concepts/drivers/driver_architectures/audio_drivers/audio_dai">Digital Audio Interface</a>.</p> |
| |
| ### CreateRingBuffer {#Dai.CreateRingBuffer} |
| |
| <p><code>CreateRingBuffer</code> is sent by clients to select both a DAI format and a ring buffer format |
| based on information that the driver provides in <code>GetDaiFormats</code> and <code>GetRingBufferFormats</code>, |
| what is supported by the client, and any other requirement. The <code>ring_buffer</code> channel is |
| used to control the audio buffer, if a previous ring buffer channel had been established and |
| was still active, the driver must close that (ring buffer) channel and make every attempt to |
| gracefully quiesce any on-going streaming operations in the process.</p> |
| |
| #### Request {#Dai.CreateRingBuffer_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>dai_format</code></td> |
| <td> |
| <code><a class='link' href='#DaiFormat'>DaiFormat</a></code> |
| </td> |
| </tr> |
| <tr> |
| <td><code>ring_buffer_format</code></td> |
| <td> |
| <code><a class='link' href='#Format'>Format</a></code> |
| </td> |
| </tr> |
| <tr> |
| <td><code>ring_buffer</code></td> |
| <td> |
| <code>request<<a class='link' href='#RingBuffer'>RingBuffer</a>></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### GetDaiFormats {#Dai.GetDaiFormats} |
| |
| <p>Retrieves the DAI formats supported by the DAI, if not available at the time the DAI |
| may reply with an error status and the client may retry at a later time. |
| Retrieving multiple <code>DaiSupportedFormats</code> allows for cases where exclusive combinations of |
| the parameters in SupportedFormats may be supported.</p> |
| |
| #### Request {#Dai.GetDaiFormats_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Dai.GetDaiFormats_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>result</code></td> |
| <td> |
| <code><a class='link' href='#Dai_GetDaiFormats_Result'>Dai_GetDaiFormats_Result</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### GetHealthState {#Dai.GetHealthState} |
| |
| <p>Retrieves top level health state. |
| A driver not responding promptly can be used as an indication of an unhealthy driver.</p> |
| |
| #### Request {#Dai.GetHealthState_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Dai.GetHealthState_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>state</code></td> |
| <td> |
| <code><a class='link' href='#HealthState'>HealthState</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### GetProperties {#Dai.GetProperties} |
| |
| <p>Retrieves top level static properties.</p> |
| |
| #### Request {#Dai.GetProperties_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Dai.GetProperties_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>properties</code></td> |
| <td> |
| <code><a class='link' href='#DaiProperties'>DaiProperties</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### GetRingBufferFormats {#Dai.GetRingBufferFormats} |
| |
| <p>Retrieves the ring buffer formats supported by the DAI, if not available at the time the DAI |
| may reply with an error status and the client may retry at a later time. |
| Retrieving multiple <code>SupportedFormats</code> allows for cases where exclusive combinations of |
| the parameters in <code>SupportedFormats</code> may be supported.</p> |
| |
| #### Request {#Dai.GetRingBufferFormats_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Dai.GetRingBufferFormats_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>result</code></td> |
| <td> |
| <code><a class='link' href='#Dai_GetRingBufferFormats_Result'>Dai_GetRingBufferFormats_Result</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### Reset {#Dai.Reset} |
| |
| <p>Resets the DAI HW. The <code>ring_buffer</code> channel obtained via <code>CreateRingBuffer</code> may be closed |
| by the driver, in this case the client needs to obtain a new <code>ring_buffer</code>. |
| <code>Reset</code> returns when the reset is completed. If the driver can't successfully reset the HW, |
| it will close the DAI protocol channel, in this case the client may obtain a new DAI |
| protocol channel and retry.</p> |
| |
| #### Request {#Dai.Reset_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Dai.Reset_Response} |
| |
| <EMPTY> |
| |
| ### SignalProcessingConnect {#Dai.SignalProcessingConnect} |
| |
| <p>Connect to a <code>SignalProcessing</code> protocol. |
| Multiple connections may be supported, if a new connection request is not supported, i.e. |
| the maximum number of connections have already been created, for instance one, then the |
| channel will be closed with an ZX_ERR_ALREADY_BOUND epitaph. |
| If signal processing is not supported at all, then the channel will be closed with a |
| ZX_ERR_NOT_SUPPORTED epitaph. |
| This method is named <code>SignalProcessingConnect</code> instead of <code>Connect</code> because this protocol |
| is intended to be composed, and hence the more verbose name allows differentiation and |
| improved clarity.</p> |
| |
| #### Request {#Dai.SignalProcessingConnect_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>protocol</code></td> |
| <td> |
| <code>request<<a class='link' href='../fuchsia.hardware.audio.signalprocessing/'>fuchsia.hardware.audio.signalprocessing</a>/<a class='link' href='../fuchsia.hardware.audio.signalprocessing/#SignalProcessing'>SignalProcessing</a>></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ## DaiConnector {#DaiConnector} |
| *Defined in [fuchsia.hardware.audio/dai_connector.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai_connector.fidl;l=8)* |
| <p>For an overview of the DAI protocols see |
| <a href="//docs/concepts/drivers/driver_architectures/audio_drivers/audio_dai.md">Digital Audio Interface</a></p> |
| |
| ### Connect {#DaiConnector.Connect} |
| |
| <p>This connects to a DAI protocol server.</p> |
| |
| #### Request {#DaiConnector.Connect_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>dai_protocol</code></td> |
| <td> |
| <code>request<<a class='link' href='#Dai'>Dai</a>></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ## Health {#Health} |
| *Defined in [fuchsia.hardware.audio/health.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/health.fidl;l=15)* |
| |
| ### GetHealthState {#Health.GetHealthState} |
| |
| <p>Retrieves top level health state. |
| A driver not responding promptly can be used as an indication of an unhealthy driver.</p> |
| |
| #### Request {#Health.GetHealthState_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Health.GetHealthState_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>state</code></td> |
| <td> |
| <code><a class='link' href='#HealthState'>HealthState</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ## RingBuffer {#RingBuffer} |
| *Defined in [fuchsia.hardware.audio/ring_buffer.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/ring_buffer.fidl;l=90)* |
| <p>For an overview see |
| <a href="https://fuchsia.dev/fuchsia-src/concepts/drivers/driver_architectures/audio_drivers/audio_streaming">Audio Driver Streaming Interface</a></p> |
| |
| ### GetProperties {#RingBuffer.GetProperties} |
| |
| <p>Accessor for top level static properties.</p> |
| |
| #### Request {#RingBuffer.GetProperties_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#RingBuffer.GetProperties_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>properties</code></td> |
| <td> |
| <code><a class='link' href='#RingBufferProperties'>RingBufferProperties</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### GetVmo {#RingBuffer.GetVmo} |
| |
| <p>Requests a shared buffer to be used for moving bulk audio data. Requests the buffer size to |
| fit at least <code>min_frames</code>, and returns the actual <code>num_frames</code> allocated in |
| <code>ring_buffer</code>.</p> |
| <p>If <code>clock_recovery_notifications_per_ring</code> is non-zero, the driver will send replies to |
| <code>WatchClockRecoveryPositionInfo</code> client requests at most at |
| <code>clock_recovery_notifications_per_ring</code> frequency. These notifications are meant to be used |
| for clock recovery.</p> |
| |
| #### Request {#RingBuffer.GetVmo_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>min_frames</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| </tr> |
| <tr> |
| <td><code>clock_recovery_notifications_per_ring</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| #### Response {#RingBuffer.GetVmo_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>result</code></td> |
| <td> |
| <code><a class='link' href='#RingBuffer_GetVmo_Result'>RingBuffer_GetVmo_Result</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### SetActiveChannels {#RingBuffer.SetActiveChannels} |
| |
| <p>Sets which channels are active via a bitmask. |
| The least significant bit corresponds to channel index 0. |
| Channels not set (bits are 0) in the bitmask are inactive. |
| Inactive channels indicate to the driver that it may turn off hardware associated with the |
| inactive channels. A subsequent <code>SetActiveChannels</code> setting an inactive channel to active |
| may incur in a <code>turn_on_delay</code> to actually restart playback/capture of the channels. |
| The total number of channels is the <code>number_of_channels</code> in <code>Format</code>, specifically in |
| <code>PcmFormat</code>, i.e. this bitmask has up to <code>number_of_channels</code> bits set (maximum 64). |
| Deactivating one, several, or all channels does not <code>Stop</code> the ring buffer. |
| <code>SetActiveChannels</code> does not change the ring buffer's behavior with regard to |
| <code>Start</code>/<code>Stop</code>, specifically position. Once <code>Start</code> is called, a ring buffer's position |
| advances (and position notifications sent as needed) regardless of the number of active |
| channels, including if no channels are active. This means that the format in the |
| ring buffer is not changed. |
| By default all channels are active. |
| If the driver does not support deactivating channels it must return <code>ZX_ERR_NOT_SUPPORTED</code>. |
| If the mask is incorrect, i.e. enables channels outside the number of bits |
| to use for a given <code>number_of_channels</code>, then the driver may return <code>ZX_ERR_INVALID_ARGS</code>. |
| The <code>set_time</code> value (in the CLOCK_MONOTONIC timeline) indicates when configuring |
| the hardware to activate or deactivate channels is completed. <code>set_time</code> does not include |
| the potential <code>turn_on_delay</code>, the driver does not delay the reply waiting for the |
| hardware to actually turn on, the driver replies with a <code>set_time</code> indicating when the |
| hardware configuration was completed. |
| For input channels, it is not required that the driver zero-out inactive channels.</p> |
| |
| #### Request {#RingBuffer.SetActiveChannels_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>active_channels_bitmask</code></td> |
| <td> |
| <code>uint64</code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| #### Response {#RingBuffer.SetActiveChannels_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>result</code></td> |
| <td> |
| <code><a class='link' href='#RingBuffer_SetActiveChannels_Result'>RingBuffer_SetActiveChannels_Result</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### Start {#RingBuffer.Start} |
| |
| <p>Start the ring buffer. The <code>start_time</code> value (in the CLOCK_MONOTONIC timeline) indicates |
| when position began moving, starting at the beginning of the ring buffer. |
| external_delay impact should not be incorporated into 'start_time'. |
| If <code>SetActiveChannels</code> is not called before <code>Start</code>, then by default all channels will be |
| active.</p> |
| |
| #### Request {#RingBuffer.Start_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#RingBuffer.Start_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>start_time</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#time'>time</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### Stop {#RingBuffer.Stop} |
| |
| <p>Stop the ring buffer. Once this call's response is received, no further position |
| notifications will be sent until <code>Start</code> is called again.</p> |
| |
| #### Request {#RingBuffer.Stop_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#RingBuffer.Stop_Response} |
| |
| <EMPTY> |
| |
| ### WatchClockRecoveryPositionInfo {#RingBuffer.WatchClockRecoveryPositionInfo} |
| |
| <p>Gets the ring buffer current position via a hanging get. The driver must respond to a |
| client's first <code>WatchClockRecoveryPositionInfo</code> call, but will not respond to subsequent |
| client calls until the position information has changed from what was most recently |
| provided to that client. The driver must not respond to a |
| <code>WatchClockRecoveryPositionInfo</code> until after it has replied to the <code>Start</code> command. If |
| <code>clock_recovery_notifications_per_ring</code> is not zero, the driver will reply with its |
| estimated position to be used for clock recovery at most at |
| <code>clock_recovery_notifications_per_ring</code> frequency. |
| <code>WatchClockRecoveryPositionInfo</code> may only be called after <code>GetVmo</code> was called, hence a |
| <code>clock_recovery_notifications_per_ring</code> was specified. |
| Must be delivered with timestamps that are monotonically increasing.</p> |
| |
| #### Request {#RingBuffer.WatchClockRecoveryPositionInfo_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#RingBuffer.WatchClockRecoveryPositionInfo_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>position_info</code></td> |
| <td> |
| <code><a class='link' href='#RingBufferPositionInfo'>RingBufferPositionInfo</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ## StreamConfig {#StreamConfig} |
| *Defined in [fuchsia.hardware.audio/stream.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=212)* |
| <p>For an overview see |
| <a href="https://fuchsia.dev/fuchsia-src/concepts/drivers/driver_architectures/audio_drivers/audio_streaming">Audio Driver Streaming Interface</a></p> |
| |
| ### CreateRingBuffer {#StreamConfig.CreateRingBuffer} |
| |
| <p><code>CreateRingBuffer</code> is sent by clients to select a stream format based on information that |
| the driver provides in <code>GetSupportedFormats</code> what is supported by the client, and any other |
| requirement. The <code>ring_buffer</code> channel is used to control the audio buffer, if a previous |
| ring buffer channel had been established and was still active, the driver must close that |
| (ring buffer) channel and make every attempt to gracefully quiesce any on-going streaming |
| operations in the process.</p> |
| |
| #### Request {#StreamConfig.CreateRingBuffer_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>format</code></td> |
| <td> |
| <code><a class='link' href='#Format'>Format</a></code> |
| </td> |
| </tr> |
| <tr> |
| <td><code>ring_buffer</code></td> |
| <td> |
| <code>request<<a class='link' href='#RingBuffer'>RingBuffer</a>></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### GetHealthState {#StreamConfig.GetHealthState} |
| |
| <p>Retrieves top level health state. |
| A driver not responding promptly can be used as an indication of an unhealthy driver.</p> |
| |
| #### Request {#StreamConfig.GetHealthState_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#StreamConfig.GetHealthState_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>state</code></td> |
| <td> |
| <code><a class='link' href='#HealthState'>HealthState</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### GetProperties {#StreamConfig.GetProperties} |
| |
| <p>Retrieves top level static properties.</p> |
| |
| #### Request {#StreamConfig.GetProperties_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#StreamConfig.GetProperties_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>properties</code></td> |
| <td> |
| <code><a class='link' href='#StreamProperties'>StreamProperties</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### GetSupportedFormats {#StreamConfig.GetSupportedFormats} |
| |
| <p>Gets formats supported by a given driver. When not all combinations supported by the |
| driver can be described with one <code>SupportedFormats</code>, the driver returns more than one |
| <code>SupportedFormats</code> in the returned vector. For example, if one <code>SupportedFormats</code> allows |
| for 32 bits samples at 48KHz, and 16 bits samples at 96KHz, but not 32 bits samples at |
| 96KHz, then the driver replies with 2 <code>SupportedFormats</code>: <<32bits>,<48KHz>> and |
| <<16bits>,<96KHz>>. For simplicity, this example ignores parameters other than rate and |
| bits per sample. In the case where the driver supports either 16 or 32 bits samples at |
| either 48 or 96KHz, the driver would reply with 1 <code>SupportedFormats</code>: |
| <<16bits,32bits>,<48KHz,96KHz>>.</p> |
| |
| #### Request {#StreamConfig.GetSupportedFormats_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#StreamConfig.GetSupportedFormats_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>supported_formats</code></td> |
| <td> |
| <code>vector<<a class='link' href='#SupportedFormats'>SupportedFormats</a>>[64]</code> |
| </td> |
| </tr> |
| </table> |
| |
| ### SetGain {#StreamConfig.SetGain} |
| |
| <p>Client update of the gain state.</p> |
| |
| #### Request {#StreamConfig.SetGain_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>target_state</code></td> |
| <td> |
| <code><a class='link' href='#GainState'>GainState</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### SignalProcessingConnect {#StreamConfig.SignalProcessingConnect} |
| |
| <p>Connect to a <code>SignalProcessing</code> protocol. |
| Multiple connections may be supported, if a new connection request is not supported, i.e. |
| the maximum number of connections have already been created, for instance one, then the |
| channel will be closed with an ZX_ERR_ALREADY_BOUND epitaph. |
| If signal processing is not supported at all, then the channel will be closed with a |
| ZX_ERR_NOT_SUPPORTED epitaph. |
| This method is named <code>SignalProcessingConnect</code> instead of <code>Connect</code> because this protocol |
| is intended to be composed, and hence the more verbose name allows differentiation and |
| improved clarity.</p> |
| |
| #### Request {#StreamConfig.SignalProcessingConnect_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>protocol</code></td> |
| <td> |
| <code>request<<a class='link' href='../fuchsia.hardware.audio.signalprocessing/'>fuchsia.hardware.audio.signalprocessing</a>/<a class='link' href='../fuchsia.hardware.audio.signalprocessing/#SignalProcessing'>SignalProcessing</a>></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### WatchGainState {#StreamConfig.WatchGainState} |
| |
| <p>Get the gain state via a hanging get. The driver will reply to the first <code>WatchGainState</code> |
| sent by the client and this reply must include a <code>gain_db</code> set to 0dB or lower. The driver |
| will not respond to subsequent client <code>WatchGainState</code> calls until the gain state changes |
| from what was most recently reported.</p> |
| |
| #### Request {#StreamConfig.WatchGainState_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#StreamConfig.WatchGainState_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>gain_state</code></td> |
| <td> |
| <code><a class='link' href='#GainState'>GainState</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### WatchPlugState {#StreamConfig.WatchPlugState} |
| |
| <p>Get the plug detect state via a hanging get. The driver will reply to the first |
| <code>WatchPlugState</code> sent by the client. The driver will not respond to subsequent client |
| <code>WatchPlugState</code> calls until the plug state changes from what was most recently reported.</p> |
| |
| #### Request {#StreamConfig.WatchPlugState_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#StreamConfig.WatchPlugState_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>plug_state</code></td> |
| <td> |
| <code><a class='link' href='#PlugState'>PlugState</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ## StreamConfigConnector {#StreamConfigConnector} |
| *Defined in [fuchsia.hardware.audio/stream_config_connector.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream_config_connector.fidl;l=8)* |
| <p>For an overview see |
| <a href="https://fuchsia.dev/fuchsia-src/concepts/drivers/driver_architectures/audio_drivers/audio_streaming">Audio Driver Streaming Interface</a>.</p> |
| |
| ### Connect {#StreamConfigConnector.Connect} |
| |
| <p>Connect to a <code>StreamConfig</code> protocol. |
| This method allows a component to serve FIDL outside the devhost's control.</p> |
| |
| #### Request {#StreamConfigConnector.Connect_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>protocol</code></td> |
| <td> |
| <code>request<<a class='link' href='#StreamConfig'>StreamConfig</a>></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| |
| ## **STRUCTS** |
| |
| ### CodecInfo {#CodecInfo data-text="CodecInfo"} |
| *Defined in [fuchsia.hardware.audio/codec.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/codec.fidl;l=10)* |
| <p>Textual information about the codec.</p> |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="CodecInfo.unique_id"> |
| <td><code>unique_id</code></td> |
| <td> |
| <code>string[16]</code> |
| </td> |
| <td><p>Unique identifier for the codec.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="CodecInfo.manufacturer"> |
| <td><code>manufacturer</code></td> |
| <td> |
| <code>string[256]</code> |
| </td> |
| <td><p>Name of the codec manufacturer.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="CodecInfo.product_name"> |
| <td><code>product_name</code></td> |
| <td> |
| <code>string[256]</code> |
| </td> |
| <td><p>Product name of the codec.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### Codec_GetDaiFormats_Response {#Codec_GetDaiFormats_Response data-text="Codec_GetDaiFormats_Response"} |
| *Defined in [fuchsia.hardware.audio/codec.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/codec.fidl;l=137)* |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="Codec_GetDaiFormats_Response.formats"> |
| <td><code>formats</code></td> |
| <td> |
| <code>vector<<a class='link' href='#DaiSupportedFormats'>DaiSupportedFormats</a>>[64]</code> |
| </td> |
| <td></td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### Codec_SetDaiFormat_Response {#Codec_SetDaiFormat_Response data-text="Codec_SetDaiFormat_Response"} |
| *Defined in [fuchsia.hardware.audio/codec.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/codec.fidl;l=146)* |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="Codec_SetDaiFormat_Response.state"> |
| <td><code>state</code></td> |
| <td> |
| <code><a class='link' href='#CodecFormatInfo'>CodecFormatInfo</a></code> |
| </td> |
| <td></td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### DaiFormat {#DaiFormat data-text="DaiFormat"} |
| *Defined in [fuchsia.hardware.audio/dai_format.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai_format.fidl;l=74)* |
| <p>DAI format. Frames are made up of <code>number_of_channels</code> samples which have <code>bits_per_sample</code> bits |
| of data within <code>bits_per_slot</code> arranged in <code>frame_format</code>. For more detailed information see |
| <a href="https://fuchsia.dev/fuchsia-src/concepts/drivers/driver_architectures/audio_drivers/audio_dai">Digital Audio Interface</a>.</p> |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="DaiFormat.number_of_channels"> |
| <td><code>number_of_channels</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| <td><p>Number of channels.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="DaiFormat.channels_to_use_bitmask"> |
| <td><code>channels_to_use_bitmask</code></td> |
| <td> |
| <code>uint64</code> |
| </td> |
| <td><p>Sets which channels are active via a bitmask. |
| The least significant bit corresponds to channel index 0.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="DaiFormat.sample_format"> |
| <td><code>sample_format</code></td> |
| <td> |
| <code><a class='link' href='#DaiSampleFormat'>DaiSampleFormat</a></code> |
| </td> |
| <td><p>The sample format of all samples.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="DaiFormat.frame_format"> |
| <td><code>frame_format</code></td> |
| <td> |
| <code><a class='link' href='#DaiFrameFormat'>DaiFrameFormat</a></code> |
| </td> |
| <td><p>The frame format of all samples.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="DaiFormat.frame_rate"> |
| <td><code>frame_rate</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| <td><p>The frame rate for all samples.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="DaiFormat.bits_per_slot"> |
| <td><code>bits_per_slot</code></td> |
| <td> |
| <code>uint8</code> |
| </td> |
| <td><p>The bits per slot for all channels.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="DaiFormat.bits_per_sample"> |
| <td><code>bits_per_sample</code></td> |
| <td> |
| <code>uint8</code> |
| </td> |
| <td><p>The bits per sample for all samples. Must be smaller than bits per channel for samples to |
| fit.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### DaiFrameFormatCustom {#DaiFrameFormatCustom data-text="DaiFrameFormatCustom"} |
| *Defined in [fuchsia.hardware.audio/dai_format.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai_format.fidl;l=58)* |
| <p>Custom Frame format.</p> |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="DaiFrameFormatCustom.left_justified"> |
| <td><code>left_justified</code></td> |
| <td> |
| <code>bool</code> |
| </td> |
| <td><p>Justification of the samples within a slot.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="DaiFrameFormatCustom.sclk_on_raising"> |
| <td><code>sclk_on_raising</code></td> |
| <td> |
| <code>bool</code> |
| </td> |
| <td><p>Clocking of data samples and frame sync output on either raising or falling sclk.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="DaiFrameFormatCustom.frame_sync_sclks_offset"> |
| <td><code>frame_sync_sclks_offset</code></td> |
| <td> |
| <code>int8</code> |
| </td> |
| <td><p>Number of sclks between the beginning of a frame sync change and audio samples. |
| For example, for I2S set to 1 and for stereo left justified set to 0.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="DaiFrameFormatCustom.frame_sync_size"> |
| <td><code>frame_sync_size</code></td> |
| <td> |
| <code>uint8</code> |
| </td> |
| <td><p>Number of sclks the frame sync is high within a frame. |
| For example, for I2S with 32 bits slots set to 32, for TDM usually set to 1.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### DaiSupportedFormats {#DaiSupportedFormats data-text="DaiSupportedFormats"} |
| *Defined in [fuchsia.hardware.audio/dai_format.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai_format.fidl;l=100)* |
| <p>Formats supported by the DAI. Frames are made up of <code>number_of_channels</code> samples which have |
| <code>bits_per_sample</code> bits of data within <code>bits_per_slot</code> bits arranged in <code>frame_formats</code>. |
| All values listed in each vector are supported. When not all combinations supported by the driver |
| can be described with one <code>DaiSupportedFormats</code>, <code>GetDaiSupportedFormats</code> returns more than one |
| <code>DaiSupportedFormats</code> in the returned vector. |
| For more detailed information see |
| <a href="https://fuchsia.dev/fuchsia-src/concepts/drivers/driver_architectures/audio_drivers/audio_dai">Digital Audio Interface</a>.</p> |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="DaiSupportedFormats.number_of_channels"> |
| <td><code>number_of_channels</code></td> |
| <td> |
| <code>vector<uint32>[64]</code> |
| </td> |
| <td><p>Possible number of channels supported.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="DaiSupportedFormats.sample_formats"> |
| <td><code>sample_formats</code></td> |
| <td> |
| <code>vector<<a class='link' href='#DaiSampleFormat'>DaiSampleFormat</a>>[4]</code> |
| </td> |
| <td><p>Sample formats supported.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="DaiSupportedFormats.frame_formats"> |
| <td><code>frame_formats</code></td> |
| <td> |
| <code>vector<<a class='link' href='#DaiFrameFormat'>DaiFrameFormat</a>>[64]</code> |
| </td> |
| <td><p>Frame formats supported.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="DaiSupportedFormats.frame_rates"> |
| <td><code>frame_rates</code></td> |
| <td> |
| <code>vector<uint32>[64]</code> |
| </td> |
| <td><p>Rates supported.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="DaiSupportedFormats.bits_per_slot"> |
| <td><code>bits_per_slot</code></td> |
| <td> |
| <code>vector<uint8>[8]</code> |
| </td> |
| <td><p>The bits per slot supported.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="DaiSupportedFormats.bits_per_sample"> |
| <td><code>bits_per_sample</code></td> |
| <td> |
| <code>vector<uint8>[8]</code> |
| </td> |
| <td><p>Bits per sample supported.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### Dai_GetDaiFormats_Response {#Dai_GetDaiFormats_Response data-text="Dai_GetDaiFormats_Response"} |
| *Defined in [fuchsia.hardware.audio/dai.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai.fidl;l=50)* |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="Dai_GetDaiFormats_Response.dai_formats"> |
| <td><code>dai_formats</code></td> |
| <td> |
| <code>vector<<a class='link' href='#DaiSupportedFormats'>DaiSupportedFormats</a>>[64]</code> |
| </td> |
| <td></td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### Dai_GetRingBufferFormats_Response {#Dai_GetRingBufferFormats_Response data-text="Dai_GetRingBufferFormats_Response"} |
| *Defined in [fuchsia.hardware.audio/dai.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai.fidl;l=58)* |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="Dai_GetRingBufferFormats_Response.ring_buffer_formats"> |
| <td><code>ring_buffer_formats</code></td> |
| <td> |
| <code>vector<<a class='link' href='#SupportedFormats'>SupportedFormats</a>>[64]</code> |
| </td> |
| <td></td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### PcmFormat {#PcmFormat data-text="PcmFormat"} |
| *Defined in [fuchsia.hardware.audio/stream.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=102)* |
| <p>Format supporting non-compressed PCM audio. Frames are made up of <code>number_of_channels</code> samples |
| which have <code>valid_bits_per_sample</code> bits of left-justified data within <code>bytes_per_channel</code>. |
| bytes. For more detailed information see |
| <a href="https://fuchsia.dev/fuchsia-src/concepts/drivers/driver_architectures/audio_drivers/audio_streaming">Audio Driver Streaming Interface</a>.</p> |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="PcmFormat.number_of_channels"> |
| <td><code>number_of_channels</code></td> |
| <td> |
| <code>uint8</code> |
| </td> |
| <td><p>Number of channels.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="PcmFormat.sample_format"> |
| <td><code>sample_format</code></td> |
| <td> |
| <code><a class='link' href='#SampleFormat'>SampleFormat</a></code> |
| </td> |
| <td><p>The format of all samples.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="PcmFormat.bytes_per_sample"> |
| <td><code>bytes_per_sample</code></td> |
| <td> |
| <code>uint8</code> |
| </td> |
| <td><p>Bytes allocated to hold a sample, equal or bigger than the valid sample size in |
| <code>valid_bits_per_sample</code>.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="PcmFormat.valid_bits_per_sample"> |
| <td><code>valid_bits_per_sample</code></td> |
| <td> |
| <code>uint8</code> |
| </td> |
| <td><p>Number of valid bits in a sample, must be equal or smaller than bits in <code>bytes_per_sample</code>. |
| If smaller, bits are left justified, and any additional bits must be ignored by the |
| receiver.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="PcmFormat.frame_rate"> |
| <td><code>frame_rate</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| <td><p>The frame rate for all samples.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### RingBufferPositionInfo {#RingBufferPositionInfo data-text="RingBufferPositionInfo"} |
| *Defined in [fuchsia.hardware.audio/ring_buffer.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/ring_buffer.fidl;l=68)* |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="RingBufferPositionInfo.timestamp"> |
| <td><code>timestamp</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#time'>time</a></code> |
| </td> |
| <td><p>The driver's best estimate of the time (in the CLOCK_MONOTONIC timeline) at which the |
| playback/capture pointer reached the position indicated by <code>position</code>. |
| external_delay impact should not be incorporated into 'timestamp'. |
| turn_on_delay impact should not be incorporated into 'timestamp'.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| <tr id="RingBufferPositionInfo.position"> |
| <td><code>position</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| <td><p>The playback/capture pointer position (in bytes) in the ring buffer at time |
| <code>timestamp</code> as estimated by the driver.</p> |
| </td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### RingBuffer_GetVmo_Response [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#RingBuffer_GetVmo_Response data-text="RingBuffer_GetVmo_Response"} |
| *Defined in [fuchsia.hardware.audio/ring_buffer.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/ring_buffer.fidl;l=123)* |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="RingBuffer_GetVmo_Response.num_frames"> |
| <td><code>num_frames</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| <td></td> |
| <td>No default</td> |
| </tr> |
| <tr id="RingBuffer_GetVmo_Response.ring_buffer"> |
| <td><code>ring_buffer</code></td> |
| <td> |
| <code>handle<vmo></code> |
| </td> |
| <td></td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### RingBuffer_SetActiveChannels_Response {#RingBuffer_SetActiveChannels_Response data-text="RingBuffer_SetActiveChannels_Response"} |
| *Defined in [fuchsia.hardware.audio/ring_buffer.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/ring_buffer.fidl;l=168)* |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="RingBuffer_SetActiveChannels_Response.set_time"> |
| <td><code>set_time</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#time'>time</a></code> |
| </td> |
| <td></td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| |
| ## **ENUMS** |
| |
| ### DaiFrameFormatStandard [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#DaiFrameFormatStandard data-text="DaiFrameFormatStandard"} |
| Type: <code>uint8</code> |
| |
| *Defined in [fuchsia.hardware.audio/dai_format.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai_format.fidl;l=37)* |
| <p>Standard Frame format.</p> |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="DaiFrameFormatStandard.NONE"> |
| <td><h3 id="DaiFrameFormatStandard.NONE" class="add-link hide-from-toc">NONE</h3></td> |
| <td><code>1</code></td> |
| <td><p>No frame format as in samples without a frame sync like PDM.</p> |
| </td> |
| </tr> |
| <tr id="DaiFrameFormatStandard.I2S"> |
| <td><h3 id="DaiFrameFormatStandard.I2S" class="add-link hide-from-toc">I2S</h3></td> |
| <td><code>2</code></td> |
| <td><p>Format as specified in the I2S specification (left justified, 2 channels, 32 bits per |
| channel, frame sync stays low for the left channel and high for the right channel, data |
| starts one clock cycle after frame sync changes clocked out at the falling edge of sclk).</p> |
| </td> |
| </tr> |
| <tr id="DaiFrameFormatStandard.STEREO_LEFT"> |
| <td><h3 id="DaiFrameFormatStandard.STEREO_LEFT" class="add-link hide-from-toc">STEREO_LEFT</h3></td> |
| <td><code>3</code></td> |
| <td><p>Left justified, 2 channels. Data starts at frame sync changes from low to high clocked out |
| at the falling edge of sclk. The frame sync must stay high for bits_per_channel bits for the |
| first channel and low for bits_per_channel bits for the second channel.</p> |
| </td> |
| </tr> |
| <tr id="DaiFrameFormatStandard.STEREO_RIGHT"> |
| <td><h3 id="DaiFrameFormatStandard.STEREO_RIGHT" class="add-link hide-from-toc">STEREO_RIGHT</h3></td> |
| <td><code>4</code></td> |
| <td><p>Right justified, 2 channels. The frame sync must stay high for bits_per_channel bits for the |
| first channel and low for bits_per_channel bits for the second channel.</p> |
| </td> |
| </tr> |
| <tr id="DaiFrameFormatStandard.TDM1"> |
| <td><h3 id="DaiFrameFormatStandard.TDM1" class="add-link hide-from-toc">TDM1</h3></td> |
| <td><code>5</code></td> |
| <td><p>Left justified, variable number of channels, data starts at frame sync changes from low to |
| high clocked out at the rising edge of sclk. The frame sync must stay high for exactly 1 |
| clock cycle.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### DaiSampleFormat [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#DaiSampleFormat data-text="DaiSampleFormat"} |
| Type: <code>uint8</code> |
| |
| *Defined in [fuchsia.hardware.audio/dai_format.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai_format.fidl;l=13)* |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="DaiSampleFormat.PDM"> |
| <td><h3 id="DaiSampleFormat.PDM" class="add-link hide-from-toc">PDM</h3></td> |
| <td><code>1</code></td> |
| <td><p>Pulse Density Modulation samples.</p> |
| </td> |
| </tr> |
| <tr id="DaiSampleFormat.PCM_SIGNED"> |
| <td><h3 id="DaiSampleFormat.PCM_SIGNED" class="add-link hide-from-toc">PCM_SIGNED</h3></td> |
| <td><code>2</code></td> |
| <td><p>Signed Linear Pulse Code Modulation samples at the host endianness.</p> |
| </td> |
| </tr> |
| <tr id="DaiSampleFormat.PCM_UNSIGNED"> |
| <td><h3 id="DaiSampleFormat.PCM_UNSIGNED" class="add-link hide-from-toc">PCM_UNSIGNED</h3></td> |
| <td><code>3</code></td> |
| <td><p>Unsigned Linear Pulse Code Modulation samples at the host endianness.</p> |
| </td> |
| </tr> |
| <tr id="DaiSampleFormat.PCM_FLOAT"> |
| <td><h3 id="DaiSampleFormat.PCM_FLOAT" class="add-link hide-from-toc">PCM_FLOAT</h3></td> |
| <td><code>4</code></td> |
| <td><p>Floating point samples IEEE-754 encoded.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### GainType [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#GainType data-text="GainType"} |
| Type: <code>uint8</code> |
| |
| *Defined in [fuchsia.hardware.audio/codec.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/codec.fidl;l=22)* |
| <p>Gain type of representation.</p> |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="GainType.DECIBELS"> |
| <td><h3 id="GainType.DECIBELS" class="add-link hide-from-toc">DECIBELS</h3></td> |
| <td><code>1</code></td> |
| <td><p>Gain specified in dB, for example -103.0dB or +3.2dB.</p> |
| </td> |
| </tr> |
| <tr id="GainType.PERCENT"> |
| <td><h3 id="GainType.PERCENT" class="add-link hide-from-toc">PERCENT</h3></td> |
| <td><code>2</code></td> |
| <td><p>Gain specified as a percentage, for example 10.0% or 80.5%.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### GetVmoError [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#GetVmoError data-text="GetVmoError"} |
| Type: <code>uint32</code> |
| |
| *Defined in [fuchsia.hardware.audio/ring_buffer.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/ring_buffer.fidl;l=80)* |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="GetVmoError.INVALID_ARGS"> |
| <td><h3 id="GetVmoError.INVALID_ARGS" class="add-link hide-from-toc">INVALID_ARGS</h3></td> |
| <td><code>1</code></td> |
| <td><p>The ring buffer setup failed due to an invalid argument, e.g. min_frames is too big.</p> |
| </td> |
| </tr> |
| <tr id="GetVmoError.INTERNAL_ERROR"> |
| <td><h3 id="GetVmoError.INTERNAL_ERROR" class="add-link hide-from-toc">INTERNAL_ERROR</h3></td> |
| <td><code>2</code></td> |
| <td><p>The ring buffer setup failed due to an internal error.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### PlugDetectCapabilities [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#PlugDetectCapabilities data-text="PlugDetectCapabilities"} |
| Type: <code>uint32</code> |
| |
| *Defined in [fuchsia.hardware.audio/stream.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=146)* |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="PlugDetectCapabilities.HARDWIRED"> |
| <td><h3 id="PlugDetectCapabilities.HARDWIRED" class="add-link hide-from-toc">HARDWIRED</h3></td> |
| <td><code>0</code></td> |
| <td><p>Stream is hardwired (will always be plugged in).</p> |
| </td> |
| </tr> |
| <tr id="PlugDetectCapabilities.CAN_ASYNC_NOTIFY"> |
| <td><h3 id="PlugDetectCapabilities.CAN_ASYNC_NOTIFY" class="add-link hide-from-toc">CAN_ASYNC_NOTIFY</h3></td> |
| <td><code>1</code></td> |
| <td><p>Stream is able to asynchronously notify of plug state changes.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### SampleFormat [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#SampleFormat data-text="SampleFormat"} |
| Type: <code>uint8</code> |
| |
| *Defined in [fuchsia.hardware.audio/stream.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=24)* |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="SampleFormat.PCM_SIGNED"> |
| <td><h3 id="SampleFormat.PCM_SIGNED" class="add-link hide-from-toc">PCM_SIGNED</h3></td> |
| <td><code>1</code></td> |
| <td><p>Signed Linear Pulse Code Modulation samples at the host endianness.</p> |
| </td> |
| </tr> |
| <tr id="SampleFormat.PCM_UNSIGNED"> |
| <td><h3 id="SampleFormat.PCM_UNSIGNED" class="add-link hide-from-toc">PCM_UNSIGNED</h3></td> |
| <td><code>2</code></td> |
| <td><p>Unsigned Linear Pulse Code Modulation samples at the host endianness.</p> |
| </td> |
| </tr> |
| <tr id="SampleFormat.PCM_FLOAT"> |
| <td><h3 id="SampleFormat.PCM_FLOAT" class="add-link hide-from-toc">PCM_FLOAT</h3></td> |
| <td><code>3</code></td> |
| <td><p>Floating point samples IEEE-754 encoded.</p> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ## **TABLES** |
| |
| ### ChannelAttributes {#ChannelAttributes data-text="ChannelAttributes"} |
| |
| |
| *Defined in [fuchsia.hardware.audio/stream.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=35)* |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="ChannelAttributes.min_frequency"> |
| <td><h3 id="ChannelAttributes.min_frequency" class="add-link hide-from-toc">1</h3></td> |
| <td><code>min_frequency</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| <td><p>Minimum frequency guaranteed to be emitted by (or captured in) this channel, in Hz. Optional. |
| If both <code>min_frequency</code> and <code>max_frequency</code> are not included, then this channel is assumed |
| to cover the full frequency range of this device. |
| TODO(fxbug.dev/81743): Define expectations beyond these min/max limits and enable drivers |
| to express tolerances related to this.</p> |
| </td> |
| </tr> |
| <tr id="ChannelAttributes.max_frequency"> |
| <td><h3 id="ChannelAttributes.max_frequency" class="add-link hide-from-toc">2</h3></td> |
| <td><code>max_frequency</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| <td><p>Maximum frequency guaranteed to be emitted by (or captured in) this channel, in Hz. Optional. |
| If both <code>min_frequency</code> and <code>max_frequency</code> are not included, then this channel is assumed |
| to cover the full frequency range of this device. |
| TODO(fxbug.dev/81743): Define expectations beyond these min/max limits and enable drivers |
| to express tolerances related to this.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### ChannelSet {#ChannelSet data-text="ChannelSet"} |
| |
| |
| *Defined in [fuchsia.hardware.audio/stream.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=51)* |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="ChannelSet.attributes"> |
| <td><h3 id="ChannelSet.attributes" class="add-link hide-from-toc">1</h3></td> |
| <td><code>attributes</code></td> |
| <td> |
| <code>vector<<a class='link' href='#ChannelAttributes'>ChannelAttributes</a>>[64]</code> |
| </td> |
| <td><p>Describes attributes for this channel set. Required. |
| The size of this vector defines the number of channels supported by this <code>ChannelSet</code>. |
| Each element of the vector defines attributes of a single channel.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### CodecFormatInfo {#CodecFormatInfo data-text="CodecFormatInfo"} |
| |
| |
| *Defined in [fuchsia.hardware.audio/codec.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/codec.fidl;l=54)* |
| <p>Codec format information.</p> |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="CodecFormatInfo.external_delay"> |
| <td><h3 id="CodecFormatInfo.external_delay" class="add-link hide-from-toc">1</h3></td> |
| <td><code>external_delay</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#duration'>duration</a></code> |
| </td> |
| <td><p>The driver's best estimate of the external delay (in nanoseconds) present in the pipeline |
| for the chosen format. When precisely synchronizing presentation across multiple entities |
| (e.g. devices), the external delay should be taken into account. Optional. |
| If not included <code>external_delay</code> is unknown.</p> |
| </td> |
| </tr> |
| <tr id="CodecFormatInfo.turn_on_delay"> |
| <td><h3 id="CodecFormatInfo.turn_on_delay" class="add-link hide-from-toc">2</h3></td> |
| <td><code>turn_on_delay</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#duration'>duration</a></code> |
| </td> |
| <td><p>The driver's best estimate of the amount of time (in nanoseconds) it takes the hardware to |
| actually start playback/capture after a <code>Start</code> command is issued. |
| It may take some time for the hardware to get into fully operational mode, for example due |
| a power state change. This delay must be taken into account if not getting the initial audio |
| samples played or captured is not acceptable. Optional. |
| If not included <code>turn_on_delay</code> is unknown.</p> |
| </td> |
| </tr> |
| <tr id="CodecFormatInfo.turn_off_delay"> |
| <td><h3 id="CodecFormatInfo.turn_off_delay" class="add-link hide-from-toc">3</h3></td> |
| <td><code>turn_off_delay</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#duration'>duration</a></code> |
| </td> |
| <td><p>The driver's best estimate of the amount of time (in nanoseconds) it takes the hardware to |
| actually stop playback/capture after a <code>Stop</code> command is issued. |
| It may take some time for the hardware to get into fully stopped mode, for example due |
| a power state change. This delay must be taken into account if playback/capture of samples |
| after a 'Stop' command is not acceptable. Optional. |
| If not included <code>turn_off_delay</code> is unknown.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### DaiProperties {#DaiProperties data-text="DaiProperties"} |
| |
| |
| *Defined in [fuchsia.hardware.audio/dai.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai.fidl;l=12)* |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="DaiProperties.is_input"> |
| <td><h3 id="DaiProperties.is_input" class="add-link hide-from-toc">1</h3></td> |
| <td><code>is_input</code></td> |
| <td> |
| <code>bool</code> |
| </td> |
| <td><p>Dai type is input or output. Required.</p> |
| </td> |
| </tr> |
| <tr id="DaiProperties.manufacturer"> |
| <td><h3 id="DaiProperties.manufacturer" class="add-link hide-from-toc">2</h3></td> |
| <td><code>manufacturer</code></td> |
| <td> |
| <code>string[256]</code> |
| </td> |
| <td><p>Name of the DAI interface provider manufacturer. If not included, the manufacturer is |
| unspecified.</p> |
| </td> |
| </tr> |
| <tr id="DaiProperties.product_name"> |
| <td><h3 id="DaiProperties.product_name" class="add-link hide-from-toc">3</h3></td> |
| <td><code>product_name</code></td> |
| <td> |
| <code>string[256]</code> |
| </td> |
| <td><p>Product name of the DAI interface provider. If not included, the product name is |
| unspecified.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### Format {#Format data-text="Format"} |
| |
| |
| *Defined in [fuchsia.hardware.audio/stream.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=93)* |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="Format.pcm_format"> |
| <td><h3 id="Format.pcm_format" class="add-link hide-from-toc">1</h3></td> |
| <td><code>pcm_format</code></td> |
| <td> |
| <code><a class='link' href='#PcmFormat'>PcmFormat</a></code> |
| </td> |
| <td><p>Format supporting non-compressed PCM samples. Required.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### GainFormat {#GainFormat data-text="GainFormat"} |
| |
| |
| *Defined in [fuchsia.hardware.audio/codec.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/codec.fidl;l=31)* |
| <p>Gain format/parameters.</p> |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="GainFormat.type"> |
| <td><h3 id="GainFormat.type" class="add-link hide-from-toc">1</h3></td> |
| <td><code>type</code></td> |
| <td> |
| <code><a class='link' href='#GainType'>GainType</a></code> |
| </td> |
| <td><p>Specifies what the numbers for gain represent, e.g. a percentage. Required.</p> |
| </td> |
| </tr> |
| <tr id="GainFormat.min_gain"> |
| <td><h3 id="GainFormat.min_gain" class="add-link hide-from-toc">2</h3></td> |
| <td><code>min_gain</code></td> |
| <td> |
| <code>float32</code> |
| </td> |
| <td><p>Minimum gain. Required.</p> |
| </td> |
| </tr> |
| <tr id="GainFormat.max_gain"> |
| <td><h3 id="GainFormat.max_gain" class="add-link hide-from-toc">3</h3></td> |
| <td><code>max_gain</code></td> |
| <td> |
| <code>float32</code> |
| </td> |
| <td><p>Maximum gain. Required.</p> |
| </td> |
| </tr> |
| <tr id="GainFormat.gain_step"> |
| <td><h3 id="GainFormat.gain_step" class="add-link hide-from-toc">4</h3></td> |
| <td><code>gain_step</code></td> |
| <td> |
| <code>float32</code> |
| </td> |
| <td><p>Gain step in decibels, this value must not be negative, but may be zero to convey an |
| effectively continuous range of values. Must not exceed <code>max_gain_db</code> - <code>min_gain_db</code>. |
| Required.</p> |
| </td> |
| </tr> |
| <tr id="GainFormat.can_mute"> |
| <td><h3 id="GainFormat.can_mute" class="add-link hide-from-toc">5</h3></td> |
| <td><code>can_mute</code></td> |
| <td> |
| <code>bool</code> |
| </td> |
| <td><p>Gain mute capability. If not included, mute is not supported.</p> |
| </td> |
| </tr> |
| <tr id="GainFormat.can_agc"> |
| <td><h3 id="GainFormat.can_agc" class="add-link hide-from-toc">6</h3></td> |
| <td><code>can_agc</code></td> |
| <td> |
| <code>bool</code> |
| </td> |
| <td><p>Automatic Gain Control (AGC) capability. If not included, AGC is not supported.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### GainState {#GainState data-text="GainState"} |
| |
| |
| *Defined in [fuchsia.hardware.audio/stream.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=123)* |
| <p>Gain state requested by the client or returned by the driver.</p> |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="GainState.muted"> |
| <td><h3 id="GainState.muted" class="add-link hide-from-toc">1</h3></td> |
| <td><code>muted</code></td> |
| <td> |
| <code>bool</code> |
| </td> |
| <td><p>Current mute state. If not included, the state is unmuted.</p> |
| </td> |
| </tr> |
| <tr id="GainState.agc_enabled"> |
| <td><h3 id="GainState.agc_enabled" class="add-link hide-from-toc">2</h3></td> |
| <td><code>agc_enabled</code></td> |
| <td> |
| <code>bool</code> |
| </td> |
| <td><p>Current Automatic Gain Control (AGC) state. If not included, AGC is disabled.</p> |
| </td> |
| </tr> |
| <tr id="GainState.gain_db"> |
| <td><h3 id="GainState.gain_db" class="add-link hide-from-toc">3</h3></td> |
| <td><code>gain_db</code></td> |
| <td> |
| <code>float32</code> |
| </td> |
| <td><p>Current gain in decibels. Required.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### HealthState {#HealthState data-text="HealthState"} |
| |
| |
| *Defined in [fuchsia.hardware.audio/health.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/health.fidl;l=6)* |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="HealthState.healthy"> |
| <td><h3 id="HealthState.healthy" class="add-link hide-from-toc">1</h3></td> |
| <td><code>healthy</code></td> |
| <td> |
| <code>bool</code> |
| </td> |
| <td><p>Driver is currently healthy. Optional. |
| No health information is provided if this field is not included. |
| This allows drivers to signal their health state in scenarios where they have not enough |
| capabilities or resources to recover on their own, for instance not able to power down the |
| hardware via a GPIO or control over the power subsystem.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### PcmSupportedFormats {#PcmSupportedFormats data-text="PcmSupportedFormats"} |
| |
| |
| *Defined in [fuchsia.hardware.audio/stream.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=69)* |
| <p>Format supporting non-compressed PCM audio. Frames are made up of number of channels samples |
| which have <code>valid_bits_per_sample</code> bits of left-justified data within <code>bytes_per_sample</code> |
| bytes. All values listed in each vector are supported. When not all combinations supported by |
| the driver can be described with one <code>SupportedFormats</code> (and hence one <code>PcmSupportedFormats</code>), |
| <code>GetSupportedFormats</code> returns more than one <code>SupportedFormats</code> in the returned vector. |
| For more detailed information see <a href="https://fuchsia.dev/fuchsia-src/concepts/drivers/driver_architectures/audio_drivers/audio_streaming">Audio Driver Streaming Interface</a>.</p> |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="PcmSupportedFormats.channel_sets"> |
| <td><h3 id="PcmSupportedFormats.channel_sets" class="add-link hide-from-toc">1</h3></td> |
| <td><code>channel_sets</code></td> |
| <td> |
| <code>vector<<a class='link' href='#ChannelSet'>ChannelSet</a>>[64]</code> |
| </td> |
| <td><p>Vector of possible <code>ChannelSets</code> supported. Required. |
| A <code>ChannelSet</code> defines a number of channels supported plus a number of optional |
| attributes for these channels. |
| Only one <code>ChannelSet</code> is allowed for each unique number of channels.</p> |
| </td> |
| </tr> |
| <tr id="PcmSupportedFormats.sample_formats"> |
| <td><h3 id="PcmSupportedFormats.sample_formats" class="add-link hide-from-toc">2</h3></td> |
| <td><code>sample_formats</code></td> |
| <td> |
| <code>vector<<a class='link' href='#SampleFormat'>SampleFormat</a>>[3]</code> |
| </td> |
| <td><p>Vector of possible <code>SampleFormat</code>s supported. Required.</p> |
| </td> |
| </tr> |
| <tr id="PcmSupportedFormats.bytes_per_sample"> |
| <td><h3 id="PcmSupportedFormats.bytes_per_sample" class="add-link hide-from-toc">3</h3></td> |
| <td><code>bytes_per_sample</code></td> |
| <td> |
| <code>vector<uint8>[8]</code> |
| </td> |
| <td><p>Vector of possible number of bits allocated to hold a sample, |
| equal or bigger than the actual sample size in <code>valid_bits_per_sample</code> in ascending order. |
| Required.</p> |
| </td> |
| </tr> |
| <tr id="PcmSupportedFormats.valid_bits_per_sample"> |
| <td><h3 id="PcmSupportedFormats.valid_bits_per_sample" class="add-link hide-from-toc">4</h3></td> |
| <td><code>valid_bits_per_sample</code></td> |
| <td> |
| <code>vector<uint8>[8]</code> |
| </td> |
| <td><p>Vector of possible number of bits in a sample in ascending order, must be equal or smaller |
| than <code>bytes_per_channel</code> for samples to fit. If smaller, bits are left justified, and any |
| additional bits will be ignored. Required.</p> |
| </td> |
| </tr> |
| <tr id="PcmSupportedFormats.frame_rates"> |
| <td><h3 id="PcmSupportedFormats.frame_rates" class="add-link hide-from-toc">5</h3></td> |
| <td><code>frame_rates</code></td> |
| <td> |
| <code>vector<uint32>[64]</code> |
| </td> |
| <td><p>Vector of possible frame rates supported in ascending order. Required.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### PlugState {#PlugState data-text="PlugState"} |
| |
| |
| *Defined in [fuchsia.hardware.audio/stream.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=138)* |
| <p>Plug state as returned by the driver. |
| If the driver reports a <code>plug_detect_capabilities</code> equal to HARDWIRED, then the driver should |
| respond to <code>WatchPlugState</code> only the first time it is called, with <code>plugged</code> set to true and |
| <code>plug_state_time</code> set to time '0'.</p> |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="PlugState.plugged"> |
| <td><h3 id="PlugState.plugged" class="add-link hide-from-toc">1</h3></td> |
| <td><code>plugged</code></td> |
| <td> |
| <code>bool</code> |
| </td> |
| <td><p>Stream is currently plugged in. Required</p> |
| </td> |
| </tr> |
| <tr id="PlugState.plug_state_time"> |
| <td><h3 id="PlugState.plug_state_time" class="add-link hide-from-toc">2</h3></td> |
| <td><code>plug_state_time</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#time'>time</a></code> |
| </td> |
| <td><p>Timestamps the information provided in the rest of the fields of this struct. Required.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### RingBufferProperties {#RingBufferProperties data-text="RingBufferProperties"} |
| |
| |
| *Defined in [fuchsia.hardware.audio/ring_buffer.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/ring_buffer.fidl;l=9)* |
| <p>Properties of the ring buffer. These values don't change once the ring buffer is created.</p> |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="RingBufferProperties.external_delay"> |
| <td><h3 id="RingBufferProperties.external_delay" class="add-link hide-from-toc">1</h3></td> |
| <td><code>external_delay</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#duration'>duration</a></code> |
| </td> |
| <td><p>The driver's best estimate of the external delay present in the presentation pipeline for |
| the chosen format. When precisely synchronizing presentation across multiple entities |
| (e.g. devices), the external delay should be taken into account. |
| If not included <code>external_delay</code> is unknown.</p> |
| </td> |
| </tr> |
| <tr id="RingBufferProperties.fifo_depth"> |
| <td><h3 id="RingBufferProperties.fifo_depth" class="add-link hide-from-toc">2</h3></td> |
| <td><code>fifo_depth</code></td> |
| <td> |
| <code>uint32</code> |
| </td> |
| <td><p>Size (in bytes) representing a temporary buffer used by the driver in order to consume or |
| generate the ring buffer contents. Required. |
| The ring buffer contents must be produced and consumed at the rate specified with the |
| <code>CreateRingBuffer</code> command, however some amount of buffering is required when the data is |
| written into and read from the ring buffer. For playback the data is consumed by the driver |
| by reading ahead up to <code>fifo_depth</code> bytes. For capture the data is produced by the driver |
| holding up to <code>fifo_depth</code> bytes at the time before committing it to main system |
| memory. Hence <code>fifo_depth</code> must be taken into account by the client when determining either |
| the minimum lead time requirement (for playback) or the maximum capture delay (for capture).</p> |
| <p>To convert <code>fifo_depth</code> to the corresponding number of audio frames, use the frame size |
| returned by <code>CreateRingBuffer</code> in the <code>StreamConfig</code> protocol, note that the <code>fifo_depth</code> |
| is not necessarily a multiple size of an audio frame.</p> |
| <p>The ring buffer data may be directly consumed/generated by hardware, in this case |
| <code>fifo_depth</code> maps directly to the size of a hardware FIFO block, since the hardware FIFO |
| block determines the amount of data read ahead or held back.</p> |
| <p>The ring buffer data may instead be consumed/generated by audio driver software that is |
| conceptually situated between the ring buffer and the audio hardware. In this case, for |
| playback the <code>fifo_depth</code> read ahead amount is set large enough such that the driver |
| guarantees no undetected underruns, this assuming the client is generating the data as |
| determined by the <code>CreateRingBuffer</code> and <code>Start</code> commands. For capture, the |
| <code>fifo_depth</code> held back amount is set large enough such that the driver guarantees no |
| undetected underruns when generating the data as determined by the <code>CreateRingBuffer</code> and |
| <code>Start</code> commands. The driver must set <code>fifo_depth</code> big enough such that the potential |
| delays added by any software interfacing with the audio hardware do not occur under most |
| scenarios, and must detect and report underruns. How an underrun is reported is not defined |
| in this API.</p> |
| </td> |
| </tr> |
| <tr id="RingBufferProperties.needs_cache_flush_or_invalidate"> |
| <td><h3 id="RingBufferProperties.needs_cache_flush_or_invalidate" class="add-link hide-from-toc">3</h3></td> |
| <td><code>needs_cache_flush_or_invalidate</code></td> |
| <td> |
| <code>bool</code> |
| </td> |
| <td><p>When set to true, indicates that clients need to make sure that their data has been flushed |
| all the way to physical memory (in the case of playback) or that their view of the ring |
| buffer will need to be invalidated before read (in the case of capture). Required.</p> |
| </td> |
| </tr> |
| <tr id="RingBufferProperties.turn_on_delay"> |
| <td><h3 id="RingBufferProperties.turn_on_delay" class="add-link hide-from-toc">4</h3></td> |
| <td><code>turn_on_delay</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#duration'>duration</a></code> |
| </td> |
| <td><p>The driver's best estimate of the amount of time it takes the hardware to actually start |
| playback/capture after:</p> |
| <ol> |
| <li>A <code>Start</code> command is completed as defined by the returned <code>start_time</code>, or</li> |
| <li>A channel is moved from the inactive to the active state using the <code>SetActiveChannels</code> |
| command and is completed as defined by the returned <code>set_time</code> making a channel active to |
| actually playback/capture some time after the same channel was made inactive by a previous |
| <code>SetActiveChannels</code> command. |
| It may take some time for the hardware to get into fully operational mode, for example due |
| a power state change or communication delays within the driver's multiple hardware entities |
| as in a Bluetooth driver. This delay must be taken into account if not getting the initial |
| audio samples played or captured is not acceptable. If not included, turn_on_delay is |
| considered 0. |
| If not included <code>turn_on_delay</code> is unknown.</li> |
| </ol> |
| </td> |
| </tr> |
| </table> |
| |
| ### StreamProperties {#StreamProperties data-text="StreamProperties"} |
| |
| |
| *Defined in [fuchsia.hardware.audio/stream.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=154)* |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="StreamProperties.unique_id"> |
| <td><h3 id="StreamProperties.unique_id" class="add-link hide-from-toc">1</h3></td> |
| <td><code>unique_id</code></td> |
| <td> |
| <code>uint8[16]</code> |
| </td> |
| <td><p>A unique identifier. If not included, there is no unique id for the StreamConfig.</p> |
| </td> |
| </tr> |
| <tr id="StreamProperties.is_input"> |
| <td><h3 id="StreamProperties.is_input" class="add-link hide-from-toc">2</h3></td> |
| <td><code>is_input</code></td> |
| <td> |
| <code>bool</code> |
| </td> |
| <td><p>Stream type is input or output. Required.</p> |
| </td> |
| </tr> |
| <tr id="StreamProperties.can_mute"> |
| <td><h3 id="StreamProperties.can_mute" class="add-link hide-from-toc">3</h3></td> |
| <td><code>can_mute</code></td> |
| <td> |
| <code>bool</code> |
| </td> |
| <td><p>Gain mute capability. If not included, the StreamConfig can't mute.</p> |
| </td> |
| </tr> |
| <tr id="StreamProperties.can_agc"> |
| <td><h3 id="StreamProperties.can_agc" class="add-link hide-from-toc">4</h3></td> |
| <td><code>can_agc</code></td> |
| <td> |
| <code>bool</code> |
| </td> |
| <td><p>Automatic Gain Control (AGC) capability. If not included, the StreamConfig can't AGC.</p> |
| </td> |
| </tr> |
| <tr id="StreamProperties.min_gain_db"> |
| <td><h3 id="StreamProperties.min_gain_db" class="add-link hide-from-toc">5</h3></td> |
| <td><code>min_gain_db</code></td> |
| <td> |
| <code>float32</code> |
| </td> |
| <td><p>Minimum gain in decibels. Required.</p> |
| </td> |
| </tr> |
| <tr id="StreamProperties.max_gain_db"> |
| <td><h3 id="StreamProperties.max_gain_db" class="add-link hide-from-toc">6</h3></td> |
| <td><code>max_gain_db</code></td> |
| <td> |
| <code>float32</code> |
| </td> |
| <td><p>Maximum gain in decibels. Required.</p> |
| </td> |
| </tr> |
| <tr id="StreamProperties.gain_step_db"> |
| <td><h3 id="StreamProperties.gain_step_db" class="add-link hide-from-toc">7</h3></td> |
| <td><code>gain_step_db</code></td> |
| <td> |
| <code>float32</code> |
| </td> |
| <td><p>Gain step in decibels, this value must not be negative, but may be zero to convey an |
| effectively continuous range of values. Must not exceed <code>max_gain_db</code> - <code>min_gain_db</code>. |
| Required.</p> |
| </td> |
| </tr> |
| <tr id="StreamProperties.plug_detect_capabilities"> |
| <td><h3 id="StreamProperties.plug_detect_capabilities" class="add-link hide-from-toc">8</h3></td> |
| <td><code>plug_detect_capabilities</code></td> |
| <td> |
| <code><a class='link' href='#PlugDetectCapabilities'>PlugDetectCapabilities</a></code> |
| </td> |
| <td><p>Plug Detect Capabilities. Required.</p> |
| </td> |
| </tr> |
| <tr id="StreamProperties.manufacturer"> |
| <td><h3 id="StreamProperties.manufacturer" class="add-link hide-from-toc">9</h3></td> |
| <td><code>manufacturer</code></td> |
| <td> |
| <code>string[256]</code> |
| </td> |
| <td><p>UI string for the manufacturer name. If not included, the manufacturer is unspecified.</p> |
| </td> |
| </tr> |
| <tr id="StreamProperties.product"> |
| <td><h3 id="StreamProperties.product" class="add-link hide-from-toc">10</h3></td> |
| <td><code>product</code></td> |
| <td> |
| <code>string[256]</code> |
| </td> |
| <td><p>UI string for the product name. If not included, the product name is unspecified.</p> |
| </td> |
| </tr> |
| <tr id="StreamProperties.clock_domain"> |
| <td><h3 id="StreamProperties.clock_domain" class="add-link hide-from-toc">11</h3></td> |
| <td><code>clock_domain</code></td> |
| <td> |
| <code><a class='link' href='#clock_domain'>clock_domain</a></code> |
| </td> |
| <td><p>An identifier for the clock domain in which this hardware operates. If |
| two hardware devices have the same clock domain, their clock rates are |
| identical and perfectly synchronized. Although these two clocks have the |
| same rate, the clock positions may be offset from each other by an |
| arbitrary (but fixed) amount. The clock_domain typically comes from a |
| system wide entity, such as a platform bus or global clock tree.</p> |
| <p>There are two special values:</p> |
| <ul> |
| <li> |
| <p>CLOCK_DOMAIN_MONOTONIC means the hardware is operating at the same |
| rate as the system montonic clock.</p> |
| </li> |
| <li> |
| <p>CLOCK_DOMAIN_EXTERNAL means the hardware is operating at an unknown |
| rate and is not synchronized with any known clock, not even with |
| other clocks in domain CLOCK_DOMAIN_EXTERNAL.</p> |
| </li> |
| </ul> |
| <p>If the domain is not CLOCK_DOMAIN_MONOTONIC, client must use position |
| notification updates to recover the hardware's clock.</p> |
| <p>Required.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### SupportedFormats {#SupportedFormats data-text="SupportedFormats"} |
| |
| |
| *Defined in [fuchsia.hardware.audio/stream.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=58)* |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="SupportedFormats.pcm_supported_formats"> |
| <td><h3 id="SupportedFormats.pcm_supported_formats" class="add-link hide-from-toc">1</h3></td> |
| <td><code>pcm_supported_formats</code></td> |
| <td> |
| <code><a class='link' href='#PcmSupportedFormats'>PcmSupportedFormats</a></code> |
| </td> |
| <td><p>Supported formats for non-compressed PCM samples with attributes. Required.</p> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ## **UNIONS** |
| |
| ### Codec_GetDaiFormats_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Codec_GetDaiFormats_Result data-text="Codec_GetDaiFormats_Result"} |
| *Defined in [fuchsia.hardware.audio/codec.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/codec.fidl;l=137)* |
| <table> |
| <tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr> |
| <tr id="Codec_GetDaiFormats_Result.response"> |
| <td><h3 id="Codec_GetDaiFormats_Result.response" class="add-link hide-from-toc">1</h3></td> |
| <td><code>response</code></td> |
| <td> |
| <code><a class='link' href='#Codec_GetDaiFormats_Response'>Codec_GetDaiFormats_Response</a></code> |
| </td> |
| <td></td> |
| </tr> |
| <tr id="Codec_GetDaiFormats_Result.err"> |
| <td><h3 id="Codec_GetDaiFormats_Result.err" class="add-link hide-from-toc">2</h3></td> |
| <td><code>err</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code> |
| </td> |
| <td></td> |
| </tr> |
| </table> |
| |
| ### Codec_SetDaiFormat_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Codec_SetDaiFormat_Result data-text="Codec_SetDaiFormat_Result"} |
| *Defined in [fuchsia.hardware.audio/codec.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/codec.fidl;l=146)* |
| <table> |
| <tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr> |
| <tr id="Codec_SetDaiFormat_Result.response"> |
| <td><h3 id="Codec_SetDaiFormat_Result.response" class="add-link hide-from-toc">1</h3></td> |
| <td><code>response</code></td> |
| <td> |
| <code><a class='link' href='#Codec_SetDaiFormat_Response'>Codec_SetDaiFormat_Response</a></code> |
| </td> |
| <td></td> |
| </tr> |
| <tr id="Codec_SetDaiFormat_Result.err"> |
| <td><h3 id="Codec_SetDaiFormat_Result.err" class="add-link hide-from-toc">2</h3></td> |
| <td><code>err</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code> |
| </td> |
| <td></td> |
| </tr> |
| </table> |
| |
| ### DaiFrameFormat [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#DaiFrameFormat data-text="DaiFrameFormat"} |
| *Defined in [fuchsia.hardware.audio/dai_format.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai_format.fidl;l=28)* |
| <p>Either a standard or custom frame format.</p> |
| <table> |
| <tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr> |
| <tr id="DaiFrameFormat.frame_format_standard"> |
| <td><h3 id="DaiFrameFormat.frame_format_standard" class="add-link hide-from-toc">1</h3></td> |
| <td><code>frame_format_standard</code></td> |
| <td> |
| <code><a class='link' href='#DaiFrameFormatStandard'>DaiFrameFormatStandard</a></code> |
| </td> |
| <td><p>The format type of all samples in the DAI, listed in <code>DaiFrameFormatStandard</code>.</p> |
| </td> |
| </tr> |
| <tr id="DaiFrameFormat.frame_format_custom"> |
| <td><h3 id="DaiFrameFormat.frame_format_custom" class="add-link hide-from-toc">2</h3></td> |
| <td><code>frame_format_custom</code></td> |
| <td> |
| <code><a class='link' href='#DaiFrameFormatCustom'>DaiFrameFormatCustom</a></code> |
| </td> |
| <td><p>The format type of all samples in the DAI, specified in <code>DaiFrameFormatCustom</code>.</p> |
| </td> |
| </tr> |
| </table> |
| |
| ### Dai_GetDaiFormats_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Dai_GetDaiFormats_Result data-text="Dai_GetDaiFormats_Result"} |
| *Defined in [fuchsia.hardware.audio/dai.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai.fidl;l=50)* |
| <table> |
| <tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr> |
| <tr id="Dai_GetDaiFormats_Result.response"> |
| <td><h3 id="Dai_GetDaiFormats_Result.response" class="add-link hide-from-toc">1</h3></td> |
| <td><code>response</code></td> |
| <td> |
| <code><a class='link' href='#Dai_GetDaiFormats_Response'>Dai_GetDaiFormats_Response</a></code> |
| </td> |
| <td></td> |
| </tr> |
| <tr id="Dai_GetDaiFormats_Result.err"> |
| <td><h3 id="Dai_GetDaiFormats_Result.err" class="add-link hide-from-toc">2</h3></td> |
| <td><code>err</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code> |
| </td> |
| <td></td> |
| </tr> |
| </table> |
| |
| ### Dai_GetRingBufferFormats_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Dai_GetRingBufferFormats_Result data-text="Dai_GetRingBufferFormats_Result"} |
| *Defined in [fuchsia.hardware.audio/dai.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai.fidl;l=58)* |
| <table> |
| <tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr> |
| <tr id="Dai_GetRingBufferFormats_Result.response"> |
| <td><h3 id="Dai_GetRingBufferFormats_Result.response" class="add-link hide-from-toc">1</h3></td> |
| <td><code>response</code></td> |
| <td> |
| <code><a class='link' href='#Dai_GetRingBufferFormats_Response'>Dai_GetRingBufferFormats_Response</a></code> |
| </td> |
| <td></td> |
| </tr> |
| <tr id="Dai_GetRingBufferFormats_Result.err"> |
| <td><h3 id="Dai_GetRingBufferFormats_Result.err" class="add-link hide-from-toc">2</h3></td> |
| <td><code>err</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code> |
| </td> |
| <td></td> |
| </tr> |
| </table> |
| |
| ### RingBuffer_GetVmo_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#RingBuffer_GetVmo_Result data-text="RingBuffer_GetVmo_Result"} |
| *Defined in [fuchsia.hardware.audio/ring_buffer.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/ring_buffer.fidl;l=123)* |
| <table> |
| <tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr> |
| <tr id="RingBuffer_GetVmo_Result.response"> |
| <td><h3 id="RingBuffer_GetVmo_Result.response" class="add-link hide-from-toc">1</h3></td> |
| <td><code>response</code></td> |
| <td> |
| <code><a class='link' href='#RingBuffer_GetVmo_Response'>RingBuffer_GetVmo_Response</a></code> |
| </td> |
| <td></td> |
| </tr> |
| <tr id="RingBuffer_GetVmo_Result.err"> |
| <td><h3 id="RingBuffer_GetVmo_Result.err" class="add-link hide-from-toc">2</h3></td> |
| <td><code>err</code></td> |
| <td> |
| <code><a class='link' href='#GetVmoError'>GetVmoError</a></code> |
| </td> |
| <td></td> |
| </tr> |
| </table> |
| |
| ### RingBuffer_SetActiveChannels_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#RingBuffer_SetActiveChannels_Result data-text="RingBuffer_SetActiveChannels_Result"} |
| *Defined in [fuchsia.hardware.audio/ring_buffer.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/ring_buffer.fidl;l=168)* |
| <table> |
| <tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr> |
| <tr id="RingBuffer_SetActiveChannels_Result.response"> |
| <td><h3 id="RingBuffer_SetActiveChannels_Result.response" class="add-link hide-from-toc">1</h3></td> |
| <td><code>response</code></td> |
| <td> |
| <code><a class='link' href='#RingBuffer_SetActiveChannels_Response'>RingBuffer_SetActiveChannels_Response</a></code> |
| </td> |
| <td></td> |
| </tr> |
| <tr id="RingBuffer_SetActiveChannels_Result.err"> |
| <td><h3 id="RingBuffer_SetActiveChannels_Result.err" class="add-link hide-from-toc">2</h3></td> |
| <td><code>err</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code> |
| </td> |
| <td></td> |
| </tr> |
| </table> |
| |
| |
| |
| ## **CONSTANTS** |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Type</th><th>Description</th></tr> |
| <tr id="CLOCK_DOMAIN_EXTERNAL"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=22">CLOCK_DOMAIN_EXTERNAL</a></td> |
| <td> |
| <code>4294967295</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="CLOCK_DOMAIN_MONOTONIC"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=21">CLOCK_DOMAIN_MONOTONIC</a></td> |
| <td> |
| <code>0</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="MAX_COUNT_CHANNELS_IN_RING_BUFFER"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=11">MAX_COUNT_CHANNELS_IN_RING_BUFFER</a></td> |
| <td> |
| <code>64</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="MAX_COUNT_CHANNEL_SETS"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=13">MAX_COUNT_CHANNEL_SETS</a></td> |
| <td> |
| <code>64</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="MAX_COUNT_DAI_FORMATS"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai.fidl;l=10">MAX_COUNT_DAI_FORMATS</a></td> |
| <td> |
| <code>64</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="MAX_COUNT_DAI_SUPPORTED_BITS_PER_SAMPLE"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai_format.fidl;l=11">MAX_COUNT_DAI_SUPPORTED_BITS_PER_SAMPLE</a></td> |
| <td> |
| <code>8</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="MAX_COUNT_DAI_SUPPORTED_BITS_PER_SLOT"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai_format.fidl;l=10">MAX_COUNT_DAI_SUPPORTED_BITS_PER_SLOT</a></td> |
| <td> |
| <code>8</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="MAX_COUNT_DAI_SUPPORTED_FRAME_FORMATS"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai_format.fidl;l=8">MAX_COUNT_DAI_SUPPORTED_FRAME_FORMATS</a></td> |
| <td> |
| <code>64</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="MAX_COUNT_DAI_SUPPORTED_NUMBER_OF_CHANNELS"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai_format.fidl;l=6">MAX_COUNT_DAI_SUPPORTED_NUMBER_OF_CHANNELS</a></td> |
| <td> |
| <code>64</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="MAX_COUNT_DAI_SUPPORTED_RATES"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai_format.fidl;l=9">MAX_COUNT_DAI_SUPPORTED_RATES</a></td> |
| <td> |
| <code>64</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="MAX_COUNT_DAI_SUPPORTED_SAMPLE_FORMATS"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai_format.fidl;l=7">MAX_COUNT_DAI_SUPPORTED_SAMPLE_FORMATS</a></td> |
| <td> |
| <code>4</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="MAX_COUNT_FORMATS"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=18">MAX_COUNT_FORMATS</a></td> |
| <td> |
| <code>64</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="MAX_COUNT_SUPPORTED_BYTES_PER_SAMPLE"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=16">MAX_COUNT_SUPPORTED_BYTES_PER_SAMPLE</a></td> |
| <td> |
| <code>8</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="MAX_COUNT_SUPPORTED_NUMBER_OF_CHANNELS"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=12">MAX_COUNT_SUPPORTED_NUMBER_OF_CHANNELS</a></td> |
| <td> |
| <code>64</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="MAX_COUNT_SUPPORTED_RATES"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=15">MAX_COUNT_SUPPORTED_RATES</a></td> |
| <td> |
| <code>64</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="MAX_COUNT_SUPPORTED_SAMPLE_FORMATS"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=14">MAX_COUNT_SUPPORTED_SAMPLE_FORMATS</a></td> |
| <td> |
| <code>3</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="MAX_COUNT_SUPPORTED_VALID_BITS_PER_SAMPLE"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=17">MAX_COUNT_SUPPORTED_VALID_BITS_PER_SAMPLE</a></td> |
| <td> |
| <code>8</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="MAX_DAI_UI_STRING_SIZE"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/dai.fidl;l=9">MAX_DAI_UI_STRING_SIZE</a></td> |
| <td> |
| <code>256</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="MAX_UI_STRING_SIZE"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=10">MAX_UI_STRING_SIZE</a></td> |
| <td> |
| <code>256</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| <tr id="UNIQUE_ID_SIZE"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=9">UNIQUE_ID_SIZE</a></td> |
| <td> |
| <code>16</code> |
| </td> |
| <td><code>uint32</code></td> |
| <td></td> |
| </tr> |
| </table> |
| |
| ## **TYPE ALIASES** |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="clock_domain"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.hardware.audio/stream.fidl;l=20">clock_domain</a></td> |
| <td> |
| <code>uint32</code></td> |
| <td></td> |
| </tr> |
| </table> |