]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit98d8e1b42e74316eafeb7ee3fba014aa8d51a7d0
treeb8184e703654e1fa10a782893f696e0bd0bb4bf3
parent9e5646f5ad2a0dc58c4f0b5b2140ad11914a9a8d
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