]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: ctxfi: Add fallback to default RSR for S/PDIF
authorHarin Lee <me@harin.net>
Mon, 6 Apr 2026 07:49:13 +0000 (16:49 +0900)
committerTakashi Iwai <tiwai@suse.de>
Mon, 6 Apr 2026 08:46:13 +0000 (10:46 +0200)
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>
Link: https://patch.msgid.link/20260406074913.217374-1-me@harin.net
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/ctxfi/ctatc.c

index 516c0a12ed9fbe1a96d44639a56fd28ab261c6eb..02fe093309391c68ee7ad86820e4810e03badab8 100644 (file)
@@ -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);