When an OSS stream is setup (e.g. two periods) with a rate that
doesn't align with the fixed rate of the slave PCM, dmix can't
establish the hw_params properly. As a dirty workaround, set either
only min or max periods so that they don't conflict with each other.
Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=874342
Signed-off-by: Takashi Iwai <tiwai@suse.de>
if (err < 0)
return err;
periods_min = 2;
- err = snd_pcm_hw_params_set_periods_min(pcm, hw, &periods_min, 0);
- if (err < 0)
- return err;
- if (dsp->maxfrags > 0) {
+ if (!dsp->maxfrags) {
+ err = snd_pcm_hw_params_set_periods_min(pcm, hw, &periods_min, 0);
+ if (err < 0)
+ return err;
+ } else {
unsigned int periods_max = periods_min > dsp->maxfrags
? periods_min : dsp->maxfrags;
err = snd_pcm_hw_params_set_periods_max(pcm, hw,