summaryrefslogtreecommitdiff
path: root/sound/firewire/motu/motu.h
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2019-06-17 11:15:08 +0300
committerTakashi Iwai <tiwai@suse.de>2019-06-18 09:45:31 +0300
commit8edc56ec8f14a586a55b2ab2fda76e6bf4738ee6 (patch)
treee41c78039331da3eda25e75ba7ad6522d7941b86 /sound/firewire/motu/motu.h
parentec694fba2ac9406cb3fc3c3216db3de9ed3174a7 (diff)
downloadlinux-8edc56ec8f14a586a55b2ab2fda76e6bf4738ee6.tar.xz
ALSA: firewire-motu: 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 without releasing/allocating the resources. There are two points to stop packet streaming; in pcm.hw_params and pcm.prepare callbacks. The former point is a case that packet streaming is already started for any MIDI substream then packet streaming is requested with different sampling transfer frequency for any PCM substream. The latter point is cases of any XRUN or packet queueing error. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/motu/motu.h')
-rw-r--r--sound/firewire/motu/motu.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/firewire/motu/motu.h b/sound/firewire/motu/motu.h
index ae4b37cdfade..32cd42873fd0 100644
--- a/sound/firewire/motu/motu.h
+++ b/sound/firewire/motu/motu.h
@@ -153,7 +153,9 @@ void snd_motu_transaction_unregister(struct snd_motu *motu);
int snd_motu_stream_init_duplex(struct snd_motu *motu);
void snd_motu_stream_destroy_duplex(struct snd_motu *motu);
int snd_motu_stream_cache_packet_formats(struct snd_motu *motu);
-int snd_motu_stream_start_duplex(struct snd_motu *motu, unsigned int rate);
+int snd_motu_stream_reserve_duplex(struct snd_motu *motu, unsigned int rate);
+void snd_motu_stream_release_duplex(struct snd_motu *motu);
+int snd_motu_stream_start_duplex(struct snd_motu *motu);
void snd_motu_stream_stop_duplex(struct snd_motu *motu);
int snd_motu_stream_lock_try(struct snd_motu *motu);
void snd_motu_stream_lock_release(struct snd_motu *motu);