Previously, the return value of `strrchr()` was not checked
in `spa_log_impl_logv()` which could cause a segmentation fault
in `snprintf()` if the `file` string argument does not contain
any directory separators ('/').
For example,
./build/spa/tools/spa-inspect ./build/spa/plugins/alsa/libspa-alsa.so
could run into this problem:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7f1d505 in __strlen_avx2 () from /usr/lib/libc.so.6
(gdb) bt
#0 0x00007ffff7f1d505 in __strlen_avx2 () from /usr/lib/libc.so.6
#1 0x00007ffff7e29408 in __vfprintf_internal () from /usr/lib/libc.so.6
#2 0x00007ffff7e3a19a in __vsnprintf_internal () from /usr/lib/libc.so.6
#3 0x00007ffff7e146f6 in snprintf () from /usr/lib/libc.so.6
#4 0x0000555555558818 in spa_log_impl_logv (object=<optimized out>, level=SPA_LOG_LEVEL_INFO,
file=0x7fffffffd4d0 "[I][", line=260, func=0x7ffff7ce8090 "error_node", fmt=<optimized out>,
args=0x7fffffffd920) at ../spa/include/spa/support/log-impl.h:49
#5 0x00007ffff7d8c69e in alsa_error_handler (file=<optimized out>, line=<optimized out>,
function=<optimized out>, err=<optimized out>, fmt=<optimized out>)
at ../spa/plugins/alsa/acp/alsa-util.c:866
#6 0x00007ffff7cd6a8f in ?? () from /usr/lib/libasound.so.2
#7 0x00007ffff7cdb55e in snd_use_case_mgr_open () from /usr/lib/libasound.so.2
#8 0x00007ffff7d8940f in pa_alsa_ucm_query_profiles (ucm=ucm@entry=0x55555556ba28, card_index=0)
at ../spa/plugins/alsa/acp/alsa-ucm.c:752
#9 0x00007ffff7d6e3c2 in acp_card_new (index=0, props=props@entry=0x7fffffffdc50)
at ../spa/plugins/alsa/acp/acp.c:1508
#10 0x00007ffff7d29b7a in impl_init (factory=<optimized out>, handle=0x55555556b540,
info=<optimized out>, support=<optimized out>, n_support=<optimized out>)
at ../spa/plugins/alsa/alsa-acp-device.c:963
#11 0x0000555555558429 in inspect_factory (factory=0x7ffff7daefa0 <spa_alsa_acp_device_factory>,
data=0x7fffffffdcf0) at ../spa/tools/spa-inspect.c:231
#12 main (argc=<optimized out>, argv=<optimized out>) at ../spa/tools/spa-inspect.c:309
as in that particular case, the filename was returned by libasound,
and it was just "parser.c".
Furthermore, separate the static variable from the rest, and apply
the `const` qualifier to the pointers in the `levels` array.
There won't be further battery level updates when RFCOMM connection is
down, so remove the battery then.
Fix minor things with canceling the provider registration.
This results in always drawing edges with 90-degree angles instead of
smooth splines. Graphs laid out this way may be look nicer sometimes,
but it is slower to lay out with large graphs.
When setting a new default sink/source, use the name of the object
instead of the name used for selecting the sink/source. This makes
it possible to use the id to search for the device but still have
the device name in the metadata as is expected.
Fixes#1004
source and sink need not be set and need to be mapped to the target
source/sink to connect to.
node.group needs to be a unique id shared by source/sink to make them
part of the same scheduling group and do clock sync.
Remove some unused properties
Let codec decides when rtp packet need to be sent (terminated by MTU size in most case).
LDAC encoding loop can now be terminated by reading if frame_num is written, no 'frame_count' updating is needed.
RTP payload fragmentation can now be implemented more easily based on this.
When we set the volume on a port, make sure we also set the save flag
so that the flag is put into the volume changed event and the session
manager can save it.
Fixes#995
Pass the type to the alloc function to make things pretier.
Emit the client added only for the first client and the removed
callback for the last client. Things like pavucontrol will make
many nodes with the same name, which we map to the same client,
only when the last node is gone, we emit the client removed.
Allocate up to the first 16 ports, use the last 2 ports and free the
first 14 ports.
This ensure our ports are not among the first ports so that port 128
and following are for normal apps, what is usually expected when
PipeWire is not running.
Fixes#951
If the node.autoconnect property is set in the stream.properties,
ignore the AUTOCONNECT flag value. This makes it possible to
force AUTOCONNECT either way.
See #964
Use the PIPEWIRE_AUTOCONNECT environment variable to set the value
of the NODE_AUTOCONNECT property. This way, you can start any
stream based app with PIPEWIRE_AUTOCONNECT=false to disable
the session manager autoconnect.
See #964
Some apps use 0 to get some sort of sink/source info. PulseAudio
likely has a source/sink at index 0 but PipeWire certainly does not.
Asking for 0 source/sink is always because of some hardcoded values
in the app and we can return the default source/sink without causing
any problems for other apps.
See #756
The start-delay adds extra silence to the buffer before starting the
playback. The idea is to have more time to adapt to the device
startup and set the timer more accurately.
See #983, #431