Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b942cf81 authored by Rene Herman's avatar Rene Herman Committed by Jaroslav Kysela
Browse files

[ALSA] es1968 - Fix stuttering capture



Looks like the buffer size for the stereo capture has to be a
power of two.  Now added a constraint to buffer bytes.
Also removed unnecessary #if 0 lines.

Signed-off-by: default avatarRene Herman <rene.herman@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent d3091fad
Loading
Loading
Loading
Loading
+3 −8
Original line number Original line Diff line number Diff line
@@ -1554,10 +1554,7 @@ static int snd_es1968_playback_open(struct snd_pcm_substream *substream)
	runtime->hw = snd_es1968_playback;
	runtime->hw = snd_es1968_playback;
	runtime->hw.buffer_bytes_max = runtime->hw.period_bytes_max =
	runtime->hw.buffer_bytes_max = runtime->hw.period_bytes_max =
		calc_available_memory_size(chip);
		calc_available_memory_size(chip);
#if 0

	snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
				   1024);
#endif
	spin_lock_irq(&chip->substream_lock);
	spin_lock_irq(&chip->substream_lock);
	list_add(&es->list, &chip->substream_list);
	list_add(&es->list, &chip->substream_list);
	spin_unlock_irq(&chip->substream_lock);
	spin_unlock_irq(&chip->substream_lock);
@@ -1613,10 +1610,8 @@ static int snd_es1968_capture_open(struct snd_pcm_substream *substream)
	runtime->hw = snd_es1968_capture;
	runtime->hw = snd_es1968_capture;
	runtime->hw.buffer_bytes_max = runtime->hw.period_bytes_max =
	runtime->hw.buffer_bytes_max = runtime->hw.period_bytes_max =
		calc_available_memory_size(chip) - 1024; /* keep MIXBUF size */
		calc_available_memory_size(chip) - 1024; /* keep MIXBUF size */
#if 0
	snd_pcm_hw_constraint_pow2(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES);
	snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,

				   1024);
#endif
	spin_lock_irq(&chip->substream_lock);
	spin_lock_irq(&chip->substream_lock);
	list_add(&es->list, &chip->substream_list);
	list_add(&es->list, &chip->substream_list);
	spin_unlock_irq(&chip->substream_lock);
	spin_unlock_irq(&chip->substream_lock);