Driver hacking questions

  • Ryan Underwood

    Ryan Underwood - 2003-04-12

    I'm trying to add a mute/unmute and slider to control the rear output via OSS mixer.  To enable (unmute) the rear output, it is making D2 of 0x6E on the codec control high.  As far as I can tell, the following line should accomplish that:
    WriteCodec(dev->core, AC97REG_ADDITIONAL_FEATURES, 0x4);

    where I have defined AC97REG_ADDITIONAL_FEATURES as 0x6E

    However, with the following code in init_mixer in au_mixer.c:


    int i;
    for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) {
    dev->mix_vol[i] = 0x5050;
    write_mixer(dev, i, dev->mix_vol[i]);

    dev->mix_recsrc = SOUND_MASK_MIC;
    set_rec_src(dev, dev->mix_recsrc);              /* default to mic source */

    WriteCodec(dev->core, AC97REG_ADDITIONAL_FEATURES, 0x4);


    I would imagine this would enable the rear output upon module load.  But... it doesn't.  Does anyone have any idea why?

    If this could work, adding the rear output as a mixer option shouldn't be too bad.  there is a front/rear fader that can be used as the "volume" control for the rear output.


    • Ryan Underwood

      Ryan Underwood - 2003-04-12

      I forgot to mention.  I got the idea of a mixer option from the sigmatel datasheet and vizard's post from earlier.  vizards code to enable the rear output was the following:
         reg = (0x6e << 16) | 0x4;  // Originally was 0x2000
      //set write bit
         reg = reg | 0x800000;
      //write to register
         control[0x29188 >> 2] = reg;

      I think WriteCodec(core, 0x6e, 0x4) should do the same thing as this.  Here is my guess as to how this should work.  In essence the WriteCodec call takes 0x6e, shifts it left two bytes, puts 0x4 in the low part, and then ors it with 0x800000 (making it effectively 0xee).  So the value being written by WriteCodec(core, 0x6e, 0x4) thus should be 0x00ee0004.

      Am I correct or missing something here?

    • Manuel Jander

      Manuel Jander - 2003-04-15

      Im very glad to here other people hacking on the Aureal drivers. But i would like to invite to using the new OpenSource driver instead. Its avaiable at savannah and here at sourceforge as a patch against ALSA 0.92.

      It is an ALSA driver, and by now AU8820 works tested 100% OK and the AU8830 very close to be bug free.
      SMP compatibility is unknow thought (any SMP hacker around there ? A few locks should do the trick...)
      It supports by far much more features. The Hardware Equalizer will be supported too (in the works).

      And it may be easier to hack on a Open Source driver, since you can see what actually is going on.

      Best Regards

      Manuel Jander


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks