#define MAX_NR_RATES 1024 #define MAX_PACKS 6 /* per URB */ #define MAX_PACKS_HS (MAX_PACKS * 8) /* in high speed mode */ #define MAX_URBS 12 #define SYNC_URBS 4 /* always four urbs for sync */ #define MAX_QUEUE 18 /* try not to exceed this queue length, in ms */
struct audioformat { struct list_head list;
u64 formats; /* ALSA format bits */ unsignedint channels; /* # channels */ unsignedint fmt_type; /* USB audio format type (1-3) */ unsignedint fmt_bits; /* number of significant bits */ unsignedint fmt_sz; /* overall audio sub frame/slot size */ unsignedint frame_size; /* samples per frame for non-audio */ unsignedchar iface; /* interface number */ unsignedchar altsetting; /* corresponding alternate setting */ unsignedchar ep_idx; /* endpoint array index */ unsignedchar altset_idx; /* array index of alternate setting */ unsignedchar attributes; /* corresponding attributes of cs endpoint */ unsignedchar endpoint; /* endpoint */ unsignedchar ep_attr; /* endpoint attributes */ bool implicit_fb; /* implicit feedback endpoint */ unsignedchar sync_ep; /* sync endpoint number */ unsignedchar sync_iface; /* sync EP interface */ unsignedchar sync_altsetting; /* sync EP alternate setting */ unsignedchar sync_ep_idx; /* sync EP array index */ unsignedchar datainterval; /* log_2 of data packet interval */ unsignedchar protocol; /* UAC_VERSION_1/2/3 */ unsignedint maxpacksize; /* max. packet size */ unsignedint rates; /* rate bitmasks */ unsignedint rate_min, rate_max; /* min/max rates */ unsignedint nr_rates; /* number of rate table entries */ unsignedint *rate_table; /* rate table */ unsignedchar clock; /* associated clock */ struct snd_pcm_chmap_elem *chmap; /* (optional) channel map */ bool dsd_dop; /* add DOP headers in case of DSD samples */ bool dsd_bitrev; /* reverse the bits of each DSD sample */ bool dsd_raw; /* altsetting is raw DSD */
};
struct snd_urb_ctx { struct urb *urb; unsignedint buffer_size; /* size of data buffer, if data URB */ struct snd_usb_substream *subs; struct snd_usb_endpoint *ep; int index; /* index for urb array */ int packets; /* number of packets per urb */ int queued; /* queued data bytes by this urb */ int packet_size[MAX_PACKS_HS]; /* size of packets for next submission */ struct list_head ready_list;
};
int opened; /* open refcount; protect with chip->mutex */
atomic_t running; /* running status */ int ep_num; /* the referenced endpoint number */ int type; /* SND_USB_ENDPOINT_TYPE_* */
unsignedchar iface; /* interface number */ unsignedchar altsetting; /* corresponding alternate setting */ unsignedchar ep_idx; /* endpoint array index */
struct snd_usb_packet_info {
uint32_t packet_size[MAX_PACKS_HS]; int packets;
} next_packet[MAX_URBS]; unsignedint next_packet_head; /* ring buffer offset to read */ unsignedint next_packet_queued; /* queued items in the ring buffer */ struct list_head ready_playback_urbs; /* playback URB FIFO for implicit fb */
unsignedint nurbs; /* # urbs */ unsignedlong active_mask; /* bitmask of active urbs */ unsignedlong unlink_mask; /* bitmask of unlinked urbs */
atomic_t submitted_urbs; /* currently submitted urbs */ char *syncbuf; /* sync buffer for all sync URBs */
dma_addr_t sync_dma; /* DMA address of syncbuf */
unsignedint pipe; /* the data i/o pipe */ unsignedint packsize[2]; /* small/large packet sizes in samples */ unsignedint sample_rem; /* remainder from division fs/pps */ unsignedint sample_accum; /* sample accumulator */ unsignedint pps; /* packets per second */ unsignedint freqn; /* nominal sampling rate in fs/fps in Q16.16 format */ unsignedint freqm; /* momentary sampling rate in fs/fps in Q16.16 format */ int freqshift; /* how much to shift the feedback value to get Q16.16 */ unsignedint freqmax; /* maximum sampling rate, used for buffer management */ unsignedint phase; /* phase accumulator */ unsignedint maxpacksize; /* max packet size in bytes */ unsignedint maxframesize; /* max packet size in frames */ unsignedint max_urb_frames; /* max URB size in frames */ unsignedint curpacksize; /* current packet size in bytes (for capture) */ unsignedint curframesize; /* current packet size in frames (for capture) */ unsignedint syncmaxsize; /* sync endpoint packet size */ unsignedint fill_max:1; /* fill max packet size always */ unsignedint tenor_fb_quirk:1; /* corrupted feedback data */ unsignedint datainterval; /* log_2 of data packet interval */ unsignedint syncinterval; /* P for adaptive mode, 0 otherwise */ unsignedchar silence_value; unsignedint stride; int skip_packets; /* quirks for devices to ignore the first n packets
in a stream */ bool implicit_fb_sync; /* syncs with implicit feedback */ bool lowlatency_playback; /* low-latency playback mode */ bool need_setup; /* (re-)need for hw_params? */ bool need_prepare; /* (re-)need for prepare? */ bool fixed_rate; /* skip rate setup */
struct snd_usb_substream { struct snd_usb_stream *stream; struct usb_device *dev; struct snd_pcm_substream *pcm_substream; int direction; /* playback or capture */ int endpoint; /* assigned endpoint */ conststruct audioformat *cur_audiofmt; /* current audioformat pointer (for hw_params callback) */ struct snd_usb_power_domain *str_pd; /* UAC3 Power Domain for streaming path */ unsignedint channels_max; /* max channels in the all audiofmts */ unsignedint txfr_quirk:1; /* allow sub-frame alignment */ unsignedint tx_length_quirk:1; /* add length specifier to transfers */ unsignedint fmt_type; /* USB audio format type (1-3) */ unsignedint pkt_offset_adj; /* Bytes to drop from beginning of packets (for non-compliant devices) */ unsignedint stream_offset_adj; /* Bytes to drop from beginning of stream (for non-compliant devices) */
unsignedint opened:1; /* pcm device opened */ unsignedint running: 1; /* running status */ unsignedint period_elapsed_pending; /* delay period handling */
unsignedint buffer_bytes; /* buffer size in bytes */ unsignedint inflight_bytes; /* in-flight data bytes on buffer (for playback) */ unsignedint hwptr_done; /* processed byte position in the buffer */ unsignedint transfer_done; /* processed frames since last period update */ unsignedint frame_limit; /* limits number of packets in URB */
/* data and sync endpoints for this stream */ unsignedint ep_num; /* the endpoint number */ struct snd_usb_endpoint *data_endpoint; struct snd_usb_endpoint *sync_endpoint; unsignedlong flags; unsignedint speed; /* USB_SPEED_XXX */
u64 formats; /* format bitmasks (all or'ed) */ unsignedint num_formats; /* number of supported audio formats (list) */ struct list_head fmt_list; /* format list */
spinlock_t lock;
unsignedint last_frame_number; /* stored frame number */
struct { int marker; int channel; int byte_idx;
} dsd_dop;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.