summaryrefslogtreecommitdiffstats
path: root/src/modules/alsa
Commit message (Collapse)AuthorAgeFilesLines
* alsa: Fix log output to inform about positive base volumes correctly.Tanu Kaskinen2011-04-042-8/+2
| | | | | This fix was done for _set_port_cb() already, but the first fix didn't fix setup_mixer(). Now that's done too.
* 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-203-12/+59
| | | | | | | 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]
* Update PA_MODULE_USAGE to be in line with actual implementationMaarten Bosmans2011-03-182-1/+5
|
* alsa: Add two more ALSA audio card profilesDaniel Mack2011-03-183-0/+225
| | | | | This adds profiles for Native Instruments recently announced "Trator Audio 6" and "Traktor Audio 10".
* Fix up according to Coding StyleMaarten Bosmans2011-03-112-2/+2
| | | | Only whitespace changes in here
* 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-113-1/+69
| | | | | | | | | | | | | 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-card: Print the profile set configuration when loading the card.Tanu Kaskinen2011-03-111-0/+1
|
* 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-112-56/+212
|
* alsa-mixer: Add DecibelFix section to the profile set config file format.Tanu Kaskinen2011-03-114-14/+297
| | | | | 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: Add support for "Line Boost" elementDavid Henningsson2011-02-282-0/+11
| | | | Signed-off-by: David Henningsson <david.henningsson@canonical.com>
* alsa-mixer: Make sure capture source and input source use right pathDavid Henningsson2011-02-256-45/+12
| | | | | | | Make sure that mic and line (with common names) use the specific path instead of the analog-input one. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
* alsa-mixer: Fixup "Mic"/"Line"/"analog-input" paths to work with the new pathsDavid Henningsson2011-02-254-22/+111
| | | | Signed-off-by: David Henningsson <david.henningsson@canonical.com>
* alsa-mixer: Add new paths for Internal Mic, Front Mic, Rear Mic and Dock MicDavid Henningsson2011-02-256-78/+317
| | | | Signed-off-by: David Henningsson <david.henningsson@canonical.com>
* 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-253-12/+91
| | | | | | | | | | | 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-card: Add a new modarg "profile_set" for giving the card a custom ↵Tanu Kaskinen2011-02-251-1/+8
| | | | profile set configuration file.
* 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.
* alsa: disable period wakeups in tsched mode if possiblePierre-Louis Bossart2011-02-011-0/+28
| | | | | | | | | | | | | | | | | | | | | | | This patch reflects a new capability that Lennart was wishing for. Wish granted... Re-submitting it now that alsa-lib 1.0.24 provides additional entry points to disable period wakeups in timer-scheduling mode if hardware can work without it (HDAudio, oxygen and Intel SST). Example with standard playback on HDAudio output Before change: Top causes for wakeups: 3.8% ( 5.4) [hda_intel] <interrupt> 2.8% ( 4.0) alsa-sink After change: Top causes for wakeups: 2.3% ( 3.0) alsa-sink Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
* build: Don't include empty Makefile.am in subdirsMaarten Bosmans2011-01-314-80/+0
|
* ratelimit: fix log levels of log suppression messagesLennart Poettering2011-01-312-5/+5
| | | | | | | | | When logging a suppression message do so on the same log level as the suppressed messages. Cherry picked by Colin Guthrie from ec5a7857127a1b3b9c5517c4a70a9b2c8aab35ca with a couple of additional changes due to extra limiting in master that was not present in stable-queue.
* alsa-sink: Don't assume we were able to enable hw-volume or sync-volume (v1.1)Jyri Sarha2011-01-151-21/+21
| | | | | This patch also disables mixer callback code if we do not have neither HW-volume or HW-mute.
* alsa-sink: Fix double use of stringJyri Sarha2011-01-151-6/+8
|
* Fix typosZhang Wanming2010-12-201-4/+4
|
* build-sys: Replace dummy Makefiles with proper Makefile.am'sColin Guthrie2010-12-058-4/+80
| | | | | | | | | | | | | | | | | | | | | | | | This is needed to better support out of tree builds (including distcheck) and to ensure the necessary folders are created in the build tree on configure and also works around an intl-tools bug (https://bugs.launchpad.net/intltool/+bug/605826) The Makefile.am's used are minimal (and in some cases completely blank). At present they do not include anything interesting with the majority of the real work still done by the monolitic src/Makefile.am It may make sense to start splitting out src/Makefile.am into smaller chunks but this commit makes the minimum changes to address the issues that result from using make distcheck and other out of tree builds. Note: This 'breaks' the ability to type make in e.g. the src/modules folder and have all of PA rebuilt accordingly (this is because the static Makefiles previously present just did a "make -C ..") which was purportedly for use in emacs. But I'm sure there will be a better and more robust way to configure emacs to do your builds properly if this behaviour is still desirable.
* alsa-sink: take base volume into account when applying hw volumeJuho Hämäläinen2010-12-011-2/+8
| | | | | | | Currently if sink base volume differs from 0dB and sync-volume is used, wrong volume values are written to hw. This patch fixes that. Signed-off-by: Juho Hämäläinen <ext-juho.hamalainen@nokia.com>
* alsa-source: fix enum typesLennart Poettering2010-11-251-2/+2
|
* alsa-mixer: make a few strings translatableLennart Poettering2010-11-251-3/+3
| | | | | | Original patch contributed by 'kelemeng' http://pulseaudio.org/ticket/843
* Handle 'Internal Mic 1' as an 'Input Source'Daniel T Chen2010-11-251-0/+4
| | | | | | | | | BugLink: https://launchpad.net/bugs/680810 Some laptops have 'Internal Mic 1' exposed as an 'Input Source', e.g., Dell XPSM 1530, so handle these, too. Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
* Add "Rear Mic" to alsa mixer paths.David Henningsson2010-11-252-0/+13
| | | | Signed-off-by: David Henningsson <david.henningsson@canonical.com>
* alsa: Print dB values in addition to percentages in debug messages.Tanu Kaskinen2010-11-192-17/+46
| | | | | | | How about this? There are a couple of bugs in sink_write_volume_cb, by the way. Another patch will be sent once this dB value printing patch is accepted. -- 8< --
* alsa: Sprinkle some PA_UNLIKELYs around error checksArun Raghavan2010-11-181-11/+10
| | | | | This just adds a few PA_UNLIKELY macros around some error paths in frequently called code.
* alsa: remove redundant call to snd_pcm_nonblock()Pierre-Louis Bossart2010-11-161-2/+0
| | | | | | | The PCM handle is already opened with the SND_PCM_NONBLOCK flag. This additional call is useless. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
* alsa-mixer: add profile for Native Instruments KorecontrollerDaniel Mack2010-10-162-0/+86
|
* daemon-conf: Add sync volume parameters to daemon-confJyri Sarha2010-10-161-0/+1
| | | | | | 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: Take syncronized HW volume infra into use for alsa-sinkJyri Sarha2010-10-166-25/+246
| | | | | | 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: Only set the 'first' flag to false when we actually call snd_pcm_start()Colin Guthrie2010-09-141-1/+2
| | | | Previously, if work_done was false, we could conceivably not call snd_pcm_start().
* alsa: Set the rewind safeguard proportionally to sample specColin Guthrie2010-09-141-2/+3
| | | | | | | | | | | | | Currently when rewinding alsa, a fixed value of 256 bytes is used, which represents 1.33ms @ 48kHz (2ch, 16bit). This is typically fine and due to DMA constraints we would not want to rewind less than this. However with more demanding sample specs, (e.g. 8ch 192kHz 32bit) 256 bytes is likely not sufficient, so calculate what 1.33ms would be and use which ever value is bigger. Discussed with David Henningsson and Pierre-Louis Bossart here: http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/7286
* alsa-mixer: add profile for Traktor Kontrol S4Daniel Mack2010-09-122-0/+82
| | | | | This new audio interface from Native Instruments has 2 stereo channels for both input and output direction. This patch adds mappings for them.
* alsa: make defines for smoother configurationWim Taymans2010-09-092-4/+10
| | | | | | | | | | | | Make new defines for the smoother window size and adjust time constants instead of reusing some unrelated constant. Increase the smoother window size even more because the bigger it is, the better. Since we have a 200ms max update interval and the max smoother history is 64 entries, 10seconds is a good default. Decrease the smoother adjust time to 1 second. The previous value of 4 seconds was too much to adapt quickly after a resume.