ALSA: ctxfi: Add fallback to default RSR for S/PDIF
PATCH 1/1 ALSA: ctxfi: Add fallback to default RSR for S/PDIF
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.
--- sound/pci/ctxfi/ctatc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/pci/ctxfi/ctatc.c +2 -1
@@ -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);
Signature · 1 line
2.53.0
Takashi Iwai
AppliedQuoted 10 lines · Harin Lee
spdif_passthru_playback_get_resources()usesatc->pll_rateas the RSR for the MSR calculation loop. However,pll_rateis only updated inatc_pll_init()and not inhw_pll_init(), so it remains 0 after the card init.When
spdif_passthru_playback_setup()skipsatc_pll_init()for 32000 Hz, (rsr * desc.msr) always becomes 0, causing the loop to spin indefinitely.
Quoted 7 lines
Add fallback to use
atc->rsrwhenatc->pll_rateis 0. This reflects the hardware state, sincehw_card_init()already configures the PLL to the default RSR.Fixes 8cc72361481f ("ALSA: SB X-Fi driver merge")Signed-off-by Harin Lee <[email protected]>
Applied to for-next branch now. Thanks.
Takashi