Subject: Re: AC97 auich and i82801BA
To: Mark Davies <mark@mcs.vuw.ac.nz>
From: Lennart Augustsson <lennart@augustsson.net>
List: port-i386
Date: 02/05/2002 10:56:20
Maybe checking for variable rate doesn't really work with some codecs?
You could try testing for variable rate by setting some different rates in
the codec and then read back what you get.

BTW, does your codec support variable rate?

    -- Lennart


Mark Davies wrote:

> We are still unsuccessfully trying to get reasonable audio out of this chipset.
> As far as we can see it should support variable sample rates, the
> documentation claims to but even with the recently added support for variable
> sample rates in the auich driver it still insists on sticking at 48000.
>
> Adding debugging to auich_attach() as below:
>
>                 [...]
>         auich_read_codec(sc, AC97_REG_EXTENDED_ID, &ext_id);
> printf("auich ext_id is %x\n", ext_id);
>         if ((ext_id & (AC97_CODEC_DOES_VRA | AC97_CODEC_DOES_MICVRA)) != 0) {
>                 auich_read_codec(sc, AC97_REG_EXTENDED_STATUS, &ext_status);
> printf("auich ext_status is %x\n", ext_status);
>                 if ((ext_id & AC97_CODEC_DOES_VRA) !=0)
>                         ext_status |= AC97_ENAB_VRA;
>                 if ((ext_id & AC97_CODEC_DOES_MICVRA) !=0)
>                         ext_status |= AC97_ENAB_MICVRA;
>                 auich_write_codec(sc, AC97_REG_EXTENDED_STATUS, ext_status);
> printf("auich ext_status is %x\n", ext_status);
>                 auich_read_codec(sc, AC97_REG_EXTENDED_STATUS, &ext_status);
> printf("auich ext_status is %x\n", ext_status);
>                 sc->sc_fixed_rate = 0;
>         } else {
>                 sc->sc_fixed_rate = 48000;
>         }
>                 [...]
>
> gives
>
> auich ext_id is 1
> auich ext_status is 0
> auich ext_status is 1
> auich ext_status is 0
>
> The fact that AC97_ENAB_VRA isn't set in that last reading of ext_status looks
> wrong to me.
>
> And then in auich_set_params() whatever sample rate gets set to the codec when
> you read it back its always 48000.
>
> Can anybody suggest whats happening here and how to fix?
>
> cheers
> mark