Skip to contentSkip to conversation

ALSA: hda/tas2781: Skip UEFI calibration on ASUS ROG Xbox Ally X

PATCH In review Matthew Schwartz 3 participants 3 messages Jan 8

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ALSA: hda/tas2781: Skip UEFI calibration on ASUS ROG Xbox Ally X

There is currently an issue with UEFI calibration data parsing for some TAS devices, like the ASUS ROG Xbox Ally X (RC73XA), that causes audio quality issues such as gaps in playback. Until the issue is root caused and fixed, add a quirk to skip using the UEFI calibration data and fall back to using the calibration data provided by the DSP firmware, which restores full speaker functionality on affected devices.

---
v1->v2: drop wrong Fixes tag, amend commit to clarify suspected root cause and workaround being used.

---
 sound/hda/codecs/side-codecs/tas2781_hda_i2c.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c +12 -1
index c8619995b1d7..ec3761050cab 100644
@@ -60,6 +60,7 @@ struct tas2781_hda_i2c_priv {
 	int (*save_calibration)(struct tas2781_hda *h);
 
 	int hda_chip_id;
+	bool skip_calibration;
 };
 
 static int tas2781_get_i2c_res(struct acpi_resource *ares, void *data)
@@ -489,7 +490,8 @@ static void tasdevice_dspfw_init(void *context)
 	/* If calibrated data occurs error, dsp will still works with default
 	 * calibrated data inside algo.
 	 */
-	hda_priv->save_calibration(tas_hda);
+	if (!hda_priv->skip_calibration)
+		hda_priv->save_calibration(tas_hda);
 }
 
 static void tasdev_fw_ready(const struct firmware *fmw, void *context)
@@ -546,6 +548,7 @@ static int tas2781_hda_bind(struct device *dev, struct device *master,
 	void *master_data)
 {
 	struct tas2781_hda *tas_hda = dev_get_drvdata(dev);
+	struct tas2781_hda_i2c_priv *hda_priv = tas_hda->hda_priv;
 	struct hda_component_parent *parent = master_data;
 	struct hda_component *comp;
 	struct hda_codec *codec;
@@ -571,6 +574,14 @@ static int tas2781_hda_bind(struct device *dev, struct device *master,
 		break;
 	}
 
+	/*
+	 * Using ASUS ROG Xbox Ally X (RC73XA) UEFI calibration data
+	 * causes audio dropouts during playback, use fallback data
+	 * from DSP firmware as a workaround.
+	 */
+	if (codec->core.subsystem_id == 0x10431384)
+		hda_priv->skip_calibration = true;
+
 	pm_runtime_get_sync(dev);
 
 	comp->dev = dev;
Signature · 1 line
2.52.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 8 lines · Matthew Schwartz

There is currently an issue with UEFI calibration data parsing for some TAS devices, like the ASUS ROG Xbox Ally X (RC73XA), that causes audio quality issues such as gaps in playback. Until the issue is root caused and fixed, add a quirk to skip using the UEFI calibration data and fall back to using the calibration data provided by the DSP firmware, which restores full speaker functionality on affected devices.

Quoted 4 lines
Quoted 57 lines

---
v1->v2: drop wrong Fixes tag, amend commit to clarify suspected root cause and workaround being used.

---
 sound/hda/codecs/side-codecs/tas2781_hda_i2c.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c +12 -2
index c8619995b1d7..ec3761050cab 100644
@@ -60,6 +60,7 @@ struct tas2781_hda_i2c_priv {
        int (*save_calibration)(struct tas2781_hda *h);
 
        int hda_chip_id;
+       bool skip_calibration;
 };
 
 static int tas2781_get_i2c_res(struct acpi_resource *ares, void *data)
@@ -489,7 +490,8 @@ static void tasdevice_dspfw_init(void *context)
        /* If calibrated data occurs error, dsp will still works with default
         * calibrated data inside algo.
         */
-       hda_priv->save_calibration(tas_hda);
+       if (!hda_priv->skip_calibration)
+               hda_priv->save_calibration(tas_hda);
 }
 
 static void tasdev_fw_ready(const struct firmware *fmw, void *context)
@@ -546,6 +548,7 @@ static int tas2781_hda_bind(struct device *dev, struct device *master,
        void *master_data)
 {
        struct tas2781_hda *tas_hda = dev_get_drvdata(dev);
+       struct tas2781_hda_i2c_priv *hda_priv = tas_hda->hda_priv;
        struct hda_component_parent *parent = master_data;
        struct hda_component *comp;
        struct hda_codec *codec;
@@ -571,6 +574,14 @@ static int tas2781_hda_bind(struct device *dev, struct device *master,
                break;
        }
 
+       /*
+        * Using ASUS ROG Xbox Ally X (RC73XA) UEFI calibration data
+        * causes audio dropouts during playback, use fallback data
+        * from DSP firmware as a workaround.
+        */
+       if (codec->core.subsystem_id == 0x10431384)
+               hda_priv->skip_calibration = true;
+
        pm_runtime_get_sync(dev);
 
        comp->dev = dev;
--

2.52.0

#2 lore raw
In reply to Matthew Schwartz
Quoted 8 lines · Matthew Schwartz

There is currently an issue with UEFI calibration data parsing for some TAS devices, like the ASUS ROG Xbox Ally X (RC73XA), that causes audio quality issues such as gaps in playback. Until the issue is root caused and fixed, add a quirk to skip using the UEFI calibration data and fall back to using the calibration data provided by the DSP firmware, which restores full speaker functionality on affected devices.

Quoted 8 lines

---
v1->v2: drop wrong Fixes tag, amend commit to clarify suspected root cause and workaround being used.

Applied now. Thanks.

Takashi