On FreeBSD (and probably other BSDs as well), the FIONREAD ioctl
on UDP sockets does not return the size of the next datagram (like
it does on Linux), but returns the size of the output buffer: this
count contain multiple datagrams and also contains the headers.
We fixed this by taking the result of the FIONREAD as lower bound
for the size, adding an upper bound and then removing the check
that the sizes should be exactly the same.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/718>
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>
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>
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.
RFC 4566 states that SDP record is terminated with CRLF, and parsers should be
able to accept records terminated with just LF. Pulseaudio only accepts LF here.
Fix this by accepting both CRLF and LF terminators.
The combine sink used the current time and counter when calculating
the latency if smoother_2 was enabled. This lead to wrong latency
reports. This patch fixes the problem by using the snapshot time
and counter instead.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/711>
Bluetooth transport layer already allows for packets larger than mSBC frame, and
there are up to 1 + MTU / (mSBC packet size) complete frames to be decoded from
each incoming SCO packet.
Now decoder fails when there is more than one complete frame available, which
could happen if MTU size is larger than 1.5 * (mSBC packet size) = 90
Fix this by adding a loop over avialable frames, and adjust decoded buffer size
to allow decoding up to 1 + MTU / (mSBC packet size) frames at once.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/706>
When the module is loaded and avahi_client_new() fails because the client cannot
connect, a shutdown of the module is scheduled. In parallel, the client_callback
is called with AVAHI_ERR_DISCONNECTED and another connection attempt is made
which also fails and triggers a second unload of the module. This crashes PA,
because there is already an unload in progress.
This patch fixes the problem by checking if an unload is already scheduled.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/710>
The timestamp used for updating the smoother was taken at the wrong time.
It may take some time until an async message is executed (measured up to
2ms), therefore the timestamp used to update the smoother must be taken
before the message is executed and not inside the message.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/705>
When the tunnel modules had no connection and a re-init was pending, the module
could be unloaded without cancelling the pending re-init. When the timer expired
in that situation, this lead to a crash. This patch fixes the problem by keeping
a reference when the module is scheduled to be re-initialized.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/705>
The AVRCP service is known to not be connected before the A2DP transport
is, resulting in PulseAudio asking BlueZ for an initial 'Volume' value
but not getting it because the property doesn't exist.
To prevent end-users from conjecturing this to be the source of whatever
issue they're observing, demote it to a warning.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/707>
When configured, reinitialize the module instead of exiting. This
allows a restart/reconnect, but the module to appear to always be alive
when the user does: "pactl list modules". (The sink will still not
exist until the tcp connection is established.)
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/688>
The io thread, after connection, sends a message asking for a sink to be
created. After the ctl thread is done with creation, it sends a message
back to the io thread so it can continue. This ensures that the sink
only exists when it's connected to something.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/688>
When the --format json parameter is given on the command line, we
attempt to produce a JSON output for most commands.
Our implementation of the JSON serialization uses vsnprintf to output
numbers. Unfortunately, vsnprintf is affected by the locale and more
specifically the LC_NUMERIC variable.
When LC_NUMERIC is set to, for instance, fr_FR.UTF-8, floating-point
numbers are output with a comma as the decimal separator, which is then
considered invalid JSON.
$ LC_NUMERIC=fr_FR.UTF-8 pactl --format json list sinks | jq .
parse error: Objects must consist of key:value pairs at line 1, column 435
This is the token which failed to parse:
}},"balance":0,00,"base_volume":{
Fixed by overriding the LC_NUMERIC value when we request JSON output.
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/702>