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

Commit 38ce57ad authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: rme32: Use SNDRV_PCM_INFO_SYNC_APPLPTR info flag



The recently introduced PCM info flag assures the call of ack ops at
each applptr change, and this is mandatory for the indirect PCM
helpers.

Also, with the proper ack callback, we need no longer prefill at
trigger start.  The relevant code can be killed.

Reviewed-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent f7c50fa6
Loading
Loading
Loading
Loading
+8 −14
Original line number Diff line number Diff line
@@ -319,7 +319,8 @@ static const struct snd_pcm_hardware snd_rme32_spdif_info = {
			 SNDRV_PCM_INFO_MMAP_VALID |
			 SNDRV_PCM_INFO_INTERLEAVED | 
			 SNDRV_PCM_INFO_PAUSE |
			 SNDRV_PCM_INFO_SYNC_START),
			 SNDRV_PCM_INFO_SYNC_START |
			 SNDRV_PCM_INFO_SYNC_APPLPTR),
	.formats =	(SNDRV_PCM_FMTBIT_S16_LE | 
			 SNDRV_PCM_FMTBIT_S32_LE),
	.rates =	(SNDRV_PCM_RATE_32000 |
@@ -346,7 +347,8 @@ static const struct snd_pcm_hardware snd_rme32_adat_info =
			      SNDRV_PCM_INFO_MMAP_VALID |
			      SNDRV_PCM_INFO_INTERLEAVED |
			      SNDRV_PCM_INFO_PAUSE |
			      SNDRV_PCM_INFO_SYNC_START),
			      SNDRV_PCM_INFO_SYNC_START |
			      SNDRV_PCM_INFO_SYNC_APPLPTR),
	.formats=            SNDRV_PCM_FMTBIT_S16_LE,
	.rates =             (SNDRV_PCM_RATE_44100 | 
			      SNDRV_PCM_RATE_48000),
@@ -370,7 +372,8 @@ static const struct snd_pcm_hardware snd_rme32_spdif_fd_info = {
			 SNDRV_PCM_INFO_MMAP_VALID |
			 SNDRV_PCM_INFO_INTERLEAVED | 
			 SNDRV_PCM_INFO_PAUSE |
			 SNDRV_PCM_INFO_SYNC_START),
			 SNDRV_PCM_INFO_SYNC_START |
			 SNDRV_PCM_INFO_SYNC_APPLPTR),
	.formats =	(SNDRV_PCM_FMTBIT_S16_LE | 
			 SNDRV_PCM_FMTBIT_S32_LE),
	.rates =	(SNDRV_PCM_RATE_32000 |
@@ -397,7 +400,8 @@ static const struct snd_pcm_hardware snd_rme32_adat_fd_info =
			      SNDRV_PCM_INFO_MMAP_VALID |
			      SNDRV_PCM_INFO_INTERLEAVED |
			      SNDRV_PCM_INFO_PAUSE |
			      SNDRV_PCM_INFO_SYNC_START),
			      SNDRV_PCM_INFO_SYNC_START |
			      SNDRV_PCM_INFO_SYNC_APPLPTR),
	.formats=            SNDRV_PCM_FMTBIT_S16_LE,
	.rates =             (SNDRV_PCM_RATE_44100 | 
			      SNDRV_PCM_RATE_48000),
@@ -1104,16 +1108,6 @@ snd_rme32_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
		snd_pcm_trigger_done(s, substream);
	}
	
	/* prefill playback buffer */
	if (cmd == SNDRV_PCM_TRIGGER_START && rme32->fullduplex_mode) {
		snd_pcm_group_for_each_entry(s, substream) {
			if (s == rme32->playback_substream) {
				s->ops->ack(s);
				break;
			}
		}
	}

	switch (cmd) {
	case SNDRV_PCM_TRIGGER_START:
		if (rme32->running && ! RME32_ISWORKING(rme32))