summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/sink.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary #includesMaarten Bosmans2011-06-221-1/+2
|
* sink-input: Kill passthrough streams if moving to an unsupported sinkArun Raghavan2011-05-021-0/+1
| | | | | | This will eventually be replaced by a hook to let clients know that the stream has moved so that they can gracefully reconnect and renegotiate a supported format.
* sink: Remove PASSTHROUGH flagArun Raghavan2011-05-021-0/+4
| | | | | | | 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.
* sink: Extend API for compressed formats supportArun Raghavan2011-05-021-0/+7
| | | | | | This adds a get_formats() vfunc for sinks to provide a list of formats they can support. pa_sink_check_formats() can be used during or after routing to determine what formats from a stream the sink can support.
* sink: Trivial typo fixArun Raghavan2011-05-021-7/+7
|
* Implement the "volume sharing" feature.Tanu Kaskinen2011-02-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Link virtual sinks and sources to their streams.Tanu Kaskinen2011-02-221-0/+2
| | | | | | | | | | | | | | | 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.
* core: Add infrastructure for synchronizing HW and SW volume changesJyri Sarha2010-10-161-14/+83
| | | | | | | | | | | | | | | | 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>
* core: initialize sink/source priorities automatically based on their proplistsLennart Poettering2009-08-291-0/+1
|
* core: add priority field to pa_sink/pa_sourceLennart Poettering2009-08-281-0/+2
|
* object: speed up type verification by not relying on strcmp()Lennart Poettering2009-08-211-1/+1
| | | | | | | | | | | | | Instead of using string contents for type identification use the address of a constant string array. This should speed up type verifications a little sind we only need to compare one machine word instead of a full string. Also, this saves a few strings. To make clear that types must be compared via address and not string contents 'type_name' is now called 'type_id'. This also simplifies the macros for declaring and defining public and private subclasses.
* sink: volume handling rework, new flat volume logicLennart Poettering2009-08-191-7/+5
| | | | | | | | | | | | | | | | | | | | | | | - We now implement a logic where the sink maintains two distinct volumes: the 'reference' volume which is shown to the users, and the 'real' volume, which is configured to the hardware. The latter is configured to the max of all streams. Volume changes on sinks are propagated back to the streams proportional to the reference volume change. Volume changes on sink inputs are forwarded to the sink by 'pushing' the volume if necessary. This renames the old 'virtual_volume' to 'real_volume'. The 'reference_volume' is now the one exposed to users. By this logic the sink volume visible to the user, will always be the "upper" boundary for everything that is played. Saved/restored stream volumes are measured relative to this boundary, the factor here is always < 1.0. - introduce accuracy for sink volumes, similar to the accuracy we already have for source volumes. - other cleanups.
* core: introduce pa_{sink|source}_update_flags()Lennart Poettering2009-08-151-0/+2
|
* core: make fixed latency dynamically changeableLennart Poettering2009-08-151-3/+15
| | | | | | | | | | | | | This of course makes the name 'fixed' a bit of a misnomer. However the definitions are now like this: fixed latency: the latency may change during runtime, but is solely controlled by the backend, the client has no influence. dynamic latency: the latency may change during runtime, influenced by the requests of the clients. i.e. fixed vs. dynamic is from the perspective of the client.
* core: move rtpoll to thread_info sub structureLennart Poettering2009-08-151-1/+2
|
* core: add assert macros for verifying calling contextLennart Poettering2009-08-131-0/+7
| | | | | | | This adds pa_assert_io_context() and pa_assert_ctl_context() in addition to a few related macros. When called they will fail when the current execution context is not IO resp. not control context. (aka 'thread' context vs. 'main' context)
* core: save volume/mute changes coming from the hardware automaticallyLennart Poettering2009-08-071-2/+2
| | | | | Volume changes coming from the lower layers are most likely changes triggered by the user, so let's save them automatically.
* alsa: rework mixer logicLennart Poettering2009-06-171-5/+41
| | | | | | | | | | | | 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.
* prop: introduce new PA_PROP_DEVICE_INTENDED_ROLES propertyLennart Poettering2009-06-081-0/+1
|
* core: add a suspend cause flags fieldLennart Poettering2009-06-051-2/+3
|
* core: introduce pa_{sink,source}_set_fixed_latency()Lennart Poettering2009-05-081-0/+1
| | | | | This allows us to forward the fixed latency directly from the sink to the monitor source withut having to wait for pa_sink_put().
* core: introduce new 'reference' volume for sinksLennart Poettering2009-04-131-4/+7
| | | | | | | | | | | | | | | The reference volume is to be used as reference volume for stored stream volumes. Previously if a new stream was created the relative volume was taken relatively to the virtual device volume. Due to the flat volume logic this could then be fed back to the virtual device volume. Repeating the whole story over and over would result in a device volume that would go lower, and lower and lower. This patch introduces a 'reference' volume for each sink which stays unmodified by stream volume changes even if flat volumes are used. It is only modified if the sink volumes are modified directly by the user. For further explanations see http://pulseaudio.org/wiki/InternalVolumes
* core: add a seperate fixed_latency field for sinks/sources with fixed latencyLennart Poettering2009-04-101-0/+2
|
* introduce relative_volume field in sink_input and make use of it on sink ↵Lennart Poettering2009-04-081-2/+3
| | | | flat volume change
* after propagating a sink volume change to the sink inputs recalculate their ↵Lennart Poettering2009-04-071-0/+1
| | | | soft volumes
* introduce pa_{sink|source}_get_latency_within_thread()Lennart Poettering2009-04-051-0/+2
|
* get rid of 'default' min/max latencies, simplify things by just having ↵Lennart Poettering2009-03-251-1/+1
| | | | absolute boundaries
* set request/rewind sizes only via accessor functionsLennart Poettering2009-03-241-2/+6
|
* simplify latency range by not allowing stored 'wildcard' ranges anymoreLennart Poettering2009-03-241-1/+1
|
* add functions that modules can call whenever they now the volume changedLennart Poettering2009-03-211-0/+2
|
* Use LGPL 2.1 on all files previously using LGPL 2Colin Guthrie2009-03-031-1/+1
|
* add logic for initializing a useful icon nameLennart Poettering2009-03-011-0/+3
|
* when changing volume, store whether it is worth remembering or noLennart Poettering2009-01-271-1/+1
|
* move flat volume logic into the core. while doing so add n_volume_steps ↵Lennart Poettering2009-01-271-21/+20
| | | | field to sinks/sources
* add functions to move all inputs of a sink away/similar for source outputsLennart Poettering2009-01-231-0/+6
|
* pulse: share private enum values with client sideMarc-André Lureau2009-01-201-9/+0
|
* pulse: introspect sink stateMarc-André Lureau2009-01-201-10/+9
|
* Merge commit 'e0f8ffe41f99789fafac575e944acf02e940bbf7'Lennart Poettering2009-01-151-0/+2
|\
| * sink: add a virtual_volume to sinkMarc-André Lureau2009-01-141-0/+2
| |
* | add new pa_card object as a way to logically combine multiple sinks and sourcesLennart Poettering2009-01-151-0/+3
|/
* core: add pa_sink_update_proplistMarc-André Lureau2009-01-131-0/+2
|
* Add "base volume" field to sinks/sourcesLennart Poettering2008-12-241-0/+2
|
* Implement new flags DONT_INHIBIT_AUTO_SUSPEND and START_UNMUTEDLennart Poettering2008-10-261-0/+1
|
* volume hooksMarc-Andre Lureau2008-10-071-0/+5
| | | | Signed-off-by: Lennart Poettering <lennart@poettering.net>
* save a bit of memoryLennart Poettering2008-08-181-7/+8
|
* rework volume/mute APIs: split out pa_xx_set_soft_volume() and add ↵Lennart Poettering2008-08-131-2/+3
| | | | force_refresh argument to read functions
* make sure to call process_rewind() under all circumstances before we do the ↵Lennart Poettering2008-06-261-0/+1
| | | | next loop iteration
* Rework module-combine to work with glitch-free core; add new max_request ↵Lennart Poettering2008-06-201-12/+30
| | | | field to pa_sink
* get rid of svn $ keywordsLennart Poettering2008-06-181-2/+0
|
* link latency of monitor source to sinkLennart Poettering2008-05-171-0/+2
| | | | git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2457 fefdeb5f-60dc-0310-8127-8f9354f1896f