Commit 6dbecb9b authored by Oswald Buddenhagen's avatar Oswald Buddenhagen Committed by Takashi Iwai
Browse files

ALSA: emu10k1: don't limit multi-channel playback to two periods



For unclear reasons, the extra voice was set up with half the buffer
size instead of the period size. Commit 27ae958cf6 ("emu10k1 driver -
add multichannel device hw:x,3 [2-8/8]") mentions half-loop interrupts,
so maybe this was an artifact of an earlier iteration of the patch.

While at it, also fix periods_min of the regular playback - one period
makes just no sense.

Signed-off-by: default avatarOswald Buddenhagen <oswald.buddenhagen@gmx.de>
Link: https://lore.kernel.org/r/20230523200709.236023-2-oswald.buddenhagen@gmx.de


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent e7684f3b
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -429,15 +429,16 @@ static int snd_emu10k1_efx_playback_prepare(struct snd_pcm_substream *substream)
	struct snd_pcm_runtime *runtime = substream->runtime;
	struct snd_emu10k1_pcm *epcm = runtime->private_data;
	unsigned int start_addr;
	unsigned int channel_size;
	unsigned int extra_size, channel_size;
	int i;

	start_addr = epcm->start_addr >> 1;  // 16-bit voices

	extra_size = runtime->period_size;
	channel_size = runtime->buffer_size;

	snd_emu10k1_pcm_init_extra_voice(emu, epcm->extra, true,
					 start_addr, start_addr + (channel_size / 2));
					 start_addr, start_addr + extra_size);

	epcm->ccca_start_addr = start_addr;
	for (i = 0; i < NUM_EFX_PLAYBACK; i++) {
@@ -465,7 +466,7 @@ static const struct snd_pcm_hardware snd_emu10k1_efx_playback =
	.buffer_bytes_max =	(128*1024),
	.period_bytes_max =	(128*1024),
	.periods_min =		2,
	.periods_max =		2,
	.periods_max =		1024,
	.fifo_size =		0,
};

@@ -925,7 +926,7 @@ static const struct snd_pcm_hardware snd_emu10k1_playback =
	.channels_max =		2,
	.buffer_bytes_max =	(128*1024),
	.period_bytes_max =	(128*1024),
	.periods_min =		1,
	.periods_min =		2,
	.periods_max =		1024,
	.fifo_size =		0,
};