Commit graph

404 commits

Author SHA1 Message Date
Wim Taymans
136fc028a5 prefer S24 over S16 formats
Prefer the higher quality over performance.

Fixes #457
2020-12-06 10:37:40 +01:00
Wim Taymans
73e0bb255a props: add container property to PROP_INFO
So we can mark a property should be inside a container.
Use this info in pw_stream to construct properties.
2020-12-01 12:58:18 +01:00
Wim Taymans
95e2ec9f72 channelmix: always copy the target channelmap 2020-11-23 20:17:38 +01:00
Wim Taymans
231c3c8b8e channelmix: add channelmap in properties 2020-11-23 15:33:11 +01:00
Wim Taymans
8c0f27c016 audioadapter: emit xrun when source can't produce data 2020-11-17 17:18:14 +01:00
Wim Taymans
79fb95bf90 stream: implement Flush
Flush out pending samples in the resampler
Set the io area status to _OK so that buffers are recycled and
new buffers produced.
2020-11-17 17:15:26 +01:00
Jan Grulich
743cf58fb7 Define SPA_FALLTHROUGH to make fall-through annotations work for all compilers
This is needed for example for Clang compiler which uses different
annotations than GCC. It will make WebRTC to happily use PipeWire
since the spa library is header-only and WebRTC defaults to use
Clang with -Wimplicit-fallthrough.
2020-10-22 13:31:19 +02:00
Wim Taymans
c81021a742 channelmix: keep amount of volumes we parsed 2020-10-08 18:06:11 +02:00
Wim Taymans
5c048500cc stream: normalize volumes when monitoring 2020-10-07 12:45:28 +02:00
Wim Taymans
9054cfcd8b channelmix: remap channel volumes
When we receive volume updates with a different number of channels
than we are configured for, remap them to our number of channels.
This currently involves taking the average volume until we actually
have a channelmap associated with the volume updates.

See #320
2020-10-07 12:01:37 +02:00
Wim Taymans
2df10d1a40 channelmix: reset the volume if the channels changed. 2020-09-29 12:02:37 +02:00
Wim Taymans
f70d0b19af channelmix: add option to NORMALIZE volumes
Normalize the complete matrix with the same coefficient
2020-09-29 12:02:34 +02:00
Wim Taymans
700a0aa35c Fix FLC+FRC to FL+FR 2020-09-29 12:02:30 +02:00
Wim Taymans
df3394a694 add some more debug 2020-09-29 12:02:25 +02:00
Wim Taymans
479bf3c803 fmtconvert: fix debug line 2020-09-28 11:47:16 +02:00
Wim Taymans
013e94ee4e audioadapter: propagate errors from the follower 2020-09-25 18:24:04 +02:00
Wim Taymans
d2d722efb3 node: add an ASYNC flag
The flag means that the process function might not complete
synchronously.

We can use this knowledge to improve the adapter. In sync mode we
can pull before scheduling the converter. In async mode we need to
schedule the follower after the converter to get the data ready for
the next iteration.

We can also improve the stream when it is operating async to schedule
a process call when a new buffer is ready to be filled.

This reduces a cycle latency from alsa and improves latency in
pulse.
2020-09-25 17:02:54 +02:00
Wim Taymans
584ae678c6 audioadapter: improve the processing loop
Handle the case where the converter in a source needs more output
buffers (-EPIPE). Schedule the follower in that case and try to
run the converter again until we have output or we can't make progress
anymore.

If the converter needs more data, schedule the follower before we
exit the loop with the data. This gives the follower a chance to get
more data asynchronously for the next iteration.
2020-09-24 17:18:47 +02:00
Wim Taymans
1cccaaa2bd merger: we always consume all input
Even when we only have empty input buffers
2020-09-24 16:57:15 +02:00
Wim Taymans
6bc3b1b764 audioconvert: fix Buffers param debug 2020-09-24 11:53:10 +02:00
Wim Taymans
28f60eaf6f spa: install the spa-resample tool 2020-09-23 11:37:16 +02:00
Wim Taymans
392eff4628 audioconvert: debug stride as well 2020-09-21 11:21:15 +02:00
Wim Taymans
f29bf9cb40 resample: reset resample state when starting
Update the initial delay and size in the rate_match io area when
starting.
2020-09-15 13:22:41 +02:00
Wim Taymans
c10feda5ce merger: follow the position duration if we can 2020-09-15 13:22:41 +02:00
Wim Taymans
8825a21e86 fmtconvert: improve channel debug names 2020-09-15 13:22:41 +02:00
Simon McVittie
8dcf76f661 audioconvert tests: Default to using an installed libspa-support
This makes installed-tests (see commit b852b58f) do the right thing.
For build-time testing, spa/plugins/audioconvert/meson.build overrides
this with the SPA_PLUGIN_DIR environment variable, and for ad-hoc
testing by developers, pw-uninstalled.sh sets the necessary variables.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-09-14 18:16:49 +00:00
Wim Taymans
e59c4675a7 audioconvert: send the command to the children
Send the command on the converter to all children as well.
Reset the resampler when we are paused so that we don't end up
with old data.

Fixes #288
2020-09-14 16:39:42 +02:00
Wim Taymans
320e63fe48 fmtconvert: place unknown channels at end
Sort the unknown channels to the end of the remap array.
2020-09-14 11:03:52 +02:00
Wim Taymans
9a7cbeea83 channelmix: improve undefined channel layout
When we have no channel layout, just copy input to output
channel.
Optimize this case in the mixer implementation.
2020-09-04 13:41:24 +02:00
Wim Taymans
3eafa6312f channelmix: add default channelmap for 5 and 7 channels 2020-09-04 12:22:30 +02:00
Wim Taymans
f7d8fef070 channelmix: normalize volumes
Normalize the volumes.
Don't mix in LFE by default but add an option
Move some booleans to flags
Improve some checks for fastpaths.
2020-09-03 13:20:36 +02:00
Wim Taymans
b62fa9faf2 channelmix: disable normalize for now
Volume is too low and we don't choose the right functions all the
time. Needs more work.
2020-09-02 18:50:01 +02:00
Wim Taymans
5dea431372 channelmix: normalize matrix to avoid clipping 2020-09-02 18:36:42 +02:00
Wim Taymans
4867edb947 channelmix: read mix coefficients correctly
Fix 5p1 to stereo mixdown by reading the coefficients correctly.
Align 5p1 to quad SSE and C implementation

Fixes #272
2020-09-02 11:15:23 +02:00
Wim Taymans
5f4fd14a40 audioconvert: optimize prefered formats
First planar, then packed, then packed other endian formats.
First F32, S32, S24_32, S16, S24, U8 because of quality and
optimizations.
2020-08-19 13:45:57 +02:00
Wim Taymans
5e9091a285 node: add new NEED_CONFIGURE flag
Add a new node flag that is set when the node needs more configuration.
Don't try to Start nodes that have the NEED_CONFIGURE flag set.
Make audioadapter clear the NEED_CONFIGURE flag when it has the
PortConfig.

These changes now make it possible to run:

gst-launch-1.0 -v pipewiresrc path=51 stream-properties="props,node.group=1" ! audio/x-raw ! pipewiresink stream-properties="props,node.group=1"

The pipewiresink and pipewiresrc will be added to the same scheduling
group (1) and the devices they connect to will be slaved, even if they
are otherwise not linked.

Without the NEED_CONFIGURE flag, pipewiresink would be added to the
pipewiresrc group and would be started by the daemon before the
session manager has a chance to configure (and link) the node.

Fixes #4
2020-08-10 16:57:14 +02:00
Wim Taymans
2362953931 audioadapter: update flags 2020-08-10 16:48:03 +02:00
Wim Taymans
cb3f1b51aa adapter: only become started on success 2020-08-07 10:49:52 +02:00
Wim Taymans
f4e8ebab51 improve debug and error messages 2020-08-07 10:47:18 +02:00
Wim Taymans
e71936f870 Improve naming
master -> driving
priority_master -> priority_driver
segment_master -> segment_owner
2020-08-06 13:49:33 +02:00
Wim Taymans
2955182e4e use spa_debug_type_short_name() when we can 2020-07-22 11:22:11 +02:00
Julian Bouzas
03bc36a502 resample-native: substract num of skipped samples after processing input
Takes into account the number of skipped samples when deciding whether
we should copy the remaining samples in the history or not.

Fixes dropping audio issue when resampling from high frequencies
such as 48KHz to low requencies such as 8KHz.
2020-07-20 15:25:02 -04:00
Wim Taymans
a520335581 fmt-ops: add sse2 version of f32 to s16 planar/interleaved 2020-07-03 11:05:26 +02:00
Wim Taymans
6e03b4005d increase amount of datas in a buffer 2020-07-01 11:43:22 +02:00
Wim Taymans
35bb7d794b dlclose on errors 2020-06-23 15:25:45 +02:00
Wim Taymans
4be29c1124 resample: load more data on aarch64 because we can 2020-06-19 11:47:57 +02:00
Simon McVittie
b852b58f82 Optionally install examples and tests
This makes it easier to test PipeWire in its "as-installed" state,
for example in an OS distribution.

The .test metadata files in ${datadir}/installed-tests/${package} are
a convention taken from GNOME's installed-tests initiative, allowing a
generic test-runner like gnome-desktop-testing to discover and run tests
in an automatic way.

The installation path ${libexecdir}/installed-tests/${package} is also
a convention borrowed from GNOME's installed-tests initiative.

In addition to the automated tests, I've installed example executables
in the same place, for manual testing. They could be separated into
a different directory if desired, but they seem like they have more
similarities with the automated tests than differences: both are there
to test that PipeWire works correctly, and neither should be relied on
for production use. Some examples are installed in deeper subdirectories
to avoid name clashes.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-06-16 17:58:02 +00:00
Wim Taymans
fc57f05e56 audioconvert: reduce memory usage
We only need as many ports and buffer data as the maximum number
of channels, which is 64.
Fix empty output size. We're only ever going to fill this with
float samples.
2020-06-16 15:55:32 +02:00
Wim Taymans
a44bea0b6a tests: check cpu flags
Use the support plugin to load the CPU detection API and check
for the right CPU flags before running the test.

Fixes #246
2020-06-09 08:00:00 +02:00
raghu447
af263187ea Reverting redundant changes 2020-06-04 10:36:39 +02:00