Commit graph

10326 commits

Author SHA1 Message Date
Alistair Leslie-Hughes
f44cb36374 rtp-send: Use getaddrinfo to improve support for ipv6 on source address
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/774>
2023-02-08 20:50:48 +00:00
Igor V. Kovalenko
1cfa737823 resampler: Fix oversized memblock pushed from resampler
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>
2023-02-08 20:43:52 +03:00
Georg Chini
6ae3961001 tunnel-sink-new: Fix hang when used in combination with module-combine-sink
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>
2023-02-07 09:25:48 +00:00
Igor V. Kovalenko
3e5db72ab7 bluetooth: Amend writeout to send more initial frames
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>
2023-02-06 18:55:47 +00:00
Igor V. Kovalenko
86c5fbab57 alsa-util: Add more standard sample rates.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/776>
2023-02-06 18:48:56 +00:00
Igor V. Kovalenko
8152f39603 alsa-util: Dump probed rates
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/775>
2023-02-06 18:09:30 +03:00
Alistair Leslie-Hughes
f8b9010582 rtp-send: Use getaddrinfo to improve support for ipv6.
inet_pton isn't guarantee to support IPV6 address when a scope has been specified.

Using getaddrinfo instead, we can safely pass through INET6+scope and have it translated
to a usable address.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/766>
2023-01-21 10:10:02 +00:00
Georg Chini
6473e9ed0e stream-interaction: Fix regression when a trigger role is also a cork role
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>
2023-01-21 10:06:57 +00:00
Georg Chini
94dd7b4b7b stream-interaction: Extend trigger groups to module-role-cork
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>
2023-01-21 10:06:57 +00:00
Igor V. Kovalenko
33129c88dc backend-native: Fix parsing comma-delimited response
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>
2023-01-19 21:38:05 +03:00
flyingOwl
c3eae5d00c time-smoother-2: Fix time calculation by comparing timestamps
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>
2022-12-30 00:16:03 +01:00
Alistair Leslie-Hughes
96bd4e57b5 pulsecore: Set errno before calling read
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/759>
2022-12-14 13:29:20 +11:00
Mart Raudsepp
89ce6321bd proplist-util: Don't assume gdkx is there as gtk could be built without it
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/757>
2022-12-10 09:01:58 +00:00
Shunsuke Shimizu
47a6918739 build-sys: Fix macOS build
* 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>
2022-12-07 10:57:01 +00:00
Alistair Leslie-Hughes
e4517da353 pactl: Stop a crash when setting the volume which is out of range
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/758>
2022-12-06 18:37:33 +11:00
Igor V. Kovalenko
0cbbc408ae module-combine-sink: Suspend while unloading to fix crash moving sinks
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/756>
2022-11-27 22:47:30 +03:00
Igor V. Kovalenko
37c72c2072 module-combine-sink: Do not set up rate adjustment timer at load time
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>
2022-11-27 22:31:51 +03:00
Igor V. Kovalenko
3c63f8e6dc backend-native: Fix stack corruption reading RFCOMM AT+BIA= response
On-stack buffer size is too short for sscanf to read AT+BIA= and AT+BAC=
response strings which have variable length.

Fix this by replacing sscanf with proper copy of input string.

Fixes: cca0d6937 ("bluetooth: add AT+BIA support")
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/755>
2022-11-26 17:01:08 +03:00
Alistair Leslie-Hughes
e650c2b33e Ensure fds are closed when exec functions are used.
When usng shm_open, FD_CLOEXEC is set explicitly.

However when using memfd_create, we must pass the MFD_CLOEXEC flag
to ensure the same fcntl value (FD_CLOEXEC) is set.

Fixes #1394

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/751>
2022-11-24 21:58:53 +00:00
Wim Taymans
3349e1c471 sndfile: handle sndfiles with s24 format
Samples with s24 format should be read with the readf_int read
function instead of the raw function.

This fixes playback of flac/wav with s24 sample format.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/750>
2022-11-10 17:13:58 +01:00
Alistair Leslie-Hughes
3f9455411c Propagate return value from pa_pstream_attach_memfd_shmid
Using wine,
The mmap call in shm_attach sometimes fails with ENOMEM which isn't propagated
up the call stack.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/747>
2022-10-19 08:06:46 +11:00
Igor V. Kovalenko
f2b748e851 bluetooth: Add 20dB boost for faststream source volume
Some devices unexpectedly return stereo backchannel stream with wrong frequency,
and volume of backchannel stream appears too low.

If this happens, boost source volume by 20dB.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/628>
2022-10-17 09:07:09 +03:00
Igor V. Kovalenko
76e01b25f5 bluetooth: Handle fragmented faststream frames
Incoming frames can span multiple packets, add support for this.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/628>
2022-10-17 09:07:09 +03:00
Igor V. Kovalenko
697a1a309a bluetooth: Use stereo sample spec for faststream backchannel
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>
2022-10-17 09:07:09 +03:00
Igor V. Kovalenko
cddb9f144a bluetooth: Add faststream codec
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/628>
2022-10-17 09:07:09 +03:00
Igor V. Kovalenko
0498e7a3d0 bluetooth: Do not use hardware volume control for A2DP backchannel
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/628>
2022-10-17 09:07:09 +03:00
Igor V. Kovalenko
48f40352a6 bluetooth: Free memblock after codec errors
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/628>
2022-10-17 09:07:09 +03:00
acheronfail
45df212d66 pactl: SUBSCRIBE add a newline after every json message
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/748>
2022-09-27 08:58:50 +00:00
wael
68a0603d76 meson: use proper type for bools
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/749>
2022-09-21 07:06:45 +00:00
Georg Chini
8fe50bbc31 time-smoother-2: Fix stream time when stream starts paused
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>
2022-08-25 08:11:04 +02:00
Marijn Suijten
8188b49bed backend-native: Remove uninformative "Profile unavailable" debug message
This message would print for all transports while not even conveying
the profile of the transport, and might be printed for non-`HFP_HF`
profiles which is the only transport-profile we're interested in.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/740>
2022-08-16 08:16:24 +03:00
Marijn Suijten
518ca03019 backend-native: Update all CIND indicators
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>
2022-08-16 08:16:24 +03:00
Marijn Suijten
6ec084e2b3 Revert "bluez5-util: move pa_bluetooth_discovery to header"
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>
2022-08-16 08:16:24 +03:00
Marijn Suijten
391dac58a9 backend-native: Add backend pointer to transport_data
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>
2022-08-16 08:16:15 +03:00
Marijn Suijten
c6bd6656a2 backend-native: Fix indentation and whitespace style
Replace tabs with spaces, remove trailing whitespace, remove bracing
around single-line `if` blocks.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/740>
2022-08-16 08:13:46 +03:00
Yureka
de8b0c1124 Make gio-2.0 optional when gsettings is disabled
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/654>
2022-08-15 14:42:54 +00:00
Fabrice Fontaine
c789bc5fe3 meson.build: fix build without C++
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>
2022-08-15 17:37:10 +03:00
Dylan Van Assche
1b031ecee6 bluetooth: hook up UPower backend
Hook up the UPower backend to backend-native to report
the host battery level to the HF.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/631>
2022-08-01 19:16:25 +00:00
Dylan Van Assche
3621731050 bluetooth: add UPower backend
UPower provides information about the power supply and battery
level of the host. Add a backend to retrieve the host battery level.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/631>
2022-08-01 19:16:25 +00:00
Dylan Van Assche
cca0d69375 bluetooth: add AT+BIA support
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>
2022-08-01 19:16:25 +00:00
Dylan Van Assche
b05e34e092 bluez5-util: move pa_bluetooth_discovery to header
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/631>
2022-08-01 19:16:25 +00:00
Rosen Penev
ff6010b80f meson: fix meson warnings
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/739>
2022-08-01 19:08:41 +00:00
hashitaku
ffbcf36854 shell-completion: add new subcommand get-* for zsh
Added to shell-completion of zsh as there is no completion for the subcommand get-*.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/735>
2022-08-01 18:34:25 +00:00
hashitaku
9f725cafb8 shell-completion: add new subcommand get-* for bash
Added to shell-completion of bash as there is no completion for the subcommand get-*.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/735>
2022-08-01 18:34:25 +00:00
Temuri Doghonadze
dc027d69e8 Translated using Weblate (Georgian)
Currently translated at 43.5% (249 of 572 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/ka/
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/736>
2022-07-22 15:18:58 +02:00
Joachim Philipp
9337d4b5b5 Translated using Weblate (German)
Currently translated at 94.9% (543 of 572 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/de/
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/736>
2022-07-22 15:18:58 +02:00
Temuri Doghonadze
15f242aee5 Translated using Weblate (Georgian)
Currently translated at 43.5% (249 of 572 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/ka/
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/736>
2022-07-21 14:42:18 +02:00
김인수
dbe455ce95 Translated using Weblate (Korean)
Currently translated at 100.0% (572 of 572 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/ko/
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/736>
2022-07-18 17:19:12 +02:00
Temuri Doghonadze
932b72f417 Translated using Weblate (Georgian)
Currently translated at 29.8% (171 of 572 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/ka/
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/736>
2022-07-18 17:19:12 +02:00
Gogo Gogsi
0f6234e320 Translated using Weblate (Croatian)
Currently translated at 100.0% (572 of 572 strings)

Translation: pulseaudio/pulseaudio
Translate-URL: https://translate.fedoraproject.org/projects/pulseaudio/pulseaudio/hr/
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/736>
2022-07-18 17:19:12 +02:00