summaryrefslogtreecommitdiff
path: root/sound/firewire/bebob/bebob.h
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2014-04-25 17:45:16 +0400
committerTakashi Iwai <tiwai@suse.de>2014-05-26 16:29:44 +0400
commitb6bc812327aa6961d783e81961273ebf2a304964 (patch)
treef200e026bd6383613d4a9e98e7234cc1e44dea90 /sound/firewire/bebob/bebob.h
parenteb7b3a056cd8130e45c4494fb27de54d53ce9f31 (diff)
downloadlinux-b6bc812327aa6961d783e81961273ebf2a304964.tar.xz
ALSA: bebob/firewire-lib: Add a quirk for discontinuity at bus reset
Normal BeBoB firmware has a quirk. When receiving bus reset, it transmits packets with discontinuous value in dbc field. This causes two situation, one is to abort streaming by firewire-lib as a result of detecting the discontinuity. Another is to call driver's .update() because of bus reset. These two is generated independently. (The former depends on isochronous stream and the latter depends on IEEE1394 bus driver.) When BeBoB driver works with XRUN-recoverable applications, this situation looks like stream_start_duplex() call followed by stream_update_duplex() call because applications will call snd_pcm_prepare() immediately at XRUN. To update connections and streams at first, this commit use completion. When queueing error occurs, stream_start_duplex() is forced to wait maximum 1000msec. During this, when .update() is called, the completion is waken and stream_start_duplex() is processed without breaking connections. At bus reset, stream_start_duplex() shouldn't break/establish connections and stream_update_duplex() should update connections because a caller of fw_iso_resources_allocate() is responsible for calling fw_iso_resources_update() on bus reset. This commit also adds a flag, which has an effect to skip checking continuity for first packet. This flag is useful for BeBoB quirk to start handling packets during streaming. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/bebob/bebob.h')
-rw-r--r--sound/firewire/bebob/bebob.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/firewire/bebob/bebob.h b/sound/firewire/bebob/bebob.h
index a195c16da41e..031ca78096d2 100644
--- a/sound/firewire/bebob/bebob.h
+++ b/sound/firewire/bebob/bebob.h
@@ -53,6 +53,10 @@ struct snd_bebob {
unsigned int midi_input_ports;
unsigned int midi_output_ports;
+ /* for bus reset quirk */
+ struct completion bus_reset;
+ bool connected;
+
struct amdtp_stream *master;
struct amdtp_stream tx_stream;
struct amdtp_stream rx_stream;