mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Darren Chang <darrenchangjr01@gmail.com>
Cc: perex@perex.cz, tiwai@suse.com, corbet@lwn.net,
	skhan@linuxfoundation.org, rdunlap@infradead.org,
	linux-sound@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: usb-audio: Add quirk for inverted sample rates on NUX NAI-24
Date: Tue, 29 Sep 2026 11:41:25 +0200	[thread overview]
Message-ID: <87bj9g2y4a.wl-tiwai@suse.de> (raw)
In-Reply-To: <20260920122653.41993-1-darrenchangjr01@gmail.com>

On Sun, 20 Sep 2026 14:26:53 +0200,
Darren Chang wrote:
> 
> The NUX NAI-24 (USB 3703:2000) has a UAC2 clock source that reports
> bmAttributes = 0x01 (internal fixed clock) and bmControls = 0x07, so the
> driver treats its sample rate as programmable.  When the driver sends
> SET_CUR(SAMPLING_FREQ_CONTROL), the firmware acknowledges the request and
> then runs the clock on the opposite base-rate family: asking for 44100 Hz
> makes the device run at 48000 Hz, and asking for 48000 Hz makes it run at
> 44100 Hz.
> 
> The result is playback that is about 8.8% fast, or 8.4% slow with heavy
> static on the 48000 Hz family.  macOS and Windows ignore bmControls, treat
> the clock as fixed and resample, so they are unaffected.
> 
> Work around it by sending the partner rate in SET_CUR for this device, so
> the device runs at the requested rate.  A new QUIRK_FLAG_SWAP_RATES flag
> controls this, applied through the quirk flags table.
> 
> Only the 44.1/48 kHz pair has been verified on hardware; the 88.2/96 kHz
> and 176.4/192 kHz pairs are untested but follow the same pattern.
> 
> Testing: the equivalent change ran on the device as a locally built
> module (44100 Hz PCM, device clock 44100 Hz, no xruns, correct tempo, no
> static).  This upstream form compiles for sound/usb without warnings and
> passes checkpatch, but has not been built in a full kernel tree or
> load-tested.
> 
> Assisted-by: LLM
> Signed-off-by: Darren Chang <darrenchangjr01@gmail.com>

Applied to for-next branch now.  Thanks.


Takashi

      reply	other threads:[~2026-09-29  9:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-20 12:26 Darren Chang
2026-09-29  9:41 ` Takashi Iwai [this message]

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=87bj9g2y4a.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=corbet@lwn.net \
    --cc=darrenchangjr01@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=rdunlap@infradead.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tiwai@suse.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®