Re: [PATCH] ALSA: hda/tas2781: Only accept CRC-less V1 data if all entries are valid
From: Mohamed Yassine JEBABLI
Date: Thu Nov 12 2026 - 10:27:07 EST
Hi Gergo,
Regarding the Q27/Q31/Q58 formats: they are not from any
documentation; I inferred them from the data. Reading the first word
of each entry as Q27 gives a plausible speaker resistance (3.82 ohm on
my Legion Pro 7, 3.64 ohm on Cristian's Yoga Pro 9), and reading the
second word as Q31 gives exactly its reciprocal, within 1e-4, on both
machines. So, for a consistent entry, R0 × InvR0 ~= 2^27 × 2^31 =
2^58.
The V2 dump from the ASUS ROG Xbox Ally X thread (with a valid CRC)
fits the same pattern: r0 = 0x3c5f7222 (~7.55 ohm in Q27) and invr0 =
0x10f615d5 (~0.1325 in Q31, i.e. 1/7.55).
My guess is Q5.27 and Q1.31, but I have no TI reference to confirm it.
Finally, all testing was done on my own hardware: the original patch
was tested on my Legion Pro 7 16IRX9H, and I reviewed and own the
changes.
Thanks,
Mohamed Yassine JEBABLI
Le jeu. 12 nov. 2026 à 16:09, Mohamed Yassine JEBABLI
<med.jebabli@xxxxxxxxx> a écrit :
>
> Hi Gergo,
>
> Regarding the Q27/Q31/Q58 formats: they are not from any documentation; I inferred them from the data. Reading the first word of each entry as Q27 gives a plausible speaker resistance (3.82 ohm on my Legion Pro 7, 3.64 ohm on Cristian's Yoga Pro 9), and reading the second word as Q31 gives exactly its reciprocal, within 1e-4, on both machines. So, for a consistent entry, R0 × InvR0 ~= 2^27 × 2^31 = 2^58.
>
> The V2 dump from the ASUS ROG Xbox Ally X thread (with a valid CRC) fits the same pattern: r0 = 0x3c5f7222 (~7.55 ohm in Q27) and invr0 = 0x10f615d5 (~0.1325 in Q31, i.e. 1/7.55).
>
> My guess is Q5.27 and Q1.31, but I have no TI reference to confirm it.
>
> Finally, all testing was done on my own hardware: the original patch was tested on my Legion Pro 7 16IRX9H, and I reviewed and own the changes.
>
> Thanks,
> Mohamed Yassine JEBABLI
>
>
> Le jeu. 12 nov. 2026, 15:43, Gergo Koteles <soyer@xxxxxx> a écrit :
>>
>> Hi,
>>
>> On Wed, 2026-11-04 at 16:55 +0100, Gergo Koteles wrote:
>> > Hi Mohamed,
>> >
>> > On Tue, 2026-11-03 at 10:27 +0100, Mohamed Yassine Jebabli via B4 Relay
>> > wrote:
>> > > From: Mohamed Yassine Jebabli <med.jebabli@xxxxxxxxx>
>> > >
>> > > Commit 408249089c48 ("ALSA: hda/tas2781: Accept V1 calibration data
>> > > without CRC") only checked the first device entry. On machines where
>> > > the BIOS populates fewer entries than p->ndev, the remaining all-zero
>> > > entries are applied and tas2781_cali_preproc() divides by zero on
>> > > playback open.
>> > >
>> > > Accept CRC-less V1 data only if every expected entry is non-zero and
>> > > self-consistent (R0 * 1/R0 close to 1.0), otherwise reject it as
>> > > before.
>> > >
>> >
>> > ...
>> >
>> > >
>> > > +/*
>> > > + * V1 data without CRC is only trusted if every expected device has a
>> > > + * populated, self-consistent entry: R0 (Q27) * 1/R0 (Q31) must be
>> > > + * close to 1.0 in Q58.
>> > > + */
>> >
>> > Just out of curiosity, where do Q27, Q31, Q58 come from?
>> > I couldn't find anything about these.
>> >
>> >
>>
>> I think it would be good to be able to see which commits were generated
>> by an LLM. This way, people wouldn't have to scour the internet trying
>> to verify hallucinations. Furthermore, it would be possible to see what
>> percentage of the kernel consists of public domain/LLM code.
>>
>> Best regards,
>> Gergo