Peter Hutterer
2cb7b19b7d
pulse-server: fix scan-build errors for unused variables
...
All cases of value stored but never read
2021-05-26 07:51:27 +00:00
Peter Hutterer
6d19dd0162
pulse-server: if all transport methods failed, fail server creation
...
No point in keeping a server running if it doesn't listen to anything.
2021-05-26 07:46:55 +00:00
Peter Hutterer
71c6a175c4
Drop double semicolons
2021-05-20 07:24:22 +00:00
Peter Hutterer
4e70799922
treewide: drop strzcmp implementations in favor of spa_streq
2021-05-18 22:10:27 +10:00
Peter Hutterer
522f87d5ea
treewide: replace strcmp() != 0 with !spa_streq
...
This change is only done in source files for now, header files will be done
separately.
2021-05-18 22:10:27 +10:00
Peter Hutterer
95a84e797a
treewide: replace !strcmp() with spa_streq()
...
This change is only done in source files for now, header files will be done
separately.
2021-05-18 22:10:27 +10:00
Peter Hutterer
7697ed0757
treewide: replace strcmp() == 0 with spa_streq()
...
This change is only done in source files for now, header files will be done
separately.
2021-05-18 22:10:27 +10:00
Wim Taymans
fb6db4a1f9
pulse-server: clean up default format a little
2021-05-12 18:06:48 +02:00
Peter Hutterer
2405f0942b
spa/buffer: rename SPA_MEMBER to SPA_PTROFF
...
SPA_MEMBER is misleading, all we're doing here is pointer+offset and a
type-casting the result. Rename to SPA_PTROFF which is more expressive (and
has the same number of characters so we don't need to re-indent).
2021-05-06 09:39:39 +00:00
Wim Taymans
620c863b6d
pulse-server: track and set monitor volume on monitor sources
2021-04-29 15:25:04 +02:00
Wim Taymans
8294a4f42c
Add vm.overrides property in pipewire and pulse-server
...
Apply vm.override properties when running in a VM. Increase the
default quantum to 1024 when running in a VM to cause less
dropouts.
2021-04-21 15:58:30 +02:00
Wim Taymans
fbd6a62b73
pulse-server: cancel items from work-queue
...
Make sure we cancel any pending work-queue items for the object before
we destroy the object.
2021-04-21 13:23:13 +02:00
Wim Taymans
c70a5de526
pulse-server: use a work-queue to schedule destroy
...
Use the context work queue to schedule destroys from callbacks.
This is better because we can pass the destroyed object around and
implement just the action we need to do on it.
2021-04-21 12:55:49 +02:00
Wim Taymans
7031471807
pulse-server: add property to make virtual nodes
...
Make a property to mark virtual nodes and use it to hide the client
id from the sink-input/source-output info in pulse-server.
2021-04-20 21:05:59 +02:00
Arun Raghavan
74140abada
pulse-server: Factor out module code to compile independently
...
This starts breaking up the giant monolith that is the pulse-server.c
code into more manageable chunks by trying to split the module code into
individual compilation units.
2021-04-15 19:37:15 -04:00
Wim Taymans
22ffed456c
pulse-server: improve event handling
...
Do the check for the client event mask in only one place where we
are actually going to send the event. This avoids sending events to
clients that did not register them.
Rework some of the event handling when the manager emit an
add/remove/change event. Make it possible to send multiple events, like
when a sink changes, also emit a change for the monitor.
See #1042
2021-04-12 17:19:15 +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
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
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
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
2681b8236b
media-session/pulse-server: more error checks + minor fixes
2021-03-27 19:16:19 +02: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
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
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
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
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