Some PulseAudio clients are known to use localised client and
stream names as values for the respective PulseAudio props, most
notably plain old pavucontrol.
We call setlocale before anything else for ncurses to display
localised text correctly. We also want to link with ncursesw, which
supports multibyte Unicode locales.
Sends the captured data from a source directly to a sink.
It uses an input and output stream so the source and sink can be
moved in pavucontrol, channel remixing is possible and the volume
can be adjusted.
See #959
When we are following the resampler requested size in capture, never
keep queued buffers around or we might get out of sync with the
requested size and cause cracks and pops in the resampler.
See #805
We can't move past the } or ] or we might miss the end of the
container. Now that we ignore \0 it is not a problem if the \0
is placed at the container boundary.
Return the result from sm_media_session_create_links() as the
result of link_nodes. This is > 0 when something was linked, < 0
on error and 0 when no ports are available. We should be able to
use this result later to handle errors.
We first need to issue the start command for driver nodes and then
we can add the node to be scheduled. Else we might end up with nodes
that receive the _process callback without the Start command being
called first and we can crash.
See #904
When a node does not have routes, treat it like a stream and use
the restore-stream logic to restore the volumes.
Rework some of the logic a little. Don't save empty strings. Wait
for param updates to save/restore values.
This makes volume restore work on virtual sinks/sources and
sinks/sources without any routes.
See #729
So that we can know if this node has routes or not.
Nodes without routes might need their volumes restored directly
with the node properties, like streams. Nodes with a route need their
volumes set on the device managing the node.
Just leave them be. Something else is supposed to changed the volumes
if needed. In the usual case where nothing changes, we don't want to
override the volumes.
When I enforing HFP codec switching between HFP profiles, it has a chance of being aborted by ECONNABORTED. Seems a retry is sufficient for work around it.
When we start draining, set ourselves active so that the process
function is called where the draining is completed.
This avoids a corked stream from waiting forever to drain the stream.
Fixes#946
Remove the soft mute/volume events, add a new method to get the soft
volume and use the volume_changed event to emit the changed soft and
monitor (real) volumes event for the node.
Make sure the monitor ports always uses the monitor volume, which is the
real volume unaffected by the mixer volumes.
This configures the soft and real volume on the sink/source in all
cases and makes the monitor port follow the real volume of the sink.
See #897
If buffer type char[] is 4-byte aligned, higher 3-byte on char could be non-zero if data is not initialized, which make 'buffer[i] >> 4' larger than 0x0f.
Use type uint8_t[] on SEC_LABEL buffer to fix it.
Implement switching HFP codecs in bluez5-devices, currently only for
backend-native.
Codecs are exposed via profiles similarly as for A2DP.
Some hardware appears to not properly reply to the +BCS message. Catch
these cases with a timeout, in which case we fall back to previously
existing transports.
libpulse assumes in introspect.c:fill_card_port_info that port profile
array size <= card profile array size, and may crash otherwise.
Enforce this in fill_card_info. It can happen, if EnumRoute and
EnumProfile info is not in sync.
Initial Props value are parsed from device settings, further changes are triggered by 'set_param' on a2dp node.
Codec can then use props to tweak its transcoder.
Add media.name so that restore-stream can store this stream.
Remove node.driver because the stream is slaved to the connected ALSA device.
Remove pause-on-idle in all cases, as this is now configurable from
the config file.
This profile is meant to be used with audio gateways, such as mobile
phones, making pipewire act as a headset. It activates all 3 "dynamic"
nodes (all of which are "Stream/*/Audio"), allowing both A2DP source
and HSP/HFP AG to be available at the same time. Ultimately, the remote
device (the AG), is the one that decides which profile to use and pipewire
just creates/destroys the appropriate stream nodes dynamically.
To make things less confusing, the HFP/HSP profile is now only available
if the remote device is a Head Unit and the A2DP profile is only available
if the remote device has an A2DP Sink.
If the device has both A2DP Source & A2DP Sink (not sure if this is a real world
possibility, but just in case...), the A2DP profile allows using them both,
while the AG profile will only allow the source.
In addition, to keep things less complex, the routes are now only used for
device nodes (the "Audio/*" ones). A2DP source and HSP/HFP AG never have a route.
Restoring their props should be possible to be handled by the restore-stream
module.
When a new node is configured, check if existing streams might need to
be moved to it.
This fixes the case where a stream has a target node set to some
bluetooth device and it starts playing to the default device because
the bluetooth device is not connected. When the BT device is then
connected and configured, the stream is moved to the new BT device.