All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: clemens@ladisch.de, tiwai@suse.de
Cc: alsa-devel@alsa-project.org, ffado-devel@lists.sourceforge.net
Subject: [PATCH] ALSA: dice: support transmission mode at 176.4/192.0 kHz for M-Audio 610/2626
Date: Fri,  4 May 2018 18:57:17 +0900	[thread overview]
Message-ID: <20180504095717.25036-1-o-takashi@sakamocchi.jp> (raw)

At highest sampling transmission frequency, ALSA dice driver
detects jumbo payload in tx packets from M-Audio 610/2626.

$ dmesg
snd_dice fw1.0: Detect jumbo payload: 0388 0348

Usual dice devices have a quirk called as dual-wire incompliant to
IEC 61883-6 at highest sampling transmission frequency. On the other hand,
M-Audio 610/2626 is compliant. This is a reason of the detection of jumbo
payload.

This commit adds support compliant transmission mode. For these devices,
tx packets are correctly handled by this driver, while rx packets can't
make these devices generate sound, unfortunately. The other factor affects
it.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/firewire/dice/dice-stream.c | 6 +++++-
 sound/firewire/dice/dice.c        | 9 +++++++++
 sound/firewire/dice/dice.h        | 2 ++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/sound/firewire/dice/dice-stream.c b/sound/firewire/dice/dice-stream.c
index 422a1ab1ddf5..e3dbe357b4fa 100644
--- a/sound/firewire/dice/dice-stream.c
+++ b/sound/firewire/dice/dice-stream.c
@@ -204,7 +204,11 @@ static int keep_resources(struct snd_dice *dice,
 	 * For this quirk, blocking mode is required and PCM buffer size should
 	 * be aligned to SYT_INTERVAL.
 	 */
-	double_pcm_frames = rate > 96000;
+	if (rate < 176400 || dice->no_dualwire)
+		double_pcm_frames = false;
+	else
+		double_pcm_frames = true;
+
 	if (double_pcm_frames) {
 		rate /= 2;
 		pcm_chs *= 2;
diff --git a/sound/firewire/dice/dice.c b/sound/firewire/dice/dice.c
index 40f7a32e4893..8baad7704bf0 100644
--- a/sound/firewire/dice/dice.c
+++ b/sound/firewire/dice/dice.c
@@ -236,6 +236,15 @@ static int dice_probe(struct fw_unit *unit,
 				(snd_dice_detect_formats_t)entry->driver_data;
 	}
 
+	/*
+	 * M-Audio units are compliant to IEC 61883-6 at high sampling
+	 * transmission frequency thus don't support 'dualwire' quirk. These
+	 * units have 0x0100d1 in its version field in config ROM, against
+	 * the value of DICE_INTERFACE.
+	 */
+	if (entry->vendor_id == OUI_MAUDIO)
+		dice->no_dualwire = true;
+
 	spin_lock_init(&dice->lock);
 	mutex_init(&dice->mutex);
 	init_completion(&dice->clock_accepted);
diff --git a/sound/firewire/dice/dice.h b/sound/firewire/dice/dice.h
index 505b79fea6d9..66e7a277ab68 100644
--- a/sound/firewire/dice/dice.h
+++ b/sound/firewire/dice/dice.h
@@ -113,6 +113,8 @@ struct snd_dice {
 	bool global_enabled;
 	struct completion clock_accepted;
 	unsigned int substreams_counter;
+
+	bool no_dualwire;
 };
 
 enum snd_dice_addr_type {
-- 
2.14.1

                 reply	other threads:[~2018-05-04  9:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180504095717.25036-1-o-takashi@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=ffado-devel@lists.sourceforge.net \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.