Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] ALSA: usb-audio: Apply sample rate quirk for Audioengine D1
@ 2020-02-11 16:22 Arvind Sankar
  2020-02-11 19:15 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Arvind Sankar @ 2020-02-11 16:22 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai; +Cc: alsa-devel, linux-usb, linux-kernel

The Audioengine D1 (0x2912:0x30c8) does support reading the sample rate,
but it returns the rate in byte-reversed order.

When setting sampling rate, the driver produces these warning messages:
[168840.944226] usb 3-2.2: current rate 4500480 is different from the runtime rate 44100
[168854.930414] usb 3-2.2: current rate 8436480 is different from the runtime rate 48000
[168905.185825] usb 3-2.1.2: current rate 30465 is different from the runtime rate 96000

As can be seen from the hexadecimal conversion, the current rate read
back is byte-reversed from the rate that was set.

44100 == 0x00ac44, 4500480 == 0x44ac00
48000 == 0x00bb80, 8436480 == 0x80bb00
96000 == 0x017700,   30465 == 0x007701

Rather than implementing a new quirk to reverse the order, just skip
checking the rate to avoid spamming the log.

Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
---
 sound/usb/quirks.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 3a5242e383b2..7f558f4b4520 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1440,6 +1440,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip)
 	case USB_ID(0x1395, 0x740a): /* Sennheiser DECT */
 	case USB_ID(0x1901, 0x0191): /* GE B850V3 CP2114 audio interface */
 	case USB_ID(0x21b4, 0x0081): /* AudioQuest DragonFly */
+	case USB_ID(0x2912, 0x30c8): /* Audioengine D1 */
 		return true;
 	}
 
-- 
2.24.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: usb-audio: Apply sample rate quirk for Audioengine D1
  2020-02-11 16:22 [PATCH] ALSA: usb-audio: Apply sample rate quirk for Audioengine D1 Arvind Sankar
@ 2020-02-11 19:15 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2020-02-11 19:15 UTC (permalink / raw)
  To: Arvind Sankar
  Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-usb, linux-kernel

On Tue, 11 Feb 2020 17:22:35 +0100,
Arvind Sankar wrote:
> 
> The Audioengine D1 (0x2912:0x30c8) does support reading the sample rate,
> but it returns the rate in byte-reversed order.
> 
> When setting sampling rate, the driver produces these warning messages:
> [168840.944226] usb 3-2.2: current rate 4500480 is different from the runtime rate 44100
> [168854.930414] usb 3-2.2: current rate 8436480 is different from the runtime rate 48000
> [168905.185825] usb 3-2.1.2: current rate 30465 is different from the runtime rate 96000
> 
> As can be seen from the hexadecimal conversion, the current rate read
> back is byte-reversed from the rate that was set.
> 
> 44100 == 0x00ac44, 4500480 == 0x44ac00
> 48000 == 0x00bb80, 8436480 == 0x80bb00
> 96000 == 0x017700,   30465 == 0x007701
> 
> Rather than implementing a new quirk to reverse the order, just skip
> checking the rate to avoid spamming the log.
> 
> Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>

Thanks, applied now with Cc to stable.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11 16:22 [PATCH] ALSA: usb-audio: Apply sample rate quirk for Audioengine D1 Arvind Sankar
2020-02-11 19:15 ` Takashi Iwai

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git