Commit graph

5335 commits

Author SHA1 Message Date
Wim Taymans
ff5201ef3d avb: check seq
Avoid infinite loops.
Check sequence number and warn
Use 32 frames per pdu in example.
2022-07-12 12:27:21 +02:00
Wim Taymans
200f591a3d avb: add source 2022-07-12 12:27:21 +02:00
Wim Taymans
552a0056b5 avb: more work
Handle properties.
Fix format negotiation.
Wait in underrun.
2022-07-12 12:27:21 +02:00
Wim Taymans
1adc94df11 start of AVB support 2022-07-12 12:27:21 +02:00
Doğukan Korkmaztürk
fd2cc19eaa pipewire: fix a bugprone-branch-clone warning
A clang-tidy bugprone-branch-clone warning has been fixed and branches
are made more uniform
2022-07-11 13:03:44 -04:00
Pauli Virtanen
a56435c4dc pipewire: deprecate pw_stream_connect target_id in documentation 2022-07-11 15:32:43 +03:00
Pauli Virtanen
ca87d40448 examples: use PW_KEY_TARGET_OBJECT
In examples, tell people how to use target.object.
2022-07-11 15:32:43 +03:00
Wim Taymans
de65fd442f modules: use TARGET_OBJECT instead of NODE_TARGET 2022-07-11 13:52:35 +02:00
Wim Taymans
6baf2ede50 filter-chain: add filter-chain.conf
Make a new filter-chain.conf file that contains the boilerplate for
filters.
Suggest that the example filter-chain fragments be copied to the
filter-chain.conf.d/ directory and that filters be run from this
config.
2022-07-11 10:00:46 +02:00
Wim Taymans
41dd96426c tests: fix clang build 2022-07-08 16:56:48 +02:00
Wim Taymans
ac90a0db13 filter-chain: fix build 2022-07-08 16:38:29 +02:00
Wim Taymans
9861e0f5f5 filter-chain: add mixer sink example 2022-07-08 16:28:50 +02:00
Wim Taymans
3a8275427e tests: wait for the filter node as well
Use the filter state to see when the filter was connected. It needs 2
roundtrips to get the filter to show in the registry.
2022-07-08 16:09:26 +02:00
Wim Taymans
8109f9a42d tests: make a test for ports
Test if adding a port will result in a new Port global.
2022-07-08 15:56:42 +02:00
Wim Taymans
e92e90bd3f tests: add filter unit test 2022-07-08 15:16:41 +02:00
Wim Taymans
e53eefef0d stream: implement prefetch
When the audioconverter needs more data, let it return NEED_DATA. This
can happen before the ports actually have consumed all the input data.
For example, then the next cycle would require 1024 samples but there
are currently only 16 samples queued, the next cycle will consume the
16 samples and then need another buffer to produce output.

For rt streams, this is not a problem because a new buffer will be
fetched in the next cycle synchronously.

When the stream is async, we can use this NEED_DATA to prefetch a
new buffer so that we have one in the next cycle.

This fixes hickups with async streams that provide random sized
buffers.
2022-07-08 10:48:29 +02:00
Wim Taymans
ea3a81dc29 raop-sink: fix some compilation errors 2022-07-07 19:56:55 +02:00
Wim Taymans
43b964ea26 stream: improve process callback
When we are running non-rt and we just dequeued a buffer, check if the
queue is empty and we need to call process to queue a new buffer. We can
only do this when there is an empty buffer to dequeue.

Don't try to request a new buffer immediately when we are rate_matching
because we want the peer to first process the newly dequeued buffer and
update the rate match.

This makes pw-midiplay work again. Previously it was only requesting a
buffer every other cycle.
2022-07-07 16:17:56 +02:00
Wim Taymans
a293e079d1 stream: don't crash when there is no io_rate 2022-07-07 15:56:25 +02:00
Wim Taymans
4da583a44b raop-sink: reuse timing packet send
Use send() instead of write(), use sendto() for the packets so that we
can specify a destination.
2022-07-07 14:00:38 +02:00
Christian Glombek
2c8d25b4dc module-raop-sink: Reply on timing socket earlier
Some AirPlay 2 devices require responding on the UDP timing port
right after sending the SETUP request.
2022-07-07 11:20:39 +00:00
Davis Davalos-DeLosh
eb3c2f3e95 module-raop: Add support for auth_setup
This step is required by some devices.

Co-authored-by: Christian Glombek <lorbus@fedoraproject.org>
2022-07-07 11:20:39 +00:00
Pauli Virtanen
167537dffc pulse-server: fix warning
The rest of the fields are zeroed later in reply_create_record_stream,
but static analysis doesn't know that.
2022-07-06 14:36:22 +00:00
Wim Taymans
a4f6598f47 dsdfile: support DSD128/256/512 as well
We need to scale the number of samples to read from the file depending
on the bitrate.

Fixes #2508
2022-07-06 09:27:38 +02:00
Pauli Virtanen
a46d4aedd7 pulse-server: work around race condition in SET_DEFAULT/MOVE_*
The default metadata update may be delayed for some time after
SET_DEFAULT, since the session manager has to work on it.

MOVE_* commands need to know what the client thinks is the current
default sink, so that they can decide between "move to default" and
"move to specific device".

To avoid race condition here, stash the default value set by the client
and use it in the MOVE_* commands, until the metadata update arrives.
2022-07-04 15:57:31 +00:00
Adolfo Rodrigues
6188e4d074 pulse-server: tweak maxlength some more
Make the buffer size at least 4 times as large as the fragment size to avoid
xruns.
2022-07-04 15:56:16 +00:00
Wim Taymans
8b649c4510 pulse-server: optimize property allocations
Only allocate a new properties object when we actually need to
change something.
2022-07-02 11:27:54 +02:00
Davide Beatrici
a31989b46d pulse-server: add card properties to sinks and sources
To match the original PulseAudio server's behavior.
2022-07-01 19:54:44 +00:00
Davide Beatrici
e0731f0ffa pulse-server: map "device.sysfs.path" to "sysfs.path" 2022-06-30 08:41:30 +02:00
Wim Taymans
d1ee783322 pw-cat: read and write raw formats correctly
We need to transform the number of bytes into frames.
2022-06-29 17:29:16 +02:00
Wim Taymans
67db81729e modules-raop: handle uninitialized vars 2022-06-27 18:51:28 +02:00
Wim Taymans
9f55708e9d audioconvert: Always apply noise when asked
Rename empty.noise -> dither.noise and always add this amount of noise
when > 0. This also adds the noise to silent sounds, not only when
nothing is connected because that would also be a problem when an amp
needs to be kept alive with an non-0 signal.

Rename noise -> dither because we can use this also for dithering later.

See #705
2022-06-27 11:19:01 +02:00
Wim Taymans
abcf7cb8d8 add some SPA_LIKELY 2022-06-27 09:37:33 +02:00
Wim Taymans
5fc7eac9b2 conf: update config files with new default property 2022-06-24 13:58:29 +02:00
James Hilliard
d61d787afa gst: log warnings if pw_stream_queue_buffer fails
There seem to be some latent issues with buffer recycling, add some
additional logging to simplify tracing buffer recycling issues.
2022-06-24 09:11:42 +00:00
Wim Taymans
532fc29c85 docs: improve docs a little 2022-06-23 18:55:02 +02:00
Wim Taymans
df457e99b2 roc: use native float samples 2022-06-23 12:48:59 +02:00
Wim Taymans
60cbc44526 modules: improve docs 2022-06-23 12:48:45 +02:00
Wim Taymans
c8b8b24a9c modules: fix format parsing
Use the same logic for parsing the format.
2022-06-23 12:39:51 +02:00
Wim Taymans
5363bdcfcb gst: protect negotiated field with lock
Move the lock around the negotiated field.

See !1287
2022-06-21 13:19:32 +02:00
Wim Taymans
a4998e0b87 filter-chain: allow unconnected filter ports
When there are unconnected filter ports, allow this but give a warning.
Improve error messages.
2022-06-21 13:07:11 +02:00
Wim Taymans
eb26c2a95e filter-chain: ladspa properties are different from flags
Don't use the ladspa properties as the plugin flags, they don't
match.
2022-06-21 12:53:11 +02:00
Wim Taymans
05064bd558 filter-chain: error out on 0 handles
When we end up in a case where we are running 0 handles, such as when we
have a stereo filter but we want mono output, emit an error until we can
reasonably handle this case.
2022-06-20 19:35:19 +02:00
Barnabás Pőcze
97a275e71e pulse-server: update quirks before querying the name
`client_update_quirks()` may modify `client::props` depending
on the "pulse.rules" section defined in the configuration file,
which means that it can change the value corresponding to the
"application.name" key. Therefore, `client::name` needs to
be queried after that.
2022-06-20 17:30:05 +00:00
Barnabás Pőcze
0f45d784d8 pulse-server: update client::name on UPDATE_CLIENT_PROPLIST command
`client::name` points to a string that is owned by `client::props`,
so when the property list is updated, it needs to be refreshed as well.
Otherwise, various use-after-frees can be triggered, for example:

==1471586==ERROR: AddressSanitizer: heap-use-after-free on address 0x60200007e7d0 at pc 0x7f14390755d0 bp 0x7ffe23edee30 sp 0x7ffe23ede5a8
READ of size 3 at 0x60200007e7d0 thread T0
    #0 0x7f14390755cf in printf_common /usr/src/debug/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors_format.inc:553
    #1 0x7f1439077215 in __interceptor_vsnprintf /usr/src/debug/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1665
    #2 0x7f1434ead47d in spa_vscnprintf ../spa/include/spa/utils/string.h:239
    #3 0x7f1434eae2ae in impl_log_logtv ../spa/plugins/support/logger.c:138
    #4 0x7f14385cacc7 in pw_log_logt ../src/pipewire/log.c:135
    #5 0x7f1433aef8e9 in do_set_profile ../src/modules/module-protocol-pulse/pulse-server.c:4656
    #6 0x7f1433b0af4d in handle_packet ../src/modules/module-protocol-pulse/server.c:109
    #7 0x7f1433b0e747 in do_read ../src/modules/module-protocol-pulse/server.c:276
    #8 0x7f1433b0eb04 in on_client_data ../src/modules/module-protocol-pulse/server.c:306
    #9 0x7f1434ec56a0 in source_io_func ../spa/plugins/support/loop.c:442
    #10 0x7f1434ec4a21 in loop_iterate ../spa/plugins/support/loop.c:430
    #11 0x7f14385dc23d in pw_main_loop_run ../src/pipewire/main-loop.c:148
    #12 0x55b065d73722 in main ../src/daemon/pipewire.c:131
    #13 0x7f143742928f  (/usr/lib/libc.so.6+0x2928f)
    #14 0x7f1437429349 in __libc_start_main (/usr/lib/libc.so.6+0x29349)
    #15 0x55b065d722a4 in _start (./src/daemon/pipewire-pulse+0x42a4)

0x60200007e7d0 is located 0 bytes inside of 16-byte region [0x60200007e7d0,0x60200007e7e0)
freed by thread T0 here:
    #0 0x7f14390be672 in __interceptor_free /usr/src/debug/gcc/libsanitizer/asan/asan_malloc_linux.cpp:52
    #1 0x7f14386a775a in do_replace ../src/pipewire/properties.c:414
    #2 0x7f14386a785e in pw_properties_set ../src/pipewire/properties.c:441
    #3 0x7f14386a658b in pw_properties_update ../src/pipewire/properties.c:309
    #4 0x7f1433adb055 in do_update_proplist ../src/modules/module-protocol-pulse/pulse-server.c:3246
    #5 0x7f1433b0af4d in handle_packet ../src/modules/module-protocol-pulse/server.c:109
    #6 0x7f1433b0e747 in do_read ../src/modules/module-protocol-pulse/server.c:276
    #7 0x7f1433b0eb04 in on_client_data ../src/modules/module-protocol-pulse/server.c:306
    #8 0x7f1434ec56a0 in source_io_func ../spa/plugins/support/loop.c:442
    #9 0x7f1434ec4a21 in loop_iterate ../spa/plugins/support/loop.c:430
    #10 0x7f14385dc23d in pw_main_loop_run ../src/pipewire/main-loop.c:148
    #11 0x55b065d73722 in main ../src/daemon/pipewire.c:131
    #12 0x7f143742928f  (/usr/lib/libc.so.6+0x2928f)

previously allocated by thread T0 here:
    #0 0x7f1439072faa in __interceptor_strdup /usr/src/debug/gcc/libsanitizer/asan/asan_interceptors.cpp:439
    #1 0x7f14386a6fe2 in do_replace ../src/pipewire/properties.c:394
    #2 0x7f14386a785e in pw_properties_set ../src/pipewire/properties.c:441
    #3 0x7f1433a6c52d in read_props ../src/modules/module-protocol-pulse/message.c:147
    #4 0x7f1433a6f467 in message_get ../src/modules/module-protocol-pulse/message.c:359
    #5 0x7f1433ab3191 in do_set_client_name ../src/modules/module-protocol-pulse/pulse-server.c:1030
    #6 0x7f1433b0af4d in handle_packet ../src/modules/module-protocol-pulse/server.c:109
    #7 0x7f1433b0e747 in do_read ../src/modules/module-protocol-pulse/server.c:276
    #8 0x7f1433b0eb04 in on_client_data ../src/modules/module-protocol-pulse/server.c:306
    #9 0x7f1434ec56a0 in source_io_func ../spa/plugins/support/loop.c:442
    #10 0x7f1434ec4a21 in loop_iterate ../spa/plugins/support/loop.c:430
    #11 0x7f14385dc23d in pw_main_loop_run ../src/pipewire/main-loop.c:148
    #12 0x55b065d73722 in main ../src/daemon/pipewire.c:131
    #13 0x7f143742928f  (/usr/lib/libc.so.6+0x2928f)
2022-06-20 17:30:05 +00:00
Wim Taymans
0d49d1f293 conf: mix-lfe is by default false 2022-06-20 17:43:44 +02:00
Wim Taymans
40f50deae9 alsa: remove NoteOn 0-velocity fixup
Pass MIDI events as they are.

JACK requires NoteOn 0-velocity midi events to be patched to NoteOff
events for compatibility with LV2 plugins. Let's do this patchup in
the JACK layer then and add an option to disable it.

It's best to pass the midi messages unmodified and then patch them up
wherever they need patching up.
2022-06-20 15:51:33 +02:00
Wim Taymans
ff05ebada6 pulse-server: tweak record attributes
Add some 'before' debug info of the attributes.
First clamp the fragsize to the maxlength and then clamp to the
minfrag or else we could bypass the configured minfrag by setting a
lower maxlength.
Scale the maxlength to at least twice the fragsize so that we can
buffer enough data in the ringbuffer to serve fragsize bytes.

See #2447
2022-06-20 11:42:59 +02:00
Lucas Holt
6a15a02ec2 Add support for MidnightBSD
Fix build issue

Fix build issue
2022-06-19 18:22:47 +00:00
Wim Taymans
6b09a304dc adapter: name control ports as "control" 2022-06-17 15:40:56 +02:00