Skip to content

Commit dfacca3

Browse files
takaswietiwai
authored andcommitted
ALSA: fireface: perform sequence replay for media clock recovery
This commit takes ALSA fireface driver to perform sequence replay for media clock recovery. The protocol specific to RME Fireface series is not compliant to IEC 61883-1/6 since it has no CIP header, therefore presentation time is not used for media clock recovery. The sequence of the number of data blocks per packet is important. I note that the device skips an isochronous cycle corresponding to an empty packet or a NODATA packet in blocking transmission method of IEC 61883-1/6. For sequence replay, the cycle is handled as receiving an empty packet. Furthermore, it doesn't start packet transmission till receiving any packet. The sequence replay is tested with below models: * Fireface 400 * Fireface 800 * Fireface 802 I note that it is better to initialize Fireface 400 in advance by initialization transaction implemented in snd-fireface-ctl-service of snd-firewire-ctl-services project. You can see whether initialized or not by HOST LED on the device. Unless, the device often stops packet transmission even if session starts. I guess the sequence replay also works well with below models: * Fireface UFX * Fireface UCX Signed-off-by: Takashi Sakamoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent a9dd8a6 commit dfacca3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

sound/firewire/fireface/amdtp-ff.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,6 @@ int amdtp_ff_init(struct amdtp_stream *s, struct fw_unit *unit,
168168
else
169169
process_ctx_payloads = process_it_ctx_payloads;
170170

171-
return amdtp_stream_init(s, unit, dir, CIP_NO_HEADER, 0,
171+
return amdtp_stream_init(s, unit, dir, CIP_BLOCKING | CIP_UNAWARE_SYT | CIP_NO_HEADER, 0,
172172
process_ctx_payloads, sizeof(struct amdtp_ff));
173173
}

sound/firewire/fireface/ff-stream.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,11 @@ int snd_ff_stream_start_duplex(struct snd_ff *ff, unsigned int rate)
199199
if (err < 0)
200200
goto error;
201201

202-
err = amdtp_domain_start(&ff->domain, 0, false, false);
202+
// NOTE: The device doesn't transfer packets unless receiving any packet. The
203+
// sequence of tx packets includes cycle skip corresponding to empty packet or
204+
// NODATA packet in IEC 61883-1/6. The sequence of the number of data blocks per
205+
// packet is important for media clock recovery.
206+
err = amdtp_domain_start(&ff->domain, 0, true, true);
203207
if (err < 0)
204208
goto error;
205209

0 commit comments

Comments
 (0)