Commit graph

10124 commits

Author SHA1 Message Date
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
Dmitry Sharshakov
f59b652142 module-rtp-source: set node name
useful for Audio/Source role
2023-01-25 10:36:17 +01:00
Dmitry Sharshakov
f2c3baf93f module-rtp-source: make SAP cleanup interval configurable
Audinate AES67 devices send SAP messages with 30-second interval, so hardcoded timeout has to be bumped. Just bumping it will reduce efficiency of common RTP module use-case, so a config is introduced for this. 70 second will be set as default for AES67 mode.
2023-01-25 10:36:08 +01:00
Wim Taymans
03cb7f3549 jack: make jack.merge-monitor default true
Make jack.merge-monitor true by default because this is what JACK also
does.

Add an exception for Mixxx because that makes it easier to select the
capture/monitor ports.

Fixes #1760
2023-01-25 09:48:28 +01:00
Wim Taymans
3e6f62875d audioconvert: make sure shifts are defined
Don't to signed left shifts, make macros to do the shifting on unsigned
ints when needed.

See !1505
2023-01-24 21:29:18 +01:00
Wim Taymans
c8850f8766 env vars should override everything
Always first use the env var and then check the properties. So that
PIPEWIRE_CORE=pipewire-1 PIPEWIRE_REMOTE=pipewire-1 make run runs
everything on pipewire-1 sockets regardless of the config files.

Also PIPEWIRE_NODE always needs to be taken into account first.
2023-01-24 17:39:54 +01:00
Wim Taymans
782e0dfb1f pulse-server: use module-combine-stream for module-combine-sink
Implement the combine-sink module with the native module.

Make sure we use the same logic to wait with emitting the module loaded
signal until we have seen all the sink_inputs of our module.

Make sure we also use the timeout to signal module failure when we don't
see the nodes.
2023-01-24 16:04:59 +01:00
Wim Taymans
6d6cd6bbfb module-combine-sink: remove listener before core_disconnect 2023-01-24 15:41:00 +01:00
Wim Taymans
4eac50966a combine-stream: also set DONT_RECONNECT 2023-01-24 13:28:48 +01:00
Niklāvs Koļesņikovs
b0fccf87d7
bluez5: a few more -Werror=strict-prototypes fixes
The Bluetooth Low Energy MIDI code added a few legacy function declarations
that fail when building with -Werror=strict-prototypes. The fix is same as
before: add a void to the empty function argument list.

Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd@relay.firefox.com>
2023-01-24 11:14:27 +02:00
Carlos Rafael Giani
293ba8aee3 alsa-compress-offload-sink: Miscellaneous clean up
- Fix typo
- Fix index check in port_enum_formats()
2023-01-24 08:44:14 +00:00
Carlos Rafael Giani
59ad6c26aa pw-cat: Add fallback for the older libavcodec channel layout API
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-01-24 08:44:14 +00:00
Carlos Rafael Giani
e261f2ac1c pw-cat: Check for pw_cat_ffmpeg flag instead of HAVE_ALSA_COMPRESS_OFFLOAD
FFmpeg integration in pw-cat does not strictly require Compress-Offload;
for example, there could be other nodes in the graph that can handle
compressed audio.

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-01-24 08:44:14 +00:00
Carlos Rafael Giani
f07bb84348 meson: Set default compress-offload option value to "disabled"
The tinycompress library is not in the package repositories of the
major Linux distributions, so set the default option to "disabled".
2023-01-24 08:44:14 +00:00
Carlos Rafael Giani
6284cf39c0 meson: Rework FFmpeg / tinycompress detection and add pw-cat-ffmpeg option
* Decouple FFmpeg integration in pw-cat from the ffmpeg option; if
  one wants to use Compress-Offload but not the ffmpeg SPA plugin,
  it is then possible to just pass -Dpw-cat-ffmpeg=enabled to meson.
  Likewise, this also makes it possible to build the ffmpeg plugin
  without extending pw-cat.
* tinycompress does not need to be detected in the root meson.build,
  since it is only needed by the alsa plugin.
2023-01-24 08:44:14 +00:00
Carlos Rafael Giani
e9a2c6aa34 Rename "compressed-offload to "Compress-Offload" in the code 2023-01-24 08:44:14 +00:00
Sanchayan Maity
55a79fd16a pw-cat: Add support for compressed formats 2023-01-24 08:44:14 +00:00
Sanchayan Maity
92344bf8ac gst: Accept MP3 and FLAC for compressed sink 2023-01-24 08:44:14 +00:00
Sanchayan Maity
6a034cc398 Add support for ALSA compressed offload
See
https://docs.kernel.org/sound/designs/compress-offload.html
https://github.com/alsa-project/tinycompress
2023-01-24 08:44:14 +00:00
Carlos Rafael Giani
f3914e494c spa: Add ENCODED audio format to compressed format builder results
WirePlumber checks for the ENCODED audio format to determine if the
format is compressed/encoded. Without this info, it is not able
to automatically link compressed audio nodes.
2023-01-24 08:44:14 +00:00
Wim Taymans
b66b9f70c4 spa: add APE format 2023-01-24 08:44:14 +00:00
Wim Taymans
e535d4c6c4 spa: add FLAC format 2023-01-24 08:44:14 +00:00
Wim Taymans
efbce802e4 spa: add ALAC format 2023-01-24 08:44:14 +00:00
Wim Taymans
603c28223b spa: add AMR type 2023-01-24 08:44:14 +00:00