Age | Commit message (Collapse) | Author |
|
usable. better (generalized) solution forthcoming, but this is a
reasonable check anyway.
problem noted and fix tested by Alexey Suslikov, thanks.
|
|
reminder from Alexey Suslikov, thanks
|
|
- another place to use azalia_nid_to_index
|
|
- put selectors that feed ADCs into the record class like we do for
mixers
- use azalia_nid_to_index more
- shrink mixer items list by condensing mutes for multiple input
sources into a single _source control of type AUDIO_MIXER_SET.
for example,
record.mix6_mic_mute=off
record.mix6_mic2_mute=off
record.mix6_line_mute=off
record.mix6_hp_mute=off
record.mix6_spkr_mute=off
record.mix6_mix_mute=off
is now represented as
record.mix6_source=mic,mic2,line,hp,spkr,mix
to mute all sources but the mic just do
record.mix6_source=mic
reduces mixer items by about 25% on my machine. also shortens the
longest names.
|
|
- we're only interested in ADCs in the ADC converter group
|
|
assumed in places to be the index of the widget in the widget_t
array of the codec_t, but I'm paranoid.
use it to shrink/simplify/fortify some parts. will be used more
soon.
|
|
* configure widgets all in one place
* add a flag on the widget_t to let us know if the widget is not
connected; shaves a lot of connection checking code
* be sure not to add power widgets as connectable sources/sinks
* configure unconnected pins as output pins. should help some
MacBooks and be benign to other devices.
the last change has been tested by several as a separate diff. no
real functional changes otherwise.
from Alexey Suslikov. thanks!
|
|
on all (at least all tested) devices. briefly, it works like so:
group together all converters that can be reached from or can reach
a connected input or output pin. ordering in the converter groups
correlates to the association and sequence of the input/output pin.
remove lots of static converter groupings in favor of the generic
grouping method. the only static groups left are for codecs that
still have static mixer configurations.
tested by many. thanks to all who tested; this wouldn't have
happened without your support.
|
|
Add this and other missing entries to the pre-defined DAC groups.
Tested with ALC885; other models according to their data sheets.
ok jakemsr@
|
|
being the cause of PR5982. unfortunately, there's no easy and clean
solution to automatic muting. we can't always rely on the codec
giving us the right information. people have different preferences
as to what should be muted and what shouldn't. etc, etc.
so instead, just make the sense state of jacks that support sensing
available through the mixer interface. this allows for any possible
user configuration and supports all pins that have sense capabilities,
not just headpones. codecs that use the generic mixer configuration
(which is the plan for all codecs) and have sensing capable pins will
now get a few more read-only mixer items, such as:
outputs.hp_sense=plugged
outputs.mic_sense=unplugged
outputs.line_sense=unplugged
hopefully what they mean is self-explanatory.
based on much discussion with ratchov@ and Alexey Suslikov
|
|
- recognize several STAC (Sigmatel/IDT) codecs and create converter
groups for the multi-channel capable codecs.
- use the correct name for Sigmatel 7661/7662.
|
|
adds outputs.master to ALC885 and ALC888 (and probably others that
don't yet have it). also makes ALC88{2,3} much more useful.
tested by jmc@ and simon@ (and myself), thanks.
|
|
the real and already existing inputs.dac in most cases.
|
|
passing in "preferred" DACs and ADCs. this will be used to give more
devices "outputs.master" and "record.volume".
|
|
use the lists to figure out what class some widgets belong to.
ok ratchov
|
|
between class, device and qualifier.
replace use of '.' with '_' where it's not really a separator.
idea from/ok ratchov@
warning: if you have a mixerctl.conf(5), it will need to be updated.
|
|
|
|
* DEBUG cleanup
from Alexey Suslikov, thanks
|
|
jack sense handling. makes azalia_generic_mixer_pinctrl useless, so zap it.
* azalia_generic_mixer_pin_sense works well enough to not need guessing
of pin direction in azalia_generic_mixer_default.
from Alexey Suslikov, thanks
|
|
* MAX_VOLUME_255 has been defined for ages. remove this define
and the code that was only being used when this wasn't defined.
* remove azalia_generic_mixer_{max,validate_value} since they
are pointless.
* when setting both stereo channels to the same level, just set
the right channel level to the left channel level instead of
calculating both separately.
from Alexey Suslikov
|
|
needs adjustment. Allows the integrated speakers to work.
from Alexey Suslikov
|
|
tested by danh@ and Aaron Stellman on Thinkpad T61.
from Alexey Suslikov, thanks
|
|
This fixes fallout for AD1984 revealed by recent azalia.c
changes and reported on misc@.
While here:
* move gpio_unmute to more logical place,
* remove code ifdef'ed and unused for ages.
from Alexey Suslikov, thanks
Index: sys/dev/pci/azalia_codec.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/azalia_codec.c,v
retrieving revision 1.52
diff -u -r1.52 azalia_codec.c
--- sys/dev/pci/azalia_codec.c 23 Oct 2008 02:23:04 -0000 1.52
+++ sys/dev/pci/azalia_codec.c 24 Oct 2008 17:29:36 -0000
@@ -98,6 +98,7 @@
(const codec_t *, nid_t, int, u_char);
int azalia_generic_set_port(codec_t *, mixer_ctrl_t *);
int azalia_generic_get_port(codec_t *, mixer_ctrl_t *);
+int azalia_gpio_unmute(codec_t *, int);
int azalia_alc260_init_dacgroup(codec_t *);
int azalia_alc260_mixer_init(codec_t *);
@@ -127,7 +128,6 @@
int azalia_stac9221_set_port(codec_t *, mixer_ctrl_t *);
int azalia_stac9221_get_port(codec_t *, mixer_ctrl_t *);
int azalia_stac9221_apple_unsol_event(codec_t *, int);
-int azalia_gpio_unmute(codec_t *, int);
int azalia_stac7661_init_dacgroup(codec_t *);
int azalia_stac7661_mixer_init(codec_t *);
int azalia_stac7661_set_port(codec_t *, mixer_ctrl_t *);
@@ -1708,6 +1708,26 @@
return azalia_generic_mixer_get(this, m->nid, m->target, mc);
}
+int
+azalia_gpio_unmute(codec_t *this, int pin)
+{
+ uint32_t data, mask, dir;
+
+ this->comresp(this, this->audiofunc, CORB_GET_GPIO_DATA, 0, &data);
+ this->comresp(this, this->audiofunc, CORB_GET_GPIO_ENABLE_MASK, 0, &mask);
+ this->comresp(this, this->audiofunc, CORB_GET_GPIO_DIRECTION, 0, &dir);
+
+ data |= 1 << pin;
+ mask |= 1 << pin;
+ dir |= 1 << pin;
+
+ this->comresp(this, this->audiofunc, CORB_SET_GPIO_ENABLE_MASK, mask, NULL);
+ this->comresp(this, this->audiofunc, CORB_SET_GPIO_DIRECTION, dir, NULL);
+ DELAY(1000);
+ this->comresp(this, this->audiofunc, CORB_SET_GPIO_DATA, data, NULL);
+
+ return 0;
+}
/* ----------------------------------------------------------------
* Realtek ALC260
@@ -2181,18 +2201,11 @@
int
azalia_alc882_init_dacgroup(codec_t *this)
{
-#if 0
- static const convgroupset_t dacs = {
- -1, 3,
- {{4, {0x02, 0x03, 0x04, 0x05}}, /* analog 8ch */
- {1, {0x06}}, /* digital */
- {1, {0x25}}}}; /* another analog */
-#else
static const convgroupset_t dacs = {
-1, 2,
{{4, {0x02, 0x03, 0x04, 0x05}}, /* analog 8ch */
{1, {0x06}}}}; /* digital */
-#endif
+ /* don't support for 0x25 dac */
static const convgroupset_t adcs = {
-1, 2,
{{3, {0x07, 0x08, 0x09}}, /* analog 6ch */
@@ -2484,13 +2497,14 @@
azalia_ad1984_init_dacgroup(codec_t *this)
{
static const convgroupset_t dacs = {
- -1, 1,
- {{2, {0x03, 0x04}}}};
-
+ -1, 2,
+ {{2, {0x04, 0x03}}, /* analog 4ch */
+ {1, {0x02}}}}; /* digital */
static const convgroupset_t adcs = {
- -1, 1,
- {{1, {0x08}}}};
-
+ -1, 3,
+ {{2, {0x08, 0x09}}, /* analog 4ch */
+ {1, {0x06}}, /* digital */
+ {1, {0x05}}}}; /* digital */
this->dacs = dacs;
this->adcs = adcs;
return 0;
@@ -3006,27 +3020,6 @@
DPRINTF(("%s: unknown tag: %d\n", __func__, tag));
}
return 0;
-}
-
-int
-azalia_gpio_unmute(codec_t *this, int pin)
-{
- uint32_t data, mask, dir;
-
- this->comresp(this, this->audiofunc, CORB_GET_GPIO_DATA, 0, &data);
- this->comresp(this, this->audiofunc, CORB_GET_GPIO_ENABLE_MASK, 0, &mask);
- this->comresp(this, this->audiofunc, CORB_GET_GPIO_DIRECTION, 0, &dir);
-
- data |= 1 << pin;
- mask |= 1 << pin;
- dir |= 1 << pin;
-
- this->comresp(this, this->audiofunc, CORB_SET_GPIO_ENABLE_MASK, mask, NULL);
- this->comresp(this, this->audiofunc, CORB_SET_GPIO_DIRECTION, dir, NULL);
- DELAY(1000);
- this->comresp(this, this->audiofunc, CORB_SET_GPIO_DATA, data, NULL);
-
- return 0;
}
/* ----------------------------------------------------------------
|
|
enables EAPD when needed
- new function azalia_generic_mixer_create_virtual - creates some
well known mixer controls, such as outputs.master
- use the two new functions when setting up a codec with the generic
codec support
- remove explicit pindir manipulations (azalia_generic_mixer_pin_sense
does this automatically now)
- add some GPIO quirks (from FreeBSD's snd_hda)
- move all GPIO quirks into one place
- add DAC/ADC groupings and support for several more codecs using the
generic codec support
- correct Sigmatel STAC9872AK name
- initialize unsol_event to NULL by default
DAC/ADC grouping and create_virtual/pin_sense code from NetBSD.
GPIO quirks from FreeBSD.
from Alexey Suslikov, thanks
|
|
Clean up a little while here.
from Alexey Suslikov, thanks
tested by several as part of a larger diff, thanks also
|
|
from conection and mixer lists. It also removes knobs connected to
power widgets.
from NetBSD via Alexey Suslikov, thanks
tested by several, thanks also
|
|
Not sure what's more surprising: how long it took for NetBSD to
catch up to the rest of the BSDs (including UCB), or the amount of
code that NetBSD has claimed for itself without attributing to the
actual authors.
OK deraadt@
|
|
ok dlg@
|
|
Tested by Alexander Hall, thanks
ok jakemsr
|
|
avoids some duplicate items when a pin widget has both input and
output amplifiers.
|
|
now. Also, note that codec->init_widget functions must be used with
care since they can create duplicate mixer item names.
|
|
the code here. Tested by Rob Lytle, thanks.
|
|
|
|
ok ratchov
|
|
other machines with STAC9221.
Tested by Vladas Urbonas on XPS M1210.
no objections jakemsr@
|
|
Tested jmc, jakemsr
|
|
Tested by jmc, ckuethe, kettenis and jakemsr.
|
|
to be enabled in order for it to produce sound. It can use the same
gpio function as the macs, so rename that to azalia_gpio_unmute.
Tested by damien@, no regressions noticed by jakemsr@
|
|
for master, remove useless pin direction calls, add mixer item for mic
boost, remove useless item for the volume knob.
|
|
AD1984. Recording isn't supported yet.
Lots of testing by reyk@, Pau Amaro-Seoane and Alexey Vatchenko;
thanks!
|
|
is available.
|
|
the DAC volumes.
Tested by otto@, ajacoutot@, merdeley@ and Darrin Chandler.
|
|
ok dlg@
|
|
Some codecs, like the AD1984 found in x60s, need this in order for the
speakers to work.
New mixer items with names *.eapd will show up for codecs that need it
and that are using the generic functions.
From kent@netbsd
|
|
their purpose, since that's often incorrect.
This should solve some no-sound problems for codecs using the generic
functions.
From kent@netbsd
|
|
speakers and line outputs will now mute and unmute depending on
headphone presence.
Tested on Macbook, Macbook Pro and Mini by otto@, ajacoutot@, merdely@
and Darrin Chandler, thanks.
|
|
"selector" and "front", so instead create the items that it actually
needs.
This unbreaks the mute button in wscons, and allows setting the volume
in programs like xmms and xine. This is for STAC9200 only - similiar
fixes for other codecs coming soon.
Tested and ok krw@
|
|
valid step, and keep them in sync. This lets audio(4) set exact gain
levels based on the mixer delta, and unbreaks volume up/down buttons
in wscons. This also avoids a divide by zero that could occur if the
generic mixer init found an amplifier with zero steps.
Problem noticed and tested by jmc@, similar diff tested by krw@
|
|
- enable internal mic and select it as the default recording source,
- create mixerctl record.source for selecting between internal and
external mics,
- mute input by default.
|
|
|