This helps to export correct APIs for compiler toolchain which
does not support version script file. For example, mingw clang.
The APIs in libpulse.def are similar with map-file except those
are in pulse-simple and pulse-mainloop-glib. Those are exported
in different shared library in Windows platform.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/761>
There is no requirement for chunk index to be aligned, we only need chunk length
to be multiple of sample frame size.
Fixes: 6434853b0 ("memblockq: Do not allow non-frame indices in the memblock queue")
Fixes: 22827a5e1 ("protocol-native: Fail if trying to push unaligned memblock into queue")
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/779>
`pa_pstream_send_memblock()` would split incoming memblock into parts not
exceeding maximum pool block size.
To make sure split parts of memblock are still frame-aligned add new `align` arg
to `pa_pstream_send_memblock`, find out required alignment from stream sample
format and pass it there. Bump default alignment to 256 which is good up to
32bit 64ch frames.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/780>
Looks like sbc_decode() would seldom access more than specified input length
bytes from input buffer if input length is less than expected frame size.
Fix potential access past allocated memory by checking if input contains
complete frame before calling sbc_decode()
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/781>
The assumption that the format enum is ordered by size is not valid for quite
some time, since 24bit formats were appended to format enum later than 32bit
formats. This causes resampler to produce properly aligned memblock of size
larger than maximum mempool block size if input format is 24bit and output
format is 32bit.
Oversized block is getting split by `pa_pstream_send_memblock()` into parts of
size not exceeding maximum mempool block size. This usually works well but for
32ch 32bit 48000Hz stream the frame alignment is 128 bytes and maximum mempool
block size value is multiple of 64 but not 128 bytes, therefore resulting parts
are misaligned.
On receiving side this causes extra allocation of 128 byte chunk while `mcalign`
helper reassembles properly aligned frame out of second block of misaligned
size. While first and second properly aligned frames are retrieved successfully
from `mcalign` helper, third retrieved frame would end up with properly aligned
size but misaligned memblock index (in this example, that would be 64 bytes.)
Attempt to push a chunk with misaligned memblock index causes assertion failure
Assertion 'uchunk->index % bq->base == 0' failed at memblockq.c:289,
function pa_memblockq_push(). Aborting.
Fix oversized block issue by checking proper size of format instead of enum
value.
Fixes: a67c21f09 ("merge 'lennart' branch back into trunk.")
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/778>
When tunnel-sink-new was used in combination with module-combine-sink, PA
would hang because the main thread was blocked waiting for the execution
of the latency snapshot message. The message would never be processed
because the rtpoll associated with the control_inq of module-combine-sink
was never run.
This patch fixes the problem by running the rtpoll in the thread function
to process incoming messages. Though there are no users of the rtpoll for
module-tunnel-source-new, the same change is applied there.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/773>
When bluetooth transport has both both sink and source, pulseaudio would
synchronize writing out frames with reading frames from peer to make fair
schedule of reads and writes. Pulseaudio allows two blocks of data to be sent to
peer before synchronizing writes with reads just in case that peer implements
similar write schedule.
It could happen that first blocks are still missed by peer, which would cause
pulseaudio writes to stall waiting for first frames from peer.
Fix this by allowing more data frames out until data from peer is actually
received.
Closes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1424
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/777>
If the same role is named in trigger_roles and cork_roles, a stream with that
role will crash PA. This patch fixes the crash and re-introduces the old
behavior, so that for example specifying trigger_roles=alarm, phone and
cork_roles=alarm, multimedia means that a phone stream will cork alarm and
multimedia streams while an alarm stream will only cork multimedia streams.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/767>
For module-role-ducking, trigger and ducking groups were introduced some years
ago. This patch extends the functionality to module-role-cork, so that trigger
and cork roles may now contain "/" separated groups.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/767>
Incoming RFCOMM string has extra end-of-command terminating character which
breaks both AT+BIA= and AT+BAC= parsers which only expect a comma.
This leads to error parsing last element of response in both cases and could
prevent detecting mSBC availability if mSBC codec id comes last, e.g. AT+BIA=1,2
Fix this by additionally checking for delimiters in both parsers.
Fixes: 3c63f8e6d ("backend-native: Fix stack corruption reading RFCOMM AT+BIA= response")
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/768>
This fixes the rare case of resume_time being bigger than time_stamp. Which
happens sometimes when a gstreamer client is quickly seeking through a
media file. The resulting integer underflow then causes a huge value in
current_time which will break the playback.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/764>
* Enable macOS specific modules (module-bonjour-publish,
module-coreaudio-detect and module-coreaudio-device)
* Correctly set `PA_SOEXT` (.so, .dylib and .dll)
* Build `poll-posix.c` and `semaphore-osx.c`
* Drop linker flag `-Wl,-z,nodelete` on Darwin
* Drop linker flag `-Wl,--no-undefined` on Darwin
* Prefer to `clock_gettime` over compat impl for old Darwin
* Disable SCM credential on Darwin
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/746>
Rate adjustment timer is set up when combine sink is resumed and relased when
combine sink is suspended. Do not create this timer again while module is loaded
to prevent duplicate effort causing assertion in time_callback.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/756>
Faststream backchannel decoder does not know whether incoming stream is mono or
stereo before first packet is decoded, and some devices return stereo stream.
As it is not easy to change source sample spec after source is created, use
stereo sample spec always and perform conversion if mono stream is found.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/628>
When a stream is started but has not yet called smoother_2_put(), pa_smoother_2_get()
returns the time since the start of the stream even if the stream was started paused.
When the stream is started paused, pa_smoother_2_get() should return 0 instead. This
patch fixes the problem.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/745>
When `indicator` is initialized to `1`:
- it always succeeds the `indicator == CIND_CALL_INDICATOR` check;
- hence always calls `continue`;
- hence never reaches the end of the `while` loop where `indicator++` is
called;
- hence `indicator` never contains any other value than `1` meaning
`cind_enabled_indicators` is ever updated.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/740>
This reverts commit b05e34e092.
Now that backend-native uses a different way to get to its own
`native_backend` instance - without going through
`pa_bluetooth_discovery` - this patch can be reverted again, as nothing
outside bluez5-util is supposed to know the internals of this struct.
That's what the many functions are for which all take pointers to this
(at that point) opaque struct instead.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/740>
This removes the inverse/recursive dependency of backend-native on the
`pa_bluetooth_discovery` struct, which is supposed to be opaque outside
of `bluez5-util` in favour of the many accessor functions defined in
`bluez5-util.h`.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/740>
Fix the following build failure without C++:
../output-1/build/pulseaudio-16.1/meson.build:1:0: ERROR: Unknown compiler(s): [['/home/autobuild/autobuild/instance-1/output-1/per-package/pulseaudio/host/bin/powerpc64-buildroot-linux-gnu-g++']]
The following exception(s) were encountered:
Running "/home/autobuild/autobuild/instance-1/output-1/per-package/pulseaudio/host/bin/powerpc64-buildroot-linux-gnu-g++ --version" gave "[Errno 2] No such file or directory: '/home/autobuild/autobuild/instance-1/output-1/per-package/pulseaudio/host/bin/powerpc64-buildroot-linux-gnu-g++'"
Fixes:
- http://autobuild.buildroot.org/results/6526a21bd4da3b8458188f27c1ec04c381e4b673
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/737>
AT+BIA is used to enable/disable CIND indicators by Bluetooth HFP spec.
By default, all indicators are enabled on connection.
AT+BIA will configure which indicators should be disabled then,
the disabled indicators may be enabled later on again with AT+BIA.
When the connection is lost and recovered, all indicators are enabled
again. The HF will reconfigure the indicators again with an AT+BIA
command.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/631>