summaryrefslogtreecommitdiffstats
path: root/src/modules/alsa
Commit message (Collapse)AuthorAgeFilesLines
* alsa-sink: fix mmap_write() work_doneWu Fengguang2011-06-281-1/+1
| | | | | mmap_write() work_done is wrongly initilized to TRUE. It ends up never being FALSE. Fix it to reduce the costly update_smoother() calls.
* alsa-mixer: Whoops, forgot to git-add this in a previous.Colin Guthrie2011-06-261-0/+35
|
* alsa-mixer: Add UAC1.0 Sennheiser Dongle to the usb-headset profile.Colin Guthrie2011-06-261-0/+2
| | | | Reported by Sean McNamara
* alsa-mixer: Add an mixer profile exception for a BT Agile handsetColin Guthrie2011-06-251-0/+4
|
* alsa-mixer: Add workaround for some USB headsetsDavid Henningsson2011-06-251-0/+3
| | | | | | | | | This is a workaround - these usb headsets have one output volume control only, labeled "Speaker". This causes the default profile set to not control the volume at all, which is a bug. Workaround that by creating a separate profile set. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
* Remove unnecessary #includesMaarten Bosmans2011-06-228-38/+6
|
* alsa-mixer: select nearest alsa volume step in sync-volume modeJuho Hämäläinen2011-06-224-14/+76
|
* alsa-mixer: When setting hw volume, always round up with playback and down ↵Colin Guthrie2011-06-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with capture. The previous logic in ade0a6f88464d8aecf83982d400ccfc402341920 does not work with for input volumes. This was discussed on the mailing list: https://tango.0pointer.de/pipermail/pulseaudio-discuss/2011-May/010091.html This approach can introduce a problem when setting the volumes for sources. What follows is Tanu Kaskinen's analysis: [quote] I'll quote the log: D: protocol-native.c: Client pavucontrol changes volume of source alsa_input.pci-0000_00_1b.0.analog-stereo. D: alsa-source.c: Requested volume: 0: 45% 1: 45% D: alsa-source.c: in dB: 0: -20.71 dB 1: -20.71 dB D: alsa-source.c: Got hardware volume: 0: 45% 1: 45% D: alsa-source.c: in dB: 0: -21.00 dB 1: -21.00 dB D: alsa-source.c: Calculated software volume: 0: 101% 1: 101% (accurate-enough=no) D: alsa-source.c: in dB: 0: 0.29 dB 1: 0.29 dB D: source.c: Volume going up to 29273 at 270475970821 D: source.c: Volume change to 29273 at 270475970821 was written 34 usec late D: alsa-source.c: Written HW volume did not match with the request: 0: 45% 1: 45% (request) != 0: 42% 1: 42% D: alsa-source.c: in dB: 0: -21.00 dB 1: -21.00 dB (request) != 0: -22.50 dB 1: -22.50 dB Looking at the last line, the requested volume seems to hit exactly the right step (-21.00dB), but for some reason Alsa decides to choose something else. I'm pretty sure that this happens because of rounding errors. In the first phase we ask Alsa what dB value we should set, and it returns -21.00 dB. The value is given as a long int, but we convert that to pa_cvolume. Then when we set the volume, we convert the pa_cvolume value back to a long integer. At this point I believe it gets converted to -2101. This is not visible in the debug message for some reason - the rounding algorithm must be different from what was used with the pa_cvolume -> long conversion. [/quote] The commit after this contains a patch that addresses this issue.
* alsa: Remove unneeded includeColin Guthrie2011-06-221-1/+0
|
* capture: Implement per-stream volume control for capture streams.Colin Guthrie2011-06-222-41/+173
| | | | | | | This piggy backs onto the previous changes for protocol 22 and thus does not bump the version. This and the previous commits should be seen as mostly atomic. Apologies for any bisecting issues this causes (although I would expect these to be minimal)
* alsa-sink: Some trivial tidyupsColin Guthrie2011-06-221-3/+2
| | | | | Mostly typo fixes but also a change to make a function relating to sink inputs use more generic variable names.
* alsa-mixer: Fix the assumption that volume is always positiveLu Guanqun2011-05-301-1/+5
| | | | | | | | | | | | | | | | | Add a variable to track whether the actual volume is set or not. Suppose this: min volume: -126 max volume: 0 then when user wants to set some constant volume to -10, it would fail. While the alsa values are typically positive, some values are "funky" and have negative values. It is desirable to fix this at the alsa level so that the numbers are positive, but it's not technically invalid, and thus we have to support it. Discussed here: http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/9832 and http://thread.gmane.org/gmane.linux.alsa.devel/85459
* core: Factor out passthrough checks into their own functionsArun Raghavan2011-05-021-2/+2
| | | | | | | | | | Since we currently have two mechanisms to signal a passthrough connection (non-PCM format or PA_SINK_INPUT_PASSTHROUGH flag), we move all the related checks into functions and use those everywhere. This makes things more consistent, and should we decide to get rid of the flag, we only need to change pa_sink_input_*_is_passthrough() accordingly.
* alsa: Reconfigure sink sample rate for passthrough inputsArun Raghavan2011-05-021-0/+52
| | | | | | When a passthrough sink-input is added, we need to reconfigure the sink's sample rate since no resampling occurs. We revert to the original rate when the passthrough sink-input is removed.
* alsa-mixer: Remove passthrough profilesArun Raghavan2011-05-022-26/+0
| | | | | These aren't used any more - we handle passthrough mode in the iec958* profiles now.
* sink: Remove PASSTHROUGH flagArun Raghavan2011-05-021-7/+0
| | | | | | | This removes the passthrough flag from sinks since we will drop exclusively passthrough sinks in favour of providing a list of formats supported by each sink. We can still determine whether a sink is in passthrough mode by checking if any non-PCM streams are attached to it.
* 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
|