Use both the volume and mute to decide what volume to send.
Don't let the mute state overwrite the volume. Also never mute the
stream.
Pressing mute and unmute restores the previous volume this way.
The volume interval that RAOP devices understand is [-30,0],
where -30.0 equals min vol, and 0.0 equals max. vol.
The local system volume is represented as a cubic (volumetric)
value in the [0,1] interval.
So cube root system volume value, scale by 30 and
translate -30 to map to target output range.
The special value -144 denotes volume mute. Send a corresponding RTSP
message when mute is not already toggled on.
Set `pulse.module.id` on every node that libpipewire-module-echo-cancel
creates so that one can see in the output of `pactl list {sinks,sources}`
which nodes were created by a particular instance of module-echo-cancel.
Fixes#3541
Add nofail flags to some filter-chain examples to avoid aborting on
startup and leaving the system in a silent state.
Add some more comments to guide people to change the paths to the
filters and config files where needed.
When we are operating in passthrough, let the Start command pass through
to the follower in all cases. Only do the negotiate/buffers when not in
passthrough.
This fixes a case where the buffers are cleared on the alsa node and it
Pauses but then never resumes in a Start because the node is already
started. The real problem is probably somewhere else (in PipeWire) but
for now this will improve things in passthrough.
We only start the ALSA pcm after we get our first buffer.
We still need to do the sync through (and get the number of prefilled
samples) to make sure we set our new timeout and don't keep on waking
up quickly while the graph fetches the first buffer.
To find the largest rate, we need to select the smallest fraction.
This fixes the case where 44100Hz was selected when there are 2 nodes,
one suggesting 44.1Khz and another 48Khz. After this, 48KHz is
selected.
There is no need to have an extra pointer in the struct that is
set to right after the object at initialization and is never modified
because a flexible array member can be used instead.
This has advantages: `struct message` is now smaller, and there is
no extra load when accessing `struct message::data`.
When we duplicate the filter, also duplicate the control values instead
of reusing the same value for all copies. We then duplicate the value
ourselves when setting a control. This makes it possible to later use
this for volume control.
This will call the process function as soon as a new buffer is dequeued.
This can be used to keep the buffer at a certain fill level instead of
the minimal fill level without the flag.
Fixes#3480
If remote supports both HFP HF and AG, both may get connected, which
occurs with Pipewire<->Pipewire connection. In this case, Pipewire on
both sides may pick the audio-gateway profile.
To avoid both sides being audio-gateway, if remote is both A2DP sink and
HF, use lower priority for the audio-gateway profile. Generally, BlueZ
won't connect both A2DP Source and Sink between same devices at the same
time, so we use that to determine which side should be the receiver.
It may occur that we have RFCOMM connected as both HF and AG. The codec
switching and support checks should in this case always use the remote
HF RFCOMM.
Fix by finding the RFCOMM with the correct profile, remote as HF.
Piggy back on the Latency param change to emit a stream changed event
because we now might have a link between the stream and a device.
We should really watch for new links and emit change events for the
streams that it links to.
Fixes#3522
Make sure that the position only advances in the running state.
When we are not following a clock we can simply increment the position
with the duration every time we run.
If we are following a clock. Take the elapsed time of the clock into
account when aligning to the position.
Fixes#3189
This makes the clock.force-quantum setting and node.force-quantum
suspend all drivers and resume them in the new quantum.
This is essential in order to change the quantum on an IRQ based
driver because it will otherwise refuse to change the graph quantum.
Rename some variables to make it clear that we are dealing with the rate
and duration of the driver.
Set the driver rate in the clock instead of the target_rate, which we
might have rejected.
When we are using the same clock (!matching) try to link the two PCM
devices together. This starts and stops the devices at the same time and
gives better latency.
Do a do_sync after setting the metadata to ensure the messages are
flushed to the server and processed. Fixes an issue where jack_property
would exit before the messages are flushed and so nothing happens.
Keep track or the follower state and do the sync from the driver
wakeup.
This improves sync between devices because the sync no longer
depends on when the node was woken up in the graph and scheduled. We
would have been able to handle this difference by using the htimestamp
but that doesn't seen to work reliably on some hardware.
This is also essential for the interrupt based scheduling.