All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk>
To: alsa-devel@alsa-project.org
Cc: linux-kernel@lists.codethink.co.uk,
	Jorge Sanjuan <jorge.sanjuan@codethink.co.uk>
Subject: [PATCH 2/6] ALSA: usb: ADC3. BADD specification: fixed 48KHz sample rate.
Date: Wed, 29 Nov 2017 10:55:28 +0000	[thread overview]
Message-ID: <20171129105532.15420-3-jorge.sanjuan@codethink.co.uk> (raw)
In-Reply-To: <20171129105532.15420-1-jorge.sanjuan@codethink.co.uk>

Make the frame rate range fixed to just 48KHz as the BADD specification
stands for ADC3 devices.

For more details check section 4.2.4 of the Basic Audio Device version
3.

Signed-off-by: Jorge Sanjuan <jorge.sanjuan@codethink.co.uk>
---
 sound/usb/format.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sound/usb/format.c b/sound/usb/format.c
index 6f8589227e6a..e8669a1e996e 100644
--- a/sound/usb/format.c
+++ b/sound/usb/format.c
@@ -445,7 +445,12 @@ static int parse_audio_format_i(struct snd_usb_audio *chip,
 	case UAC_VERSION_2:
 	case UAC_VERSION_3: {
 		/* fp->channels is already set in this case */
-		ret = parse_audio_format_rates_v2v3(chip, fp);
+		if (chip->badd_profile > UAC3_FUNCTION_SUBCLASS_FULL_ADC_3_0) {
+			fp->rate_min = fp->rate_max = 48000;
+			fp->rates = SNDRV_PCM_RATE_CONTINUOUS;
+			return 0;
+		} else
+			ret = parse_audio_format_rates_v2v3(chip, fp);
 		break;
 	}
 	}
-- 
2.11.0

  parent reply	other threads:[~2017-11-29 10:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-29 10:55 [PATCH 0/6] ALSA: usb: UAC3. Add support for Basic Audio Device (BADD) Jorge Sanjuan
2017-11-29 10:55 ` [PATCH 1/6] ALSA: usb: ADC3: Add initial BADD spec support Jorge Sanjuan
2017-12-13 22:48   ` [Linux-kernel] " Ben Hutchings
2017-11-29 10:55 ` Jorge Sanjuan [this message]
2017-11-29 10:55 ` [PATCH 3/6] ALSA: usb: ADC3. Do not set sample rate for BADD configuration Jorge Sanjuan
2017-11-29 10:55 ` [PATCH 4/6] usb: audio: Fix variable length field to be variable Jorge Sanjuan
2017-11-29 11:33   ` Clemens Ladisch
2017-11-29 10:55 ` [PATCH 5/6] ALSA: usb: Use Class Specific EP for UAC3 devices Jorge Sanjuan
2017-12-13 22:55   ` [Linux-kernel] " Ben Hutchings
2017-11-29 10:55 ` [PATCH 6/6] ALSA: usb: Only get control header for UAC1 class Jorge Sanjuan

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=20171129105532.15420-3-jorge.sanjuan@codethink.co.uk \
    --to=jorge.sanjuan@codethink.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@lists.codethink.co.uk \
    /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.