Commit 019af592 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai
Browse files

ALSA: firewire-digi00x: perform sequence replay for media clock recovery



This commit takes ALSA firewire-digi00x driver to perform sequence replay
for media clock recovery.

All of models in Digidesign digi00x family don't transfer isochronous
packets till receiving isochronous packets. The on-the-fly mode is used
for the purpose. They don't interpret presentation time expressed in syt
field of received CIP, therefore the sequence of the number of data blocks
per packet is important for media clock recovery.

The sequence replay is tested with below models:

* Digidesign Digi 002
* Digidesign Digi 002 Rack
* Digidesign Digi 003
* Digidesign Digi 003 Rack

Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210531025103.17880-5-o-takashi@sakamocchi.jp


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 029ffc42
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -396,16 +396,13 @@ int amdtp_dot_init(struct amdtp_stream *s, struct fw_unit *unit,
		 enum amdtp_stream_direction dir)
{
	amdtp_stream_process_ctx_payloads_t process_ctx_payloads;
	unsigned int flags;
	unsigned int flags = CIP_NONBLOCKING | CIP_UNAWARE_SYT;

	// Use different mode between incoming/outgoing.
	if (dir == AMDTP_IN_STREAM) {
		flags = CIP_NONBLOCKING;
	if (dir == AMDTP_IN_STREAM)
		process_ctx_payloads = process_ir_ctx_payloads;
	} else {
		flags = CIP_BLOCKING;
	else
		process_ctx_payloads = process_it_ctx_payloads;
	}

	return amdtp_stream_init(s, unit, dir, flags, CIP_FMT_AM,
				process_ctx_payloads, sizeof(struct amdtp_dot));
+6 −2
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@

#include "digi00x.h"

#define READY_TIMEOUT_MS	500
#define READY_TIMEOUT_MS	200

const unsigned int snd_dg00x_stream_rates[SND_DG00X_RATE_COUNT] = {
	[SND_DG00X_RATE_44100] = 44100,
@@ -375,7 +375,11 @@ int snd_dg00x_stream_start_duplex(struct snd_dg00x *dg00x)
		if (err < 0)
			goto error;

		err = amdtp_domain_start(&dg00x->domain, 0, false, false);
		// NOTE: The device doesn't start packet transmission till receiving any packet.
		// It ignores presentation time expressed by the value of syt field of CIP header
		// in received packets. The sequence of the number of data blocks per packet is
		// important for media clock recovery.
		err = amdtp_domain_start(&dg00x->domain, 0, true, true);
		if (err < 0)
			goto error;