Age | Commit message (Collapse) | Author |
|
default DAC receive the first playback stereo channel pair if the DAC
wouldn't otherwise be used and allow the jack's output volume to be
controlled by outputs.master by default. this was already mostly
implemented for codecs with 3 or more dacs, but front headphone jacks
are also common on 2 dac codecs as well.
|
|
|
|
codecs a controller can support
* dynamically allocate memory for the array of codec structures
|
|
usable. detach the driver if the device is only capable of HDMI.
this keeps an unusable device from being /dev/audio0 (thus
/dev/audio by default), while /dev/audio1 is fully functional.
|
|
own function
|
|
* remove irrelevant comment
* this driver uses at most 2 converter groups per group set, don't
allocate more than needed
* remove unused members from codec_t
azalia.c:
* macros for register values
|
|
first 30 do nothing. perhaps there are other codecs with such
amps? (ab)use some reserved bits in the amplifier capabilities
parameter to store the first volume step that actually changes the
volume. problem reported and patch tested by LEVAI Daniel.
|
|
reported and patch tested by Bryan Chapman. according to FreeBSD,
this might be needed for other MacBookPro models but no one else has
told me their MacBookPro doesn't work.
|
|
more non-generic versions, and there never will be again.
|
|
directly instead of through pointers in the codec_t.
- fold azalia_generic_{g,s}et_port into azalia_{g,s}et_port since both
are small and partly duplicated eachother.
|
|
macros and codec->init_widget. now there is only only place to look
to see what special handling a specific codec will get.
|
|
the output jacks to different DACs.
- multichannel codecs often have a front headphone jack that is
intended to be used separately from the multichannel jacks. if a front
headphone jack exists, try to connect it to a DAC not used by the
multichannel jacks.
|
|
the node id of the "parent" widget
- initialize widgets' mixer_class ealier
|
|
- don't unmute input from a built-in mic on the main input mixer
intended to stop possible feedback loops between buit-in speakers
and built-in mics. built-in mics also tend to capture machine
noise, especially fans. actual recording should not be affected.
|
|
default, as long is the first output pin is not also connected to
that DAC. cleanup a bit now that there are multiple muting methods.
|
|
be a non-generic version. move the prototype to azalia.h so it
can also be used in azalia.c in the future.
|
|
the pin nids, the default converter the pin connects to and the
pin's priority. priority is based on the pin's default direction
and the association and sequence numbers from the vendor. according
to the hda spec, lower association/priority means higher priority.
sort the list in order of highest to lowest priority.
|
|
and do some further initialization and information gathering:
- disable mixer and selector widgets that don't have any enabled
connections
- create lists of analog and digital input and output converters
- find the internal/fixed connection microphone and speaker, and
which converters they are connected to by default
- create a list of jack sensing capable pins
some of this was already being done in other places, but moved here
for simplification/better organization
|
|
VRef level and be sure to turn VRef off when not set for input.
|
|
|
|
that don't have selectable inputs. all connections are active, always.
showing all connections in the set rather than just one makes a lot
more sense.
|
|
longer direcly affect other widgets
- if an unsolicited response is received from a volume knob widget,
adjust outputs.master according to the measured change in level of the
volume knob widget
|
|
function for creating "master" volume control.
- apply gpio quirks separately from and prior to configuring the mixer.
gpio manipulation can cause noise on output channels. configuring
gpio before amps are unmuted in the mixer configuration is a good
thing.
from Alexey Suslikov, thanks
|
|
magic numbers
from Alexey Suslikov
|
|
are not really useful as output devices and fixed speakers are not
really useful as input devices
|
|
outputs by default it's nice to have a way to control multiple sources/
outputs with a single control setting.
so here's an implementation of "master" controls that uses selectable
control lists, because the biggest problem is figuring out what should
be "master".
outputs.master.slaves is the current set of output mixer controls
that settings for outputs.master and outputs.master will be applied
to. record.volume.slaves works similarly for recording inputs.
|
|
recording and playback paths.
- select a subset of controls that are relevant in a default
configuration for each path.
|
|
jacks which can mute speaker output are chosen with the new mixer item
'outputs.spkr_muters'. e.g.
$ mixerctl -v outputs.spkr_muters
outputs.spkr_muters=hp,mic,line-in { hp mic line-in }
if a jack is present in any listed "muter" plug, AND that plug is
configured for output (e.g. outputs.hp_dir=output) the speaker will
be muted. the list of muters is selectable, selecting none turns of
muting altogether.
|
|
keep track of some information about them, such as the DAC they are
connected to by default. this will be used soon.
|
|
b) members of the widget connection list may be invalid.
so,
- change azalia_nid_to_index to azalia_widget_enabled, and have it only
check that the given nid is valid, and that the corresponding widget
is enabled.
- use azalia_widget_enabled every time members of the connection list
are used.
|
|
- use "beep" as pin device 0xe
|
|
classes in azalia.h instead of azalia_codec.c. this will allow
the mixer class to be determined outside of azalia_generic_mixer_init.
|
|
- MI_TARGET_* are enumerated in hex
from Alexey Suslikov
|
|
reminder from Alexey Suslikov, thanks
|
|
items. BIOSes can set the jack detect override bit to tell us that
the jack detection circuirty isn't actually attached.
should remove the _sense controls that never change.
|
|
- 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.
|
|
* 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!
|
|
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
|
|
|
|
formats and creates an array of unique encodings. use the array in
azalia_query_encoding.
in other words, no more duplicate encodings in `audioctl encodings`.
|
|
* 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
|
|
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@
|
|
Tested by jmc, ckuethe, kettenis and jakemsr.
|
|
|
|
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
|
|
move it out of azalia_generic_mixer_set into its own function,
azalia_generic_mixer_pinctrl. From kent@netbsd.
In azalia_stac9200_mixer_init, let the unsolicited event handler make
the initial headphone vs speaker choice. Removes some duplicate code.
These changes only affect STAC9200. Tested by krw@ on a Latitude
D620.
|
|
- The STAC9200 codec was mistakenly referred to as STAC9220. Change
this to STAC9200 and add a link to the datasheet.
- Add a new target, MI_TARGET_PINCTRL, to azalia_generic_mixer_set()
that allows us to turn pins on and off.
- Add an unsolicited event handler for STAC9200 that will toggle the
headphone and speaker pins. This means the speaker will now mute and
unmute based on headphone presence.
- Spelling: PRESENSE -> PRESENCE
Tested by ajacoutot@, tedu@ and krw@, ok krw@.
|
|
From kent NetBSD
|