summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/sink-input.c
Commit message (Collapse)AuthorAgeFilesLines
* sink-input: Don't resample passthrough inputsPierre-Louis Bossart2011-05-021-12/+14
|
* sink-input: Check flat volume with pa_sink_flat_volume_enabled().Tanu Kaskinen2011-04-181-2/+2
| | | | | Checking just the flag doesn't work if the sink uses volume sharing, because such sinks never have PA_SINK_FLAT_VOLUME set.
* sink-input: Add volume_writable to pa_sink_input.Tanu Kaskinen2011-03-291-29/+7
| | | | | | | | | | This is pretty cosmetic change; there's no actual functionality added. Previously the volume_writable information was available through the pa_sink_input_is_volume_writable() function, but I find it cleaner to have a real variable. The sink input introspection variable name was also changed from read_only_volume to volume_writable for consistency.
* Fix up some double spacesMaarten Bosmans2011-03-181-2/+2
|
* Fix up according to Coding StyleMaarten Bosmans2011-03-111-4/+4
| | | | Only whitespace changes in here
* Revert "Add volume ramping feature - sink-input modification"Arun Raghavan2011-02-281-309/+81
| | | | | | | | | | This reverts commit 5318eb35ef3f91836084382a4f3d5ef08d322554. Conflicts: src/pulsecore/sink-input.c (part of a patch series removing all ramping code)
* Revert "ramping: minor cleanups"Arun Raghavan2011-02-281-10/+2
| | | | | | This reverts commit f202af17b717f5b383ac072f80a6c1327bc3143b. (part of a patch series removing all ramping code)
* Revert "core: volume ramping fix"Arun Raghavan2011-02-281-1/+1
| | | | | | This reverts commit aa9348441db34b787784711f19882d6c42fa315d. (part of a patch series removing all ramping code)
* Implement the "volume sharing" feature.Tanu Kaskinen2011-02-261-24/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Allow read-only or non-existing sink input volume.Tanu Kaskinen2011-02-221-4/+25
| | | | | | | | | | | | 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-221-0/+1
| | | | | | | | | | | | | | | 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.
* log: Totally trivial spelling 'correction' (for en-US)Colin Guthrie2010-10-171-1/+1
|
* introspect: Include whether a stream is corked in the info callback.Colin Guthrie2010-10-061-0/+3
|
* AC3 passthrough supportPierre-Louis Bossart2010-08-121-0/+44
| | | | | | | | | | | | Second version after Tanu's feedback TODO: - notify client that volume control is disabled - change sink rate in passthrough mode if needed - automatic detection of passthrough mode instead of hard coded profile names Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
* native: rework handling of seeks that depend on variables the client does ↵Lennart Poettering2010-02-091-1/+1
| | | | | | | | | | | | not know anything about All seeks/flushes that depend on the playback buffer read pointer cannot be accounted for properly in the client since it does not know the actual read pointer. Due to that the clients do not account for it at all. We need do the same on the server side. And we did, but a little bit too extreme. While we properly have not applied the changes to the "request" counter we still do have to apply it to the "missing" counter. This patch fixes that.
* core: Fix macro typo - PA_SINK_IS_LINKED -> PA_SINK_INPUT_IS_LINKEDColin Guthrie2010-02-091-1/+1
|
* sink-input: Replace a tab indentation with spaces.Tanu Kaskinen2010-01-061-1/+1
|
* core: volume ramping fixhuan zheng2010-01-061-1/+1
| | | | | | | | | | | | | | | Hi, I found that volume ramping is inside PA now. there's a minor fix here, it is a bug i found after the patch is submitted: line 1781 of sink-input.c : if ((i->thread_info.ramp_info.envelope_dying - nbytes) <= 0) { need to be changed to if ((i->thread_info.ramp_info.envelope_dying - (ssize_t) nbytes) <= 0) { otherwise this argument will never be negative since nbytes is of type size_t which is unsigned. Please change it when you have time, sorry if bring any inconvenience. :)
* fix a number of warningsDaniel Mack2010-01-051-5/+7
| | | | | most of them were due to missing #ifdefs or wrong printf format type for [s]size_t.
* Merge branch 'master' of ssh://rootserver/home/lennart/git/public/pulseaudioLennart Poettering2009-11-201-5/+6
|\
| * core: adjust volume only when there is actually a memory blockLennart Poettering2009-11-111-5/+6
| | | | | | | | | | | | Fixes an assert that is hit in somne niche cases: https://bugzilla.redhat.com/show_bug.cgi?id=533482
* | ramping: minor cleanupsLennart Poettering2009-11-051-2/+10
| |
* | Merge remote branch 'origin/merge-queue'Lennart Poettering2009-11-051-74/+301
|\ \ | |/ |/| | | | | | | Conflicts: src/pulsecore/sink-input.c src/pulsecore/sink.c
| * Add volume ramping feature - sink-input modificationzbt2009-08-051-60/+291
| |
* | core: dump proplist when creating stream similar to how we already to it for ↵Lennart Poettering2009-09-201-2/+6
| | | | | | | | sinks/sources
* | core: add an additional volume factor that is applied after resampling took ↵Lennart Poettering2009-09-111-8/+51
| | | | | | | | place
* | llvm-clang-analyzer: drop a few unnecessary assignments and other trivial fixesLennart Poettering2009-09-081-3/+0
| |
* | core: always allow volume setting with single-channel pa_cvolumeLennart Poettering2009-08-311-2/+12
| |
* | core: move 'flags' field into 'pa_sink_input_new_data' structure so that ↵Lennart Poettering2009-08-281-11/+10
| | | | | | | | hooks can access it
* | sink-input: extend comments on rewinding logic a bitLennart Poettering2009-08-271-7/+15
| |
* | core: relex validity checks when destructing half-set up source outputs/sink ↵Lennart Poettering2009-08-221-1/+4
| | | | | | | | inputs
* | 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-input: add callbacks that are called whenever the mute/volume changesLennart Poettering2009-08-211-1/+15
| |
* | sink: volume handling rework, new flat volume logicLennart Poettering2009-08-191-107/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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: make fixed latency dynamically changeableLennart Poettering2009-08-151-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | 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: split of FAIL_ON_SUSPEND into KILL_ON_SUSPEND and NO_CREATE_ON_SUSPENDLennart Poettering2009-08-151-1/+1
| |
* | core: introduce pa_{sink_input|source_output}_fail_move()Lennart Poettering2009-08-151-0/+19
| |
* | core: add functions to query max_rewind/max_request values from streamsLennart Poettering2009-08-131-0/+19
| |
* | core: add assert macros for verifying calling contextLennart Poettering2009-08-131-5/+47
|/ | | | | | | 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)
* alsa: rework mixer logicLennart Poettering2009-06-171-5/+5
| | | | | | | | | | | | 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.
* core: make sure we fix up flags/monitor flags already in pa_sink_new() ↵Lennart Poettering2009-05-081-1/+1
| | | | instead of pa_sink_put()
* core: use pa_{source|sink}_get_latency_within_thread() at one more placeLennart Poettering2009-04-141-4/+1
|
* core: introduce new 'reference' volume for sinksLennart Poettering2009-04-131-24/+31
| | | | | | | | | | | | | | | 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-4/+9
|
* core: memory leak, fix ref counting when moving streamsLennart Poettering2009-04-101-5/+15
|
* introduce relative_volume field in sink_input and make use of it on sink ↵Lennart Poettering2009-04-081-13/+43
| | | | flat volume change
* add suspend_within_thread() callbacks to pa_sink_input/pa_source_outputLennart Poettering2009-04-071-0/+1
|
* properly account for seeks in the requested_bytes counterLennart Poettering2009-04-011-2/+2
|
* pass destination source/sink when moving streams so that we can access themLennart Poettering2009-04-011-1/+1
|
* don't access i->sink if it is not setLennart Poettering2009-04-011-3/+5
|