summaryrefslogtreecommitdiffstats
path: root/src/pulsecore
Commit message (Collapse)AuthorAgeFilesLines
* Implement the "volume sharing" feature.Tanu Kaskinen2011-02-264-185/+580
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we have a filter sink that does some processing, currently the benefits of the flat volume feature are not really available. That's because if you have a music player that is connected to the filter sink, the hardware sink doesn't have any idea of the music player's stream volume. This problem is solved by this "volume sharing" feature. The volume sharing feature works so that the filter sinks that want to avoid the previously described problem declare that they don't want to have independent volume, but they follow the master sink volume instead. The PA_SINK_SHARE_VOLUME_WITH_MASTER sink flag is used for that declaration. Then the volume logic is changed so that the hardware sink calculates its real volume using also the streams connected to the filter sink in addition to the streams that are connected directly to the hardware sink. Basically we're trying to create an illusion that from volume point of view all streams are connected directly to the hardware sink. For that illusion to work, the volumes of the filter sinks and their virtual streams have to be managed carefully according to a set of rules: If a filter sink follows the hardware sink volume, then the filter sink's * reference_volume always equals the hw sink's reference_volume * real_volume always equals the hw sink's real_volume * soft_volume is always 0dB (ie. no soft volume) If a filter sink doesn't follow the hardware sink volume, then the filter sink's * reference_volume can be whatever (completely independent from the hw sink) * real_volume always equals reference_volume * soft_volume always equals real_volume (and reference_volume) If a filter sink follows the hardware sink volume, and the hardware sink supports flat volume, then the filter sink's virtual stream's * volume always equals the hw sink's real_volume * reference_ratio is calculated normally from the stream volume and the hw sink's reference_volume * real_ratio always equals 0dB (follows from the first point) * soft_volume always equals volume_factor (follows from the previous point) If a filter sink follows the hardware sink volume, and the hardware sink doesn't support flat volume, then the filter sink's virtual stream's * volume is always 0dB * reference_ratio is always 0dB * real_ratio is always 0dB * soft_volume always equals volume_factor If a filter sink doesn't follow the hardware sink volume, then the filter sink's virtual stream is handled as a regular stream. Since the volumes of the virtual streams are controlled by a set of rules, the user is not allowed to change the virtual streams' volumes. It would probably also make sense to forbid changing the filter sinks' volume, but that's not strictly necessary, and currently changing a filter sink's volume changes actually the hardware sink's volume, and from there it propagates to all filter sinks ("funny" effects are expected when adjusting a single channel in cases where all sinks don't have the same channel maps). This patch is based on the work of Marc-André Lureau, who did the initial implementation for Pulseaudio 0.9.15.
* core: Add a new hook PA_CORE_HOOK_CARD_PROFILE_CHANGEDColin Guthrie2011-02-252-0/+3
| | | | | | This will allow modules to know when a card profile has changed and take appropriate action. This might prove useful when developing UCM so that the appropriate verb can be set.
* core: Added new hooks: PA_CORE_HOOK_SOURCE_PORT_CHANGED and ↵Kim Therkelsen2011-02-253-0/+6
| | | | | | | | | | | PA_CORE_HOOK_SINK_PORT_CHANGED This allows modules to know when certain ports are changed. This will allow e.g. a filter module (or LADSAP) to only load when a certain port is used on the device (e.g. to only filter headphones and not normal speakers). (Comment from Colin Guthrie: This may also have use in UCM)
* Merge remote-tracking branch 'mkbosmans/mingw32-build'Colin Guthrie2011-02-2537-123/+270
|\
| * Use pa_read, pa_write and pa_poll instead of system functionsMaarten Bosmans2011-02-172-12/+12
| |
| * Use pa_* instead of generic functions to improve portabilityMaarten Bosmans2011-02-172-2/+6
| |
| * win32: Implement pa_randomMaarten Bosmans2011-02-171-1/+16
| |
| * win32: Implement rtclock based on QueryPerformanceCounterMaarten Bosmans2011-02-175-6/+30
| | | | | | | | Also remove some unnecessary <time.h> headers.
| * win32: flush stderr after log outputMaarten Bosmans2011-02-171-0/+3
| |
| * Implement some functions for win32Maarten Bosmans2011-02-172-10/+54
| | | | | | | | And disable building binaries for win32 that make no sense there
| * Repair some typosMaarten Bosmans2011-02-173-6/+6
| |
| * Fix dependencies and include necessary headersMaarten Bosmans2011-02-176-1/+6
| |
| * Use PCRE if POSIX regex.h is not availableMaarten Bosmans2011-02-171-1/+6
| |
| * Apply #ifdefs around functionality not available on win32Maarten Bosmans2011-02-179-3/+67
| | | | | | | | And also the reverse: around some win32 specific functionality
| * Adapt win32 specific code to current APIMaarten Bosmans2011-02-172-3/+27
| |
| * Use <pulsecore/socket.h> instead of <sys/socket.h>Maarten Bosmans2011-02-1721-78/+38
| | | | | | | | | | | | | | | | The check whether POSIX socket.h or WIN32 winsock2.h must be included can be made centrally. The downside is that some functionality of e.g. arpa/inet.h is also implemented in winsock.h, so that some files that don't use socket functions, but do use inet.h functions, must also include pulsecore/socket.h. (as well as arpa/inet.h)
| * Clean up <poll.h> includesMaarten Bosmans2011-02-171-1/+0
| | | | | | | | | | | | Instead <pulsecore/poll.h> should be included. That file includes poll.h on platform where it is appropriate. Also remove some unnecessary <ioctl.h> includes.
| * Use setenv instead of putenvMaarten Bosmans2011-02-171-1/+1
| | | | | | | | | | | | | | In theory putenv could be used to handle freeing of strings yourself, but this was not done in PulseAudio. That leaves no advantages in using putenv. With setenv you're at the mercy of the implementation whether the strings leak, but at least that is better then a certain leak, as it was before.
* | sconv_sse: Exclude SSE optimizations for Mac OS XEdward Rudd2011-02-221-2/+2
| | | | | | | | At least on 32bit compiles, there are not enough registers.
* | Allow read-only or non-existing sink input volume.Tanu Kaskinen2011-02-225-13/+60
| | | | | | | | | | | | | | | | | | | | | | | | There are two known cases where read-only or non-existing sink input volume is relevant: passthrough streams and the planned volume sharing logic. Passthrough streams don't have volume at all, and the volume sharing logic requires read-only sink input volume. This commit is primarily working towards the volume sharing feature, but support for non-existing sink input volume is also added, because it is so closely related to read-only volume. Some unrelated refactoring in iface-stream.c creeped into this commit too (new function: stream_to_string()).
* | core: Link virtual sinks and sources to their streams.Tanu Kaskinen2011-02-228-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change doesn't add any functionality in itself, but it will be useful in the future for operating on chains of sinks or sources that are piggy-backing on each other. For example, the PA_PROP_DEVICE_MASTER_DEVICE property could be handled in the core so that each virtual device doesn't have to maintain it separately. By using the origin_sink and destination_source pointers the core is able to see at stream creation time that the stream is created by a virtual device, and then update that device's property list using the name of the master device that the stream is being connected to. The same thing can be done also when the stream is being moved from a device to another, in which case the _MASTER_DEVICE property needs updating.
* | Correct wav file creation for 24/32 and 24 bits sample formats HSD=3669357Vincent Becker2011-02-221-2/+11
| |
* | PulseAudio: added IT block to fix thumb conditional instruction build error ↵Kurt Taylor2011-02-211-0/+1
|/ | | | | | | | messages See: http://pulseaudio.org/ticket/914 Tweaked-By: Arun Raghavan <arun.raghavan@collabora.co.uk>
* build: Don't include empty Makefile.am in subdirsMaarten Bosmans2011-01-312-40/+0
|
* Fighting rewinds: Reduce calls to handle_seekDavid Henningsson2011-01-311-30/+26
| | | | | | | | | If many small blocks are in queue, handle_seek is being called for every one of them, sometimes causing a rewind. Delay the call until all blocks are handled, then call handle_seek only once. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
* Fighting rewinds: Seek and write data in the same messageDavid Henningsson2011-01-311-8/+12
| | | | | | | | Allow a message in the queue to perform both a seek and a post data. For clients that do not use PA_SEEK_RELATIVE (e g gstreamer), this cuts the message count - and sometimes even the rewinds - in half. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
* ratelimit: fix log levels of log suppression messagesLennart Poettering2011-01-3110-12/+13
| | | | | | | | | 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.
* Core: Fix incorrect check of return valueScott Reeves2011-01-231-2/+2
|
* core: Use pa_sink_get_latency_within_thread() in sync-volume codeJyri Sarha2011-01-151-9/+2
|
* core: Use volume_change_safety_margin when rewinding sync-volume eventsJyri Sarha2011-01-151-6/+16
| | | | | After this patch the volume changes are applied immediately after sink rewind before processing streams and monitor source.
* core: Change sematics of pa_flist_new_with_name() (v1.1)Jyri Sarha2011-01-152-3/+5
| | | | | Name string is copied and added to flist structure. The original is responsibility of the caller. The name is only used for debug printing.
* Revert "core: make use of dbus_message_iter_append_fixed_array"Colin Guthrie2011-01-031-1/+6
| | | | | This causes problems as outlined in ticket #887. This reverts commit f564c7d76371380980faa10ee3c756c3130c60bf.
* Fix typosZhang Wanming2010-12-202-2/+2
|
* Fix return value of pa_sndfile_format_from_stringVincent Becker2010-12-181-3/+3
| | | | This prevented to use pacat --file-format option correctly
* core: Fix variable "has_whined" value bugYang Xichuan2010-12-181-1/+1
| | | | | | | | | In the file src/pulsecore/random.c I found that the log information "Failed to get proper entropy. Falling back to seeding with current time." would never be printed. This change corrects the issue.
* build-sys: Replace dummy Makefiles with proper Makefile.am'sColin Guthrie2010-12-054-14/+40
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* core: Add name to flist struct for more informative log messagesJyri Sarha2010-11-282-4/+13
| | | | PA_STATIC_FLIST_DECLARE macro sets the flist name automatically.
* core: Lower "flist is full" log message level to debug and ratelimit itJyri Sarha2010-11-281-1/+2
|
* volume: Add explicit checks for ARMv6 instructionsv0.98-devArun Raghavan2010-11-281-4/+4
| | | | | | | This ensures that the build does not fail if the ssat and pkhbt instructions are not available (armv5te and below). Fixes: http://www.pulseaudio.org/ticket/790
* core: New LIFO style flist implementation v2.2Jyri Sarha2010-11-161-153/+64
| | | | | | | | | | | | The old free list implementation used objects in FIFO style. This is bad because it tries keep all the objects ever used alive and in memory. This minimizes the changes that an allocated object is already in cache. When there is shortage of physical memory this may also increase change that newly allocated object is swapped out. LIFO (e.g. stack) style free list should help these issues. Like the old one the new implementation is also lock free. This version (v2.1) of the patch has a potential weakness fixed. The previous version (2.0) did segfault when popping from empty flist, this does not.
* core: make use of dbus_message_iter_append_fixed_arrayLuiz Augusto von Dentz2010-10-201-6/+1
| | | | | dbus_message_iter_append_fixed_array does appends a block of fixed-length values to an array.
* volume: Fix incorrect usage of PA_VOLUME_IS_VALIDArun Raghavan2010-10-191-2/+2
| | | | | The commit that introduced this macro was incorrect in some places. This patch fixes these. Thanks to Pierre-Louis Bossart for pointing this out.
* log: Totally trivial spelling 'correction' (for en-US)Colin Guthrie2010-10-171-1/+1
|
* intended-roles: Mark devices with a form factor of 'headset' as being ↵Colin Guthrie2010-10-161-1/+2
| | | | | | | appropriate for 'phone' streams This was a result a report by Patrick Ben Koetter relating to his Logitech Wireless Headset.
* daemon-conf: Add sync volume parameters to daemon-confJyri Sarha2010-10-163-4/+9
| | | | | | Signed-off-by: Jyri Sarha <jyri.sarha@nokia.com> Reviewed-by: Tanu Kaskinen <tanu.kaskinen@digia.com> Reviewd-by: Colin Guthrie <cguthrie@mandriva.org>
* core: Add infrastructure for synchronizing HW and SW volume changesJyri Sarha2010-10-162-30/+363
| | | | | | | | | | | | | | | | To make concurrent use of SW and HW volume glitchles their application needs to be synchronized. For accurate synchronization the HW volume needs to be applied in IO thread. This patch adds infrastructure to delay the applying of HW volume to match with SW volume timing. To avoid synchronization problems this patch moves many of the volume and mute related functions from main thread to IO thread. All these changes become active only if the sync volume flag for a sink has been set. So, for this patch to have any effect it needs to be taken into use by sink implementor. Signed-off-by: Jyri Sarha <jyri.sarha@nokia.com> Reviewed-by: Tanu Kaskinen <tanu.kaskinen@digia.com> Reviewd-by: Colin Guthrie <cguthrie@mandriva.org>
* cli: Validate volume before settingArun Raghavan2010-10-151-0/+15
| | | | | This causes an error to be generated if an invalid volume is provided to commands that set sink/sink-input/source volume.
* volume: Use a macro to check if a volume is validArun Raghavan2010-10-151-2/+2
| | | | | | | This adds a PA_VOLUME_IS_VALID() macro for checking if a given pa_volume_t is valid. This makes changes to the volume ranges simpler (just change PA_VOLUME_MAX, for example, without needing to modify any other code).
* SSE/MMX/ARM: Fix high frequency noise with unusual number of channelsDavid Henningsson2010-10-133-13/+25
| | | | | | | | In the assembly optimized versions of SSE, a noise could occur when the number of channels were 3,5,6 or 7. For MMX and ARM, this could occur when the number of channels were 3. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
* introspect: Include whether a stream is corked in the info callback.Colin Guthrie2010-10-063-2/+12
|