Commit graph

66 commits

Author SHA1 Message Date
David Henningsson
961ec210a6 Introduce "available" concept for ports, and communicate that to clients. Bump protocol version to 24.
Note: There is still no notification when status availability changes.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-11-26 13:47:33 +02:00
Pierre-Louis Bossart
f0ec495938 sink,source: support for rate update
Avoid resampling or use integer resampling when supported by the
sinks/sources

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2011-10-17 20:09:46 +05:30
Arun Raghavan
a9c85074cb def: Hide server-side sink/source flags
This makes sure that sink/source flags that are used on the server side
only are not leaked to clients.
2011-09-14 14:02:12 +05:30
Colin Guthrie
aa3142ab20 volume: Rename 'sync volume' to 'deferred volume'.
This just covers Lennart's concern over the terminology used.

The majority of this change is simply the following command:
 grep -rli sync[-_]volume . | xargs sed -i 's/sync_volume/deferred_volume/g;s/PA_SINK_SYNC_VOLUME/PA_SINK_DEFERRED_VOLUME/g;s/PA_SOURCE_SYNC_VOLUME/PA_SOURCE_DEFERRED_VOLUME/g;s/sync-volume/deferred-volume/g'

Some minor tweaks were added on top to tidy up formatting and
a couple of phrases were clarified too.
2011-09-13 21:15:49 +01:00
Colin Guthrie
cc117be62b def: Add a new enum to allow differntiation between sinks and sources.
This is for bits of code or API where the concepts and constructs are
extensibly the same for sinks and sources. To avoid duplication we can
simply define our structure/API and then use this enum to differentiate
the two.
2011-08-18 17:10:13 +01:00
Arun Raghavan
a6ad2d860a sink: Add PA_SINK_SET_FORMATS macro
Required for testing the existence of the flag
2011-08-18 14:56:41 +05:30
Arun Raghavan
2677911e92 source: Remove the PA_SOURCE_PASSTHROUGH flag
This isn't actually used anywhere, and PA_SINK_PASSTHROUGH was also
removed.
2011-08-17 09:00:47 +05:30
Arun Raghavan
fb67016844 sink: Add a SET_FORMATS flag
This adds a PA_SINK_SET_FORMATS flag to the pa_sink_flags enum,
signalling that a sink allows the set of supported formats to be set
externally. The idea is for clients to be able to know what sinks
support this ability and adapt their UI appropriately.
2011-08-16 11:11:34 +05:30
Colin Guthrie
a9cf320bc1 devices: Set certain sink/source flags automatically.
Some sink flags are really just a product of what callbacks
are set on the device. We still enforce a degree of sanity
that the flags match the callbacks set, but we also set the
flags automatically in our callback setter functions to
help ensure that a) people use them and b) flags & callbacks
are kept in sync.
2011-07-20 22:20:37 +01:00
Colin Guthrie
30597b7c27 def: Add some flags for source outputs.
These flags will be required in upcoming work to integrate format and volume
support for source outputs.
2011-06-22 21:53:20 +01:00
Arun Raghavan
53091cc5f0 sink-input: Add a format-lost event
This event is emitted if the sink-input could not be moved to a new sink
because it doesn't support the format of the sink-input. Clients can
reconnect their stream with a different format if they wish or
gracefully exit.
2011-05-15 10:09:34 +05:30
Arun Raghavan
71ec9577cf sink: Remove PASSTHROUGH flag
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.
2011-05-02 11:54:48 +05:30
Tanu Kaskinen
c9c88fb8dc Implement the "volume sharing" feature.
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.
2011-02-26 10:37:20 +00:00
Maarten Bosmans
a39a83665f win32: Implement rtclock based on QueryPerformanceCounter
Also remove some unnecessary <time.h> headers.
2011-02-17 12:02:31 +01:00
Colin Guthrie
2a01bab3cc doxygen: Fix version numbers for new features
Due to how our branching worked out, these new features will
debut in v1.0 and not v0.9.22 which has already been released
from the stable-queue branch
2010-12-04 16:43:04 +00:00
Jyri Sarha
5391daf8df core: Add infrastructure for synchronizing HW and SW volume changes
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>
2010-10-16 11:53:38 +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
Mads Kiilerich
6faf38313e headers: Some trivial fixes for some documentation typos
Note also the willneed/will_need inconsistency. I guess it could be nice to ASAP
choose one of them and introduce a backward compatibility hack for the other.

The issues was mostly found with:
for a in $(grep -r '^[ /]\*.*()' $(
	find -name '*.[ch]') |
	sed 's,^.* \([^ ]*\)().*$,\1,g' |
	sort |
	uniq |
	grep ^pa_)
do
	grep -rq "^.[^*].*\<$a(" $(find * -name '*.h') || echo $a
done
2010-01-05 21:27:33 +01:00
Lennart Poettering
f27a50691c libpulse: introduce PA_STREAM_RELATIVE_VOLUME 2009-10-29 00:46:22 +01:00
Colin Guthrie
8f4940b17a libpulse: Add *_NOFLAGS flags with value 0 for various enums
This avoids the need for ugly casting in client implementations.
2009-09-22 18:43:03 +01:00
Lennart Poettering
6b8fdc4169 CANCELLED vs. CANCELED
Define CANCELLED as alias for CANCELED
2009-09-17 01:19:55 +02:00
Lennart Poettering
54609675e5 libpulse: add new error code PA_ERR_BUSY 2009-09-11 01:20:45 +02:00
Lennart Poettering
bd8e043a52 bluetooth: return sensible error code in set_profile() 2009-06-17 04:51:57 +02:00
Maarten Bosmans
8bcb9c6910 various spelling fixes 2009-04-04 02:27:13 +02:00
Lennart Poettering
d33be12fde Merge commit 'elmarco/dbus' 2009-03-30 20:26:27 +02:00
Marc-André Lureau
1dad83b73c pulse: client connect to dbus 2009-03-30 21:05:31 +03:00
Lennart Poettering
491aafd8dc typo fix 2009-03-30 18:27:33 +02:00
Lennart Poettering
8282efcfa3 fix value of DYNAMIC_LATENCY 2009-03-25 16:17:15 +01:00
Lennart Poettering
44ca897769 introduce new flag that marks sinks/sources which can adjust the latency dynamically 2009-03-25 00:30:54 +01:00
Lennart Poettering
3122008704 try to detect when stupid clients forks and refuse all service from then on 2009-03-05 04:33:40 +01:00
Lennart Poettering
823431e447 allow sending meta/policy events to clients 2009-02-12 03:18:05 +01:00
Lennart Poettering
6bb2c49057 add #defines for all enums that lacked it 2009-02-06 02:01:17 +01:00
Lennart Poettering
f9696c0e7f add a macro definition for each error code 2009-02-03 03:38:40 +01:00
Lennart Poettering
50bfa774f6 add new error code PA_ERR_NOTIMPLEMENTED 2009-02-03 03:08:14 +01:00
Lennart Poettering
e47d03dea4 implement PA_STREAM_FAIL_ON_SUSPEND logic 2009-02-03 02:23:46 +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
6058530571 import version.h in all header files to make sure that version-based feature testing works 2009-01-27 02:36:42 +01:00
Lennart Poettering
a5c9546fc7 fix copy'n'paste error 2009-01-22 00:17:55 +01:00
Lennart Poettering
8839d86672 remove misplaced whitespace 2009-01-20 00:14:50 +01:00
Lennart Poettering
8886e66ff6 Document explicitly that the internal sink/source states are not considered part of the ABI/API 2009-01-19 23:54:44 +01:00
Marc-André Lureau
310f433848 pulse: share private enum values with client side 2009-01-20 00:16:18 +02:00
Marc-André Lureau
9c4f8e627a pulse: introspect sink state 2009-01-20 00:16:18 +02:00
Lennart Poettering
23cd942a0d fix doxygen version references 2009-01-19 23:03:22 +01:00
Lennart Poettering
29c7a28817 kill autoload stuff as planned 2009-01-15 20:07:13 +01:00
Lennart Poettering
b6deb0cc4c add new pa_card object as a way to logically combine multiple sinks and sources 2009-01-15 18:29:16 +01:00
Lennart Poettering
0b0b3d895d make PA_CONTEXT_IS_GOOD/PA_STREAM_IS_GOOD a macro so that we can easily check for its availability 2009-01-15 18:23:32 +01:00
Marc-André Lureau
09641cc707 build: fix few warnings 2009-01-13 22:56:02 +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
bf403fe0d8 introduce macros for all flags so that clients can check for them with #ifdef 2008-09-03 19:51:33 +02:00
Lennart Poettering
c402de7545 reindent comments a bit 2008-09-03 18:51:46 +02:00