aboutsummaryrefslogtreecommitdiffstats
path: root/sound/firewire
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2019-06-11 22:21:12 +0900
committerTakashi Iwai <tiwai@suse.de>2019-06-11 16:02:06 +0200
commit24bb77b3fff442cab2a6f4227ffcf40fd713816f (patch)
tree10b9b5c0e4bf2e502b81a71df3b1d42002f8c46f /sound/firewire
parentALSA: firewire-digi00x: reserve/release isochronous resources in pcm.hw_params/hw_free callbacks (diff)
downloadlinux-dev-24bb77b3fff442cab2a6f4227ffcf40fd713816f.tar.xz
linux-dev-24bb77b3fff442cab2a6f4227ffcf40fd713816f.zip
ALSA: firewire-digi00x: update isochronous resources when starting packet streaming after bus-reset
After bus reset, isochronous resource manager releases all of allocated isochronous resources. The nodes to transfer isochronous packet should request reallocation of the resources. However, between the bus-reset and invocation of 'struct fw_driver.update' handler, ALSA PCM application can detect this situation by XRUN because the target device cancelled to transmit packets once bus-reset occurs. Due to the above mechanism, ALSA fireface driver just stops packet streaming in the update handler, thus pcm.prepare handler should request the reallocation. This commit requests the reallocation in pcm.prepare callback when bus generation is changed. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire')
-rw-r--r--sound/firewire/digi00x/digi00x-stream.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sound/firewire/digi00x/digi00x-stream.c b/sound/firewire/digi00x/digi00x-stream.c
index 3b903e42d29a..3c5e1c5a2e11 100644
--- a/sound/firewire/digi00x/digi00x-stream.c
+++ b/sound/firewire/digi00x/digi00x-stream.c
@@ -303,6 +303,7 @@ void snd_dg00x_stream_release_duplex(struct snd_dg00x *dg00x)
int snd_dg00x_stream_start_duplex(struct snd_dg00x *dg00x)
{
+ unsigned int generation = dg00x->rx_resources.generation;
int err = 0;
if (dg00x->substreams_counter == 0)
@@ -312,6 +313,16 @@ int snd_dg00x_stream_start_duplex(struct snd_dg00x *dg00x)
amdtp_streaming_error(&dg00x->rx_stream))
finish_session(dg00x);
+ if (generation != fw_parent_device(dg00x->unit)->card->generation) {
+ err = fw_iso_resources_update(&dg00x->tx_resources);
+ if (err < 0)
+ goto error;
+
+ err = fw_iso_resources_update(&dg00x->rx_resources);
+ if (err < 0)
+ goto error;
+ }
+
/*
* No packets are transmitted without receiving packets, reagardless of
* which source of clock is used.