Commit graph

10197 commits

Author SHA1 Message Date
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
Wim Taymans
fab9d12a44 module-rtp-source: use simple boolean to check activity
Avoid doing clock_gettime for each RTP packet and use a simple boolean
to check if packets arrived since the last SAP timeout check.
2023-01-27 11:49:20 +01:00
Dmitry Sharshakov
7b3d02b7fa module-rtp-source: touch session on RTP
Don't time out while actually running
2023-01-27 10:35:44 +00:00
Dmitry Sharshakov
c1cf2143b2 aes67: build pipewire-aes67 binary 2023-01-27 10:35:44 +00:00
Dmitry Sharshakov
785694db31 module-rtp-source: close socket while idle
Reduce network bandwidth when many streams are present but not used
2023-01-27 10:35:44 +00:00
Dmitry Sharshakov
62766d8175 module-rtp-source: set custom channel names if available
Some AES67 devices set `i` attribute with necessary information
2023-01-27 10:35:44 +00:00
Wim Taymans
cb2cc28da0 context: don't switch driver rate when nothing is running
When the driver has no followers to run, we can keep the current rate
and don't need to switch. This avoids a useless switch to the default
samplerate when all followers are removed.
2023-01-26 16:18:58 +01:00
Wim Taymans
fba7083f8c modules: also install module-combine-stream 2023-01-26 11:57:45 +01:00
Wim Taymans
9558a5d5e0 0.3.65 2023-01-26 09:55:03 +01:00
Wim Taymans
1efb43b897 bluez5: fix uninitialized value warning 2023-01-26 09:54:30 +01:00
Wim Taymans
97dd95ddec module-rtp-source: increase SAP timeout some more
Some AES67 senders need more time.
2023-01-26 09:09:46 +01:00
Pauli Virtanen
17049abd04 bluez5: backend-native: fixup HFP command handling
Strip initial \n from commands: some devices (Sennheiser HD 350BT) send
them.

Only reply OK to empty command with terminated command line;
non-terminated lines are invalid.

Add some debug in case the RFCOMM reply contains non-printable
characters.
2023-01-25 22:22:37 +02:00
Pauli Virtanen
effc1974e3 bluez5: backend-native: HFP should reply OK to no commands
HFP 1.8 -> 3GPP 27.007 -> ITU-T Rec. V.250 Sec. 5.6, which indicates to
reply OK to no commands on command line, not ERROR.
2023-01-25 19:35:26 +02:00
Wim Taymans
6e99ccb73e module-rtp-source: increase overrun watermark a little
On Wifi we can get big bursts.
2023-01-25 17:23:52 +01:00
Georges Basile Stavracas Neto
0fd44bc9d0 pipewiresrc: Make it live by default
In theory, the pipewiresrc element is a live element by default.
However, that is not reflected in code, as the element never sets
that flag unless explicltly requested through stream properties.

Make it live by default, but still respect if consumers of the
element mark it as not live.
2023-01-25 16:13:03 +00:00
Wim Taymans
8d4f7df9d6 module-rtp-sink: use min-ptime and max-ptime
Use the MTU, min-ptime and max-ptime to calculate the packet size to
send.
2023-01-25 17:08:10 +01:00
Wim Taymans
53681c9337 client-rt: add rule for Davinci Resolve
Davinci Resolve does not manage to figure out acceptable buffer size
itself so help it a little with an override.

Fixes #1697
2023-01-25 16:43:41 +01:00
Wim Taymans
9fb44c3a71 module-rtp-source: improve buffer handling
Try to keep half the packet size in the ringbuffer as well. This helps
us adapt to the packet size of the sender.

Drop samples from the ringbuffer for the first packet we read. This
makes us lock onto the stream with the exact requested latency.
2023-01-25 16:23:00 +01:00
Wim Taymans
80a6880f33 module-rtp-sink: add tool and ptime attributes 2023-01-25 16:22:18 +01:00
Wim Taymans
6a375d5778 module-rtp-source: add match rules
Add match rules so that one can select what SAP announcements to
listen to. Also make it possible to set per session latency.
2023-01-25 14:58:15 +01:00
Wim Taymans
64dca0b36d pipewire: add conf.h to standard includes
Also fix function signature so that it matched the .h file.
2023-01-25 13:23:44 +01:00
Wim Taymans
b9a144e478 module-rtp: handle property failure better
The cleanup might want to iterate the session list so make sure it is
initialized.
2023-01-25 13:23:39 +01:00
Dmitry Sharshakov
4bf1c2946e module-rtp-sink: fix net.loop
Avoid uninitialized variable use
2023-01-25 10:39:24 +01:00
Dmitry Sharshakov
f8dfdf7b99 module-rtp-source: lower priority of frequent messages 2023-01-25 10:37:14 +01:00
Dmitry Sharshakov
974a9019d1 module-rtp-source: lower overrun log level 2023-01-25 10:36:45 +01:00
Dmitry Sharshakov
8000a55654 module-rtp-source: make incoming RTP messages more elaborate 2023-01-25 10:36:32 +01:00