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.
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
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")
`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.
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
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
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
When we are already past the size of the buffer, don't bother calling
the overflow callback anymore, the buffer is already corrupted.
Otherwise it would be possible to have the overflow callback fail the
first time around, some data will be skipped, and then the next
overflow callback would succeed, giving the impression that all is
fine.
Add a unit test for this.
Pass the parameters around in a structure.
Add BUFFER_BYTES argument to configure the buffer size.
Add PIPEWIRE_ALSA env variable to set format, rate, channels,
period-bytes and buffer-bytes.
Add more variables in the alsa config file.
Instantiate the graph nodes when the samplerate is known instead of
using a fixed samplerate of 48KHz.
Warn when the convolver samplerate does not match the graph rate. We
might want to resample the IR later.
Suspend all nodes of the driver, even if the driver is already
suspended.
The suspend command makes sure that all nodes renegotiate to the new
graph rate.
This fixes the following sequence of events:
1. Play 44.1KHz file to loopback sink
2. Sink switches to 44.1, negotiates to 44.1
3. Loopback input and output streams negotiate to 44.1. All is good.
4. Stop playback, wait 5 seconds
5. Sink suspends, loopback input suspends (output stream doesn't suspend)
6. Play 48KHz file
7. Sink switches to 48, negotiates to 48. Sink (and followers) don't
suspend because sink was already suspended.
8. loopback input negotiates to 48, output stays at 44.1 -> failure
This patch fixes step 7. where it now tries to suspend all followers
even when the driver was already suspended. This then ensures that all
followers will try to negotiate to the new driver rate.
Use a reference to the location in the node where the handle of the
plugin can be found. That way we can change the handle only in the
node and have it changed everywhere else.
Add a resampler option to prefill the resampler with 0. This then
results in the resampler always outputing and consuming the same
amount of data instead of a short buffer in the beginning.
Add a process_playback function and use _trigger in the process_capture
to start processing. This ensure that the requested size is updated
before calling the process function.
We always need to update the latest requested size for output streams
before calling process. If there are no buffers or no suggestion, let
the audioconvert make one before we try again.
This way we always get the most recent requested size.
In monitor mode, we only need one sync to get the prompt and then we
just wait until we need to stop. There is no need to keep on syncing
because it consumes a lot of CPU.
Patch by Hiero32
Fixes#2709
When rfcomm_hfp_ag() returns false, an "ERROR" reply is sent.
When testing if the SLC is configured, 2 "ERROR" replies are sent, which
should not be done.
For backward compatibility with old Wireplumber releases, support the
old api.bluez5.a2dp.sink/source names, and use them in object events
instead of the media.sink/source names.