From 07b266424df51894efd6d42e6de169d229559bec Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Sun, 2 Jun 2019 16:12:48 +0900 Subject: ALSA: firewire-tascam: reserve/release isochronous resources in pcm.hw_params/hw_free callbacks Once allocated, isochronous resources are available for packet streaming, even if the streaming is cancelled. For this reason, current implementation handles allocation of the resources and starting packet streaming at the same time. However, this brings complicated procedure to start packet streaming. This commit separates the allocation and starting. The allocation is done in pcm.hw_params callback and available till pcm.hw_free callback. Even if any XRUN occurs, pcm.prepare callback is done to restart packet streaming for allocated the resources. There are two points to stop packet streaming; in pcm.hw_params and pcm.prepare callbacks. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/firewire/tascam/tascam.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound/firewire/tascam/tascam.h') diff --git a/sound/firewire/tascam/tascam.h b/sound/firewire/tascam/tascam.h index 6a411ee0dcf1..1cb75c374f11 100644 --- a/sound/firewire/tascam/tascam.h +++ b/sound/firewire/tascam/tascam.h @@ -147,6 +147,8 @@ int snd_tscm_stream_get_clock(struct snd_tscm *tscm, int snd_tscm_stream_init_duplex(struct snd_tscm *tscm); void snd_tscm_stream_update_duplex(struct snd_tscm *tscm); void snd_tscm_stream_destroy_duplex(struct snd_tscm *tscm); +int snd_tscm_stream_reserve_duplex(struct snd_tscm *tscm, unsigned int rate); +void snd_tscm_stream_release_duplex(struct snd_tscm *tscm); int snd_tscm_stream_start_duplex(struct snd_tscm *tscm, unsigned int rate); void snd_tscm_stream_stop_duplex(struct snd_tscm *tscm); -- cgit v1.2.3