Comment 73 for bug 1487168

Revision history for this message
Raymond (superquad-vortex2) wrote : Re: [Emulated AD1980 AC97 inside Virualbox 5.0, playback] volume slider problem

to avoid the driver rename master playback volume to master surround, you need to specify

ac97->spec.ad18xx.lo_as_master = 1;

only for the enumerated ad1980 codec inside virtualbox

static int patch_ad1888(struct snd_ac97 * ac97)
{
 unsigned short misc;

 patch_ad1881(ac97);
 ac97->build_ops = &patch_ad1888_build_ops;

 /*
  * LO can be used as a real line-out on some devices,
  * and we need to revert the front/surround mixer switches
  */
 if (ac97->subsystem_vendor == 0x1043 &&
     ac97->subsystem_device == 0x1193) /* ASUS A9T laptop */
  ac97->spec.ad18xx.lo_as_master = 1;

 misc = snd_ac97_read(ac97, AC97_AD_MISC);
 /* AD-compatible mode */
 /* Stereo mutes enabled */
 misc |= AC97_AD198X_MSPLT | AC97_AD198X_AC97NC;
 if (!ac97->spec.ad18xx.lo_as_master)
  /* Switch FRONT/SURROUND LINE-OUT/HP-OUT default connection */
  /* it seems that most vendors connect line-out connector to
   * headphone out of AC'97
   */
  misc |= AC97_AD198X_LOSEL | AC97_AD198X_HPSEL;

 snd_ac97_write_cache(ac97, AC97_AD_MISC, misc);
 ac97->flags |= AC97_STEREO_MUTES;
 return 0;
}