Compare commits

...

6 commits

Author SHA1 Message Date
Tanu Kaskinen
e5ad31e873 Update NEWS for 16.1
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/727>
2022-06-21 13:54:48 +03:00
Jan Palus
e4d54dae91 bluetooth/gst: Correct var type for GST_TYPE_BITMASK
GST_TYPE_BITMASK is 64-bit bit mask while corresponding channel_mask in
pulseaudio is int therefore usually 32-bit. Switch to uint64_t instead
to match internal representation in gstreamer.

Fixes pulseaudio crash on ARM 32-bit when pulseaudio is compiled with
gstreamer and either LDAC or aptX support is available.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/723>
2022-06-20 14:02:29 +03:00
Georg Chini
0e896eb518 combine-sink: Fix threading issue during underrun
A recent commit added i->origin sink for the sink inputs of the combine sinks.
Therefore pa_sink_process_input_underruns() treated the combine sink like
filter sinks. pa_sink_process_input_underruns() calls itself with the
origin sink, which is only correct for filter sinks because they run in the
thread context of the origin sink. The combine sink however has its own
thread context, so pa_sink_process_input_underruns() was executed in the
wrong context.
This patch fixes the issue by skipping the section for module-combine-sink.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/722>
2022-06-20 14:02:15 +03:00
Igor V. Kovalenko
ca8c5242eb rtp: Initialize SDP info struct field added for OPUS
Turned out that pa_sdp_info::enable_opus is never initialized, which seldom
makes module-rtp-recv believe it will be playing OPUS-encoded stream even though
discovered SDP record does not indicate OPUS codec in metadata.

Fix this by adding missing initializer.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/720>
2022-06-20 14:01:56 +03:00
Jaechul Lee
437cfe4630 sound-file-stream: Fix crash when playing a file which is not aligned
pulseaudio crash occurred when I play a file using pacmd play-file command.
The file is not aligned with its frame size and the last rendering size
is also not aligned. Thus, an assertion was generated at the end of the
file as the following.

memblockq.c: Assertion 'uchunk->length % bq->base == 0' failed at
../src/pulsecore/memblockq.c:288, function pa_memblockq_push(). Aborting.

When I play the file using paplay, it works good. So, I changed to
pa_memblockq_push_align instead of pa_memblockq_push to prevent the
assertion.

Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/717>
2022-06-20 14:01:47 +03:00
Sean Greenslade
8299a7f100 pactl: fix parsing of percentages with decimal points
The logic for detecting which type of volume was given incorrectly interpreted
any value with a decimal as a VOL_LINEAR. It also could set multiple flags,
which would put the flags variable into an indeterminate state. Additionally,
the flags stack variable was uninitialized which could also lead to an
indeterminate flag state.

Percentages are now prioritized over all other types, and only one type flag
can be set.
2022-06-20 14:01:26 +03:00
6 changed files with 47 additions and 17 deletions

19
NEWS
View file

@ -1,3 +1,22 @@
PulseAudio 16.1
A bug fix release.
* Fix parsing of percentage volumes with decimal points in pactl
* Fix crash with the "pacmd play-file" command when reads from the disk aren't frame-aligned
* Fix module-rtp-recv sometimes thinking it's receiving an Opus stream when it's not
* Fix frequent crashing in module-combine-sink, regression in 16.0
* Fix crashing on 32-bit architectures when using the GStreamer codecs for LDAC and AptX
Contributors
Georg Chini
Igor V. Kovalenko
Jaechul Lee
Jan Palus
Sean Greenslade
PulseAudio 16.0
Changes at a glance:

View file

@ -22,6 +22,7 @@
#endif
#include <arpa/inet.h>
#include <stdint.h>
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
@ -82,7 +83,7 @@ fail:
static GstCaps *gst_create_caps_from_sample_spec(const pa_sample_spec *ss) {
gchar *sample_format;
GstCaps *caps;
int channel_mask;
uint64_t channel_mask;
switch (ss->format) {
case PA_SAMPLE_S16LE:

View file

@ -129,6 +129,7 @@ pa_sdp_info *pa_sdp_parse(const char *t, pa_sdp_info *i, int is_goodbye) {
i->origin = i->session_name = NULL;
i->salen = 0;
i->payload = 255;
i->enable_opus = false;
if (!pa_startswith(t, PA_SDP_HEADER)) {
pa_log("Failed to parse SDP data: invalid header.");

View file

@ -1016,20 +1016,29 @@ size_t pa_sink_process_input_underruns(pa_sink *s, size_t left_to_play) {
if (i->origin_sink) {
size_t filter_result, left_to_play_origin;
/* The recursive call works in the origin sink domain ... */
left_to_play_origin = pa_convert_size(left_to_play, &i->sink->sample_spec, &i->origin_sink->sample_spec);
/* The combine sink sets i->origin sink but has a different threading model
* than the filter sinks. Therefore the recursion below may not be executed
* because pa_sink_process_input_underruns() was not called in the thread
* context of the origin sink.
* FIXME: It is unclear if some other kind of recursion would be necessary
* for the combine sink. */
if (!i->module || !pa_safe_streq(i->module->name, "module-combine-sink")) {
/* .. and returns the time to sleep before waking up. We need the
* underrun duration for comparisons, so we undo the subtraction on
* the return value... */
filter_result = left_to_play_origin - pa_sink_process_input_underruns(i->origin_sink, left_to_play_origin);
/* The recursive call works in the origin sink domain ... */
left_to_play_origin = pa_convert_size(left_to_play, &i->sink->sample_spec, &i->origin_sink->sample_spec);
/* ... and convert it back to the master sink domain */
filter_result = pa_convert_size(filter_result, &i->origin_sink->sample_spec, &i->sink->sample_spec);
/* .. and returns the time to sleep before waking up. We need the
* underrun duration for comparisons, so we undo the subtraction on
* the return value... */
filter_result = left_to_play_origin - pa_sink_process_input_underruns(i->origin_sink, left_to_play_origin);
/* Remember the longest underrun so far */
if (filter_result > result)
result = filter_result;
/* ... and convert it back to the master sink domain */
filter_result = pa_convert_size(filter_result, &i->origin_sink->sample_spec, &i->sink->sample_spec);
/* Remember the longest underrun so far */
if (filter_result > result)
result = filter_result;
}
}
if (uf == 0) {

View file

@ -185,7 +185,7 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t length, pa_memchunk *chunk
tchunk.length = (size_t) n * fs;
pa_memblockq_push(u->memblockq, &tchunk);
pa_memblockq_push_align(u->memblockq, &tchunk);
pa_memblock_unref(tchunk.memblock);
}

View file

@ -2527,16 +2527,16 @@ static int parse_volume(const char *vol_spec, pa_volume_t *vol, enum volume_flag
vs = pa_xstrdup(vol_spec);
*vol_flags = (pa_startswith(vs, "+") || pa_startswith(vs, "-")) ? VOL_RELATIVE : VOL_ABSOLUTE;
if (strchr(vs, '.'))
*vol_flags |= VOL_LINEAR;
if (pa_endswith(vs, "%")) {
*vol_flags |= VOL_PERCENT;
vs[strlen(vs)-1] = 0;
}
if (pa_endswith(vs, "db") || pa_endswith(vs, "dB")) {
else if (pa_endswith(vs, "db") || pa_endswith(vs, "dB")) {
*vol_flags |= VOL_DECIBEL;
vs[strlen(vs)-2] = 0;
}
else if (strchr(vs, '.'))
*vol_flags |= VOL_LINEAR;
atod_input = vs;
@ -2597,7 +2597,7 @@ static int parse_volumes(char *args[], unsigned n) {
volume.channels = n;
for (i = 0; i < volume.channels; i++) {
enum volume_flags flags;
enum volume_flags flags = 0;
if (parse_volume(args[i], &volume.values[i], &flags) < 0)
return -1;