|
@@ -940,6 +940,28 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream)
|
|
|
oss_frame_size = snd_pcm_format_physical_width(params_format(params)) *
|
|
oss_frame_size = snd_pcm_format_physical_width(params_format(params)) *
|
|
|
params_channels(params) / 8;
|
|
params_channels(params) / 8;
|
|
|
|
|
|
|
|
|
|
+ err = snd_pcm_oss_period_size(substream, params, sparams);
|
|
|
|
|
+ if (err < 0)
|
|
|
|
|
+ goto failure;
|
|
|
|
|
+
|
|
|
|
|
+ n = snd_pcm_plug_slave_size(substream, runtime->oss.period_bytes / oss_frame_size);
|
|
|
|
|
+ err = snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, n, NULL);
|
|
|
|
|
+ if (err < 0)
|
|
|
|
|
+ goto failure;
|
|
|
|
|
+
|
|
|
|
|
+ err = snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_PERIODS,
|
|
|
|
|
+ runtime->oss.periods, NULL);
|
|
|
|
|
+ if (err < 0)
|
|
|
|
|
+ goto failure;
|
|
|
|
|
+
|
|
|
|
|
+ snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL);
|
|
|
|
|
+
|
|
|
|
|
+ err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_HW_PARAMS, sparams);
|
|
|
|
|
+ if (err < 0) {
|
|
|
|
|
+ pcm_dbg(substream->pcm, "HW_PARAMS failed: %i\n", err);
|
|
|
|
|
+ goto failure;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
#ifdef CONFIG_SND_PCM_OSS_PLUGINS
|
|
#ifdef CONFIG_SND_PCM_OSS_PLUGINS
|
|
|
snd_pcm_oss_plugin_clear(substream);
|
|
snd_pcm_oss_plugin_clear(substream);
|
|
|
if (!direct) {
|
|
if (!direct) {
|
|
@@ -974,27 +996,6 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream)
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
- err = snd_pcm_oss_period_size(substream, params, sparams);
|
|
|
|
|
- if (err < 0)
|
|
|
|
|
- goto failure;
|
|
|
|
|
-
|
|
|
|
|
- n = snd_pcm_plug_slave_size(substream, runtime->oss.period_bytes / oss_frame_size);
|
|
|
|
|
- err = snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, n, NULL);
|
|
|
|
|
- if (err < 0)
|
|
|
|
|
- goto failure;
|
|
|
|
|
-
|
|
|
|
|
- err = snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_PERIODS,
|
|
|
|
|
- runtime->oss.periods, NULL);
|
|
|
|
|
- if (err < 0)
|
|
|
|
|
- goto failure;
|
|
|
|
|
-
|
|
|
|
|
- snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL);
|
|
|
|
|
-
|
|
|
|
|
- if ((err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_HW_PARAMS, sparams)) < 0) {
|
|
|
|
|
- pcm_dbg(substream->pcm, "HW_PARAMS failed: %i\n", err);
|
|
|
|
|
- goto failure;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
if (runtime->oss.trigger) {
|
|
if (runtime->oss.trigger) {
|
|
|
sw_params->start_threshold = 1;
|
|
sw_params->start_threshold = 1;
|
|
|
} else {
|
|
} else {
|