This is needed as a precursor to allowing capture of IEC61937
formats. We now also need to include the channel map while converting
format info to caps so that a correct channel mask is generated for
pulsesrc's caps.
PA_INVALID_INDEX, the default value, is unfortunately !0.
Setting the volume before the stream is created will put the ring
buffer in error state. Unfortunately, that's what spice-gtk does.
PulseAudio defines PA_RATE_MAX as the maximum sampling rate that it
supports. We were previously exposing a maximum rate of INT_MAX, which
is incorrect, but worked because nothing was really using a rate greater
than 384000 kHz.
While playing DSD data, we hit a case where there might be very high
sample rates (>1MHz), and pulsesink fails during stream creation with
such streams because it erroneously advertises that it supports such
rates.
Since PA_RATE_MAX is #define'd to (8*48000U), we can't just use it in
the caps string. Instead, we fix up the rate to what we actually support
whenever we use our macro caps.
GstAudioRingBuffer doesn't needs us to have at least 2 segments. We make
sure that if our buffer parameters are such that the maxlength is not at
least 2x fragsize, we still request the ringbuffer to keep that much
space so it continues to work.
https://bugzilla.gnome.org/show_bug.cgi?id=770446
This gives a quick introduction to how the pulsesink/pulsesrc code
interacts with the pa_threaded_mainloop that we start up to communicate
with the server.
A bug in PulseAudio causes PA_STREAM_START_MUTED to be rejected on
record streams. Until this is fixed upstream, we mute the stream
manually at startup. Based on a patch by Alban Browaeys
<prahal@yahoo.com>.
https://bugzilla.gnome.org/show_bug.cgi?id=684469
When we start and renegotiate, there is a moment where the stream is created but
not yet connected. Make sure all functions deal with this situation correctly
instead of erroring out.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=681247
When get_time is called but we are not yet negotiated, return 0 instead of
posting an error. It's possible that the base class is still negotiating when
our get_time is called.
This makes sure that we:
a) Destroy an existing stream if a negotiate() request comes in: this is
required when receiving a downstream renegotiation request after a
stream has been created.
b) Create a new stream on prepare(): this is required since we do a
setcaps() in negotiate(), which causes the stream to be dropped by a
ringbuffer release() call (this does not happen during first negotiation
since the release is only done on a running ringbuffer). The subsequent
call to ringbuffer acquire() fails because the stream was lost on
release().
https://bugzilla.gnome.org/show_bug.cgi?id=681247
This itereates over the GstAudioInfo to set invalid channel positions
rather than use memset() which works right now because it assumes that
GST_AUDIO_CHANNEL_POSITION_INVALID is -1.
Post the notify outside of the pa_lock to avoid a deadlock caused by basesrc
calling get_time with the object lock.
Reset the clock on connect.
Post clock-lost and clock-provide messages.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=673977
Conflicts:
ext/pulse/pulsesrc.c
pa_stream_* functions return negative on error, despite the defines
for error codes being positive.
I only got to repro the error twice, so I'm not sure 100% sure this
fixes the issue (the negative var being uninitialized after returning
from pa_stream_get_latency).
Conflicts:
ext/pulse/pulseaudiosink.c
ext/pulse/pulsesrc.c
gst/audioparsers/gstaacparse.c
gst/audioparsers/gstamrparse.c
gst/audioparsers/gstdcaparse.c
gst/audioparsers/gstflacparse.c
gst/effectv/gstradioac.c
gst/effectv/gstradioac.h
gst/effectv/gstripple.c
Some possible FIXMEs remaining in the audio parser getcaps functions.
PulseAudio 1.0 supports per-source-output volumes, and this exposes the
functionality via the GstStreamVolume interface.
When compiled against pre-1.0 PulseAudio, the interface is not
implemented, and the "volume" or "mute" properties are not available.
This bit of ugliness will go away when we can depend on PulseAudio 1.0
or greater.
https://bugzilla.gnome.org/show_bug.cgi?id=595055