Commit graph

9748 commits

Author SHA1 Message Date
Wim Taymans 41fd8144f0 tests: relax test a little 2022-09-29 15:25:02 +02:00
Wim Taymans e97a0a67d8 tests: use spa_assert_se for tests
Or otherwise they are compiled away
2022-09-29 15:05:16 +02:00
Wim Taymans 497c695d6f channelmix: optimize some more nXm cases
Loop though coefficients, when all are 0, clear the destination.
When only one coefficient is used, simply copy with volume.
Otherwise run the complete convolution.
2022-09-29 13:21:23 +02:00
Wim Taymans a30b335beb channelmix: leave volume unchanged for unknown channel volumes
When we get an unknown number of channels, don't do anything, like it
used to be.
2022-09-29 12:44:42 +02:00
Wim Taymans 8a4091f578 tests: add unit test for n_m matrix 2022-09-29 12:36:49 +02:00
Wim Taymans 25cf4d0a31 channelmix: use volume/mute when no channel volumes
When setting a volume without channel volumes, use the volume/mute
instead of doing nothing.
2022-09-29 12:35:52 +02:00
Wim Taymans b7928799e5 channelmix: fix normalization
Don't count the sum for unused matrix coefficients. When doing pairing,
we set the mask to ~0 and so we would otherwise count too much.

Apply normalization to the active matrix coefficients, not whatever the
loop variables end up being at the end of the loops.
2022-09-29 12:29:36 +02:00
Wim Taymans 3b507e062c channelmix: improve debug 2022-09-29 12:26:28 +02:00
Wim Taymans c743f4936a audioconvert: use calculated random value
Use the calculated random value instead of making a new one.
2022-09-29 09:27:28 +02:00
Wim Taymans 637bc6f7c4 channelmix: add optimised NxM channelmix functions 2022-09-28 17:50:59 +02:00
Wim Taymans 10f1d545a7 audioconvert: handle NULL params 2022-09-28 12:14:52 +02:00
Wim Taymans 38e8e76f76 modules: disconnect streams before destroy
So that they are both stopped before being destroyed.
2022-09-28 09:13:31 +02:00
Demi Marie Obenour 1e848fc299 SPA POD parser: fix several integer overflows
This fixes several integer overflow problems in the POD parser, as well
as fixing a returns-twice warning from GCC and integer truncation
problems in SPA_FLAG_CLEAR and SPA_ROUND_DOWN_N.  The integer overflows
can result in a tiny POD being treated as a huge one, causing
out-of-bounds reads.
2022-09-27 10:21:17 +00:00
Wim Taymans 0e4df09e53 audioconvert: add peaks test 2022-09-27 12:14:43 +02:00
Wim Taymans a579fc49ba audioconvert: move peaks functions to separate file
Make a peaks finder helper and use it in the peaks resampler.
2022-09-27 11:25:02 +02:00
Wim Taymans 323ec0b51b pulse-server: improve maxlength calculations
When no maxlength is given, we use the MAXLENGTH value but we need to
round it DOWN (instead of up) because our buffer is only MAXLENGTH big.
Use CLAMP where we can.
When in capture mode, the maxlength exceeds MAXLENGTH, scale down the
fragsize instead.

Fixes noise in audacious when playing 6 channels sounds. float32 * 6
channels with the maximum buffer size would result in the ringbuffer
being overwritten.
2022-09-26 17:29:17 +02:00
Jonas Holmberg 1a44689d3f module-loopback: Disconnect streams before destroying
Disconnect both streams before destroying any of them so that
playback_process() doesn't get called after the capture stream has been
destroyed.
2022-09-26 16:47:33 +02:00
Wim Taymans e0d1be32fd pulse-server: don't read more than requested size
When we underrun, don't try to read more than what was requested
even if there is more in the ringbuffer.
2022-09-26 13:30:39 +02:00
Wim Taymans 2d858e0ba2 spa: a Flush command does not stop processing
A flush command is not supposed to stop playback but just clear the
current state. Normally, to avoid complications, an application will
Pause, Flush and optionally Start to do things smoothly without
interfering with the process loop, but things should not crash if that's
not the case.

Fixes #2726
2022-09-26 11:10:02 +02:00
Wim Taymans ed8be8e393 man: add some more see also manpages 2022-09-26 10:07:32 +02:00
Wim Taymans 78bfdd1717 raop: use pw_strip to string header values 2022-09-26 09:31:55 +02:00
Sebastian Koenig fa20fb2e80 rtsp-client: remove trailing whitespace from header data
Some clients may send headers with trailing whitespace, which can upset
subsequent parsing of the data into numbers.  This patch removes such trailing
whitespace before further processing the header data.
2022-09-26 07:20:27 +00:00
Sebastian Koenig fd66fb8867 raop: add support for ALAC codec
Some Airplay devices announce themselves as using the ALAC (Apple Lossless Audio
Codec) format, while pipewire only supports the PCM codec.  A look at the
Pulseaudio RAOP reveals that ALAC is supported there, but the encoding looks
exactly like what pipewire does for PCM.  This patch adds support for ALAC, but
it uses the existing PCM infrastructure to send the audio data.
2022-09-26 07:16:52 +00:00
Piotr Drąg 0c1e4475ba Update Polish translation 2022-09-26 07:16:12 +00:00
Ataberk Özen 10ac448b59 alsa-mixer: add support for Asus Xonar SE 2022-09-25 12:52:14 +03:00
Demi Marie Obenour fea248d450 SPA POD parser: Fix bug when parsing choice types
spa_pod_parser_can_collect and spa_pod_parser_getv were inconsistent
with each other.  When parsing crafted POD, this could cause a type
confusion or stack overflow.
2022-09-24 15:52:53 +00:00
Pauli Virtanen 2e3347e850 bluez5: use HFP HF as default, not HSP HS
E.g. iphones don't support HSP, only HFP, so change the default to use
HFP HF instead of HSP.  HFP is now old, and most devices should support
it now.
2022-09-24 13:26:50 +03:00
Barnabás Pőcze 0a48165cff spa: bluez: backend-native: accept "=" for +VGS and +VGM
HFP 1.8 states in 4.35.1:

  Due to the small inconsistency between the GSM standard [2]) and the current
  Headset specification ([3]), the HF shall also accept the “=” symbol,
  in place of “:”, as a valid separator for this unsolicited result code.

iOS seems to use "=", so accept that as well.

See #2463
2022-09-24 02:47:58 +02:00
Barnabás Pőcze 0ee4fea03d spa: bluez: backend-native: fix HF/HS to AG message terminator
Both HFP and HSP require an AT command from HF/HS to AG to
be terminated by CR, not LF. (HFP 1.8, 4.34.1; HSP 1.2, 4.8.1)

See #2463

Fixes: 0b2d3730b6 ("bluez5: Add HFP HF support")
2022-09-24 02:45:41 +02:00
Barnabás Pőcze 2fb63f71c3 spa: bluez: backend-native: use sscanf() for parsing AT commands 2022-09-24 02:22:29 +02:00
Barnabás Pőcze c24594a8ac spa: bluez: backend-native: fix type and add error checking 2022-09-24 02:22:19 +02:00
Barnabás Pőcze 8881030904 spa: bluez: backend-native: use strsep() instead of strtok()
`strsep()` is simpler to use than `strtok()` or `strtok_r()`
while being thread-safe and reentrant.

Although it is an extension, it is available in both glibc and musl.
2022-09-24 02:22:16 +02:00
Demi Marie Obenour c1920163d5 Fix calls to sendmsg()
Align cmsg buffers properly and use MSG_NOSIGNAL.
2022-09-23 16:33:36 +00:00
Demi Marie Obenour 90c955c223 Replace more macros with accessor functions 2022-09-23 11:39:33 -04:00
Demi Marie Obenour 671a7102ff Fix some badly-behaved macros
Some macros evaluated their arguments more than once when it was not
needed, or were missing parentheses.
2022-09-23 11:39:33 -04:00
Demi Marie Obenour bb4f274ae0 Make all fopen() calls use O_CLOEXEC
by adding "e" to the mode strings.
2022-09-23 15:19:01 +00:00
Demi Marie Obenour 400860f63c Add <stdint.h> includes
This is to make the headers standalone.
2022-09-23 15:19:01 +00:00
Wim Taymans 6fda8212e7 impl-node: refactor pause_node
Rename pause_node to idle_node and only perform the pause when
pause_on_idle is active.
2022-09-23 17:02:01 +02:00
Wim Taymans 69e6db5216 impl-node: only pause pause_on_idle nodes
When we are starting a node and need to cancel it, only set the node
to the paused state when pause_on_idle is set. Use the pause_node
function to make sure everything is in the paused state.

Otherwise we would send a Pause command to the node but because it was
still added to the graph we would continue to call the process function
on it.

Fixes #2701
2022-09-23 16:58:15 +02:00
Wim Taymans 7c93c29cfd add some more debug 2022-09-23 16:48:40 +02:00
Wim Taymans e8aef6b4bd audioconvert: only Suspend should trigger negotiate
A Suspend should clear all the negotiated state and start a new
negotiation in Start. Use a flag to control this.

This avoids recalculation of state for each pause/play state change.

See #2701
2022-09-23 15:32:36 +02:00
Wim Taymans 9119e8a26e improve debug 2022-09-23 15:14:50 +02:00
Wim Taymans ad8fa41678 audioadapter: warn when scheduling a stopped node
Log a warning when we try to schedule a stopped node.

See #2701
2022-09-23 11:30:42 +02:00
Balázs Úr 104a75656e Update Hungarian translation 2022-09-22 11:31:53 +00:00
Wim Taymans e0614246f5 pulse-server: set fragsize as latency
Reducing the latency is just papering over the issue in #2702. The
real fix is to limit the blocksize to the fragsize like what is done
in 00a234daf2

Reducing the latency then also causes regressions like #2715 so don't
do that anymore.

Fixes #2715
2022-09-22 11:58:14 +02:00
Wim Taymans 71a918fae1 acp-tool: handle ctrl-D to exit
Fixes #2700
2022-09-21 17:32:13 +02:00
Jonas Holmberg dacbeca77e alsa-pcm: Change resync warning logic
Log follower resync messages with info level until there has been a
successful read or write to get rid of the initial warning when starting
a stream.
2022-09-21 16:42:37 +02:00
Wim Taymans ef39576150 alsa: rate limit some warnings 2022-09-21 15:52:24 +02:00
Wim Taymans 9632145c9a log: make some more macros
Make a macro to log at a certain level with func,line,file added.
Use the new macros to reduce some redundant arguments.
2022-09-21 15:50:41 +02:00
Wim Taymans 47f2b72088 pulse-server: don't overwrite previous towrite value
And actually take the MAX_BLOCK into account when writing samples to a
client.
2022-09-21 12:00:36 +02:00