Commit graph

3461 commits

Author SHA1 Message Date
Wim Taymans
90de408e31 loopback: use _raw_build helpers
Now that the raw_builder supports wildcard for rate, use it in loopback
and add an option to force resampling as well.
2021-04-01 10:47:23 +02:00
Wim Taymans
7afb3bc1a4 pulse-server: add module properties 2021-04-01 09:35:31 +02:00
Wim Taymans
27e00d1be4 pulse-server: don't fix sample rate
Use the builder directly to leave the samplerate undefined so that we
adapt to the graph samplerate instead of forcing resampling.
2021-04-01 09:32:00 +02:00
Wim Taymans
4aa817771a pulse-server: arguments can be NULL
And module-null-sink does not have mandatory arguments.
2021-04-01 09:04:55 +02:00
Wim Taymans
cc7cbaa83b pulse-server: module-loopback fixes
source and sink need not be set and need to be mapped to the target
source/sink to connect to.
node.group needs to be a unique id shared by source/sink to make them
part of the same scheduling group and do clock sync.
Remove some unused properties
2021-04-01 08:24:51 +02:00
Wim Taymans
8383e86f33 pulse-server: module arguments can be NULL 2021-04-01 08:24:22 +02:00
Arun Raghavan
e7b04bca2c pulse-server: Implement module-loopback
Implements all modargs other than rate adjustment and max latency
related ones, which do not make sense in our context.

Fixes: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/543
2021-03-31 18:19:36 -04:00
Wim Taymans
427e8abf0c impl-node: improve reason string in recalc_graph
Don't just report "quantum changed" as the reason for recalculating
the graph but make it depend on what actually happened.
2021-03-31 13:30:03 +02:00
Pauli Virtanen
7b9792ffab pulse-server: fix brace in wrong place 2021-03-31 11:13:07 +00:00
Wim Taymans
dd6a18d576 pulse-server: handle 0 id as default sink/source as well
Also handle 0 id as the default sink/source

See #756
2021-03-30 10:15:36 +02:00
Wim Taymans
efd52d633f examples: only use memfd_create when defined
See #987
2021-03-30 09:59:07 +02:00
Dmitry Sharshakov
e7f2f450ff bluez5: add parameter to use A2DP source as input 2021-03-30 09:21:12 +02:00
Wim Taymans
51c700a655 media-session: only save routes with the save flag set
We only want to save the route properties when they were changed
by a user action.
2021-03-29 15:52:31 +02:00
Wim Taymans
f78be58568 stream: Add node.autoconnect stream.properties
If the node.autoconnect property is set in the stream.properties,
ignore the AUTOCONNECT flag value. This makes it possible to
force AUTOCONNECT either way.

See #964
2021-03-29 14:19:34 +02:00
Wim Taymans
ec0b2b8dd7 stream: use PIPEWIRE_AUTOCONNECT env variable
Use the PIPEWIRE_AUTOCONNECT environment variable to set the value
of the NODE_AUTOCONNECT property. This way, you can start any
stream based app with PIPEWIRE_AUTOCONNECT=false to disable
the session manager autoconnect.

See #964
2021-03-29 14:05:25 +02:00
Wim Taymans
3878ad921a pulse-server: handle 0 sink/source name or index as default
Some apps use 0 to get some sort of sink/source info. PulseAudio
likely has a source/sink at index 0 but PipeWire certainly does not.

Asking for 0 source/sink is always because of some hardcoded values
in the app and we can return the default source/sink without causing
any problems for other apps.

See #756
2021-03-29 13:50:37 +02:00
Wim Taymans
80ce2c94ac alsa: add start-delay parameters to sink
The start-delay adds extra silence to the buffer before starting the
playback. The idea is to have more time to adapt to the device
startup and set the timer more accurately.

See #983, #431
2021-03-29 13:20:14 +02:00
Wim Taymans
30659c5f61 media-session: remove double ;; 2021-03-29 11:41:30 +02:00
Wim Taymans
73f50bb964 improve debug 2021-03-29 11:41:06 +02:00
Pauli Virtanen
eb7df98cd6 pulse-server: minor fix 2021-03-27 21:53:49 +02:00
Wim Taymans
c85a04fb49 tools: add some check when parsing the profile info
Fail when we can't parse the profile info to avoid using invalid
values.
2021-03-27 20:37:26 +01:00
Wim Taymans
ae22852a9b remove some useless checks
The variable was already dereferenced above and thus can't be NULL
2021-03-27 20:36:43 +01:00
Wim Taymans
d81fc9bcb4 introspect: remove impossible case 2021-03-27 18:37:21 +01:00
Pauli Virtanen
2681b8236b media-session/pulse-server: more error checks + minor fixes 2021-03-27 19:16:19 +02:00
Wim Taymans
f0a2b6d01f core: Always include fcntl
Fixes #833
2021-03-27 12:51:38 +01:00
Pauli Virtanen
54e06d9df0 bluez5: add additional aac encoder options, and implement optional vbr 2021-03-27 11:47:34 +00:00
Wim Taymans
eaf3b3a3c9 remote-node: remove the mix from the port
We add the mix in init and remove it again when clearing.

See #973
2021-03-26 21:14:42 +01:00
Wim Taymans
ea5a830c8a global: always remove from the global map
We add the global to the global map to allocate an id. Remove the
global from the map in _destroy() instead of _unregister() to make
sure we always remove the global from the map, even if the global
was not registered.

See #973
2021-03-26 20:49:57 +01:00
George Kiagiadakis
511cb28e17 properties: clear SPA_DICT_FLAG_SORTED when adding/removing items
This allows calling spa_dict_qsort() externally on the dict,
ensuring that lookups will not break when items are added or removed.
2021-03-26 17:00:43 +00:00
Pauli Virtanen
6b5b56bcc7 pulse-server: use transportCodec prop for bluez codec messages 2021-03-26 16:59:07 +00:00
Wim Taymans
e3323f7bca pulse-server: actually handle clearing of metadata
Make sure we also set the metadata back to NULL when the object is
removed.
2021-03-26 16:28:41 +01:00
Wim Taymans
98585e092c pulse-server: handle metadata remove
Also handle the case where metadata is removed. Set the pointer to
the object to NULL. This can happen when the session manager restarts.
2021-03-26 16:04:45 +01:00
Guillaume Desmottes
9690820e63 keys: document PW_KEY_APP_VERSION 2021-03-26 14:22:07 +00:00
Huang-Huang Bao
34c9f24d2a bluez5: autoconnect device profiles on startup
Auto-connect all paired & trusted devices on startup.
Since devices that already connected or powering off would reject the connecting requests, it should be fine with this behavior.
Also reconnect remaining profiles if only partial profiles are connected.
2021-03-26 14:15:55 +00:00
Wim Taymans
4112b34f4d pulse-server: also release and free the dbus name 2021-03-26 15:14:53 +01:00
Wim Taymans
109411bd2b pulse-server: add listener after success
Or else we might have freed the hook while it's still added to the
module.
2021-03-26 15:13:50 +01:00
Wim Taymans
69a8c302b1 media-session: clean up default node names 2021-03-26 15:13:23 +01:00
Wim Taymans
f6356a3441 media-session: handle node destroy during linking
Mark a node as busy linking while we call _create_links. The
_create_links method does a roundtrip and this might cause the node
to be destroyed. Set a flag when we notice this and avoid accessing
the destroyed object.
2021-03-26 13:07:28 +01:00
Wim Taymans
0af8c0c045 pulse-server: check message size 2021-03-25 19:07:13 +01:00
Philippe Normand
ddd731bc09 module-access: Plug /.flatpak-info fd leak
The file descriptor needs to be closed in all situations, not only in the fstat
error case.
2021-03-25 18:05:07 +00:00
Pauli Virtanen
3d82700edb media-session: retry link a few times if it fails
Retry linking nodes a few times instead of giving up immediately.

This is a workaround, but it fixes moving streams on BT profile changes.
2021-03-25 19:51:02 +02:00
Wim Taymans
bcc147cf72 context: keep some room for our own support
We need some extra items in the array to store our own support
objects, so pass a smaller one to the core support.
2021-03-25 17:43:59 +01:00
Wim Taymans
e3b0cc76a3 pulse-server: avoid leaks in error path
When reading the properties failes, make sure to free the properties
anyway.
2021-03-25 17:34:44 +01:00
Wim Taymans
5629885e41 media-session: avoid strcmp on unterminated string
The string might not be 0 terminated so use the length to set a
limit for strcmp.
2021-03-25 17:29:19 +01:00
Wim Taymans
4ab4c57a55 impl-core: fix memleak in error case 2021-03-25 17:17:40 +01:00
Wim Taymans
78da72ce30 pulse-server: take length of the right string
We need to take the length of the desc, not name, to construct the
extended 'Monitor of <desc>" string.
2021-03-25 17:02:10 +01:00
Wim Taymans
faeb42fa66 pw-loopback: fix leaks, improve cleanup 2021-03-25 16:50:49 +01:00
Wim Taymans
2d2557381c pulse-server: avoid returning NULL strings
Don't return a NULL string when converting an id to a string because
some callers don't expect this and crash.
2021-03-25 15:35:12 +01:00
George Kiagiadakis
05beb04259 impl-core: also include fcntl.h on non-freebsd builds to compile getrandom 2021-03-25 15:16:41 +02:00
Arseny Maslennikov
403f27c531 meson, pw-top: use ncursesw
Some PulseAudio clients are known to use localised client and
stream names as values for the respective PulseAudio props, most
notably plain old pavucontrol.

We call setlocale before anything else for ncurses to display
localised text correctly. We also want to link with ncursesw, which
supports multibyte Unicode locales.
2021-03-25 11:22:52 +00:00