usb_mic_state_t

Syntax

#include <cafe/usb_mic.h>

typedef enum {
    usb_mic_state_gain_db,
    usb_mic_state_gain_min,
    usb_mic_state_gain_max,
    usb_mic_state_gain_step,
    usb_mic_state_mute,
    usb_mic_state_digital_gain_db,
    usb_mic_state_queue_depth,
    usb_mic_state_xfer_per_entry,
    usb_mic_state_max_queue_depth,
    usb_mic_state_max_xfer_per_entry,
    usb_mic_state_core
} usb_mic_state_t;

Elements

usb_mic_state_gain_db Microphone gain value, in UAC sense.
usb_mic_state_gain_min Read-only value. Minimum gain device supports. Defined in UAC sense.
usb_mic_state_gain_max Read-only value. Maximum gain device supports. Defined in UAC sense.
usb_mic_state_gain_step Read-only value. Gain adjustment granularity of the device. Defined in UAC sense.
usb_mic_state_mute Mute state of the device. Not yet supported.
usb_mic_state_digital_gain_db Not implemented for USB microphone.
usb_mic_state_queue_depth This is a latency tuning parameter that specifies the number of URBs that are submitted to the USB system at a time. Increasing this number improves the resilience of the system under heavy load with respect to seamless playback. Changing this parameter does not change the USB microphone system's computational load. In general, the smaller the number of transfers per entry (see below), the greater this parameter should be. This parameter must be set before playback is started.
usb_mic_xfer_per_entry This integer is a latency tuning parameter that specifies the number of USB transactions per request block. This integer must be at least one. The smaller this value, the greater the rate of interrupts generated and processed in the system, thus increasing the CPU load. At the same time, the amount of buffering needed for seamless playback via AX is reduced. This parameter defines the URB size. This parameter must be set before playback is started.
usb_mic_max_queue_depth Read only value. The value set with usb_mic_state_queue_depth cannot be greater than what is returned with this argument.
usb_mic_max_xfer_per_entry Read only value. The value set with usb_mic_state_xfer_per_entry cannot be greater than what is returned with this argument.
usb_mic_state_core This is a performance tuning parameter to set the core affinity of the USB microphone system. The core is selected with one and only one of: OS_THREAD_ATTR_AFFINITY_CORE0, OS_THREAD_ATTR_AFFINITY_CORE1, or OS_THREAD_ATTR_AFFINITY_CORE2. This parameter must be set before playback is started.

Description

This enumeration defines the various side band parameters that can be adjusted or queried in the USB microphone subsystem.

Latency tuning control variables have been added to the USB microphone system. They control the rate at which USB transfers complete. For example, setting the number transfers per USB request block (URB) to 3 will lead to transfers completing every 3ms. This is the same rate as the AX system. Increasing the rate of USB transfer completion by setting a small value with usb_mic_xfer_per_entry, leads to a reduction of the latency of direct playback: The ring buffer will be refilled at the rate thus specified, and at a high frequency of fill, the buffer will not be drawn down as far between refills. Therefore, the buffering requirement for seamless playback is reduced.

The queue depth specifies how many URBs are queued in the USB system. At a minimum, two URBs need to be queued for seamless capture of USB microphone PCM data.

See Also

USBMICSetState
USBMICGetState

Revision History

2013/05/08 Automated cleanup pass.
2012/08/03 Cleanup Pass
2012/01/06 Initial version.


CONFIDENTIAL