ALSA: firewire-digi00x: reserve/release isochronous resources in pcm.hw_params/hw_fre...
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tue, 11 Jun 2019 13:21:11 +0000 (22:21 +0900)
committerTakashi Iwai <tiwai@suse.de>
Tue, 11 Jun 2019 14:02:05 +0000 (16:02 +0200)
commitae8ffbb26512bbfd3f929e34c85880f620ecb6eb
treeb8184e703654e1fa10a782893f696e0bd0bb4bf3
parentad3065054761c86d3284315b67512a70f5ae0c04
ALSA: firewire-digi00x: 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>
sound/firewire/digi00x/digi00x-midi.c
sound/firewire/digi00x/digi00x-pcm.c
sound/firewire/digi00x/digi00x-stream.c
sound/firewire/digi00x/digi00x.h