Skip to content

Commit b942cf8

Browse files
Rene HermanJaroslav Kysela
authored andcommitted
[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: Rene Herman <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Jaroslav Kysela <[email protected]>
1 parent d3091fa commit b942cf8

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

sound/pci/es1968.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,10 +1554,7 @@ static int snd_es1968_playback_open(struct snd_pcm_substream *substream)
15541554
runtime->hw = snd_es1968_playback;
15551555
runtime->hw.buffer_bytes_max = runtime->hw.period_bytes_max =
15561556
calc_available_memory_size(chip);
1557-
#if 0
1558-
snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
1559-
1024);
1560-
#endif
1557+
15611558
spin_lock_irq(&chip->substream_lock);
15621559
list_add(&es->list, &chip->substream_list);
15631560
spin_unlock_irq(&chip->substream_lock);
@@ -1613,10 +1610,8 @@ static int snd_es1968_capture_open(struct snd_pcm_substream *substream)
16131610
runtime->hw = snd_es1968_capture;
16141611
runtime->hw.buffer_bytes_max = runtime->hw.period_bytes_max =
16151612
calc_available_memory_size(chip) - 1024; /* keep MIXBUF size */
1616-
#if 0
1617-
snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
1618-
1024);
1619-
#endif
1613+
snd_pcm_hw_constraint_pow2(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES);
1614+
16201615
spin_lock_irq(&chip->substream_lock);
16211616
list_add(&es->list, &chip->substream_list);
16221617
spin_unlock_irq(&chip->substream_lock);

0 commit comments

Comments
 (0)