summaryrefslogtreecommitdiffstats
path: root/src/modules/alsa/alsa-mixer.c
Commit message (Collapse)AuthorAgeFilesLines
* alsa-mixer: Check that the kernel driver returns consistent limits with both ↵Tanu Kaskinen2011-03-301-0/+37
| | | | | | | | snd_mixer_selem_get_*_dB_range() and _ask_*_vol_dB(). The check is inspired by a driver that returned higher dB limit from snd_mixer_selem_get_playback_dB_range() than what _ask_playback_vol_dB() returned at maximum integer volume.
* alsa-mixer: Make sure that SND_MIXER_SCHN_UNKNOWN isn't used when indexing ↵Tanu Kaskinen2011-03-301-2/+11
| | | | | | e->masks. SND_MIXER_SCHN_UNKNOWN is defined as -1, so that's not a good array index...
* alsa-mixer: Make probing elements with more than two volume channels fail.Tanu Kaskinen2011-03-301-0/+16
| | | | | This is just a quick hack to prevent array overflow. Correct fix would be to implement support for more channels.
* alsa-mixer: Get rid of a compiler warning.Tanu Kaskinen2011-03-281-2/+2
| | | | | | | | | | On 64-bit systems LONG_MAX is greater than the largest possible value of a uint32_t variable, which caused the compiler to warn about a comparison that is always false. On 32-bit systems pa_atou() can return a value that will overflow when assigned to e->volume_limit, which has type long, so the comparison was necessary. This dilemma is resolved by using pa_atol() instead of pa_atou().
* Move compile-time checks around pa_run_from_build_tree to core-utilMaarten Bosmans2011-03-241-8/+4
| | | | To make the code cleaner and have the checks all in one place.
* alsa-mixer: Refactoring: merge element_mute_volume(), element_zero_volume() ↵Tanu Kaskinen2011-03-201-67/+35
| | | | and element_apply_constant_volume() into a single function.
* alsa-mixer: Implement constant volume.Tanu Kaskinen2011-03-201-2/+44
| | | | | | | This change makes it possible to configure an arbitrary constant volume for a volume element in the path configuration, which is applied when the path is selected. Note: this is only useful when the exact hardware and driver are known beforehand.
* Get rid of some warnings: -Wunsafe-loop-optimizationsMaarten Bosmans2011-03-201-7/+7
| | | | | | | | | | pulsecore/core-util.c: In function ‘pa_hexstr’: pulsecore/core-util.c:1858: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations] modules/alsa/alsa-mixer.c: In function ‘pa_alsa_decibel_fix_dump’: modules/alsa/alsa-mixer.c:3678: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations] modules/alsa/alsa-mixer.c: In function ‘pa_alsa_path_set_new’: modules/alsa/alsa-mixer.c:2640: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
* alsa-mixer: When figuring out the max_dB of a path, use only channels that ↵Tanu Kaskinen2011-03-111-4/+9
| | | | | | | | | | | are used by the path elements. Without this, p->max_dB could never be less than 0 dB, because the loop at the end of pa_alsa_path_probe() would reset p->max_dB to 0 as soon as the loop encountered a channel that wasn't touched by any element. There was a similar issue for p->min_dB too (it could never be more than 0 dB), which is also fixed by this patch.
* alsa-mixer: Implement support for setting element specific upper limits for ↵Tanu Kaskinen2011-03-111-1/+67
| | | | | | | | | | | | | volume. This feature is mainly useful in embedded systems that have built-in speakers. In such situations the full audio path is known beforehand, so it's possible to know what is the maximum sensible volume, and any higher volume can be disabled. The volume limit is set in path configuration files in the [Element] section, using option "volume-limit". The value is the desired maximum volume step of the volume element.
* alsa-mixer: Add a default case for a switch, so that the compiler won't ↵Tanu Kaskinen2011-03-111-15/+17
| | | | complain about unhandled cases.
* alsa-mixer: Use decibel fixes when getting and setting decibel volumes.Tanu Kaskinen2011-03-111-53/+207
|
* alsa-mixer: Add DecibelFix section to the profile set config file format.Tanu Kaskinen2011-03-111-3/+220
| | | | | This commit only implements the parser, the decibel fix data is not yet used for anything.
* alsa-mixer: Fix a git-am cockup in b0f72311Colin Guthrie2011-03-041-3/+3
| | | | | | | | | | It seems git managed to mess up a git-am with a patch from David which moved where this function was called element_probe to within itself (recursive which could normally lead to an infinite loop, but as it was now never called from anywhere else, this didn't happen). Thank you to Maarten for spotting and following up the issue.
* alsa-mixer: always round towards 0 dBDavid Henningsson2011-02-251-6/+9
| | | | | | | Always round towards 0 dB. Also add a few debug comments to aid troubleshooting. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
* alsa-mixer: add required-any and required-* for enum optionsDavid Henningsson2011-02-251-12/+78
| | | | | | | | | | | Now you can add required-any to elements in a path and the path will be valid as long as at least one of the elements are present. Also you can have required, required-any and required-absent in element options, causing a path to be unsupported if an option is (not) present (simplified example: to skip line in path if "Capture source" doesn't have a "Line In" option). Signed-off-by: David Henningsson <david.henningsson@canonical.com>
* alsa-mixer: Add a few well-known descriptionsDavid Henningsson2011-02-251-0/+7
| | | | | | | | Add front mic, rear mic, and docking line-in. These are likely to be present on modern hda chips, for reference see linux-2.6/sound/pci/hda/hda_codec.c:hda_get_input_pin_label Signed-off-by: David Henningsson <david.henningsson@canonical.com>
* alsa-mixer: Fix path set building when using the element-output or ↵Tanu Kaskinen2011-02-251-0/+5
| | | | | | | | | element-input mapping options in profile set configuration. When creating synthesized paths, pa_alsa_path_set_new() created duplicate elements for each path, and one of the duplicate elements would be marked as required absent. That made path probing fail. While debugging this, I noticed also that pa_alsa_path_synthesize() didn't initialize p->last_element properly.
* Fix typosZhang Wanming2010-12-201-4/+4
|
* alsa-mixer: make a few strings translatableLennart Poettering2010-11-251-3/+3
| | | | | | Original patch contributed by 'kelemeng' http://pulseaudio.org/ticket/843
* alsa: Take syncronized HW volume infra into use for alsa-sinkJyri Sarha2010-10-161-7/+110
| | | | | | Signed-off-by: Jyri Sarha <jyri.sarha@nokia.com> Reviewed-by: Tanu Kaskinen <tanu.kaskinen@digia.com> Reviewd-by: Colin Guthrie <cguthrie@mandriva.org>
* alsa: fix mixer profiles, add passthrough configPierre-Louis Bossart2010-07-131-3/+5
| | | | Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
* alsa-mixer: Replace erroneous PA_ALSA_VOLUME_IGNORE with ↵Tanu Kaskinen2010-05-101-1/+1
| | | | | | | PA_ALSA_ENUMERATION_IGNORE. This fix doesn't have any concrete effect, because the two constants have the same value.
* alsa-mixer: Use pa_xfree() instead of pa_xstrdup() for freeing a string.Tanu Kaskinen2010-05-101-1/+1
|
* alsa: use default output port namesLennart Poettering2010-02-211-2/+0
| | | | | instead of coming up with pointless aliases, reuse the already established names, for second headphones, and second speakers.
* alsa: cover "Desktop Speaker" mixer elementsLennart Poettering2010-02-211-1/+2
| | | | As exposed by really old Microsoft USB sound systems
* alsa: cover bass boost mixer elementLennart Poettering2010-02-091-0/+2
| | | | http://pulseaudio.org/ticket/740
* alsa: introduce more standard path namesLennart Poettering2009-11-051-10/+14
|
* alsa: Give all ports a human name to allow UI tools to present the choice to ↵Colin Guthrie2009-09-181-3/+3
| | | | users.
* alsa: correct assumptions about channels an element lacksVladimir Kokarev2009-09-171-10/+2
| | | | | | | If an element does not control some channels assume they are 0dB in comparison to the other elements, i.e. do not influence the volume at all. Previously we were assuming they were as high as the highest of the channels we do control.
* alsa: when probing for profiles configure buffer/period sizes since some ↵Lennart Poettering2009-09-091-3/+20
| | | | broken drivers apparently need that
* llvm-clang-analyzer: drop a few unnecessary assignments and other trivial fixesLennart Poettering2009-09-081-1/+1
|
* adjust various data/library paths automatically if we are run from a build treeLennart Poettering2009-08-211-3/+13
|
* alsa: adjust priority bonus of mappings that match the configured default ↵Lennart Poettering2009-08-121-2/+2
| | | | | | | | | | channel map We need to make sure that having both input and output weighs more for selecting the default profile than a channel map that matches the default channel map has. https://bugzilla.redhat.com/show_bug.cgi?id=496320
* alsa: don't reset volume/mute when selecting pathLennart Poettering2009-07-231-2/+2
|
* alsa: synthesize volume values more sensibly for channels that are not ↵Lennart Poettering2009-06-191-3/+21
| | | | controllable in hw
* alsa: properly count mappings of manually defined profilesLennart Poettering2009-06-181-0/+6
|
* alsa: fix duplicate mapping detectionLennart Poettering2009-06-181-2/+2
|
* alsa: allow placing device id in alsa device strings at arbitrary positionsLennart Poettering2009-06-171-2/+2
|
* alsa: rework mixer logicLennart Poettering2009-06-171-0/+3382
Completely rework mixer logic. This now allows controlling a full set of elements from a single sink's volume slider/mute button. This also introduces sink and source "ports" that can be used to choose different input or output ports with the UI. (i.e. "mic"/"line-in" or "speaker"/"headphones". The mixer paths and device maps are now configered in external configuration files and can be tweaked as necessary.