Commit graph

6767 commits

Author SHA1 Message Date
Wim Taymans e301048abb settings: use metadata for settings
The settings metadata can be used to modify global context properties
at runtime such as min/max quantum, loglevel and samplerate.

See #1288
2021-06-17 11:13:42 +02:00
Wim Taymans f6ce23cbe3 metadata: add vargs format method for metadata values 2021-06-17 11:11:46 +02:00
Wim Taymans beb80a06e8 media-session: use core metadata implementation
Use the core metadata implementation and export that one.
2021-06-17 11:11:45 +02:00
Wim Taymans 80ef77f994 context: add metadata implementation
Add a simple metadata implementation to the core that clients can
use to manage metadata or export.
2021-06-17 11:11:45 +02:00
Wim Taymans d8ad87fd09 context: improve settings and defaults
Make structure with defaults that holds the defaults as they are loaded
from the config file or initialized with default values.

Copy this structure to a settings version that is used at runtime.

Add a force-quantum and force-rate field in the settings that can be
used to force a quantum and samplerate if != 0.
2021-06-17 11:11:45 +02:00
Wim Taymans 2ad202b8e8 audioconvert: track and compensate for rate changes
Follow the rate of the _io_position area and adjust the resampler
to match. This ensures that we always process at the DSP samplerate
to the target negotiated fixed rate of the device/stream.
2021-06-17 11:11:45 +02:00
Wim Taymans 519bd342be audioconvert: don't use samplerate to negotiate
The merger and splitter use the samplerate from the _io_position
for the DSP formats so set the samplerate to 0 to make sure we
don't use it to negotiate a format with the peer.
2021-06-17 11:11:45 +02:00
Wim Taymans 7ba7179eee audioconvert: use the position rate to negotiate
When we have an io_position, use the rate as the samplerate when
negotiating.
2021-06-17 11:11:45 +02:00
Wim Taymans ed80d72d51 audioconvert: also set io_position on channelmix
Also make the channelmix node aware of the io_position so that
is can use this later to get the default rate.
2021-06-17 11:11:45 +02:00
Wim Taymans c726dd887c alsa: refactory _io_position checking
Move the code to check the position duration for changes to one
new method.
Also check for samplerate changes and adjust the resampler state
accordingly.
2021-06-17 11:11:44 +02:00
Wim Taymans 0ec760315e jack: there is no need to lock in get_aliases
See #1313
2021-06-17 10:56:39 +02:00
Wim Taymans 0f9fd45a58 jack: rework locking
Ensure all callbacks are called from the thread_loop and release
the thread lock before calling the callback.

Introduce a new rt_lock that is taken while the callbacks are called.
Only call the process_callback when we can acquire the rt_lock in the
data thread. This ensures the process callback is never called
concurrently with any other callback.

Give a warning when we try to call do_sync from the thread_loop
itself. We would deadlock because the thread that is supposed to do
the sync operation would be blocked in wait().

Fixes #1313
2021-06-17 10:46:04 +02:00
Wim Taymans 3e52c6598b jack: add more port checks
Check if the port id and direction is valid before accessing the
port array.
Handle unknown and invalid ports in many methods.
Free the port item after we removed the item from pipewire because
more methods are being called while removing the port and we don't
want them to fail.
2021-06-17 09:23:11 +02:00
Huang-Huang Bao 4c9ac08310 bluez5: always emit node object info for dynamic node
impl_add_listener() could be called more than one time, ensure that we always emit node info
so that session manager(bluez-monitor) can receives it.

Fixes #1308
2021-06-17 07:22:46 +00:00
Peter Hutterer 62e98aa836 test: move some of the property tests to pwtest
Mostly 1:1 move of the test-properties.c file in src to the one in test, but a
few checks were merged into the existing functions.
2021-06-17 07:08:53 +00:00
Peter Hutterer 7a6fa50575 daemon: drop the obsolete dbus policy file 2021-06-17 07:02:48 +00:00
Peter Hutterer 08525e865d daemon: simplify configuration file generation
We convert from conf.in to conf, let's make this hardcoded so we stick to
the same scheme everywhere.
2021-06-17 07:02:48 +00:00
Barnabás Pőcze 7cecb1567d spa: tests: remove double dot from names of test files
Previously, the configured test file would be named like the following:

  spa-include-test-spa_control_control_h..cpp

fix that by removing one of the dots.

Furthermore, use the already existing `find` object instead of
calling `find_program` one more time.
2021-06-16 19:45:27 +02:00
Barnabás Pőcze bbbf5724be pipewire: module-zeroconf-discover: free correct pointer
Retrieve the pointer returned by `calloc()` and free that
instead of freeing the pointer to a member. This has worked
so far because as of yet `api` is the first member of the struct.
2021-06-16 17:39:25 +00:00
Barnabás Pőcze 58e254ec63 pulse-server: module-zeroconf-publish: remove unnecessary emit
Since !737 it is not required of modules to emit the "loaded"
event if they can load immediately, therefore remove the
unnecessary `module_emit_loaded()` call.

Furthermore remove redundant log messages as well.
2021-06-16 16:40:57 +02:00
Wim Taymans 61bcd4f988 jack: only use the "default" metadata 2021-06-16 12:17:52 +02:00
Wim Taymans f43c57afdb pulse-server: add context listener last
Add if after we have done everything else because if there is an
error we don't remove it and there will be an invalid hook registered
in the context.
2021-06-16 12:17:39 +02:00
Wim Taymans 22bb2666c4 metadata: remove metadata when the global is removed
So that we can ensure the metadata only contains valid subject
ids.
2021-06-16 12:17:35 +02:00
Wim Taymans 07d43a001b pw-dump: remember the subject of metadata
So that we can also print it instead of printing 0.
2021-06-16 12:17:30 +02:00
Wim Taymans f15d585f8d metadata: check M permissions before changing metadata
To change a metadata, we need to be able to read the subject and also
have the M permission on it.
2021-06-16 12:17:25 +02:00
Wim Taymans 9d9e3f2d23 metadata: add client-id to properties
Add the client that owns the metadata to the properties.
2021-06-16 12:17:20 +02:00
Wim Taymans 9984dcd1ea pipewire: small comment fix 2021-06-16 12:17:15 +02:00
Sanchayan Maity 96c77e1f2f pulse-server: Implement module-pipe-source 2021-06-16 08:05:51 +00:00
Sanchayan Maity d5ee0ad8cc module-pipe-sink: Fix usage of spa_strerror
spa_strerror() works with negative error codes and async spa results.
2021-06-16 13:30:48 +05:30
Barnabás Pőcze a168e4261f doc: move color overrides into light color scheme block
Otherwise when a user is visiting with dark color scheme
preference, the code fragments would appear with far too
bright colors.
2021-06-15 17:58:06 +00:00
Haochen Tong 18ef422f3f
filter-chain: reformat configuration 2021-06-15 20:11:33 +08:00
Sanchayan Maity 4be1981f54 module-protocol-pulse: Clean up unused #define ERROR_RETURN 2021-06-15 10:54:48 +05:30
Wim Taymans b6559289f1 pulse-server: fix compilation on some compilers 2021-06-14 15:43:32 +02:00
Wim Taymans e3a2f4a645 jack: keep context lock locked for callbacks
Also keep the context lock locked with emiting the registration,
portregistration and connect callbacks.

All the other callbacks are emited with the lock and it makes sense to
also emit these ones with the lock so that code in the callback gets
a consitent view.

See #1265
2021-06-13 19:26:10 +02:00
Wim Taymans 1bc383a7b7 pipewire-pulse: also store format/channels for sources 2021-06-12 20:30:49 +02:00
Wim Taymans ba402209ba pulse-server: use PulseAudio name for format and channels
Use the pulseaudio names for the format and channels, like the real
pulseaudio.
2021-06-12 20:29:51 +02:00
Sanchayan Maity cf93fd7f9a module-protocol-pulse: Add Avahi zeroconf publish module 2021-06-12 17:56:49 +00:00
Sanchayan Maity e66125ede0 module-protocol-pulse: Factor out some common code
Factor out some of the common code that will be required for zeroconf
support next.
2021-06-12 17:56:49 +00:00
Barnabás Pőcze bd6f63fecd pulse-server: improve module loading
Modules no longer need to emit the "loaded" event manually
if they can load immediately. In that case, the module loading
code will take care of emitting the event. If they can't,
they must return an async spa result, and emit the "loaded" event
when they see fit.

Fixes #1232
2021-06-11 20:50:30 +02:00
Barnabás Pőcze 4d02233ff3 pulse-server: don't broadcast remove event when a module wasn't loaded 2021-06-11 20:50:30 +02:00
Barnabás Pőcze f26358e958 pulse-server: module-simple-protocol-tcp: remove unnecessary struct member 2021-06-11 20:50:30 +02:00
Barnabás Pőcze 3eaea123f9 pulse-server: module-simple-protocol-tcp: add module listener 2021-06-11 20:50:30 +02:00
Barnabás Pőcze 12359b490d pulse-server: module-null-sink: provide fallback name
If no `sink_name` has been specified, use "null-sink" to avoid a
NULL pointer dereference later in the function.
2021-06-11 20:50:30 +02:00
Barnabás Pőcze 09c162c8bf pulse-server: module-null-sink: add missing version to events struct 2021-06-11 20:50:30 +02:00
Barnabás Pőcze 6f5b089767 pulse-server: clear hook list when module is freed
Moreover, rename the hook list to "listener_list".
2021-06-11 20:50:30 +02:00
Barnabás Pőcze d9befc0792 pulse-server: eliminate some memory leaks in modules 2021-06-11 20:50:30 +02:00
Barnabás Pőcze 1d5fb2a7db pulse-server: remove unnecessary struct members 2021-06-11 20:50:30 +02:00
Barnabás Pőcze cd0eb829dd pulse-server: remove redundant log messages from modules
The same information is printed in
* `on_module_loaded()`,
* `module_load()`, and
* `module_unload()`.
2021-06-11 20:50:30 +02:00
Wim Taymans a90c86dd47 defs: reorganize the assert macros a little
Make a special Coverity version of spa_assert_se borrowed from
PulseAudio
NDEBUG now compiles the asserts to nop, except for the _se one.

See !755
2021-06-11 20:05:25 +02:00
Wim Taymans b7c2e7a693 conf: the midi bridge example is from a spa-node-factory
Fixes #1294
2021-06-10 23:47:15 +02:00