Modified: branches/2007R1/sound/blackfin/ad1836.c (5266 => 5267)
--- branches/2007R1/sound/blackfin/ad1836.c 2008-09-09 09:25:37 UTC (rev 5266)
+++ branches/2007R1/sound/blackfin/ad1836.c 2008-09-09 09:29:44 UTC (rev 5267)
@@ -864,7 +864,7 @@
.channels_max = CHANNELS_MAX,
#endif
.buffer_bytes_max = PCM_BUFFER_MAX,
- .period_bytes_min = 2 * FRAGMENT_SIZE_MIN,
+ .period_bytes_min = 32,
.period_bytes_max = PCM_BUFFER_MAX/2,
.periods_min = FRAGMENTS_MIN,
.periods_max = FRAGMENTS_MAX,
@@ -888,7 +888,7 @@
.channels_max = CHANNELS_MAX,
#endif
.buffer_bytes_max = PCM_BUFFER_MAX,
- .period_bytes_min = 2 * FRAGMENT_SIZE_MIN,
+ .period_bytes_min = 32,
.period_bytes_max = PCM_BUFFER_MAX/2,
.periods_min = FRAGMENTS_MIN,
.periods_max = FRAGMENTS_MAX,
@@ -896,6 +896,7 @@
static int snd_ad1836_playback_open(snd_pcm_substream_t *substream)
{
+ int ret;
ad1836_t *chip = snd_pcm_substream_chip(substream);
snd_printk_marker();
@@ -913,16 +914,24 @@
chip->tx_substream = substream;
#endif
substream->runtime->hw = snd_ad1836_playback_hw;
-
+ ret = snd_pcm_hw_constraint_integer(substream->runtime, \
+ SNDRV_PCM_HW_PARAM_PERIODS);
+ if (ret < 0)
+ return -EINVAL;
return 0;
}
static int snd_ad1836_capture_open(snd_pcm_substream_t *substream)
{
+ int ret;
ad1836_t *chip = snd_pcm_substream_chip(substream);
snd_printk_marker();
substream->runtime->hw = snd_ad1836_capture_hw;
+ ret = snd_pcm_hw_constraint_integer(substream->runtime, \
+ SNDRV_PCM_HW_PARAM_PERIODS);
+ if (ret < 0)
+ return -EINVAL;
chip->rx_substream = substream;
return 0;