* [BUG] ALSA: intel8x: Why incorrect codec index used setting ICH_DI2L SDIN
@ 2025-06-18 19:19 Alok Tiwari
2025-06-19 15:38 ` Andy Shevchenko
0 siblings, 1 reply; 4+ messages in thread
From: Alok Tiwari @ 2025-06-18 19:19 UTC (permalink / raw)
To: perex, tiwai, phasta, andriy.shevchenko, linux-sound
Cc: alok.a.tiwari, linux-kernel
Correct the index to use codec[i] to match the loop iteration, not codec[1].
Is this a mistake or intentional?
Thanks,
Alok
propose changes
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
---
sound/pci/intel8x0.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 51e7f1f1a48e..b521cec20333 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -2249,7 +2249,7 @@ static int snd_intel8x0_mixer(struct intel8x0 *chip, int ac97_clock,
tmp |= chip->ac97_sdin[0] << ICH_DI1L_SHIFT;
for (i = 1; i < 4; i++) {
if (pcm->r[0].codec[i]) {
- tmp |= chip->ac97_sdin[pcm->r[0].codec[1]->num] << ICH_DI2L_SHIFT;
+ tmp |= chip->ac97_sdin[pcm->r[0].codec[i]->num] << ICH_DI2L_SHIFT;
break;
}
}
--
2.47.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [BUG] ALSA: intel8x: Why incorrect codec index used setting ICH_DI2L SDIN
2025-06-18 19:19 [BUG] ALSA: intel8x: Why incorrect codec index used setting ICH_DI2L SDIN Alok Tiwari
@ 2025-06-19 15:38 ` Andy Shevchenko
2025-06-19 19:26 ` [External] : " ALOK TIWARI
0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2025-06-19 15:38 UTC (permalink / raw)
To: Alok Tiwari; +Cc: perex, tiwai, phasta, linux-sound, linux-kernel
On Wed, Jun 18, 2025 at 12:19:21PM -0700, Alok Tiwari wrote:
> Correct the index to use codec[i] to match the loop iteration, not codec[1].
>
> Is this a mistake or intentional?
You marked it as a BUG in the Subject, can you elaborate more, please?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [External] : Re: [BUG] ALSA: intel8x: Why incorrect codec index used setting ICH_DI2L SDIN
2025-06-19 15:38 ` Andy Shevchenko
@ 2025-06-19 19:26 ` ALOK TIWARI
2025-06-20 8:11 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: ALOK TIWARI @ 2025-06-19 19:26 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: perex, tiwai, phasta, linux-sound, linux-kernel
On 6/19/2025 9:08 PM, Andy Shevchenko wrote:
> On Wed, Jun 18, 2025 at 12:19:21PM -0700, Alok Tiwari wrote:
>> Correct the index to use codec[i] to match the loop iteration, not codec[1].
>>
>> Is this a mistake or intentional?
>
> You marked it as a BUG in the Subject, can you elaborate more, please?
>
I should have mark this as a query.
Why is the value 1 hardcoded here in the codec?
tmp |= chip->ac97_sdin[pcm->r[0].codec[1]->num] << ICH_DI2L_SHIFT;
https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/sound/pci/intel8x0.c#n2252
Thanks,
Alok
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [External] : Re: [BUG] ALSA: intel8x: Why incorrect codec index used setting ICH_DI2L SDIN
2025-06-19 19:26 ` [External] : " ALOK TIWARI
@ 2025-06-20 8:11 ` Takashi Iwai
0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2025-06-20 8:11 UTC (permalink / raw)
To: ALOK TIWARI
Cc: Andy Shevchenko, perex, tiwai, phasta, linux-sound, linux-kernel
On Thu, 19 Jun 2025 21:26:53 +0200,
ALOK TIWARI wrote:
>
>
>
> On 6/19/2025 9:08 PM, Andy Shevchenko wrote:
> > On Wed, Jun 18, 2025 at 12:19:21PM -0700, Alok Tiwari wrote:
> >> Correct the index to use codec[i] to match the loop iteration, not codec[1].
> >>
> >> Is this a mistake or intentional?
> >
> > You marked it as a BUG in the Subject, can you elaborate more, please?
> >
>
> I should have mark this as a query.
> Why is the value 1 hardcoded here in the codec?
>
> tmp |= chip->ac97_sdin[pcm->r[0].codec[1]->num] << ICH_DI2L_SHIFT;
>
> https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/sound/pci/intel8x0.c#n2252
I believe this is a long-standing bug, but practically seen, it never
hits on real devices, because there have been little devices with
multiple AC97 codecs on Intel ICH, and they have at most only two
codecs, AFAIK.
That said, I'd happily take the fix patch when you submit a properly
formatted one. It'll likely change the behavior of existing devices,
but it's always good to fix something.
thanks,
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-06-20 8:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-18 19:19 [BUG] ALSA: intel8x: Why incorrect codec index used setting ICH_DI2L SDIN Alok Tiwari
2025-06-19 15:38 ` Andy Shevchenko
2025-06-19 19:26 ` [External] : " ALOK TIWARI
2025-06-20 8:11 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox