History

ALSA: compress: add support for gapless playback

this add new API for sound compress to support gapless playback. As noted in Documentation change, we add API to send metadata of encoder and padding delay to DSP. Also add API for indicating EOF and switching to subsequent track Also bump the compress API version

Jeeja KP committed 13 years ago

Commit 9727b491 parent 8be69ef4 files · +180 −1Browse files

Showing the changes to include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/sound/compress_offload.h+30−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 #include <sound/compress_params.h>
3131
3232
33−#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 0)
33+#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 1)
3434 /**
3535 * struct snd_compressed_buffer: compressed buffer
3636 * @fragment_size: size of buffer fragment in bytes
@@ -121,6 +121,27 @@ struct snd_compr_codec_caps { · 84 unmodified lines
121121 struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS];
122122 };
123123
124+/**
125+ * @SNDRV_COMPRESS_ENCODER_PADDING: no of samples appended by the encoder at the
126+ * end of the track
127+ * @SNDRV_COMPRESS_ENCODER_DELAY: no of samples inserted by the encoder at the
128+ * beginning of the track
129+ */
130+enum {
131+ SNDRV_COMPRESS_ENCODER_PADDING = 1,
132+ SNDRV_COMPRESS_ENCODER_DELAY = 2,
133+};
134+
135+/**
136+ * struct snd_compr_metadata: compressed stream metadata
137+ * @key: key id
138+ * @value: key value
139+ */
140+struct snd_compr_metadata {
141+ __u32 key;
142+ __u32 value[8];
143+};
144+
124145 /**
125146 * compress path ioctl definitions
126147 * SNDRV_COMPRESS_GET_CAPS: Query capability of DSP
@@ -145,6 +166,10 @@ struct snd_compr_codec_caps { · 18 unmodified lines
145166 struct snd_compr_codec_caps)
146167 #define SNDRV_COMPRESS_SET_PARAMS _IOW('C', 0x12, struct snd_compr_params)
147168 #define SNDRV_COMPRESS_GET_PARAMS _IOR('C', 0x13, struct snd_codec)
169+#define SNDRV_COMPRESS_SET_METADATA _IOW('C', 0x14,\
170+ struct snd_compr_metadata)
171+#define SNDRV_COMPRESS_GET_METADATA _IOWR('C', 0x15,\
172+ struct snd_compr_metadata)
148173 #define SNDRV_COMPRESS_TSTAMP _IOR('C', 0x20, struct snd_compr_tstamp)
149174 #define SNDRV_COMPRESS_AVAIL _IOR('C', 0x21, struct snd_compr_avail)
150175 #define SNDRV_COMPRESS_PAUSE _IO('C', 0x30)
@@ -152,10 +177,14 @@ struct snd_compr_codec_caps { · 1 unmodified line
152177 #define SNDRV_COMPRESS_START _IO('C', 0x32)
153178 #define SNDRV_COMPRESS_STOP _IO('C', 0x33)
154179 #define SNDRV_COMPRESS_DRAIN _IO('C', 0x34)
180+#define SNDRV_COMPRESS_NEXT_TRACK _IO('C', 0x35)
181+#define SNDRV_COMPRESS_PARTIAL_DRAIN _IO('C', 0x36)
155182 /*
156183 * TODO
157184 * 1. add mmap support
158185 *
159186 */
160187 #define SND_COMPR_TRIGGER_DRAIN 7 /*FIXME move this to pcm.h */
188+#define SND_COMPR_TRIGGER_NEXT_TRACK 8
189+#define SND_COMPR_TRIGGER_PARTIAL_DRAIN 9
161190 #endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t