public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: ctxfi: Add fallback to default RSR for S/PDIF
@ 2026-04-06  7:49 Harin Lee
  2026-04-06  8:50 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Harin Lee @ 2026-04-06  7:49 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai; +Cc: linux-sound, linux-kernel, Harin Lee

spdif_passthru_playback_get_resources() uses atc->pll_rate as the RSR
for the MSR calculation loop. However, pll_rate is only updated in
atc_pll_init() and not in hw_pll_init(), so it remains 0 after the
card init.

When spdif_passthru_playback_setup() skips atc_pll_init() for
32000 Hz, (rsr * desc.msr) always becomes 0, causing the loop to spin
indefinitely.

Add fallback to use atc->rsr when atc->pll_rate is 0. This reflects
the hardware state, since hw_card_init() already configures the PLL
to the default RSR.

Fixes: 8cc72361481f ("ALSA: SB X-Fi driver merge")
Cc: stable@vger.kernel.org
Signed-off-by: Harin Lee <me@harin.net>
---
 sound/pci/ctxfi/ctatc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c
index 516c0a12ed9f..02fe09330939 100644
--- a/sound/pci/ctxfi/ctatc.c
+++ b/sound/pci/ctxfi/ctatc.c
@@ -794,7 +794,8 @@ static int spdif_passthru_playback_get_resources(struct ct_atc *atc,
 	struct src *src;
 	int err;
 	int n_amixer = apcm->substream->runtime->channels, i;
-	unsigned int pitch, rsr = atc->pll_rate;
+	unsigned int pitch;
+	unsigned int rsr = atc->pll_rate ? atc->pll_rate : atc->rsr;
 
 	/* first release old resources */
 	atc_pcm_release_resources(atc, apcm);
-- 
2.53.0


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

* Re: [PATCH] ALSA: ctxfi: Add fallback to default RSR for S/PDIF
  2026-04-06  7:49 [PATCH] ALSA: ctxfi: Add fallback to default RSR for S/PDIF Harin Lee
@ 2026-04-06  8:50 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2026-04-06  8:50 UTC (permalink / raw)
  To: Harin Lee; +Cc: Jaroslav Kysela, Takashi Iwai, linux-sound, linux-kernel

On Mon, 06 Apr 2026 09:49:13 +0200,
Harin Lee wrote:
> 
> spdif_passthru_playback_get_resources() uses atc->pll_rate as the RSR
> for the MSR calculation loop. However, pll_rate is only updated in
> atc_pll_init() and not in hw_pll_init(), so it remains 0 after the
> card init.
> 
> When spdif_passthru_playback_setup() skips atc_pll_init() for
> 32000 Hz, (rsr * desc.msr) always becomes 0, causing the loop to spin
> indefinitely.
> 
> Add fallback to use atc->rsr when atc->pll_rate is 0. This reflects
> the hardware state, since hw_card_init() already configures the PLL
> to the default RSR.
> 
> Fixes: 8cc72361481f ("ALSA: SB X-Fi driver merge")
> Cc: stable@vger.kernel.org
> Signed-off-by: Harin Lee <me@harin.net>

Applied to for-next branch now.  Thanks.


Takashi

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

end of thread, other threads:[~2026-04-06  8:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-06  7:49 [PATCH] ALSA: ctxfi: Add fallback to default RSR for S/PDIF Harin Lee
2026-04-06  8:50 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox