summaryrefslogtreecommitdiff
path: root/src/pulse/stream.c
AgeCommit message (Collapse)AuthorFilesLines
2015-06-12stream: Support extended API with PULSE_LATENCY_MSEC if possibleArun Raghavan1-1/+9
This only works in the single-format case (i.e. we know the format up-front and we're not negotiating).
2015-06-12stream: Check sample spec validity before abiding PULSE_LATENCY_MSECDavid Henningsson1-3/+5
In case the sample spec is not known, as can be the case when pa_stream_new_extended is used, we cannot satisfy the PULSE_LATENCY_MSEC request. As a workaround disable being able to use PULSE_LATENCY_MSEC in this case. Reported-by: Fritsch <fritsch@xbmc.org> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2015-01-14update FSF addresses to FSF web pageOndrej Holecek1-3/+1
FSF addresses used in PA sources are no longer valid and rpmlint generates numerous warnings during packaging because of this. This patch changes all FSF addresses to FSF web page according to the GPL how-to: https://www.gnu.org/licenses/gpl-howto.en.html Done automatically by sed-ing through sources.
2014-10-24stream: Fail on client submitting non-frame-aligned memblocksDavid Henningsson1-0/+2
If somebody tries to push a non-frame-aligned memblock onto the memblockq, then we should fail the write. Otherwise the daemon will crash, see https://bugs.freedesktop.org/show_bug.cgi?id=77595 Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2014-09-10Client API: Add pa_stream_write_ext_free() function.Lukasz Marek1-3/+15
New function allows to pass data pointer that is a member of the outer structure that need to be freed too when data is not needed anymore. Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-01-08stream: Remove a volume channel validity checkTanu Kaskinen1-1/+0
The check is done for clients that use pa_stream_new() but not for clients that use pa_stream_new_extended(). This is inconsistent. We could check that the volume channels match the channels set in the format info struct that is passed to pa_stream_new_extended(), but that doesn't work if the format info doesn't contain the channel information (that can happen if the client wants the server to choose the channel count for the stream). And it should also be possible to pass a mono volume for a multi-channel stream. The check could be extended to handle all these cases, but I don't see much point in wasting time on that. The server will anyway validate the stream parameters, it's not particularly important to fail already when the stream is being created at the client side.
2013-12-15Add pa_sample_rate_valid()Tanu Kaskinen1-1/+1
I think this makes the code a bit nicer to read and write. This also reduces the chances of off-by-one errors when checking the bounds of sample rate values.
2013-07-04Remove pa_bool_t and replace it with bool.poljar (Damir Jelić)1-85/+85
commands used for this (executed from the pulseaudio/src directory): find . -regex '\(.*\.[hc]\|.*\.cc\|.*\.m4\)' -not -name 'macro.h' \ -a -not -name 'reserve.[ch]' -a -not -name 'reserve-monitor.[ch]' \ -a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \ -a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \ -a -not -name 'poll-win32.c' -a -not -name 'thread-win32.c' \ -a -not -name 'dllmain.c' -a -not -name 'gconf-helper.c' \ -exec sed -i -e 's/\bpa_bool_t\b/bool/g' \ -e 's/\bTRUE\b/true/g' -e 's/\bFALSE\b/false/g' {} \; and: sed -i -e '181,194!s/\bpa_bool_t\b/bool/' \ -e '181,194!s/\bTRUE\b/true/' -e \ '181,194!s/\bFALSE\b/false/' pulsecore/macro.h
2013-06-24Whitespace cleanup: Remove all multiple newlinespoljar (Damir Jelić)1-4/+0
This patch removes all occurrences of double and triple newlines. Command used for this: find . -type d \( -name ffmpeg \) -prune -o \ -regex '\(.*\.[hc]\|.*\.cc\)' \ -a -not -name 'adrian-aec.*' -a -not \ -name reserve.c -a -not -name 'rtkit.*' \ -exec sed -i -e '/^$/{N;s/^\n$//}' {} \; Two passes were needed to remove triple newlines. The excluded files are mirrored files from external sources.
2013-06-24Style fix: Remove new lines from opening bracketspoljar (Damir Jelić)1-2/+1
This patch replaces every occurrence of ')\n{' with ') {'. Command used for this: find . -type d \( -name ffmpeg \) -prune -o \ -regex '\(.*\.[hc]\|.*\.cc\)' \ -a -not -name core-util.c -a -not \ -name adrian-aec.c -a -not -name g711.c \ -exec sed -i -e '/)$/{N;s/)\n{$/) {/}' {} \; The excluded files are mirrored files from external sources.
2013-03-25stream: Make it easier to enable debug outputArun Raghavan1-6/+20
This is only useful while hacking on PulseAudio.
2012-11-08pulse: Fix hole handling in pa_stream_peek().Tanu Kaskinen1-4/+16
Previously, if there was a hole in a recording stream, pa_stream_peek() would crash. Holes could be handled silently inside pa_stream_peek() by generating silence (wouldn't work for compressed streams, though) or by skipping any holes. However, I think it's better to let the caller decide how the holes should be handled, so in case of holes, pa_stream_peek() will return NULL data pointer and the length of the hole in the nbytes argument. This change is technically an interface break, because previously the documentation didn't mention the possibility of holes that need special handling. However, since holes caused crashing anyway in the past, it's not a regression if applications keep misbehaving due to not handing holes properly. Some words about when holes can appear in recording streams: I think it would be reasonable behavior if overruns due to the application reading data too slowly would cause holes. Currently that's not the case - overruns will just cause audio to be skipped. But the point is that this might change some day. I'm not sure how holes can occur with the current code, but as the linked bug shows, they can happen. It's most likely due to recording from a monitor source where the thing being monitored has holes in its playback stream. BugLink: http://bugs.launchpad.net/bugs/1058200
2012-09-21stream: Allow record streams to start mutedArun Raghavan1-1/+0
This check was valid before we introduced per-source-output volumes, so dropping it now. Thanks to Alban Browaeys <prahal@yahoo.com> for catching this.
2012-03-28stream: Fix sample spec initialisation for extended APIArun Raghavan1-1/+1
This fixes pa_sample_spec init to use the correct API. Not doing so triggers a valgrind warning as we call pa_sample_spec_valid() on this later on, which checks the rate and channels fields. Thanks to Rémi Denis-Courmont for reporting this.
2012-02-19pulse: Fix old bug in stream_freeMaarten Lankhorst1-2/+3
Signed-off-by: Maarten Lankhorst<m.b.lankhorst@gmail.com>
2011-12-12stream: Fix commentsPeter Meerwald1-3/+3
2011-11-14stream: Fix upload samples' cleanupAntti-Ville Jansson1-1/+1
In pa_create_stream_callback, a stream is inserted into s->context->record_streams only if it's a record stream. Otherwise it's inserted into s->context->playback_streams. However, in stream_unlink the stream is removed from s->context->playback_streams only if it's a playback stream and otherwise it's removed from s->context->record_streams. Thus, if the stream is an upload stream, we first insert it into s->context->playback_streams in pa_create_stream_callback and then try to remove it unsuccessfully from s->context->record_streams in stream_unlink. This means that we are leaking hashmap entries until the context is freed, constantly consuming more memory with applications that upload and unload a large number of samples through one context. Of course, this begs the question whether upload streams even belong in either of those hashmaps. I don't want to mess around with the code too much at this point though, so this patch should be a sufficient improvement.
2011-10-01memblockq: Improve debuggability by storing a name and a sample spec.Tanu Kaskinen1-1/+2
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-09-14stream: Relax assert for extended APIArun Raghavan1-1/+1
For some reason this assert wasn't triggered earlier -- we shouldn't be looking at the stream sample_spec if the formats API is used.
2011-08-25More spelling fixesMaarten Bosmans1-4/+4
2011-08-02protocol-native: Allow clients to know at what index underrun occurredDavid Henningsson1-2/+24
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-07-14Fix two comment typos.Ralph Giles1-1/+1
2011-06-24win32: Make some unused-variable warnings go awayMaarten Bosmans1-5/+4
2011-06-22capture: Implement per-stream volume control for capture streams.Colin Guthrie1-16/+22
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-22capture: Add the passthrough format negotiation to capture streams.Colin Guthrie1-18/+12
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-19stream: Simplify passing of formats in extended APIArun Raghavan1-9/+9
Passing a NULL-terminated array of pa_format_info pointers is a bit unwieldy for clients. Instead of this, let's pass in an array of pointers and the number of elements in the array.
2011-06-19stream: Fix a couple of format_info leaksArun Raghavan1-1/+4
2011-05-15protocol-native: Stop auto timing updates if connected to suspended sink or ↵Jyri Sarha1-4/+24
source This quite is an old patch. It was added to N900 to avoid unnecessary wake-ups when the phone is in power save mode (= blank screen and no user interaction). In this situation if the user had a browser window with flash animation open pulseaudio kept waking up every 10 seconds, causing a severe hit to use times. Anyway I do not see any reason to send timing updates if the sink or source where the stream is connected to is suspended.
2011-05-15sink-input: Provide more information to client when format is lostArun Raghavan1-0/+8
When the sink format changes and we kill the stream, clients need a way to know (a) what device they should reconnect to, and (b) what the stream running time was when the stream got killed (pa_stream_get_time() won't work after the stream has been killed). This adds these two bits of information in the event callback's proplist parameter.
2011-05-02stream: Add API to get a stream's pa_format_infoArun Raghavan1-0/+10
2011-05-02core: Fix some FIXMEs for the extended APIArun Raghavan1-6/+17
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-02core: Add extended stream API to support compressed formatsArun Raghavan1-19/+104
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-03-18Fix up some double spacesMaarten Bosmans1-1/+1
2011-03-11Fixup #include directives according to Coding StyleMaarten Bosmans1-2/+2
Use #include "header.h" if functionality of header.h is implemented and #include <header.h> if functionality of header.h is used.
2011-03-11Fix up according to Coding StyleMaarten Bosmans1-1/+1
Only whitespace changes in here
2011-01-15client: Don't update smoother while corkedArun Raghavan1-2/+2
This prevents the smoother attached to the stream clock from being updated while the stream is corked, which in turn ensures that once corking is completed, pa_stream_get_time() always returns the same value until the stream is uncorked - i.e., the clock does not advance when the client believes that it will not. The actual call to pa_smoother_put() happens on things like stream suspend/unsuspend, which trigger timing updates. This changes the smoother coefficients, which means that a call to pa_smoother_get() for the same value of 'x' can return different values before and after a timing update.
2010-08-12AC3 passthrough supportPierre-Louis Bossart1-1/+9
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-02-09native: rework handling of seeks that depend on variables the client does ↵Lennart Poettering1-0/+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.
2010-02-09client: implement $PULSE_LATENCY_MSECLennart Poettering1-6/+31
This allows easy overriding of a clients latency setting for debugging purposes. http://pulseaudio.org/ticket/753
2010-02-09client: detect forking in sample cache API, tooLennart Poettering1-0/+1
2010-02-09native: fix request counter miscalculationsLennart Poettering1-0/+4
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
2009-12-03libpulse: Store pa_stream pointers to hashmaps instead of dynarrays.Tanu Kaskinen1-10/+10
Since the stream identifiers (channels) are monotonically growing integer, it isn't a good idea to use them as index to a dynamic array, because the array will grow all the time. This is not a problem with client connections that don't create many streams, but, for example, long-running clients that use libcanberra for playing event sounds, this means that the client connection effectively leaks memory.
2009-11-20pulse: ask for timing updates both *before* and *after* triggering a stream ↵Lennart Poettering1-2/+36
state change so that in the STARTED/UNDERFLOW callbacks we accurate transport latency information
2009-11-20pulse: delay smoother update only when unpausing, not when pausing, since we ↵Lennart Poettering1-17/+19
don't want the timer to advance when we are supposedly already paused
2009-11-20pulse: try to fix inaccuracy with uncork timing for streams that are created ↵Lennart Poettering1-1/+16
in corked state
2009-10-29libpulse: introduce PA_STREAM_RELATIVE_VOLUMELennart Poettering1-1/+9
2009-08-15pulse: even in case of record stream, let's initialize req_bytes to 0Marc-André Lureau1-1/+1
2009-07-24client: limit block size for zero-copy operations to mempool block sizeLennart Poettering1-0/+11
2009-07-24client: make volume struct constLennart Poettering1-1/+1
2009-07-24alsa: throw timing data away after device resumeLennart Poettering1-1/+1