Wim Taymans
7bd6b725dc
Fix some warnings
...
When memfd and systemd are disabled.
See #987
2021-04-04 21:09:39 +02:00
Wim Taymans
8cf6da467f
pulse-server: use the name of the default sink
...
When setting a new default sink/source, use the name of the object
instead of the name used for selecting the sink/source. This makes
it possible to use the id to search for the device but still have
the device name in the metadata as is expected.
Fixes #1004
2021-04-02 10:07:39 +02:00
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
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
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
Pauli Virtanen
eb7df98cd6
pulse-server: minor fix
2021-03-27 21:53:49 +02:00
Pauli Virtanen
2681b8236b
media-session/pulse-server: more error checks + minor fixes
2021-03-27 19:16:19 +02: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
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
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
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
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
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
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
Wim Taymans
5d88e072a8
pulse-server: handle NULL proxy
...
The proxy could be removed before we get the global remove so we need
to handle the case where we access an object without a proxy and
avoid a crash.
2021-03-25 09:08:13 +01:00
Wim Taymans
fa1350b0cf
pulse-server: make sure we are active when draining
...
When we start draining, set ourselves active so that the process
function is called where the draining is completed.
This avoids a corked stream from waiting forever to drain the stream.
Fixes #946
2021-03-22 10:31:09 +01:00
Wim Taymans
80a6583271
pulse-server: send any STREAM_KILLED command last
...
Mark the stream as killed and then only send the STREAM_KILLED
command after we send the other pending commands.
2021-03-22 10:29:45 +01:00
Wim Taymans
6b6bf1e1d0
pulse-server: always reply to pending drain operation
...
When we destroy a stream but there is still a pending drain operation,
send an error for the drain tag first.
2021-03-22 10:16:48 +01:00
Huang-Huang Bao
3bce026d67
protocol-native: fix out-of-bounds access to SEC_LABEL hex table
...
If buffer type char[] is 4-byte aligned, higher 3-byte on char could be non-zero if data is not initialized, which make 'buffer[i] >> 4' larger than 0x0f.
Use type uint8_t[] on SEC_LABEL buffer to fix it.
2021-03-21 12:07:39 +00:00
Pauli Virtanen
132786c202
pulse-server: implement send_object_message
...
Use it for providing Bluez codec listing/switching interface. It
currently works by just switching device profiles.
2021-03-20 23:30:38 +02:00
Wim Taymans
de12a24e77
protocol-native: hex encode invalid SEC_LABEL
...
When the sec label contains invalid chars, hexencode it to avoid
causing problems with invalid strings later.
2021-03-20 21:00:55 +01:00
Pauli Virtanen
942ead7d90
pulse-server: fix route profile numbering
...
Route profile numbers refer to profile ids, not indices.
2021-03-20 15:32:26 +02:00
Pauli Virtanen
7be7b258cb
pulse-server: don't send invalid port profile arrays
...
libpulse assumes in introspect.c:fill_card_port_info that port profile
array size <= card profile array size, and may crash otherwise.
Enforce this in fill_card_info. It can happen, if EnumRoute and
EnumProfile info is not in sync.
2021-03-20 15:15:37 +02:00
Wim Taymans
8a4d2ed7ce
pipewire-pulse: set correct errno values
...
errno should be set to the positive errno value.
This does not cause problems except for the pulse-server where the
errno value is negated and returned as an error result.
2021-03-19 12:46:05 +01:00
Joakim Tjernlund
d983c51469
pulse-server: Emulate PA driver name as blueman looks for it
2021-03-18 16:20:30 +01:00
Wim Taymans
8d7c5732db
pulse-server: remove .monitor suffix when set as default source
...
We place the sink name in the metadata when it is used as a default
source.
2021-03-18 10:28:47 +01:00
Wim Taymans
bc47378abc
pulse-server: support moving capture streams to monitors
...
Also resolve the monitor ids to the sink with the monitor ports.
2021-03-17 17:02:28 +01:00
Wim Taymans
24d795e9a4
pulse-server: don't free stream map in disconnect
...
The cleanup handler might still run and try to iterate the streams
so make sure the map is not freed yet.
See #901
2021-03-17 16:28:21 +01:00
Björn Daase
5913eb098c
treewide: fix issues found by codespell
2021-03-16 19:11:25 +00:00
Jan Alexander Steffens (heftig)
c6aa48548e
pulse-server: Use fprintf to write the pid file
...
This simplifies the code and also avoids a warning with _FORTIFY_SOURCE:
../pipewire/src/modules/module-protocol-pulse/pulse-server.c: In function ‘create_pid_file’:
../pipewire/src/modules/module-protocol-pulse/pulse-server.c:6028:2: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6028 | write(fd, pid_str, strlen(pid_str) + 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-03-13 20:09:31 +01:00
Jan Alexander Steffens (heftig)
ac9bcdee31
pulse-server: Error out if pid file name would be too long
2021-03-13 20:09:03 +01:00
Albert Chang
2ae6851698
pulse-server: create pid file on start up
...
Some PulseAudio clients, such as QEMU, check that the pid file exists
prior to initialization.
2021-03-13 14:47:45 +00:00
Wim Taymans
a5922a9c0a
pulse-server: use async reply for set_default_sink/source
...
Because we set the default sink/source before calling the metadata,
we don't send out updates about the new sink and this confuses
pavucontrol.
Instead, use the new async reply to reply once the new metadata has
been configured and the defaults have been updated.
2021-03-11 15:39:19 +01:00
Wim Taymans
bdea557fb1
module-portal: improve error message
...
Pass some error messages and errno around to give a better error
message (instead of ENOMEM) when the connection with dbus fails.
2021-03-11 15:18:28 +01:00
Thibault Saunier
485bae5eb0
meson: Use feature options everywhere it makes sense
2021-03-10 20:18:34 +00:00
Wim Taymans
e334c5862e
pulse-server: fill in the format info
2021-03-10 17:27:11 +01:00
Wim Taymans
d5fc67cf06
pulse-server: Prefer the formats of the extended format API
...
Fix enumerate the formats from the extended API and then append
the old API formats.
See #876
2021-03-10 16:55:01 +01:00
Wim Taymans
c237ccfbda
pulse-server: use the manager sync method for async replies
...
Use the manager sync method to wait until all pending queries are
finished. It is the manager that will query the new parameters so
we need to wait until that completes.
See #868
2021-03-09 12:09:05 +01:00
Wim Taymans
82c452a93d
pulse-server: expose sync method
2021-03-09 12:08:45 +01:00