Commit graph

5967 commits

Author SHA1 Message Date
Pauli Virtanen 6b5b56bcc7 pulse-server: use transportCodec prop for bluez codec messages 2021-03-26 16:59:07 +00:00
Pauli Virtanen a552655edc bluez5: add bluetoothAudioCodec property to device
Also make the "codecless" profiles to automatically switch to the codec
profiles.
2021-03-26 16:59:07 +00:00
Pauli Virtanen 6b0cf799c4 spa: add bluetoothAudioCodec property and type 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 d805253c69 bluez5: don't warn when the services are not available
If oFono or hsphfpd are not installed, just log an info message
that they are not used. The native backend will work fine and we
don't want to log warnings.

See #971
2021-03-26 12:09:43 +01:00
Wim Taymans 0af8c0c045 pulse-server: check message size 2021-03-25 19:07:13 +01:00
Wim Taymans 27a5ebb87e jack: free server in error case 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 c78901f9f9 jack: free client in error case 2021-03-25 17:54:24 +01: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 ee99693f77 bluez5: check for NULL info before accessing it 2021-03-25 17:38:45 +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
George Kiagiadakis 6c4d27da9f ci: fix command separators in coverity image creation script 2021-03-25 11:54:01 +00:00
George Kiagiadakis 1660afbd97 ci: add coverity pipeline
This is meant to run as a scheduled job with the COVERITY variable set
2021-03-25 11:31:48 +00:00
George Kiagiadakis e5664a24a5 ci: bump ci-templates and fedora image versions 2021-03-25 11:31:48 +00: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
Wim Taymans 5f7910fcac impl-port: only add the port when buffers are negotiated
To avoid crashes when the node is scheduled but buffer have been
cleared.

See #904
2021-03-25 11:30:58 +01:00
Wim Taymans b5220c83da improve debug 2021-03-25 11:30:30 +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 b759f9a691 pw-loopback: handle NULL buffers
Make sure we return the non-NULL buffers in all cases.
2021-03-24 17:45:18 +01:00
Wim Taymans 4bcb7e0468 tools: add pw-loopback
Sends the captured data from a source directly to a sink.

It uses an input and output stream so the source and sink can be
moved in pavucontrol, channel remixing is possible and the volume
can be adjusted.

See #959
2021-03-24 17:02:21 +01:00
Wim Taymans 20b8426013 pipewire: snprintf always 0 terminates the string 2021-03-24 16:58:19 +01:00
Wim Taymans 8c334fa3ab alsa: never queue buffers when rate matching
When we are following the resampler requested size in capture, never
keep queued buffers around or we might get out of sync with the
requested size and cause cracks and pops in the resampler.

See #805
2021-03-24 11:48:32 +01:00
Wim Taymans 34800dc019 json: don't move past the end of a symbol
We can't move past the } or ] or we might miss the end of the
container. Now that we ignore \0 it is not a problem if the \0
is placed at the container boundary.
2021-03-23 18:05:44 +01:00
Wim Taymans b54af4ab0a media-session: don't loop forever on link failures
Based on patch from Pauli Virtanen

Keep track of the last node that we failed to link to and don't try
to link to it again over and over.

See #882
2021-03-23 17:27:01 +01:00
Wim Taymans fe49c2e6b1 impl-node: handle error from the Start command
When we execute Start on a node, handle the error case and set
the node into the error state.
2021-03-23 17:25:36 +01:00
Wim Taymans a9e14a30da impl-node: allow suspend on error nodes
When a node is in the error state, make sure we can execute a
Suspend on it to bring it back into a usable state.
2021-03-23 17:21:45 +01:00
Wim Taymans 3981f15ec6 media-session: also suspend error nodes
When a node is in the error state we need to suspend it to be
able to use it later again.
2021-03-23 17:21:06 +01:00
Wim Taymans ae85a3da39 media-session: make link_nodes return the number of links
Return the result from sm_media_session_create_links() as the
result of link_nodes. This is > 0 when something was linked, < 0
on error and 0 when no ports are available. We should be able to
use this result later to handle errors.
2021-03-23 16:36:46 +01:00
Wim Taymans df9644f109 jack: add jack.self-connect-mode
Add a property to restrict self-connections. This can be used to
stop clients from connecting themselves automatically.

Fixes #952
2021-03-23 12:24:38 +01:00
Wim Taymans 3b0b5cb55d pw-dump: print id-xxx for unknown ids
When the id has no info in the type system use id-xxx instead
of "unknown".
2021-03-23 11:32:35 +01:00
Wim Taymans 4668b72312 impl-node: first start the node, then make it schedulable
We first need to issue the start command for driver nodes and then
we can add the node to be scheduled. Else we might end up with nodes
that receive the _process callback without the Start command being
called first and we can crash.

See #904
2021-03-23 10:17:01 +01:00
Wim Taymans 7ee52b396d media-session: use restore stream for routeless nodes
When a node does not have routes, treat it like a stream and use
the restore-stream logic to restore the volumes.

Rework some of the logic a little. Don't save empty strings. Wait
for param updates to save/restore values.

This makes volume restore work on virtual sinks/sources and
sinks/sources without any routes.

See #729
2021-03-22 17:10:31 +01:00
Wim Taymans fc44013d17 device: place the number of routes in the nodes
So that we can know if this node has routes or not.
Nodes without routes might need their volumes restored directly
with the node properties, like streams. Nodes with a route need their
volumes set on the device managing the node.
2021-03-22 16:43:54 +01:00
Wim Taymans 8a9c2ae901 merger: don't try to change the volumes in PortConfig
Just leave them be. Something else is supposed to changed the volumes
if needed. In the usual case where nothing changes, we don't want to
override the volumes.
2021-03-22 16:33:36 +01:00
Huang-Huang Bao d439b7cdd7 bluez5: retry sco connect if it got aborted by ECONNABORTED
When I enforing HFP codec switching between HFP profiles, it has a chance of being aborted by ECONNABORTED. Seems a retry is sufficient for work around it.
2021-03-22 10:53:16 +00:00