Commit graph

6088 commits

Author SHA1 Message Date
Barnabás Pőcze
923d88bd35 spa: support: log-impl: check the return value of strrchr()
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.
2021-04-07 15:55:44 +02:00
Wim Taymans
c324107211 0.3.25 2021-04-06 15:51:02 +02:00
Wim Taymans
09243d55ae pulse-server: fix leak in flatpak detection 2021-04-06 11:26:02 +02:00
Wim Taymans
78db493d0d pulse-server: depend on pipewire.service
Make sure we only start after the main pipewire.service is started.

See https://bugzilla.redhat.com/show_bug.cgi?id=1943867
2021-04-06 10:24:25 +02:00
Wim Taymans
bdbd3e3f2e pulse-server: Make sure we don't send null name and description
We can't send a null name or description because that makes clients
crash.
2021-04-05 17:36:38 +02:00
Pauli Virtanen
026e3882d2 bluez5: remove battery when RFCOMM connection drops
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.
2021-04-05 15:04:16 +00:00
Pauli Virtanen
eb396f1ea8 pipewire: add environment variable for disabling journald logging
Logging to journald can be annoying at high debug levels, so add an easy
way to disable it.
2021-04-05 14:36:21 +03:00
Wim Taymans
68804a3082 gst: remove volatile, it causes a warning with newer gcc
See #1018
2021-04-05 10:28:54 +02:00
Wim Taymans
7bd6b725dc Fix some warnings
When memfd and systemd are disabled.

See #987
2021-04-04 21:09:39 +02:00
Dmitry Sharshakov
97b01ed9b0 bluez5: add a property to select default profile 2021-04-04 08:43:09 +00:00
Erkki Seppälä
6a10ac36aa pw-dot: added -9/--90 for outputting using 'splines = ortho'
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.
2021-04-02 12:04:32 +03:00
Erkki Seppälä
71b53f1590 pw-dot: added -L/--lr for outputting the graph using 'rankdir = "LR"'
Graphs laid out this way may be look nicer sometimes.
2021-04-02 12:04:32 +03:00
Erkki Seppälä
21a36f3c51 pw-dot: using output - will write the output to stdout
This enables single-liners for viewing the graph in applicable shells.
2021-04-02 12:04:32 +03:00
Erkki Seppälä
4a0b7fa9b8 pw-dot: send diagnostic messages to stderr, not stdout
This will help when using stdout for other purposes in the
future (e.g. next commit).
2021-04-02 12:04:32 +03:00
Wim Taymans
8cf6da467f pulse-server: use the name of the default sink
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
2021-04-02 10:07:39 +02:00
Kraus Shusha
63e7a5c5d4 Update INSTALL.md, typo 2021-04-02 05:40:12 +00:00
Wim Taymans
9562cd56a2 alsa-seq: tweak port names some more
Remove the client id, it can change and is otherwise not generally
useful. Move the direction with the port.

Fixes #1007
2021-04-01 19:43:28 +02:00
Dmitry Sharshakov
e3f344b3fa bluez5/native: send correct AT+CMER HFP HF command
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
2021-04-01 19:12:49 +03:00
Wim Taymans
90de408e31 loopback: use _raw_build helpers
Now that the raw_builder supports wildcard for rate, use it in loopback
and add an option to force resampling as well.
2021-04-01 10:47:23 +02:00
Wim Taymans
b318a9e1d3 support: add right property id 2021-04-01 10:08:47 +02:00
Wim Taymans
339927ac76 spa: allow variable format, rate, channels, size, framerate
Use 0 values to skip adding the values to the format param, which
leaves them variable.
2021-04-01 09:58:08 +02:00
Wim Taymans
7afb3bc1a4 pulse-server: add module properties 2021-04-01 09:35:31 +02:00
Wim Taymans
27e00d1be4 pulse-server: don't fix sample rate
Use the builder directly to leave the samplerate undefined so that we
adapt to the graph samplerate instead of forcing resampling.
2021-04-01 09:32:00 +02:00
Wim Taymans
4aa817771a pulse-server: arguments can be NULL
And module-null-sink does not have mandatory arguments.
2021-04-01 09:04:55 +02:00
Wim Taymans
cc7cbaa83b pulse-server: module-loopback fixes
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
2021-04-01 08:24:51 +02:00
Wim Taymans
8383e86f33 pulse-server: module arguments can be NULL 2021-04-01 08:24:22 +02:00
Arun Raghavan
e7b04bca2c pulse-server: Implement module-loopback
Implements all modargs other than rate adjustment and max latency
related ones, which do not make sense in our context.

Fixes: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/543
2021-03-31 18:19:36 -04:00
Huang-Huang Bao
63281413bd
a2dp: fix a problem in b9d1b818 2021-03-31 19:33:21 +08:00
Wim Taymans
427e8abf0c impl-node: improve reason string in recalc_graph
Don't just report "quantum changed" as the reason for recalculating
the graph but make it depend on what actually happened.
2021-03-31 13:30:03 +02:00
Huang-Huang Bao
b9d1b818d5 a2dp: guard against LDAC quality value, add labels for LDAC quality prop info 2021-03-31 11:14:58 +00:00
Huang-Huang Bao
5c93f780cf a2dp: improve a2dp sink codec data flushing
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.
2021-03-31 11:14:58 +00:00
Pauli Virtanen
7b9792ffab pulse-server: fix brace in wrong place 2021-03-31 11:13:07 +00:00
Stephen Bancroft
6990e93827 Remove set -e from autogen 2021-03-31 14:27:05 +11:00
Wim Taymans
f0ab2bc1db bluez5: pass the route save property around
So that volumes are saved by the session manager.

Fixes  #995
2021-03-30 16:31:17 +02:00
Wim Taymans
dc3bf68aa2 acp: make sure we pass the save flag around
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
2021-03-30 16:06:30 +02:00
Wim Taymans
c50c0b91c5 jack: improve registration callbacks
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.
2021-03-30 12:57:38 +02:00
Wim Taymans
dd6a18d576 pulse-server: handle 0 id as default sink/source as well
Also handle 0 id as the default sink/source

See #756
2021-03-30 10:15:36 +02:00
Wim Taymans
efd52d633f examples: only use memfd_create when defined
See #987
2021-03-30 09:59:07 +02:00
Wim Taymans
5b2b256ecd alsa: initialize reserve array 2021-03-30 09:40:10 +02:00
Wim Taymans
43317f67ba a2dp-source: improve info parsing
Make sure we handle NULL info.
Simplify the property parsing.
2021-03-30 09:24:35 +02:00
Dmitry Sharshakov
e7f2f450ff bluez5: add parameter to use A2DP source as input 2021-03-30 09:21:12 +02:00
Wim Taymans
149471631e alsa: use higher ports for listening
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
2021-03-29 17:05:03 +02:00
Wim Taymans
51c700a655 media-session: only save routes with the save flag set
We only want to save the route properties when they were changed
by a user action.
2021-03-29 15:52:31 +02:00
Wim Taymans
f78be58568 stream: Add node.autoconnect stream.properties
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
2021-03-29 14:19:34 +02:00
Wim Taymans
ec0b2b8dd7 stream: use PIPEWIRE_AUTOCONNECT env variable
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
2021-03-29 14:05:25 +02:00
Wim Taymans
3878ad921a pulse-server: handle 0 sink/source name or index as default
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
2021-03-29 13:50:37 +02:00
Wim Taymans
80ce2c94ac alsa: add start-delay parameters to sink
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
2021-03-29 13:20:14 +02:00
Wim Taymans
fda565864c alsa: limit headroom to buffer-size
We can never have more headroom that the total buffer-size so better
clamp this here.
2021-03-29 13:17:01 +02:00
Wim Taymans
30659c5f61 media-session: remove double ;; 2021-03-29 11:41:30 +02:00
Wim Taymans
73f50bb964 improve debug 2021-03-29 11:41:06 +02:00