summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/protocol-native.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary #includesMaarten Bosmans2011-06-221-2/+0
|
* introspect: Get format of source outputColin Guthrie2011-06-221-0/+1
| | | | | | This gets the negotiated format of source outputs in pa_context_get_source_output*(). Also prints the format and volume in 'pactl list'.
* capture: Implement per-stream volume control for capture streams.Colin Guthrie2011-06-221-4/+74
| | | | | | | 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)
* introspect: Get formats for sourcesColin Guthrie2011-06-221-0/+13
| | | | | This gets the list of supported formats for a source in pa_context_get_source_info*(). Also prints these in 'pactl list'.
* capture: Add the passthrough format negotiation to capture streams.Colin Guthrie2011-06-221-39/+90
| | | | | This helps to keep the API more symmetrical and also potentially allows support for passthrough monitor sources at some point in the future.
* protocol-native: Don't leak formatsArun Raghavan2011-06-191-3/+16
| | | | | This clarifies some ownership issues with the formats idxset on the server side so we don't end up leaking formats on errors.
* protocol-native: Use original requested latency on stream movesArun Raghavan2011-06-141-4/+12
| | | | | | | | 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.
* protocol-native: Fix memory leaks introduced in protocol 21 (passthrough ↵Colin Guthrie2011-05-161-26/+30
| | | | | | | | | | | 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.
* introspect: Get format of sink inputArun Raghavan2011-05-021-0/+2
| | | | | This gets the negotiated format of sink inputs in pa_context_get_sink_input*(). Also prints the format in 'pactl list'.
* introspect: Get formats for sinksArun Raghavan2011-05-021-0/+13
| | | | | This gets the list of supported formats for a sink in pa_context_get_sink_info*(). Also prints these in 'pactl list'.
* core: Fix some FIXMEs for the extended APIArun Raghavan2011-05-021-4/+9
| | | | | | This adds some checks that I'd postponed and adds a "should-be-good-enough" guess for tlength when using a compressed format.
* format: Avoid some code duplicationArun Raghavan2011-05-021-5/+2
| | | | | | 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).
* core: Add extended stream API to support compressed formatsArun Raghavan2011-05-021-30/+77
| | | | | | | | | | | | | | | 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
* sink-input: Add volume_writable to pa_sink_input.Tanu Kaskinen2011-03-291-2/+2
| | | | | | | | | | 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.
* Fix up some double spacesMaarten Bosmans2011-03-181-19/+19
|
* Fix up according to Coding StyleMaarten Bosmans2011-03-111-4/+4
| | | | Only whitespace changes in here
* Implement the "volume sharing" feature.Tanu Kaskinen2011-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Allow read-only or non-existing sink input volume.Tanu Kaskinen2011-02-221-1/+13
| | | | | | | | | | | | 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()).
* Fighting rewinds: Reduce calls to handle_seekDavid Henningsson2011-01-311-30/+26
| | | | | | | | | 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>
* Fighting rewinds: Seek and write data in the same messageDavid Henningsson2011-01-311-8/+12
| | | | | | | | 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>
* ratelimit: fix log levels of log suppression messagesLennart Poettering2011-01-311-1/+1
| | | | | | | | | When logging a suppression message do so on the same log level as the suppressed messages. Cherry picked by Colin Guthrie from ec5a7857127a1b3b9c5517c4a70a9b2c8aab35ca with a couple of additional changes due to extra limiting in master that was not present in stable-queue.
* introspect: Include whether a stream is corked in the info callback.Colin Guthrie2010-10-061-1/+4
|
* AC3 passthrough supportPierre-Louis Bossart2010-08-121-2/+14
| | | | | | | | | | | | 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>
* various modernizationsLennart Poettering2010-02-231-1/+1
|
* native: improve logging for buffer_attrsLennart Poettering2010-02-221-0/+18
|
* native: rework handling of seeks that depend on variables the client does ↵Lennart Poettering2010-02-091-1/+5
| | | | | | | | | | | | 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.
* native: fix request counter miscalculationsLennart Poettering2010-02-091-2/+5
| | | | | | | | | | | | | 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
* protocol: use the right sample rate for sourcesWim Taymans2009-11-101-1/+1
| | | | Use the correct sample rate for reporting about the timing.
* libpulse: introduce PA_STREAM_RELATIVE_VOLUMELennart Poettering2009-10-291-3/+14
|
* protocol-native: if a client set volume/mute/device store it since it is ↵Lennart Poettering2009-10-281-2/+8
| | | | user input
* protocol-native: declare that user configured volumes are always absoluteLennart Poettering2009-10-281-1/+3
|
* native: send PA_COMMAND_PLAYBACK_BUFFER_ATTR_CHANGED messages only to ↵Lennart Poettering2009-09-101-13/+15
| | | | clients that understand it
* protocol-native: log explicitly when someone asks us to quitLennart Poettering2009-09-081-0/+2
|
* llvm-clang-analyzer: drop a few unnecessary assignments and other trivial fixesLennart Poettering2009-09-081-2/+1
|
* core: always allow volume setting with single-channel pa_cvolumeLennart Poettering2009-08-311-3/+3
|
* native: make sure clients cannot trigger an assert by sending us invalid ↵Lennart Poettering2009-08-291-1/+6
| | | | volume info
* protocol-native: replace use of pa_namereg_is_valid_name() by ↵Lennart Poettering2009-08-291-10/+15
| | | | pa_namereg_is_valid_name_or_wildcard() where applicable to allow use of @@ wildcards
* core: move 'flags' field into 'pa_sink_input_new_data' structure so that ↵Lennart Poettering2009-08-281-2/+4
| | | | hooks can access it
* protocol-native: print more volume change debug messages to easy tracking ↵Lennart Poettering2009-08-271-6/+20
| | | | down of feedback loops
* protocol-native: compare uint64_t variable with (uint64_t) -1 instead of ↵Lennart Poettering2009-08-271-1/+2
| | | | (size_t) -1 for compat with 32bit archs
* object: speed up type verification by not relying on strcmp()Lennart Poettering2009-08-211-10/+5
| | | | | | | | | | | | | 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.
* sink: volume handling rework, new flat volume logicLennart Poettering2009-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | - 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.
* native-protocol: downgrade volume change log messagesLennart Poettering2009-08-151-3/+9
|
* log: place more rate limit invocationsLennart Poettering2009-08-151-1/+3
|
* core: split of FAIL_ON_SUSPEND into KILL_ON_SUSPEND and NO_CREATE_ON_SUSPENDLennart Poettering2009-08-151-2/+2
|
* native: handle moving() callback with NULL destination properlyLennart Poettering2009-08-151-1/+7
|
* protocol-native: log explicitly each time a client triggers a volume changeLennart Poettering2009-08-141-3/+12
|
* protocol-native: use the right samplerateWim Taymans2009-07-231-1/+1
| | | | | The render_memblockq is expressed in the sample_spec of the sink, not of the particular stream before resampling.
* native: don't hit assert when user uploads zero-sized sampleLennart Poettering2009-07-011-1/+3
|
* Base mainloop on pa_rtclock_now()Marc-André Lureau2009-06-201-10/+7
| | | | | | | | | | | | | | | | Move the mainloop to monotonic based time events. Introduces 4 helper functions: pa_{context,core}_rttime_{new,restart}(), that fill correctly a timeval with the rtclock flag set if the mainloop supports it. Both mainloop-test and mainloop-test-glib works with rt and timeval based time events. PulseAudio and clients should be fully functional. This patch has received several iterations, and this one as been largely untested. Signed-off-by: Marc-André Lureau <marca-andre.lureau@nokia.com>