Commit graph

105 commits

Author SHA1 Message Date
Colin Guthrie
cd559553a0 core: Fix macro typo - PA_SINK_IS_LINKED -> PA_SINK_INPUT_IS_LINKED 2010-02-09 21:59:55 +00:00
Tanu Kaskinen
25435bf373 sink-input: Replace a tab indentation with spaces. 2010-01-06 11:03:19 +02:00
huan zheng
aa9348441d core: volume ramping fix
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.  :)
2010-01-06 00:22:23 +01:00
Daniel Mack
937c587e77 fix a number of warnings
most of them were due to missing #ifdefs or wrong printf format type for
[s]size_t.
2010-01-05 22:46:13 +01:00
Lennart Poettering
9708ecd648 Merge branch 'master' of ssh://rootserver/home/lennart/git/public/pulseaudio 2009-11-20 01:02:01 +01:00
Lennart Poettering
d9b5bbca01 core: adjust volume only when there is actually a memory block
Fixes an assert that is hit in somne niche cases:

https://bugzilla.redhat.com/show_bug.cgi?id=533482
2009-11-11 04:18:10 +01:00
Lennart Poettering
f202af17b7 ramping: minor cleanups 2009-11-05 22:58:15 +01:00
Lennart Poettering
4d62f159a7 Merge remote branch 'origin/merge-queue'
Conflicts:
	src/pulsecore/sink-input.c
	src/pulsecore/sink.c
2009-11-05 22:54:42 +01:00
Lennart Poettering
e7686a607d core: dump proplist when creating stream similar to how we already to it for sinks/sources 2009-09-20 03:18:03 +02:00
Lennart Poettering
a015d56fac core: add an additional volume factor that is applied after resampling took place 2009-09-11 03:26:25 +02:00
Lennart Poettering
f5046759cd llvm-clang-analyzer: drop a few unnecessary assignments and other trivial fixes 2009-09-08 23:46:23 +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
84eb6614eb core: move 'flags' field into 'pa_sink_input_new_data' structure so that hooks can access it 2009-08-28 23:24:09 +02:00
Lennart Poettering
5df842db64 sink-input: extend comments on rewinding logic a bit 2009-08-27 01:48:35 +02:00
Lennart Poettering
1a05d67f07 core: relex validity checks when destructing half-set up source outputs/sink inputs 2009-08-22 04:04:23 +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
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
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
5ee4069e9e core: add functions to query max_rewind/max_request values from streams 2009-08-13 02:17:24 +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
zbt
5318eb35ef Add volume ramping feature - sink-input modification 2009-08-05 20:10:10 +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
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
4ee4a55617 core: use pa_{source|sink}_get_latency_within_thread() at one more place 2009-04-14 01:03:10 +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
61b07768c2 add suspend_within_thread() callbacks to pa_sink_input/pa_source_output 2009-04-07 00:46:20 +02:00
Lennart Poettering
373b5efe51 properly account for seeks in the requested_bytes counter 2009-04-01 23:05:09 +02:00
Lennart Poettering
75a8d18285 pass destination source/sink when moving streams so that we can access them 2009-04-01 03:04:39 +02:00
Lennart Poettering
c2f6d090c7 don't access i->sink if it is not set 2009-04-01 03:03:20 +02:00
Lennart Poettering
7f5481ede0 simplify latency config functions a bit and make them callable in more contexts 2009-03-30 18:23:48 +02:00
Lennart Poettering
d04f3e1aef Trigger move callback a little bit earlier so that no IO thread is running 2009-03-30 18:21:34 +02:00
Lennart Poettering
a998038ee2 introduce pa_sink_input_get_relative_volume() 2009-03-20 13:50:26 +01:00
Colin Guthrie
86dee05aec Use LGPL 2.1 on all files previously using LGPL 2 2009-03-03 20:23:02 +00:00
Lennart Poettering
620bf84573 try to vacuum a little when nothing is going on 2009-02-25 09:13:19 +01:00
Lennart Poettering
00839ddaa6 make sure we check the sink status for PA_SINK_INPUT_FAIL_ON_SUSPEND only after module-suspend-on-idle had the chance to resume the device 2009-02-24 22:27:25 +01:00
Lennart Poettering
3bccb704b6 Allow passing a NULL proplist to pa_xxxx_update_proplist() to just fire a notification 2009-02-22 05:01:32 +01:00
Lennart Poettering
823431e447 allow sending meta/policy events to clients 2009-02-12 03:18:05 +01:00
Lennart Poettering
f42afc4883 make return value of pa_{sink_input|source_output}_update_proplist() void 2009-02-05 04:08:18 +01:00
Lennart Poettering
63e234335f handle default volume initialization properly 2009-02-05 04:05:47 +01:00
Lennart Poettering
de86c6e3ad add a 'volume factor' that is implicitly multiplied into the volume of a sink input without being visible to the outside 2009-02-05 01:22:05 +01:00
Lennart Poettering
d802a76963 remove soft volume from pa_sink_input_new_info since it should be handled internally and automatically by the sink input 2009-02-04 18:34:08 +01:00
Lennart Poettering
4cf82c74a1 merge in properties earlier to make identification of streams from hooks easier 2009-02-04 18:28:52 +01:00
Lennart Poettering
fc31d21353 when moving a sink between sinks make volume relative 2009-02-03 04:06:52 +01:00
Lennart Poettering
08800c35b0 make a couple of functions return proper error codes 2009-02-03 03:14:20 +01:00