Hi all, I modified my previous patch for supporting a period_size (rather than period_bytes) constraint with Takashi's suggestion that the fields be non-zero for either constraint to kick in. See file in attachment. It has worked fine on my hardware for the past few days.
Guilhem. __________________________________________________ Yahoo! - We Remember 9-11: A tribute to the more than 3,000 lives lost http://dir.remember.yahoo.com/tribute
--- alsa-kernel/include_orig/pcm.h Tue Aug 6 03:28:27 2002 +++ alsa-kernel/include/pcm.h Wed Sep 4 13:32:19 2002 @@ -75,6 +75,8 @@ unsigned int channels_min; /* min channels */ unsigned int channels_max; /* max channels */ size_t buffer_bytes_max; /* max buffer size */ + size_t period_size_min; /* min size size (in samples) */ + size_t period_size_max; /* max size size (in samples) */ size_t period_bytes_min; /* min period size */ size_t period_bytes_max; /* max period size */ unsigned int periods_min; /* min # of periods */ --- alsa-kernel/core_orig/pcm_native.c Tue Aug 13 12:13:34 2002 +++ alsa-kernel/core/pcm_native.c Fri Sep 6 12:52:44 2002 @@ -1628,9 +1628,17 @@ hw->rate_min, hw->rate_max); snd_assert(err >= 0, return -EINVAL); + if (hw->period_size_min || hw->period_size_max) { + err = snd_pcm_hw_constraint_minmax(runtime, +SNDRV_PCM_HW_PARAM_PERIOD_SIZE, + hw->period_size_min, +hw->period_size_max); + snd_assert(err >= 0, return -EINVAL); + } + + if (hw->period_bytes_min || hw->period_bytes_max) { err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, hw->period_bytes_min, hw->period_bytes_max); snd_assert(err >= 0, return -EINVAL); + } err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIODS, hw->periods_min, hw->periods_max);