[alsa-devel] [PATCH 06/11] ALSA: bebob: add SYT-Match support

Takashi Sakamoto o-takashi at sakamocchi.jp
Mon Jun 8 16:31:03 CEST 2015


In previous commits, this driver can detect the source of clock as mush
as possible. SYT-Match mode is also available.

This commit purge the restriction.

Signed-off-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>
---
 sound/firewire/bebob/bebob_pcm.c    |  5 -----
 sound/firewire/bebob/bebob_stream.c | 20 ++++++++++++++++++--
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/sound/firewire/bebob/bebob_pcm.c b/sound/firewire/bebob/bebob_pcm.c
index e3f65a0..e0a6b06 100644
--- a/sound/firewire/bebob/bebob_pcm.c
+++ b/sound/firewire/bebob/bebob_pcm.c
@@ -171,11 +171,6 @@ pcm_open(struct snd_pcm_substream *substream)
 	err = snd_bebob_stream_get_clock_src(bebob, &src);
 	if (err < 0)
 		goto err_locked;
-	/* SYT-Match is not supported. */
-	if (src == SND_BEBOB_CLOCK_TYPE_SYT) {
-		err = -EBUSY;
-		goto err_locked;
-	}
 
 	/*
 	 * When source of clock is internal or any PCM stream are running,
diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c
index c8af8ff..5335c30 100644
--- a/sound/firewire/bebob/bebob_stream.c
+++ b/sound/firewire/bebob/bebob_stream.c
@@ -474,8 +474,24 @@ destroy_both_connections(struct snd_bebob *bebob)
 static int
 get_sync_mode(struct snd_bebob *bebob, enum cip_flags *sync_mode)
 {
-	/* currently this module doesn't support SYT-Match mode */
-	*sync_mode = CIP_SYNC_TO_DEVICE;
+	enum snd_bebob_clock_type src;
+	int err;
+
+	err = snd_bebob_stream_get_clock_src(bebob, &src);
+	if (err < 0)
+		return err;
+
+	switch (src) {
+	case SND_BEBOB_CLOCK_TYPE_INTERNAL:
+	case SND_BEBOB_CLOCK_TYPE_EXTERNAL:
+		*sync_mode = CIP_SYNC_TO_DEVICE;
+		break;
+	default:
+	case SND_BEBOB_CLOCK_TYPE_SYT:
+		*sync_mode = 0;
+		break;
+	}
+
 	return 0;
 }
 
-- 
2.1.4



More information about the Alsa-devel mailing list