Commit graph

9938 commits

Author SHA1 Message Date
Thomas Weißschuh
ed46324872 alsa: fix memory leak of properties 2023-01-01 02:00:36 +00:00
Bob Ham
a65a58d1a0 README.md: Add "Getting help" section
Fixes #2916
2022-12-29 12:48:07 +00:00
Wim Taymans
860b8fc27f modules: fix rate update
Setting the rate with the PROP_rate would actually result in a rate
adjustment of 1.0f / rate, so do the same here.

See #2891
2022-12-29 12:22:56 +01:00
Barnabás Pőcze
73c5f6e1bf pipewire: module-roc-{sink,source}: port to ROC v0.2.X
Incompatible changes between ROC v0.1.X and v0.2.X require
adjusting the ROC modules' code. The largest change is going
from `roc_address` to `roc_endpoint`. There is also a breaking
change, the removal of `local.ip` parameter from module-roc-sink
as `roc_sender_bind()` has been removed.

The API usage was modelled after https://github.com/roc-streaming/roc-pulse

See #1757
Fixes #2911
2022-12-29 10:13:30 +00:00
Robert Mader
be99aa1eba gst: deviceprodiver: Add fd property / camera portal support
Add a `fd` property to `GstPipeWireDeviceProvider` so it can be used
with fds obtained from e.g. the camera xdg-desktop-portal.

This is needed so apps like Cheese or Camera can easily implement the
camera portal.
2022-12-27 23:43:22 +01:00
Robert Mader
2bc3e0ca10 gst: deviceprodiver: Use GstPipeWireCore and some cleanups
Quoting the commit introducing `GstPipeWireCore`:
```
Make all sources in the same process with the same fd share the
connection to the server. This makes it possible to set the same
fd on multiple sources/sinks and have them all use the same
connection, like when capturing multiple monitors from screencast
with the portal.
```

Do the same for `GstPipeWireDeviceProvider`, so it can share a
connection with device sinks as well. This will be needed for fd based
connections introduced in the next commit.

Further more it allows some cleanups.

1: 70652d1a37
2022-12-27 23:36:36 +01:00
Pauli Virtanen
b0853ad34a bluez5: media-sink: set initial latency after getting transport
The call to set_latency doesn't do anything, before transport has been
set.
2022-12-21 16:42:04 +02:00
Pauli Virtanen
c7b3ef0d9f bluez5: backend-native: fix missing brace in CIND reply
It should look like ...,("battchg,(0-5)) not ...,"battchg",(0-5))
2022-12-21 12:55:20 +02:00
columbarius
9f1311a2e0 examples: only use memfd_create when defined
See #987
2022-12-20 10:42:28 +01:00
Julian Picht
8c0a94c9d8 module/roc-*: fix position of comment 2022-12-19 12:47:47 +01:00
Julian Picht
b47e799c9a module/roc-*: implement audio.rate 2022-12-19 12:25:33 +01:00
Wim Taymans
89ac6b3535 alsa: don´t set -1 as node.target
Leave the target unset when -1, just like what pw-stream does.

See #2893
2022-12-17 18:17:33 +01:00
Wim Taymans
9c2b2a64f0 audioconvert: improve debug output
Print channelmix matrix when there is something to print. Avoids
skipping zero matrix lines in some cases.
2022-12-16 19:50:45 +01:00
Wim Taymans
846dbce7f1 doc: update after PIPEWIRE_DEBUG changes 2022-12-16 18:29:19 +01:00
Wim Taymans
6a69152185 acp: add api.acp.probe-rate option
Add an option to configure the samplerate used for probing because the
default 48KHz might not work for everyone.

See also #1599
2022-12-16 12:57:17 +01:00
Wim Taymans
f4f316b951 filter-chain: move fft to dsp_ops 2022-12-16 11:30:18 +01:00
Wim Taymans
b6b6efff42 convolver: use normal float for complex float array 2022-12-16 10:51:19 +01:00
Wim Taymans
538b6ce35e filter-chain: use dsp sum/copy/clear functions 2022-12-16 10:22:01 +01:00
Wim Taymans
0f2f113bdc filter-chain: add optimized sum function 2022-12-16 10:19:20 +01:00
Wim Taymans
cd38d7b53b filter-chain: move functions to separate struct
So that it's easier to copy them.
2022-12-16 09:37:45 +01:00
Wim Taymans
fa10849139 filter-chain: pass dsp_ops around
Initialize dsp_ops in the filter-chain and pass it around.
2022-12-16 09:28:00 +01:00
Wim Taymans
f7c49bbdde pulse-server: add channel-map in echo-cancel module 2022-12-15 13:12:47 +01:00
Wim Taymans
7758240c79 bluez: fix compilation without ldac_abr
The define for this constant was removed but it was LDACBT_EQMID_MQ
before.
2022-12-15 12:20:40 +01:00
Wim Taymans
5ff00f40b9 0.3.63 2022-12-15 09:56:23 +01:00
Wim Taymans
5f30ccae50 pipewire: remove redundant code
The generic code can now also handle the single character debug
specification.
2022-12-14 18:54:50 +01:00
Wim Taymans
9b3b6e2401 pipewire: support global log level in PIPEWIRE_DEBUG
Add support for PIPEWIRE_DEBUG=3,foo.bar:5 to set a global log level in
addition to specific topics.

Previously it would have to be done with *:3,foo.bar:5, which would not
really set a global level but all topics to the custom level of 3.
2022-12-14 18:00:54 +01:00
Wim Taymans
da3273891c tests: add another pw_split_strv test
To check if an empty string after a delimiter is counted.
2022-12-14 16:56:17 +01:00
Wim Taymans
72bee99f87 pulse-server: add category for connection debug
Use a new conn. topic to debug the messages. These are disabled by
default.
2022-12-14 16:40:58 +01:00
Wim Taymans
34973eac89 pipewire: fix pw_debug_is_category_enabled()
The function was broken since the log topics were added.

Use the logger to init a topic with the given name and check if
there was a custom level for the topic.
2022-12-14 16:20:23 +01:00
Wim Taymans
e5ac60b2b2 alsa: increase target for a52 and dca
For encoded format, we need to send bigger chunks to make the encoder
happy. Add a new min_delay variable with this info so that we never
leave less than that amount of samples in the ringbuffer.

Fixes #2650
2022-12-14 12:41:22 +01:00
Dylan Aïssi
cbc75dc98d pw-mon: recognize -N and -C as valid options 2022-12-14 11:07:42 +01:00
Wim Taymans
50dad68eb4 midi: fix midi event sorting
The high bit is always 1 so we can use only the lower 3 bits for the
priority.
2022-12-13 16:41:20 +01:00
Wim Taymans
144df8675f audioconvert: enable channelmix.mix-lfe by default
It seems OK and SDL also seems to mix LFE by default so what could
possibly go wrong.

Fixes #2425
2022-12-13 16:29:46 +01:00
Jonas Holmberg
6d6a5e2dbb alsa-pcm: avoid an expected resync warning
Log resync message as info when reassigning follower.
2022-12-13 14:47:04 +01:00
Wim Taymans
480902eb3a jack: sort midi events better
Use the same sorting as ardour for midi events with the same timestamp
so that the order is:

Controller messages > Program Change > Note Off > Note On >
    Note Pressure > Channel Pressure > Pitch Bend

Fixes #1868
2022-12-13 13:01:26 +01:00
Wim Taymans
61750813ff filter-chain: move buffer resample to separate function
Fix the error paths.
Rename some variables around to make things clearer.
2022-12-13 12:18:46 +01:00
Dmitry Sharshakov
28af79be79 filter-chain: convolver: flush, add resampler quality option
Robustness fix: don't truncate IR, free the resampler state after use.
2022-12-13 10:09:55 +00:00
Dmitry Sharshakov
7950d3ff0d filter-chain: convolver: resample IR
Ensure correct filtering when node rate does not match filter rate
2022-12-13 10:09:55 +00:00
Wim Taymans
b5c21c1fbc pipewire: use dlclose unless PIPEWIRE_DLCLOSE is set to false
Always dlclose the libraries but use PIPEWIRE_DLCLOSE to override this
behaviour.

Fixes #2786
2022-12-12 17:11:04 +01:00
Wim Taymans
b29200ee82 pulse-server: add a pulse.cmd section
Add a new config section that can contain a set of commands to run after
starting.

There is only load-module available now but it can be used to remove the
dependency on pactl when starting the server.
2022-12-12 16:46:16 +01:00
Wim Taymans
87d2719148 utils: expose pw_split_ip 2022-12-12 16:45:30 +01:00
Mersad Jelacic
72f5dbe6a6 doc: Change variable name to 'SPA_PLUGIN_DIR'
Sync with 'SPA_PLUGIN_DIR' name that is used in code.

Change-Id: Ibd8f84dd2aaf4ba7f581ad44140bf7b46ae43709
2022-12-12 10:53:15 +01:00
Wim Taymans
63f279c826 audioconvert: remove default channel map
If there is no valid channel map, assume MONO channels. A valid channel
map should be assigned at the source of the data, not here.

The problem is that when a device uses AUX channels, this will be fixed
up here with a surround setup, which is not right.
2022-12-12 09:40:51 +01:00
Wim Taymans
8d4fe59764 audioconvert: improve debug
When we are mixing unnamed channels, place MONO in the debug output.
2022-12-12 09:38:51 +01:00
Sefa Eyeoglu
b927063b89
audioconvert: fix distorted audio on AVX2
Closes pipewire/pipewire#2885

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2022-12-11 20:16:03 +01:00
Barnabás Pőcze
8c892443eb spa: audioadapter: fix stack-use-after-scope when configuring format
It is not enough for `buffer` to be alive in its current
scope because when execution enters that branch, `format`
will be set to `fmt`, which points inside `buffer`. And
since `format` is used outside that scope, `buffer` must
live longer.

This was detected by ASAN when Audacity was starting up.

  ==25007==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffdbcfef560 at pc 0x7fe44ca95db3 bp 0x7ffdbcfeeda0 sp 0x7ffdbcfeed90
  READ of size 4 at 0x7ffdbcfef560 thread T0
      #0 0x7fe44ca95db2 in spa_pod_parser_pod ../spa/include/spa/pod/parser.h:67
      #1 0x7fe44ca9a805 in spa_format_parse ../spa/include/spa/param/format-utils.h:44
      #2 0x7fe44cad293a in port_set_format ../spa/plugins/audioconvert/audioconvert.c:1934
      #3 0x7fe44cadad14 in impl_node_port_set_param ../spa/plugins/audioconvert/audioconvert.c:2038
      #4 0x7fe44ca587e2 in configure_format ../spa/plugins/audioconvert/audioadapter.c:509
      #5 0x7fe44ca60dff in negotiate_format ../spa/plugins/audioconvert/audioadapter.c:822
      #6 0x7fe44ca62bbf in impl_node_send_command ../spa/plugins/audioconvert/audioadapter.c:846
      #7 0x7fe45ea1c2f1 in node_update_state ../src/pipewire/impl-node.c:407
      #8 0x7fe45ea5137e in pw_impl_node_set_state ../src/pipewire/impl-node.c:2251
      #9 0x7fe45eb3355f in pw_work_queue_destroy ../src/pipewire/work-queue.c:142
      #10 0x7fe45b2cd6f4 in source_event_func ../spa/plugins/support/loop.c:615
      #11 0x7fe45b2c634f in loop_iterate ../spa/plugins/support/loop.c:452
      #12 0x7fe45e9ebebc in spa_hook_list_clean ../spa/include/spa/utils/hook.h:395
      #13 0x5561e03dc722 in main ../src/daemon/pipewire.c:131
      #14 0x7fe45da3c28f  (/usr/lib/libc.so.6+0x2328f)
      #15 0x7fe45da3c349 in __libc_start_main (/usr/lib/libc.so.6+0x23349)
      #16 0x5561e03db2a4 in _start ../sysdeps/x86_64/start.S:115

  Address 0x7ffdbcfef560 is located in stack of thread T0 at offset 160 in frame
      #0 0x7fe44ca56fa9 in configure_format ../spa/plugins/audioconvert/audioadapter.c:475

    This frame has 4 object(s):
      [32, 36) 'state' (line 493)
      [48, 56) 'fmt' (line 494)
      [80, 128) 'b' (line 492)
      [160, 4256) 'buffer' (line 491) <== Memory access at offset 160 is inside this variable
2022-12-10 09:59:08 +00:00
Barnabás Pőcze
3bdd2e01c5 pipewire: store SPA handles in a global list by age
Operating on the assumption that every SPA handle
can reference any other older SPA handle, the only
safe destruction order is from youngest to oldest.

To achieve this, store all handles across all plugins
sorted by age (youngest first), and use that as the
order of destruction in `pw_deinit()`.

This line of thinking does not account for what happens
when a handle that is referenced by others is unloaded,
but it does not make that case worse either.

See #2881
2022-12-10 00:46:37 +01:00
Wim Taymans
d4eff5b058 fix build some more. 2022-12-09 18:10:15 +01:00
Wim Taymans
a52ecd02df fix build some more... 2022-12-09 18:05:01 +01:00
Wim Taymans
61951dd327 fix build 2022-12-09 17:43:34 +01:00