Commit graph

190 commits

Author SHA1 Message Date
David Henningsson
793f46320e introspect: Expose port info per card to clients
For volume control UIs to be able to show ports in inactive profiles,
expose all ports together with the card info. This includes updating
the protocol and the client API to show the connection between ports
and for which profiles the ports are relevant.

Update protocol to 26.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2012-03-11 12:23:46 +05:30
Arun Raghavan
0bbe94f5db protocol-native: Fix 'auth-group-enabled' modarg
This is actually implemented in module-protocol-stub as
'auth-group-enable'. An unfortunate typo because the other argument is
spelt as 'enabled', but it's better to be slightly inconsistent than to
change the public interface.
2011-12-14 21:51:50 +05:30
Peter Meerwald
c6b95d5235 pstream: Fix spelling of 'receive'.
These functions are not exported in the map file and thus do
not form part of the API and can be corrected without any problem.
2011-12-12 22:36:39 +00:00
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
Arun Raghavan
efbfe5fecb core: Make debugging a bit simpler
This takes out a bunch of commented debug prints and puts them in
defines. Makes it easier to turn them all on/off at a single point.
2011-11-10 12:43:09 +05:30
Lars R. Damerow
7a387fed36 alsa: support fixed latency range in alsa modules
This adds a boolean module parameter to disable automatic dynamic
latency readjustments on underruns, but leaves automatic dynamic
watermark readjustments untouched.
2011-11-03 21:17:54 +01:00
Tanu Kaskinen
666261ece8 memblockq: Improve debuggability by storing a name and a sample spec.
These are not used for anything at this point, but this
makes it easy to add ad-hoc debug prints that show the
memblockq name and to convert between bytes and usecs.
2011-10-01 13:25:16 +01:00
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
Maarten Bosmans
c5dca7cf2b More spelling fixes 2011-08-25 11:27:47 +01:00
Maarten Bosmans
92219b01b9 Initialise variables
These were detected using clang static analyzer.
2011-08-15 09:41:56 +01:00
David Henningsson
1893234063 protocol-native: Allow clients to know at what index underrun occurred
This patch introduces some extra protocol information, so protocol
version is bumped. This functionality is primarily needed to solve
a long standing issue in alsa-plugins, which should ignore underruns
if and only if it is obsolete, i e, if more data has been written to
the pipe in the meantime (which will automatically end the underrun).

BugLink: http://bugs.launchpad.net/bugs/805940
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-08-02 13:59:00 +01:00
Arun Raghavan
a823fae3e5 protocol-native: Trivial fix for a compiler warning 2011-07-12 14:46:21 -07:00
Arun Raghavan
f69cbdbdf7 protocol-native: Fix invalid assert
For source and sinks, we allow both the index and name to be invalid
while introspecting (the default source/sink will be used). This
modifies the assert appropriately. Thanks to Drew Ogle
<dantealiegri@gmail.com> for reporting and providing a patch.
2011-07-11 20:52:41 -07:00
Arun Raghavan
018de50cfd protocol-native: Fix backward compatibility break
This makes sure we don't perform a check on record stream volumes for
clients that don't support them.
2011-07-09 19:16:18 -07:00
Maarten Bosmans
dd9265ac78 Remove unnecessary #includes 2011-06-22 23:12:20 +01:00
Colin Guthrie
4ab60d0377 introspect: Get format of source output
This gets the negotiated format of source outputs in
pa_context_get_source_output*(). Also prints the format and volume
in 'pactl list'.
2011-06-22 22:45:27 +01:00
Colin Guthrie
dffc4d18d3 capture: Implement per-stream volume control for capture streams.
This piggy backs onto the previous changes for protocol 22 and
thus does not bump the version. This and the previous commits should be
seen as mostly atomic. Apologies for any bisecting issues this causes
(although I would expect these to be minimal)
2011-06-22 22:45:27 +01:00
Colin Guthrie
fdf3a08814 introspect: Get formats for sources
This gets the list of supported formats for a source in
pa_context_get_source_info*(). Also prints these in 'pactl list'.
2011-06-22 21:55:27 +01:00
Colin Guthrie
5d35375aa7 capture: Add the passthrough format negotiation to capture streams.
This helps to keep the API more symmetrical and also potentially
allows support for passthrough monitor sources at some point in the future.
2011-06-22 21:55:27 +01:00
Arun Raghavan
b161a7e073 protocol-native: Don't leak formats
This clarifies some ownership issues with the formats idxset on the
server side so we don't end up leaking formats on errors.
2011-06-19 17:46:35 -07:00
Arun Raghavan
7f48b79758 protocol-native: Use original requested latency on stream moves
We were calculating new latency based on the latency set on the old
sink/source, rather than the actual latency requested by the client.
Over a series of moves, this will lead the latency being ~halved each
time, resulting in an eventual rewind flood from a latency that cannot
be handled.
2011-06-14 16:39:47 -07:00
Colin Guthrie
4ff2e85894 protocol-native: Fix memory leaks introduced in protocol 21 (passthrough support)
The proplist used may never be freed if an error condition was found with
CHECK_VALIDITY macro and the formats idxset was never freed regardless
of error state.

This change fixes adds a new maco CHECK_VALIDITY_GOTO() which allows
for cleanup to be done before returning.
2011-05-16 09:59:35 +01:00
Arun Raghavan
7aa84e8208 introspect: Get format of sink input
This gets the negotiated format of sink inputs in
pa_context_get_sink_input*(). Also prints the format in 'pactl list'.
2011-05-02 11:55:39 +05:30
Arun Raghavan
322980e2e3 introspect: Get formats for sinks
This gets the list of supported formats for a sink in
pa_context_get_sink_info*(). Also prints these in 'pactl list'.
2011-05-02 11:55:39 +05:30
Arun Raghavan
e11770b64f core: Fix some FIXMEs for the extended API
This adds some checks that I'd postponed and adds a
"should-be-good-enough" guess for tlength when using a compressed
format.
2011-05-02 11:55:35 +05:30
Arun Raghavan
e418e49ecb format: Avoid some code duplication
We frequently need to free an idxset containing pa_format_infos, so
define an internal free function that can be used directly with this
(instead of defining it once-per-file).
2011-05-02 11:54:48 +05:30
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
Maarten Bosmans
684b89c639 Fix up some double spaces 2011-03-18 09:20:07 +00:00
Maarten Bosmans
ecf09f2cd6 Fix up according to Coding Style
Only whitespace changes in here
2011-03-11 11:49:35 +00:00
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
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
David Henningsson
74eb4d8921 Fighting rewinds: Reduce calls to handle_seek
If many small blocks are in queue, handle_seek is being called
for every one of them, sometimes causing a rewind. Delay the
call until all blocks are handled, then call handle_seek only
once.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-01-31 11:38:26 +00:00
David Henningsson
fe7b972487 Fighting rewinds: Seek and write data in the same message
Allow a message in the queue to perform both a seek and a post data.
For clients that do not use PA_SEEK_RELATIVE (e g gstreamer), this
cuts the message count - and sometimes even the rewinds - in half.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2011-01-31 11:38:17 +00:00
Lennart Poettering
1250b5d735 ratelimit: fix log levels of log suppression messages
When logging a suppression message do so on the same log level as the
suppressed messages.

Cherry picked by Colin Guthrie from ec5a785712
with a couple of additional changes due to extra limiting in master
that was not present in stable-queue.
2011-01-31 11:36:24 +00:00
Colin Guthrie
3de129f3ac introspect: Include whether a stream is corked in the info callback. 2010-10-06 09:17:01 +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
dbdc666fb6 various modernizations 2010-02-23 01:23:41 +01:00
Lennart Poettering
b5e30764c4 native: improve logging for buffer_attrs 2010-02-22 04:57:21 +01:00
Lennart Poettering
66cfa72eb4 native: rework handling of seeks that depend on variables the client does 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.
2010-02-09 22:45:59 +00:00
Lennart Poettering
699233fb47 native: fix request counter miscalculations
Do not subtract bytes the client sends us beyond what we requested from
our missing bytes counter.

This was mostly a thinko that caused servers asking for too little data
when the client initially sent more data than requested, because that
data sent too much was accounted for twice.

This commit fixes this miscalculation.

http://bugzilla.redhat.com/show_bug.cgi?id=534130
2010-02-09 22:29:20 +00:00
Wim Taymans
f3866f2635 protocol: use the right sample rate for sources
Use the correct sample rate for reporting about the timing.
2009-11-10 13:21:55 +01:00
Lennart Poettering
f27a50691c libpulse: introduce PA_STREAM_RELATIVE_VOLUME 2009-10-29 00:46:22 +01:00
Lennart Poettering
546bcf3f2f protocol-native: if a client set volume/mute/device store it since it is user input 2009-10-28 23:50:42 +01:00
Lennart Poettering
27c6a80ccb protocol-native: declare that user configured volumes are always absolute 2009-10-28 23:47:21 +01:00
Lennart Poettering
807f2a9923 native: send PA_COMMAND_PLAYBACK_BUFFER_ATTR_CHANGED messages only to clients that understand it 2009-09-10 02:15:12 +02:00
Lennart Poettering
31d1d9088e protocol-native: log explicitly when someone asks us to quit 2009-09-08 23:53:28 +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
e1ce365cd9 native: make sure clients cannot trigger an assert by sending us invalid volume info 2009-08-29 06:11:02 +02:00