Commit graph

9341 commits

Author SHA1 Message Date
Thomas Weißschuh 2394413ec3 hook: don't remove from unitialized list
A lot of code calls spa_hook_remove() from error paths where the hook
and therefore the list may not have been initialized.
This leads to null-derefences.
2022-08-30 11:52:42 +00:00
Thomas Weißschuh b23b0e6125 list: add spa_list_is_initialized()
This function can be used to test if a list has been initialized.
2022-08-30 11:52:42 +00:00
NorwayFun f4ad9fc90c Update LINGUAS 2022-08-30 11:00:02 +00:00
Piotr Drąg ced134b9fa Update Polish translation 2022-08-30 10:59:39 +00:00
Wim Taymans e04e3ef40e audioconvert: fix rate match for sources
Only update the resampler rate when we ask for more data, when we have
more input data, use the previously configured rate to calculate how
many samples we will consume.

Fixes resync errors with multiple sources. One source would do rate
matching, audioconvert would ask it to produce X samples, the source is
scheduled to produce the samples, the rate match is updated with the new
rate correction, audioconvert is scheduled again. It should now use the
X samples it asked to produce and apply the new rate correction for the
next iteration.
2022-08-30 12:43:14 +02:00
Pauli Virtanen c0e8b397f6 bluez5: avoid (harmless) integer overflow
If no packets have been received and spa_bt_decode_buffer_process is
called, this->packet_size.max == INT32_MIN, which can give overflows.

Guard against this condition, although it should be harmless.
2022-08-24 16:59:21 +00:00
Fran Dieguez 461876c227 Update galician translations 2022-08-23 09:47:42 +02:00
Gleb Popov c6ffeeeb34 On FreeBSD do not try to redefine O_PATH.
FreeBSD 13+ versions do have O_PATH flag, but FreeBSD 12, which is still supported
does not.
2022-08-21 22:43:31 +03:00
Gleb Popov ad13681d33 Guard <sys/vfs.h> inclusion with an #ifdef. 2022-08-21 22:42:57 +03:00
Wim Taymans f9e7fd7c67 avb: free resources on error 2022-08-20 21:41:59 +02:00
Tasos Sahanidis 0e847c97c8 jack: Increase JACK_CLIENT_NAME_SIZE
Some devices have really long names, especially when taking localisation
into account due to multibyte characters.
2022-08-20 19:35:39 +00:00
Tasos Sahanidis 7884ff82db jack: Include NULL in return value of jack_client_name_size()
This fixes an assertion failure in PortAudio's JACK backend when the
monitor client name is longer than than JACK_CLIENT_NAME_SIZE.
2022-08-20 19:35:39 +00:00
James Hilliard 1ea1d525c1 gst: copy buffer memory in dequeue_buffer using gst_memory_copy
When always-copy is enabled we should copy buffer memory instead of
sharing buffer memory and using gst_buffer_copy_deep.

This should ensure we recycle the parent buffer as soon as the memory
is copied.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2022-08-20 09:30:44 -06:00
Thomas Weißschuh a969feb3c0 avb: validate random data for xsubi 2022-08-19 07:35:02 +00:00
Thomas Weißschuh f2e1827e18 utils: pw_getrandom: warn on unused return value
The return value tells us if we actually got any random data so it
should not be ignored.
2022-08-19 07:35:02 +00:00
Thomas Weißschuh 987069cc3c utils: pw_getrandom() use errno from read() call
The errno from read is more useful than the one from close() clobbering
it. So make sure to preserve the real reason for failure for the caller.
2022-08-19 07:35:02 +00:00
Thomas Weißschuh 6531bedcdb spa: add SPA_WARN_UNUSED_RESULT 2022-08-19 07:35:02 +00:00
Thomas Weißschuh bbb3cdc185 pw-cat: clean up resource correctly on EIO
The core has already been connected and the loop is running so we also
have to clean those up.

Fixes #2651
2022-08-19 07:34:02 +00:00
Frédéric Danis 6b3390387d bluez5: Test transport pointer before using it
If this->transport is NULL the debug log will crash.
2022-08-18 12:57:04 +02:00
Wim Taymans 0532d194ad protocol-native: small cleanups
Style fixes.
Use new variable for fd to avoid casts.
Generate an error when  the fd is invalid.
2022-08-17 19:56:52 +02:00
Cameron Nemo 0883a0163b protocol-native: write socket address into fd
Support fork-free readiness notifications.

Without this, a service supervisor that does not implement socket
activation has no way of knowing whether or not pipewire is ready to
accept connections on the socket.

s6 is the most popular service manager that supports this mechanism.
See here: https://skarnet.org/software/s6/notifywhenup.html
2022-08-17 17:41:21 +00:00
Dmitry Sharshakov 3ceb3288ca convolver: fix crash on FFT unload
Co-authored-by: Barnabás Pőcze <pobrn@protonmail.com>
2022-08-17 11:22:05 +00:00
Barnabás Pőcze 68ff3ad841 treewide: meson.build: use host_machine instead of build_machine
At the moment, cross compilation may not work in certain cases because
checks are carried out against the build machine instead of the host machine.
Replace uses of `build_machine` with `host_machine` to fix that.

In native compilation, all three "machine objects" available in meson
are the same, so this change should have no effect in that case.

More: https://mesonbuild.com/Cross-compilation.html
2022-08-17 07:34:20 +00:00
Barnabás Pőcze 358254f20a spa: meson.build: add missing new line 2022-08-17 07:34:20 +00:00
Pauli Virtanen b9baeeb587 bluez5: opus: react faster to too long packet queue
React immediately to "bad" buffer level. Use smaller bitrate
increments/decrements.  Fix ABR timer increment for fragmented packets.
Handle actual bitrate being smaller than target during silence.
2022-08-13 15:58:08 +03:00
Pauli Virtanen c1acb5168d bluez5: bump Opus max bitrates
Limit bitrates to 2-2.5x Opus recommended "good quality", instead of
1.5x, which is safer quality-wise for CVBR.
2022-08-13 15:12:35 +03:00
Barnabás Pőcze 1275fc99df pipewire-jack: do not dereference value from pw_data_loop_get_thread()
`pw_data_loop_get_thread()` returns a `pthread_t` cast to `struct spa_thread *`,
so simply casting it back to `pthread_t` is enough.
2022-08-11 16:50:05 +02:00
Barnabás Pőcze 3f3b70ad83 pipewire-jack: return a zero initialized pthread_t in case of error
When the `client` argument is NULL, return a zero initialized
`pthread_t` object from `jack_client_thread_id()`. Returning
`-EINVAL` can be problematic because even though `pthread_t` is
a typedef for `unsigned long` in glibc, it is still a pointer,
not a numeric identifier. And in musl, it is a typedef to a
pointer, which results in a warning:

  In file included from ../spa/include/spa/support/cpu.h:34,
                   from ../pipewire-jack/src/pipewire-jack.c:40:
  ../pipewire-jack/src/pipewire-jack.c: In function 'jack_client_thread_id':
  ../spa/include/spa/utils/defs.h:274:11: warning: returning 'int' from a function with return type 'jack_native_thread_t' {aka 'struct __pthread *'} makes pointer from integer without a cast [-Wint-conversion]
    274 |    return (val);     \
        |           ^
  ../pipewire-jack/src/pipewire-jack.c:3775:2: note: in expansion of macro 'spa_return_val_if_fail'
   3775 |  spa_return_val_if_fail(c != NULL, -EINVAL);
2022-08-11 16:45:25 +02:00
Gleb Popov 4a0395d23e Enable AVB on Linux only. 2022-08-11 17:23:16 +03:00
Gleb Popov 25b2f316f0 Bump FreeBSD CI to 13.1 2022-08-11 14:57:43 +03:00
Wim Taymans 27dcbfc1ee remote-node: don't set activation state and signal_time twice
This is already set by resume_node.
2022-08-11 12:35:51 +02:00
Wim Taymans 1bc1d96f88 node: rename signal to signal_func
To avoid confusion and it is more easily greppable
2022-08-11 12:34:51 +02:00
Wim Taymans ca8b61e984 protocol-native: improve connection disconnect
The connection is created in new, therefore free it in destroy, not in
disconnect.
Connect sets the fd, so unset the fd in disconnect.
2022-08-11 12:07:59 +02:00
Wim Taymans 78c069ff87 potocol-native: improve error handling
Init the compat types map a little earlier so that it is initialized
when we try to clear it on error.
Add the client listener earlier so that we can use the events to clean
up the map, source and connection.
2022-08-11 12:06:28 +02:00
Wim Taymans d7da581b9c jack: return error when disconnected
When we are disconnected from the server (EPIPE), don't try to wait for
the result of a sync operation but return the error.

Fixes #2606
2022-08-11 11:04:50 +02:00
Wim Taymans 3df0fb21a0 channelmix: only produce REAR/SIDE from FC in simple upmix
Only simple upmixing would replicate the FC channel into REAR/SIDE.
The PSD method would take the diff between FL/FR (which would
be 0 if only FC is available) and not generate output.
2022-08-11 09:37:43 +02:00
Wim Taymans da9868594d channelmix: produce STEREO from FC
Make it possible to produce STEREO from FC.
2022-08-11 09:35:54 +02:00
Wim Taymans b03b57c77a channelmix: also filter FC and LFE when no layout
Always apply filter based on dest layout, even when distributing,
averaging or copying a signal.
2022-08-11 09:33:34 +02:00
Wim Taymans 1e71c0e840 meson: also check for roc headers
Fixes #2513
2022-08-10 12:09:54 +02:00
Wim Taymans f50aafed4d systemd: add filter-chain service
See #2553
2022-08-10 11:35:59 +02:00
Wim Taymans 50bdebe4e8 pw-cli: remove the dump command
It is mostly implemented as part of wpctl status, pw-dump, pw-link, pw-top and
others.
2022-08-10 10:36:56 +02:00
Wim Taymans 851bfba6ed pw-cli: add alias in comand help
Add alias to docs and mention alias in help.

Fixes #2552
2022-08-10 10:35:35 +02:00
Wim Taymans fe5e164876 keys: improve docs a little
Fixes #2563
2022-08-10 10:13:32 +02:00
Wim Taymans ab898f8ae6 jack: use context properties for rules
For a JACK client, the context and node is the same. It makes sense to
also run the rules on the context properties so that application
name etc. can be matched as well.

Fixes #2580
2022-08-10 09:52:20 +02:00
Wim Taymans 83e3aba980 jack: clean transport when closing the client
See #2569
2022-08-09 20:55:41 +02:00
Wim Taymans 0ad7cb3298 loop: flush items before stopping
Before leaving the loop, flush out any pending items in the invoke
queue.

See #2631
2022-08-09 20:38:06 +02:00
Wim Taymans 32cf5f312b data-loop: call pw_loop_invoke directly
The loop invoke method will already call the function directly when the
thread has been stopped and will also make sure that pending items are
flushed first.

See #2631
2022-08-09 20:16:33 +02:00
Barnabás Pőcze 9d5f565682 pipewire: extend memfd name with additional information
Knowing the flags, type, and size that were used in
the `pw_mempool_alloc()` call can be useful for
debugging purposes.
2022-08-09 11:24:00 +00:00
Wim Taymans f971362f76 alsa: improve test
Add capture mode, add more info for class
2022-08-09 12:16:37 +02:00
Wim Taymans 80b59a4971 alsa: add test for dumping hw_params
See #2620
2022-08-09 11:51:20 +02:00