Comments inline.
as always, tnx in advance for putting up with my outlook web access based crappy citing
-----Original Message-----
From: Takashi Iwai [mailto:tiwai@xxxxxxx]
Sent: Thu 3/15/2007 5:11 AM
To: John Utz
Cc: alsa-devel@xxxxxxxxxxxxxxxxxxxxx
Subject: Re: [PATCH] ac97_patch.c ac97_codec.{ch} - enable 'Smart 5.1' UAJ on VIA vt1618 ac97 codec
Hi,
thanks for the patch.
ME => you are more than welcome!
At Wed, 14 Mar 2007 18:12:58 -0700,
John Utz wrote:
>
> Greetings;
>
> Attached is support for configuring the ins and outs on a vt1618 codec. This is a
> substantially more complicated patch than the previous one for the vt1617a ( tis why i
> did that one first! :-) )
>
> Several controls are added, they may or may not be implemented on all hardware,
> some of them seem to have no effect on an MSI CN700T mainboard:
>
> "Center/LFE Exchange"
> "DC Offset Removal"
> "Headphone Amp Disable"
> "Back Channel Disable"
> "Soft Mute Disable"
Switches to disabling features are rather confusing.
It's better to invert them and make them working as on = enable, off =
disable.
ME => Fair 'nuf, will fix and resubmit - these are the register names from the via docs
> "Surround Back is Aux In"
ME => I can probably rethink this into a 2 way enum
> "Universal Audio Jack 0 (Speaker)"
> "Universal Audio Jack 1 (Line In)"
> "Universal Audio Jack 2 (Mic In)"
They are pretty uncommon as mixer names.
Especially, parentheses in mixer names are not good.
ME => UAJ is a non vendor-specific tech, it's on the VT1618 and the ALC880(?)
ME => it might be abstractable and provide driver simplification for UAJ chips.
ME => I put it in the label because the user might gain insight from it
ME => I will change it thusly:
ME =>
ME => Universal Audio Jack Speaker
ME => Universal Audio Jack Line In
ME => Universal Audio Jack Mic In
ME =>
ME => Would this be acceptable?
> Setting these 3 new controls to the settings to:
>
> "DAC Mixed (5.1 Out)", "Reserved (5.1 Out)", "Reserved (5.1 Out)"
Can we simply use "5.1 Out"?
ME => This is the nub of the problem! The vt1618 docs are less than clear.
ME => I wanted to communicate the uncertainty of this setting to the user.
ME => By experimentation, i made 5.1 work on *ONE* board (MSI CN700T)
ME => by setting the register to weird values:
ME =>
ME => DAC Mixed, Reserved, Reserved
ME =>
ME => What if this breaks other implementations?
ME =>
ME => The chip has both UAJ pins and dedicated output pins and some
ME => boards will probably use the dedicated output pins instead of
ME => the UAJ. If the mixer has something that says 5.1 Out, a user
ME => seeking surround will set it! :-)
> allows 6 channel output to be played using the following command:
>
> aplay -Dhw:0,1 chan-id.wav
>
> Note that 6 bits would require an impractical 64 way enum, thus the 3 controls.
>
> Changelog Entry
>
> ====
>
> [PATCH] ALSA: Smart 5.1 / Universal Audio Jack for VIA 1618 codec
>
> This patch provides Universal Audio Jack support by way of 3 4 way enums that allows
> the user to choose 1 of 64 possible settings for the vt1618's version of what via
> calls 'Smart 5.1'
>
> A new codec patch function is implemented:
>
> patch_vt1618
>
> Several functions are added for reading/writing the Universal Audio Jack register:
>
> snd_ac97_vt1618_UAJ{012}_{putget}
>
> A new pair of ac97_codec functions are added to allow for reading and writing paged
> out registers:
>
> snd_ac97_read_page
> snd_ac97_write_page
They are not necessarily exported at all as long as they are used in
ac97_* code.
ME => so, i should not export them? ie: EXPORT_SYMBOL(snd_ac97_write_page)
ME => why are the other ones exported? ie: EXPORT_SYMBOL(snd_ac97_write_cache)
In the latest version, even they could be static
ME => so all of them should be static?
since ac97_patch.c is included from ac97_codec.c.
ME => AHA! that explains something i noticed when merging yesterday.
ME => all the patch_foo decls are gone in ac97_patch.h!
That is, you can use even snd_ac97_page_save() and
snd_ac97_page_restore() from ac97_patch.c. (You need forward function
declarations, though.)
Or, even better to create more generic version of paged register
accessor, and rewrite snd_ac97_get/put_volsw(), too...
ME => umm, did i not make generic page read and write? am i misunderstanding you?
unsigned short snd_ac97_read_page(struct snd_ac97 *ac97, unsigned short reg, unsigned short page)
{
unsigned short page_save;
unsigned short ret;
mutex_lock(&ac97->page_mutex);
page_save = snd_ac97_read(ac97, AC97_INT_PAGING) & AC97_PAGE_MASK;
snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, page);
ret = snd_ac97_read(ac97, reg);
snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, page_save);
mutex_unlock(&ac97->page_mutex); /* unlock paging */
return ret;
}
void snd_ac97_write_page(struct snd_ac97 *ac97, unsigned short reg, unsigned short value, unsigned short page)
{
unsigned short page_save;
mutex_lock(&ac97->page_mutex);
page_save = snd_ac97_read(ac97, AC97_INT_PAGING) & AC97_PAGE_MASK;
snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, page);
snd_ac97_write(ac97, reg, value);
snd_ac97_update_bits(ac97, AC97_INT_PAGING, AC97_PAGE_MASK, page_save);
mutex_unlock(&ac97->page_mutex); /* unlock paging */
}
Takashi
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Alsa-devel mailing list Alsa-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/alsa-devel