Commit graph

60 commits

Author SHA1 Message Date
Arun Raghavan
0ac2cfce6d core: Add extended stream API to support compressed formats
This is the beginning of work to support compressed formats natively in
PulseAudio. This adds a pa_stream_new_extended() that takes a format
structure, sends it to the server (=> protocol extension) and has the
server negotiate with the appropropriate sink to figure out what format
it should use.

This is work in progress, and works only with PCM streams. Actual
compressed format support in some sink needs to be implemented, and
extensive testing is required.

More details on how this is supposed to work is available at:
http://pulseaudio.org/wiki/PassthroughSupport
2011-05-02 11:54:43 +05:30
Tanu Kaskinen
e72e75570c sink-input: Add volume_writable to pa_sink_input.
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.
2011-03-29 21:18:06 +01:00
Arun Raghavan
8401572fd5 Revert "Add volume ramping feature - sink-input modification"
This reverts commit 5318eb35ef.

Conflicts:

	src/pulsecore/sink-input.c

(part of a patch series removing all ramping code)
2011-02-28 17:13:13 +05:30
Tanu Kaskinen
99ddca89cd Allow read-only or non-existing sink input volume.
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()).
2011-02-22 20:12:31 +00:00
Tanu Kaskinen
969c7c80fe core: Link virtual sinks and sources to their streams.
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.
2011-02-22 10:10:48 +00:00
Colin Guthrie
b6be95ef53 sink-input: Fix comment 2010-10-01 01:39:35 +01:00
Pierre-Louis Bossart
9b6c84ad6e AC3 passthrough support
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>
2010-08-12 18:20:27 +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
a015d56fac core: add an additional volume factor that is applied after resampling took place 2009-09-11 03:26:25 +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
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
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
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
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
Maarten Bosmans
8bcb9c6910 various spelling fixes 2009-04-04 02:27:13 +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
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
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
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
08800c35b0 make a couple of functions return proper error codes 2009-02-03 03:14:20 +01:00
Lennart Poettering
e47d03dea4 implement PA_STREAM_FAIL_ON_SUSPEND logic 2009-02-03 02:23:46 +01:00
Lennart Poettering
64b0543588 when changing volume, store whether it is worth remembering or no 2009-01-27 23:40:03 +01:00
Lennart Poettering
d5f46e824e move flat volume logic into the core. while doing so add n_volume_steps field to sinks/sources 2009-01-27 04:39:07 +01:00
Lennart Poettering
9ba408415c store requested resampling method in a seperate field and use it when create a new resampler after a move 2009-01-27 00:52:28 +01:00
Lennart Poettering
29cb778dcc move sink input/source output move functions into two parts so that we can start the move, delete the original sink, create a new sink, finish the move; similar for source outputs 2009-01-23 22:38:30 +01:00
Lennart Poettering
75119e91cd add new dont_rewind_render flag to allow quick starts of newly created streams 2009-01-15 00:40:06 +01:00
Marc-André Lureau
2204bbebf2 core: add source, si, so proplist_update 2009-01-13 19:06:10 +02:00
Lennart Poettering
adc2973c8d Implement new flags DONT_INHIBIT_AUTO_SUSPEND and START_UNMUTED 2008-10-26 19:32:04 +01:00
Lennart Poettering
358824b330 add new virtual function may_move_to to sink inputs/source outputs to allow modules to forbid certain connections 2008-10-21 18:24:45 +02:00
Marc-Andre Lureau
45412740b8 volume hooks
Signed-off-by: Lennart Poettering <lennart@poettering.net>
2008-10-07 01:54:30 +02:00
Lennart Poettering
d315dcf5d9 save a bit of memory 2008-08-18 17:46:57 +02:00
Lennart Poettering
add6c0361a Rework module-combine to work with glitch-free core; add new max_request field to pa_sink 2008-06-20 22:32:41 +02:00
Lennart Poettering
8ae83d618e get rid of svn $ keywords 2008-06-18 23:23:21 +03:00
Lennart Poettering
b27cc1d426 fix a bad memory access pulsecore/client.c
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2527 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-06-13 21:56:19 +00:00
Lennart Poettering
045c1d602d merge glitch-free branch back into trunk
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2445 fefdeb5f-60dc-0310-8127-8f9354f1896f
2008-05-15 23:34:41 +00:00
Lennart Poettering
14a9b80afb - Check process name when dealing with PID files
- Add new PA_STREAM_FIX_CHANNELS, FIX_RATE, FIX_FORMAT, DONT_MOVE, VARIABLE_RATES to pa_sream_flags_t adn implement it
- Expose those flags in pacat
- Add notifications about device suspend/resume to the protocol and expose them in libpulse
- Allow changing of buffer_attr during playback
- allow disabling for remixing globally
- hookup polkit support


git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2067 fefdeb5f-60dc-0310-8127-8f9354f1896f
2007-11-21 01:30:40 +00:00