Commit graph

10172 commits

Author SHA1 Message Date
Barnabás Pőcze
1cde814cdf spa: libcamera: remove unused libcamera-client.c 2023-02-09 22:02:48 +01:00
Wim Taymans
274b63e972 jack: improve frame to and from time functions
Also support times and frames before the current one by doing a signed
diff.
Also take into account the rate adjusted period time.
2023-02-09 16:44:47 +01:00
Pauli Virtanen
b94cb5d99d bluez5: fix BAP current profile
Fix BAP profiles again: make sure the current profile is indicated
properly.
2023-02-07 22:54:37 +02:00
Wim Taymans
344be779b1 filter-chain: support single copy plugin
When input and output are linked with a copy function, don't disable the
node but add it to the valid graph inputs.
2023-02-07 14:14:55 +01:00
Wim Taymans
72242dc91f filter-chain: add invert plugin
To invert the polarity of a signal.

See #3008
2023-02-07 13:46:06 +01:00
Wim Taymans
fda829a1fa conf: fixup config comments
Use () to mark optional fields to avoid confusion with [] for arrays.
Add contition fields where available.
2023-02-07 10:35:43 +01:00
Wim Taymans
5552ff7fdd conf: add conditions to modules, exec and objects
Make it possible to conditionally load modules, objects and exec by
adding match rules for context properties.

This makes it possible to only load a module when  property is set,
which makes it possible to unset a property in a local config to disable
module loading. One example is the x11 modules, which can then be
disabled on a per user bases based on config overrides.
2023-02-07 09:50:46 +01:00
Wim Taymans
b9999b292d channelmix: improve mixing setup
Handle MONO layout as a real layout, not just like FC. This means it
does not share the FC mixing weights.
Only distribute and combine MONO channels when the target is also
MONO, enable normalization in this case.
Otherwise downmix and upmix the mono channels like any other channel,
which will make it respect the upmix and other settings.
Change some tests with this new way of doing things.

Fixes #3010
2023-02-06 21:05:23 +01:00
Pauli Virtanen
987b772b97 bluez5: don't claim sbc is supported when there's no A2DP at all
Handle failure to register legacy A2DP endpoints.
2023-02-06 06:35:40 +00:00
Pauli Virtanen
cfee662f0b bluez5: fix BAP profiles for source/duplex cases
Codec switching does not currently work properly for source/duplex.
With BAP it's also possible only when we're BAP client.

When we can't codec switch, emit the "codecless" BAP profile.
2023-02-06 06:35:40 +00:00
Huang-Huang Bao
4b60569c4a gst: correct buffer & meta offset calculation
The offset in GstVideoMeta point to location of merge-mapped buffer memories (see "gst_buffer_find_memory()") instead of raw memory location for each plane, make adjustment to comply this rule.

Also some cleanups.

Fixes 023577e391
2023-02-06 06:34:14 +00:00
Thomas Weißschuh
4f9f32084c module-combine-stream: add missing proxy event version 2023-02-06 06:07:13 +00:00
Pauli Virtanen
417f1dc02a bluez5: fix dependency checking
Don't do subdir_done() in bluez5/meson.build, since the presence of
dependencies is supposed to be checked in spa/meson.build.
2023-02-05 09:36:45 +00:00
Wim Taymans
73cc5d1dde libcamera: map controls to standard ids
Map the control id from libcamera to standard pipewire ones and
vice versa.
2023-02-05 10:27:47 +01:00
Wim Taymans
50a1e2db22 utils: remove () around variable declaration
c++ warns about this.
2023-02-05 10:27:12 +01:00
Barnabás Pőcze
06df127ad9 pipewire: mem: refuse invalid file mapping
Refuse to map a file if the specified `offset + size` would
be bigger than the size of the file. This prevents receiving
SIGBUS when the consumer tries to make an incorrect mapping.

See #2617 #2914 #3007
2023-02-03 22:44:32 +01:00
Dmitry Sharshakov
d42656c0d9 filter-chain: add example configs for spatializer 2023-02-03 13:49:18 +03:00
Wim Taymans
caf58ecffb keys: don't use macro to define keys
Make PW_ENABLE_DEPRECATED use the symbol directly without using the
PW_DEPRECATED macro to work around rust compiler bug.

See #2952
2023-02-03 10:26:47 +01:00
Wim Taymans
5ee7be9534 conf: revert to 32 min-quantum
ae077a4967 accidentally changed the
default min-quantum to 16, revert it back to 32 because 16 is really
low.

See #2791
2023-02-03 09:12:51 +01:00
Huang-Huang Bao
023577e391 gst: add buffer video meta support
Fixes video buffer strides handling.
This enables passing of image datas with right line padding.
2023-02-03 07:23:35 +00:00
Thomas Weißschuh
38f88d3d25 thread-loop: constify timespec argument
This makes it easier for the user to see that pw_thread_loop_get_time()
does not modify the timespec so that it can be reused over multiple
calls.
2023-02-03 00:28:56 +00:00
Frédéric Simonis
04e769ff35 Add source example for the loopback module 2023-02-02 19:10:42 +00:00
Wim Taymans
8ffb74c8e2 alsa: keep more headroom when rate matching
When we are rate matching, keep some more headroom to make sure we
have enough data for the adaptive resampler.

Fixes crackling when following the dummy node and probably also when
following another capture device.
2023-02-02 20:06:58 +01:00
Wim Taymans
7e2dab876a module-rtp-sink: handle buffer offset and size correctly 2023-02-02 16:08:40 +01:00
Wim Taymans
aed394cf89 module-rtp: use timestamps as ringbuffer index
Use the timestamps directly as the ringbuffer index. We can save some
conversions to bytes and there is a direct mapping to RTP timestamp,
clock position and ringbuffer index.

Simplify the source a little. Remove the buffering state, we always
start with read and write pointers separted by the target buffering.
2023-02-02 15:54:53 +01:00
Wim Taymans
16e995be26 module-rtp: remove some useless debug 2023-02-02 12:12:01 +01:00
Wim Taymans
b50fa83325 module-rtp-sink: improve sync
Always write to index of the clock, not just for the first packet.
This ensure the timestamp on the packet always matches the time it was
processed in the graph.
2023-02-01 20:06:19 +01:00
Wim Taymans
1a5de467db module-rtp: support direct clock timestamps
Always use the timestamp of the graph clock for RTP packets. Add an
option to apply a random or fixed offset.
Add a ts-refclk option on the sender to specify a reference clock to
use for timestamping. This will activate the direct timestamp mode and
signal this in the SDP.

Parse ts-refclk and ts-offset from the SDP. Make it possible to match
them in rules. Add option to activate the direct-timestamp, where the
rate matching is disabled and the timestamps are used directly for
writing and reading from the ringbuffer using the graph clock.

This makes it possible to set a PTP clock on sink and source and avoid
rate matching by using a shared clock.
2023-02-01 18:31:33 +01:00
Wim Taymans
206df03c27 support: Handle supported clocks with timerfd
We don't need to follow a clock when it is one of the supported clocks
for timerfd.
2023-02-01 16:19:14 +01:00
Wim Taymans
e3b358ac8b support: add support for other clocks
Add support for using other clocks.
clock.id can be used to set one of the system clocks.
clock.device can be used to open a clock device such as a PTP clock
device.
Use a dll to track the progress of non-monotonic clocks.
2023-02-01 15:54:54 +01:00
Wim Taymans
2681d7e3ec acp: add option to set Pro Audio channels
We always probe the Pro Audio profile with the maximum number of
channels but this can lead to a more limited amount of sample rates.

Add an option to set the channels used when probing so that the other
samplerates become available.

Fixes #2990
2023-01-31 15:59:39 +01:00
Dmitry Sharshakov
e4f4ef9e1c filter-chain: fix spatializer rate changes 2023-01-30 22:44:55 +03:00
Barnabás Pőcze
b931f53783 filter-chain: review comments 2023-01-30 22:02:48 +03:00
Wim Taymans
05048a2d9d filtet-chain: fix compilation without sofa 2023-01-30 21:43:07 +03:00
Dmitry Sharshakov
a5d15ff16a filter-chain: fix warning 2023-01-30 21:12:06 +03:00
Wim Taymans
6539535176 filter-chain: remove mutex
We only ever load the IR from the main thread so we don't need a lock.
2023-01-30 21:07:06 +03:00
Wim Taymans
42a40e07d7 filter-chain: make sofa changes lockfree
Use the control changes to load a new IR, then signal to data thread to
use the new IR. In the data thread, signal the main thread to free the old
IR after we swapped it out.

THis moves all allocations from the data thread into the main thread.
2023-01-30 21:07:06 +03:00
Wim Taymans
63002bfcee filter-chain: add method to notify control changes 2023-01-30 21:07:06 +03:00
Dmitry Sharshakov
cf09077705 spatializer: free old convolvers immediately
We shouldn't need them anymore
2023-01-30 21:07:06 +03:00
Dmitry Sharshakov
9a3bf1a6de spatializer: interpolate IRs
Fixes clicking
2023-01-30 21:07:06 +03:00
Dmitry Sharshakov
9399fc318e spatializer: move to sofa_plugin 2023-01-30 21:07:06 +03:00
Dmitry Sharshakov
8677cb2fdf spatializer: do not initialize convolvers in init
Ports are not accessible during init, so this is pointless
2023-01-30 21:07:06 +03:00
Dmitry Sharshakov
7977755dd0 spatializer: move coords to control ports
Allows for simple cases with moveable sources
2023-01-30 21:07:06 +03:00
Dmitry Sharshakov
3e0dc2678b filter-chain: add spatializer
SOFA is a file format used for storing and accessing spatial audio data, namely head-related transfer functions. These can be used to create binaural spatial sound using head- or earphones.

This commit introduces libmysofa as an optional dependency for loading SOFA files and creates a spatializer plugin for the filter-chain

ci: install libmysofa-devel for full build

ci: bump FDO_DISTRIBUTION_TAG
2023-01-30 21:07:06 +03:00
Wim Taymans
ecf06935ba filter-chain: don't leak config 2023-01-30 11:57:56 +01:00
Pauli Virtanen
1ed9daa8c5 bluez5: fix supported codecs when as BAP Server
BAP Clients do not have endpoints associated with them, and we only know
that codecs on currently configured transports are supported.

Handle this case in spa_bt_device_supports_media_codec
2023-01-29 17:38:21 +02:00
Pauli Virtanen
fb43a71543 bluez5: SupportedUUIDs is an adapter-specific property
The DBus adapter objects has both .Adapter1 and .Media1 interfaces.

Change handling of this so that we wait for both properties to appear.
2023-01-27 19:25:16 +02:00
Pauli Virtanen
7b54a891b4 bluez5: separate object manager for A2DP and BAP
BlueZ fails registering object managers containing A2DP endpoints if
controller is in LE-only mode.

Make the A2DP and BAP object managers separate, so that failure to
register one does not prevent registering the other.

Also rename some functions to indicate which ones deal with the legacy
BlueZ API.
2023-01-27 19:25:16 +02:00
Wim Taymans
3208946a5f context: avoid excessive upsampling
For lower than default rates, limit the upsampling to 2 times the default
rate. This avoid 8000Hz to the upsampled to 192000 when a 44100 is
available (but not 48000).
For higher rates limit the upsampling to *3.
2023-01-27 18:22:55 +01:00
Wim Taymans
a5b2282b14 context: improve rate selection
Try to upsample to something in the same rate family so that the amount
of resample filter is minimal.
If that doesn't work, try to downsample to something in the same rate
family above the 44100 threshold.
If that also doesn't work, downsample to the highest available samplerate.
2023-01-27 16:54:31 +01:00