summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-11-22 15:30:59 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-11-22 15:30:59 +0000
commitdb90b606bb8b3ecd2a84a97a4a557ab026287d54 (patch)
tree549db4d7e2bc56c22a6409475d5b40e245fffd87
parentd00d4028e7a30da863489e822935ef6d7dc91242 (diff)
Support multiple periods
-rw-r--r--audio/pcm_bluetooth.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/audio/pcm_bluetooth.c b/audio/pcm_bluetooth.c
index 7192f4f3..815ddd23 100644
--- a/audio/pcm_bluetooth.c
+++ b/audio/pcm_bluetooth.c
@@ -996,7 +996,9 @@ static int bluetooth_a2dp_hw_constraint(snd_pcm_ioplug_t *io)
unsigned int rate_count;
int err, min_channels, max_channels;
unsigned int period_list[] = {
- 4096, /* 23/46ms (stereo/mono 16bit at 44.1kHz) */
+ 2048,
+ 4096, /* e.g. 23.2msec/period (stereo 16bit at 44.1kHz) */
+ 8192
};
/* access type */
@@ -1027,15 +1029,16 @@ static int bluetooth_a2dp_hw_constraint(snd_pcm_ioplug_t *io)
if (err < 0)
return err;
- /* supported block sizes: */
- err = snd_pcm_ioplug_set_param_list(io, SND_PCM_IOPLUG_HW_PERIOD_BYTES,
- ARRAY_NELEMS(period_list), period_list);
+ /* supported buffer sizes
+ * (can be used as 3*8192, 6*4096, 12*2048, ...) */
+ err = snd_pcm_ioplug_set_param_minmax(io, SND_PCM_IOPLUG_HW_BUFFER_BYTES,
+ 8192*3, 8192*3);
if (err < 0)
return err;
- /* period count fixed to 3 as we don't support prefilling */
- err = snd_pcm_ioplug_set_param_minmax(io, SND_PCM_IOPLUG_HW_PERIODS,
- 3, 3);
+ /* supported block sizes: */
+ err = snd_pcm_ioplug_set_param_list(io, SND_PCM_IOPLUG_HW_PERIOD_BYTES,
+ ARRAY_NELEMS(period_list), period_list);
if (err < 0)
return err;
@@ -1062,7 +1065,7 @@ static int bluetooth_a2dp_hw_constraint(snd_pcm_ioplug_t *io)
}
err = snd_pcm_ioplug_set_param_list(io, SND_PCM_IOPLUG_HW_RATE,
- rate_count, rate_list);
+ rate_count, rate_list);
if (err < 0)
return err;