aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/sound
diff options
context:
space:
mode:
authorJeeja KP <jeeja.kp@intel.com>2013-02-14 06:22:51 -0500
committerTakashi Iwai <tiwai@suse.de>2013-02-14 06:30:22 -0500
commit9727b490e543de956b8ba356e2d5499097d0b7a2 (patch)
tree81c41ee5b9987fdcb32c474484c39f45210507c0 /Documentation/sound
parent8be69efacdc73fc110624f847bdf04b83decfc70 (diff)
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 Signed-off-by: Jeeja KP <jeeja.kp@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'Documentation/sound')
-rw-r--r--Documentation/sound/alsa/compress_offload.txt46
1 files changed, 46 insertions, 0 deletions
diff --git a/Documentation/sound/alsa/compress_offload.txt b/Documentation/sound/alsa/compress_offload.txt
index 90e9b3a11abc..0bcc55155911 100644
--- a/Documentation/sound/alsa/compress_offload.txt
+++ b/Documentation/sound/alsa/compress_offload.txt
@@ -145,6 +145,52 @@ Modifications include:
145- Addition of encoding options when required (derived from OpenMAX IL) 145- Addition of encoding options when required (derived from OpenMAX IL)
146- Addition of rateControlSupported (missing in OpenMAX AL) 146- Addition of rateControlSupported (missing in OpenMAX AL)
147 147
148Gapless Playback
149================
150When playing thru an album, the decoders have the ability to skip the encoder
151delay and padding and directly move from one track content to another. The end
152user can perceive this as gapless playback as we dont have silence while
153switching from one track to another
154
155Also, there might be low-intensity noises due to encoding. Perfect gapless is
156difficult to reach with all types of compressed data, but works fine with most
157music content. The decoder needs to know the encoder delay and encoder padding.
158So we need to pass this to DSP. This metadata is extracted from ID3/MP4 headers
159and are not present by default in the bitstream, hence the need for a new
160interface to pass this information to the DSP. Also DSP and userspace needs to
161switch from one track to another and start using data for second track.
162
163The main additions are:
164
165- set_metadata
166This routine sets the encoder delay and encoder padding. This can be used by
167decoder to strip the silence. This needs to be set before the data in the track
168is written.
169
170- set_next_track
171This routine tells DSP that metadata and write operation sent after this would
172correspond to subsequent track
173
174- partial drain
175This is called when end of file is reached. The userspace can inform DSP that
176EOF is reached and now DSP can start skipping padding delay. Also next write
177data would belong to next track
178
179Sequence flow for gapless would be:
180- Open
181- Get caps / codec caps
182- Set params
183- Set metadata of the first track
184- Fill data of the first track
185- Trigger start
186- User-space finished sending all,
187- Indicaite next track data by sending set_next_track
188- Set metadata of the next track
189- then call partial_drain to flush most of buffer in DSP
190- Fill data of the next track
191- DSP switches to second track
192(note: order for partial_drain and write for next track can be reversed as well)
193
148Not supported: 194Not supported:
149 195
150- Support for VoIP/circuit-switched calls is not the target of this 196- Support for VoIP/circuit-switched calls is not the target of this