linux icon indicating copy to clipboard operation
linux copied to clipboard

RT1320 Duplicate Speaker Control Bug - Sound Card Registration Fails

Open CanuteTheGreat opened this issue 2 months ago • 0 comments

Sound card registration fails with dual RT1320 amplifiers (-EBUSY)

I'm hitting a bug on Alienware Area-51 (2025) where the sound card fails to register due to duplicate control creation. Tested on kernels6.16.12.

Hardware

  • Alienware Area-51 AA18250 (SKU 0CCD)
  • Arrow Lake-S CPU
  • RT722 codec + dual RT1320 amps via SoundWire (cfg-amp:2)

The Problem

snd_soc_register_card failed -16
control 2:0:0:Speaker Switch:0 is already present

The sound card doesn't register at all, so there's no audio.

What's Happening

I traced this to asoc_sdw_rt_amp_spk_rtd_init() in sound/soc/sdw_utils/soc_sdw_rt_amp.c. The function gets called twice (once per RT1320), and each call adds routes separately:

for_each_rtd_codec_dais(rtd, i, codec_dai) {
    if (strstr(codec_dai->component->name_prefix, "-1"))
        ret = snd_soc_dapm_add_routes(&card->dapm, rt_amp_map, 2);
    else if (strstr(codec_dai->component->name_prefix, "-2"))
        ret = snd_soc_dapm_add_routes(&card->dapm, rt_amp_map + 2, 2);
}

Since snd_soc_dapm_add_routes() auto-creates widgets/controls, the second call tries to create a duplicate "Speaker" widget and fails with -EBUSY.

Fix

In sound/soc/sdw_utils/soc_sdw_utils.c (around line 1320): Remove the static widget/control definitions from RT1320's codec_info - set them to NULL.

In sound/soc/sdw_utils/soc_sdw_rt_amp.c: Rewrite asoc_sdw_rt_amp_spk_rtd_init() to:

  • Create the Speaker widget/control programmatically using a static flag (only once)
  • Only process on the first codec DAI to avoid running twice
  • Count the amps, then add all routes in one call

0001-ASoC-sdw_utils-Fix-duplicate-Speaker-control-with-dual-RT1320.patch

CanuteTheGreat avatar Oct 31 '25 06:10 CanuteTheGreat