~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/sound/sof/stream.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
  2 /*
  3  * This file is provided under a dual BSD/GPLv2 license.  When using or
  4  * redistributing this file, you may do so under either license.
  5  *
  6  * Copyright(c) 2018 Intel Corporation
  7  */
  8 
  9 #ifndef __INCLUDE_SOUND_SOF_STREAM_H__
 10 #define __INCLUDE_SOUND_SOF_STREAM_H__
 11 
 12 #include <sound/sof/header.h>
 13 
 14 /*
 15  * Stream configuration.
 16  */
 17 
 18 #define SOF_IPC_MAX_CHANNELS                    8
 19 
 20 /* common sample rates for use in masks */
 21 #define SOF_RATE_8000           (1 <<  0) /**< 8000Hz  */
 22 #define SOF_RATE_11025          (1 <<  1) /**< 11025Hz */
 23 #define SOF_RATE_12000          (1 <<  2) /**< 12000Hz */
 24 #define SOF_RATE_16000          (1 <<  3) /**< 16000Hz */
 25 #define SOF_RATE_22050          (1 <<  4) /**< 22050Hz */
 26 #define SOF_RATE_24000          (1 <<  5) /**< 24000Hz */
 27 #define SOF_RATE_32000          (1 <<  6) /**< 32000Hz */
 28 #define SOF_RATE_44100          (1 <<  7) /**< 44100Hz */
 29 #define SOF_RATE_48000          (1 <<  8) /**< 48000Hz */
 30 #define SOF_RATE_64000          (1 <<  9) /**< 64000Hz */
 31 #define SOF_RATE_88200          (1 << 10) /**< 88200Hz */
 32 #define SOF_RATE_96000          (1 << 11) /**< 96000Hz */
 33 #define SOF_RATE_176400         (1 << 12) /**< 176400Hz */
 34 #define SOF_RATE_192000         (1 << 13) /**< 192000Hz */
 35 
 36 /* continuous and non-standard rates for flexibility */
 37 #define SOF_RATE_CONTINUOUS     (1 << 30)  /**< range */
 38 #define SOF_RATE_KNOT           (1 << 31)  /**< non-continuous */
 39 
 40 /* generic PCM flags for runtime settings */
 41 #define SOF_PCM_FLAG_XRUN_STOP  (1 << 0) /**< Stop on any XRUN */
 42 
 43 /* stream PCM frame format */
 44 enum sof_ipc_frame {
 45         SOF_IPC_FRAME_S16_LE = 0,
 46         SOF_IPC_FRAME_S24_4LE,
 47         SOF_IPC_FRAME_S32_LE,
 48         SOF_IPC_FRAME_FLOAT,
 49         /* other formats here */
 50 };
 51 
 52 /* stream buffer format */
 53 enum sof_ipc_buffer_format {
 54         SOF_IPC_BUFFER_INTERLEAVED,
 55         SOF_IPC_BUFFER_NONINTERLEAVED,
 56         /* other formats here */
 57 };
 58 
 59 /* stream direction */
 60 enum sof_ipc_stream_direction {
 61         SOF_IPC_STREAM_PLAYBACK = 0,
 62         SOF_IPC_STREAM_CAPTURE,
 63 };
 64 
 65 /* stream ring info */
 66 struct sof_ipc_host_buffer {
 67         struct sof_ipc_hdr hdr;
 68         uint32_t phy_addr;
 69         uint32_t pages;
 70         uint32_t size;
 71         uint32_t reserved[3];
 72 } __packed;
 73 
 74 struct sof_ipc_stream_params {
 75         struct sof_ipc_hdr hdr;
 76         struct sof_ipc_host_buffer buffer;
 77         uint32_t direction;     /**< enum sof_ipc_stream_direction */
 78         uint32_t frame_fmt;     /**< enum sof_ipc_frame */
 79         uint32_t buffer_fmt;    /**< enum sof_ipc_buffer_format */
 80         uint32_t rate;
 81         uint16_t stream_tag;
 82         uint16_t channels;
 83         uint16_t sample_valid_bytes;
 84         uint16_t sample_container_bytes;
 85 
 86         uint32_t host_period_bytes;
 87         uint16_t no_stream_position; /**< 1 means don't send stream position */
 88         uint8_t cont_update_posn; /**< 1 means continuous update stream position */
 89         uint8_t reserved0;
 90         int16_t ext_data_length; /**< 0, means no extended data */
 91         uint8_t reserved[2];
 92         uint16_t chmap[SOF_IPC_MAX_CHANNELS];   /**< channel map - SOF_CHMAP_ */
 93         uint8_t ext_data[]; /**< extended data */
 94 } __packed;
 95 
 96 /* PCM params info - SOF_IPC_STREAM_PCM_PARAMS */
 97 struct sof_ipc_pcm_params {
 98         struct sof_ipc_cmd_hdr hdr;
 99         uint32_t comp_id;
100         uint32_t flags;         /**< generic PCM flags - SOF_PCM_FLAG_ */
101         uint32_t reserved[2];
102         struct sof_ipc_stream_params params;
103 }  __packed;
104 
105 /* PCM params info reply - SOF_IPC_STREAM_PCM_PARAMS_REPLY */
106 struct sof_ipc_pcm_params_reply {
107         struct sof_ipc_reply rhdr;
108         uint32_t comp_id;
109         uint32_t posn_offset;
110 } __packed;
111 
112 /* free stream - SOF_IPC_STREAM_PCM_PARAMS */
113 struct sof_ipc_stream {
114         struct sof_ipc_cmd_hdr hdr;
115         uint32_t comp_id;
116 } __packed;
117 
118 /* flags indicating which time stamps are in sync with each other */
119 #define SOF_TIME_HOST_SYNC      (1 << 0)
120 #define SOF_TIME_DAI_SYNC       (1 << 1)
121 #define SOF_TIME_WALL_SYNC      (1 << 2)
122 #define SOF_TIME_STAMP_SYNC     (1 << 3)
123 
124 /* flags indicating which time stamps are valid */
125 #define SOF_TIME_HOST_VALID     (1 << 8)
126 #define SOF_TIME_DAI_VALID      (1 << 9)
127 #define SOF_TIME_WALL_VALID     (1 << 10)
128 #define SOF_TIME_STAMP_VALID    (1 << 11)
129 
130 /* flags indicating time stamps are 64bit else 3use low 32bit */
131 #define SOF_TIME_HOST_64        (1 << 16)
132 #define SOF_TIME_DAI_64         (1 << 17)
133 #define SOF_TIME_WALL_64        (1 << 18)
134 #define SOF_TIME_STAMP_64       (1 << 19)
135 
136 struct sof_ipc_stream_posn {
137         struct sof_ipc_reply rhdr;
138         uint32_t comp_id;       /**< host component ID */
139         uint32_t flags;         /**< SOF_TIME_ */
140         uint32_t wallclock_hz;  /**< frequency of wallclock in Hz */
141         uint32_t timestamp_ns;  /**< resolution of timestamp in ns */
142         uint64_t host_posn;     /**< host DMA position in bytes */
143         uint64_t dai_posn;      /**< DAI DMA position in bytes */
144         uint64_t comp_posn;     /**< comp position in bytes */
145         uint64_t wallclock;     /**< audio wall clock */
146         uint64_t timestamp;     /**< system time stamp */
147         uint32_t xrun_comp_id;  /**< comp ID of XRUN component */
148         int32_t xrun_size;      /**< XRUN size in bytes */
149 }  __packed;
150 
151 #endif
152 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php