Commit graph

228 commits

Author SHA1 Message Date
Lennart Poettering
14a9771689 core: drop unnecessary variable initialization 2009-09-03 00:21:19 +02:00
Lennart Poettering
1200a0b143 sink: simplify pa_sink_render_full() by replacing it by a pa_sink_render() plus a couple of pa_sink_render_full() 2009-09-02 00:54:22 +02:00
Lennart Poettering
45513a2077 core: fill up memblock with pa_sink_render_into_full() in pa_sink_render_full() instead of doing our own loop 2009-09-01 22:19:30 +02:00
Lennart Poettering
17f609ac83 core: handle suspended state in pa_sink_render_full() similar to the other render functions 2009-09-01 22:18:55 +02:00
Lennart Poettering
ce6dff4ee0 core: add missing sink_unref() 2009-09-01 22:18:01 +02:00
Lennart Poettering
2970c11902 core: always allow volume setting with single-channel pa_cvolume 2009-08-31 21:40:59 +02:00
Lennart Poettering
8bf2e3fe94 core: initialize sink/source priorities automatically based on their proplists 2009-08-29 04:31:33 +02:00
Lennart Poettering
3b54849a08 core: add priority field to pa_sink/pa_source 2009-08-28 23:31:05 +02:00
Lennart Poettering
9abc010c93 object: speed up type verification by not relying on strcmp()
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.
2009-08-21 21:27:44 +02:00
Lennart Poettering
9f97b7cbe1 sink-input: add callbacks that are called whenever the mute/volume changes 2009-08-21 02:56:17 +02:00
Lennart Poettering
8c31974f56 sink: volume handling rework, new flat volume logic
- 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.
2009-08-19 02:55:02 +02:00
Lennart Poettering
8dd0d871a7 core: add to FIXMEs 2009-08-16 00:45:56 +02:00
Lennart Poettering
0c08dbd9b9 core: introduce pa_{sink|source}_update_flags() 2009-08-15 03:41:13 +02:00
Lennart Poettering
3c271ae060 core: document difference between IO and main thread view on requested latency 2009-08-15 00:54:25 +02:00
Lennart Poettering
c6080d8c61 core: don't update latency range if not changed 2009-08-15 00:54:02 +02:00
Lennart Poettering
3f9c67a7fb core: call pa_sink_get_latency_within_thread() instead of going directly via process_msg() 2009-08-15 00:52:50 +02:00
Lennart Poettering
350a2bc846 core: make fixed latency dynamically changeable
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.
2009-08-15 00:48:14 +02:00
Lennart Poettering
4eb59fb90e core: move rtpoll to thread_info sub structure 2009-08-15 00:26:00 +02:00
Lennart Poettering
e4db56bf07 core: split of FAIL_ON_SUSPEND into KILL_ON_SUSPEND and NO_CREATE_ON_SUSPEND 2009-08-15 00:12:53 +02:00
Lennart Poettering
0989be13f6 core: introduce pa_{sink_input|source_output}_fail_move() 2009-08-15 00:03:50 +02:00
Lennart Poettering
9a95fe49c8 core: add assert macros for verifying calling context
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)
2009-08-13 02:14:19 +02:00
Lennart Poettering
7d4916379b ladspa/remap: make sure we process all requested rewinds unconditionally
In some situations a rewind request travelling downstream might be
optimized away on its way and an upstream rewind processing might never
come back. Hence, call _process_rewind() before each _render()just to
make sure we processed them all.
2009-08-07 23:58:45 +02:00
Lennart Poettering
51b3899348 core: save volume/mute changes coming from the hardware automatically
Volume changes coming from the lower layers are most likely changes
triggered by the user, so let's save them automatically.
2009-08-07 23:55:06 +02:00
zbt
897ef86b7f Add volume ramping feature - sink modification 2009-08-05 20:10:47 +02:00
Lennart Poettering
8fe50b0d7c alsa,core: include mapping name in description strings 2009-06-18 04:38:59 +02:00
Lennart Poettering
39b37a2bac core: be a bit more verbose when registering a sink/source fails 2009-06-18 03:40:47 +02:00
Lennart Poettering
31575f7766 alsa: rework mixer logic
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.
2009-06-17 03:45:14 +02:00
Lennart Poettering
f13bbd576f prop: introduce new PA_PROP_DEVICE_INTENDED_ROLES property 2009-06-08 16:58:45 +02:00
Lennart Poettering
e7a6d53118 core: replace tabs by spaces 2009-06-08 00:12:20 +02:00
Lennart Poettering
587fc2ab1c core: make sure soft mute status stays in sync with hw mute status
This should close rhbz #494851, mandriva bz #51234.

Probably the same as our own #572, launchpad #352732.
2009-06-08 00:02:15 +02:00
Jyri Sarha
8eaea3aa64 optimization: Optimized pa_sink_render_full.
This is finally the latest version of the patch.
2009-06-07 02:06:44 +02:00
Lennart Poettering
d1646f78af core: monitor sources need to inherit the suspend cause from their sinks 2009-06-06 15:32:45 +02:00
Lennart Poettering
69eab1e057 core: suppress suspending/resume when we are already in the right state 2009-06-06 15:31:46 +02:00
Lennart Poettering
00797b8b6e core: add a suspend cause flags field 2009-06-05 19:05:07 +02:00
Lennart Poettering
28069ef0f7 core: automatically add icons for headsets/headphones/speakers for devices 2009-05-13 01:00:39 +02:00
Jyri Sarha
35faedb6e8 core: Take samples from silence cache rather than write zeros
If the only stream to render from is muted take samples from the
silence cache. This should shrink memory/cache bandwidth. Again the
gain was not what I hoped for.
2009-05-09 00:06:47 +02:00
Jyri Sarha
d7b8947a5e core: optimize pa_sink_render_full()
I have used this fix for quite a while and I am pretty confident about
it. However, the performance gain was not what I expected.
2009-05-08 23:59:16 +02:00
Lennart Poettering
7f767e5fe6 core: liberalize 99a6a4 a bit
While flags should generally be initialized by passing them to
pa_{sink|source}_new() we make an exception for the volume related flags
which may be initilized afterwards, but before _put().
2009-05-08 02:16:10 +02:00
Lennart Poettering
8d9c26e3b6 core: cache requested latency only when we are running, not while we are still constructing 2009-05-08 02:04:48 +02:00
Lennart Poettering
99a6a4742f core: make sure we fix up flags/monitor flags already in pa_sink_new() instead of pa_sink_put() 2009-05-08 02:04:48 +02:00
Lennart Poettering
3766850c8b core: introduce pa_{sink,source}_set_fixed_latency()
This allows us to forward the fixed latency directly from the sink to
the monitor source withut having to wait for pa_sink_put().
2009-05-08 02:04:48 +02:00
Lennart Poettering
fe8b10cc05 core: introduce new 'reference' volume for sinks
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
2009-04-13 22:56:25 +02:00
Lennart Poettering
f7c229d8f9 core: add a seperate fixed_latency field for sinks/sources with fixed latency 2009-04-10 01:26:04 +02:00
Lennart Poettering
9ae8ca2c37 core: memory leak, fix ref counting when moving streams 2009-04-10 01:21:16 +02:00
Lennart Poettering
c32c6c833e introduce relative_volume field in sink_input and make use of it on sink flat volume change 2009-04-08 03:49:16 +02:00
Lennart Poettering
c523b16d33 after propagating a sink volume change to the sink inputs recalculate their soft volumes 2009-04-07 04:47:58 +02:00
Lennart Poettering
93e14d3e62 we need to make our multiplications with linear values 2009-04-07 04:05:03 +02:00
Lennart Poettering
02686cce6d reduce number of conversions to/from linear volumes 2009-04-07 04:04:19 +02:00
Lennart Poettering
e356a03ab2 If the sink volume is lowered to 0 and then increased again, make sure all stream volumes follow instead of staying at 0 2009-04-07 01:21:07 +02:00
Lennart Poettering
61b07768c2 add suspend_within_thread() callbacks to pa_sink_input/pa_source_output 2009-04-07 00:46:20 +02:00