Wim Taymans
af6e212817
pulse-server: add simple protocol module
...
Fixes #954
2021-04-12 16:17:06 +02:00
Wim Taymans
d8f86ca6e5
pulse-server: make name in create_server const
...
constify the name in create_server() and make a copy of the name
were it is needed instead of modifying the argument in-place.
2021-04-10 11:22:41 +02:00
Wim Taymans
47bf30d734
pulse-server: create pid file only once
...
Only try to create the pid file once, not for every socket
we listen to.
2021-04-10 11:06:18 +02:00
Wim Taymans
225c9ebc2d
pulse-server: limit the aux channels to 32
...
PulseAudio does not have more than 32 AUX channels so when we generate
them from unknown positions, make sure we wrap around.
See #1033
2021-04-09 19:20:46 +02:00
Wim Taymans
33ddd5f760
pulse-server: implement module-native-protocol-tcp
...
The module creates a tcp server on the given ip/port pair.
2021-04-09 18:27:30 +02:00
Wim Taymans
5d20f50df8
pulse-server: use the right config property
2021-04-09 11:45:06 +02:00
Wim Taymans
44e6e7f5c8
pulse-server: use PipeWire format and channel names
...
Use the PipeWire format and channel names in the config to avoid
confusion.
2021-04-09 11:30:57 +02:00
Wim Taymans
b305f57e4d
pulse-server: make sample format and channel_map configurable
...
Add an entry in the config file for default format and channel map.
Use the defaults in the server_info request
Use the defaults for the default channels and map in the modules.
2021-04-09 11:12:13 +02:00
Wim Taymans
877309bfbe
use priority.session to select the default sink/source
...
priority.session is meant to be used to set routing priorities.
priority.driver is meant to be used by the scheduler to select what
nodes is best for driving the graph. This usually depends on the
hardware quality and the use case (Pro Audio devices are likely
to be used as driving the graph).
See #1028
2021-04-08 17:48:13 +02:00
Wim Taymans
2e18d8d005
module-loopback: fix connecting to the .monitor source
...
When a pulseaudio clients asks to be connected to a monitor of a sink
we need to specify the sink to the session manager as the target.
Fixes #1024
2021-04-08 16:02:28 +02:00
Wim Taymans
09243d55ae
pulse-server: fix leak in flatpak detection
2021-04-06 11:26:02 +02:00
Wim Taymans
bdbd3e3f2e
pulse-server: Make sure we don't send null name and description
...
We can't send a null name or description because that makes clients
crash.
2021-04-05 17:36:38 +02:00
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
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
0af8c0c045
pulse-server: check message size
2021-03-25 19:07:13 +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
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
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
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