Commit graph

7403 commits

Author SHA1 Message Date
Peter Hutterer b00bc81929 test: fix a use-of-uninitialized-variable compiler warning
False positive, we abort in the cases where this isn't initialized.

Fixes e1672f9762
2021-09-22 12:15:33 +10:00
Anders Jonsson 93e51a85f1 po: Update Swedish translation 2021-09-21 22:30:42 +02:00
Wim Taymans 6f519d4052 pulse-server: put the channel map in the loopback args
Fixes #1486
2021-09-21 18:33:29 +02:00
Wim Taymans 59203c11b8 jack: only update buffer_size/srate when active
As long as we are inactive, don't update our internal buffer_size or
sample rate. This way, when we become active, we will emit the right
callback with the right value instead of doing nothing.

Fixes crashes in Carla.
2021-09-21 18:32:30 +02:00
Wim Taymans c8f629a0a3 pulse-server: improve module args compatibility
Boolean switches can also be true with 'y', 'yes', 't' and 'on'
2021-09-21 17:39:11 +02:00
Javier Martinez Canillas 310e6009ca
libcamera: fix a segfault caused by queueing no longer valid requests
The requests_ vector contains the requests created for a camera on start()
but the vector elements are not removed on camera stop(). This leads to a
segfault, when these requests that are no longer valid are queued again.

Also move the streamName_ map clear to LibCamera::stop() where it should
be, since its elements are added in the LibCamera::start() function.
2021-09-21 14:49:08 +02:00
Javier Martinez Canillas 439dc8eb2a
libcamera: disconnect camera in spa_libcamera_stream_off()
The camera is connected in the spa_libcamera_stream_on() function but the
disconnect happen in LibCamera::stop(). It makes more sense to have this
two operations separated as it's done for the connection and start, since
the camera then can be stopped/started without needing to do a reconnect.

Move the camera disconnect to spa_libcamera_stream_off() for the reason
mentioned above but also to make the code more consistent and symmetric.
2021-09-21 14:49:08 +02:00
Javier Martinez Canillas ce9f75abaa
libcamera: free the FrameBufferAllocator buffers before deleting it
The libcamera application developer guide mentions that buffers allocated
by the FrameBufferAllocator must be explicitly freed before deleting it.
2021-09-21 14:49:08 +02:00
Javier Martinez Canillas 21c412dc49
libcamera: fix a use-after-free due an attempt to stop the camera twice
Camera is currently stopped and started in the spa_libcamera_set_format()
function, but this leads to a segfault due attempting to access a buffers
field of an already freed libcamera::FrameBufferAllocator instance.

The FrameBufferAllocator instance is freed in LibCamera::stop(), that is
called by spa_libcamera_stream_off() as handler of the node commands
SPA_NODE_COMMAND_Pause and SPA_NODE_COMMAND_Suspend.

Since the camera was already stopped, there's no need to attempt to stop
it again. In fact, the camera shouldn't be stopped/started at all in the
spa_libcamera_set_format() function but instead only as an action of the
SPA_NODE_COMMAND_{Pause,Suspend} and SPA_NODE_COMMAND_Start commands.

And same for the stop that's done in the LibCamera::close() function, it
shouldn't be needed because the camera is already stopped before closing.

Fixes #1513
2021-09-21 14:49:08 +02:00
Javier Martinez Canillas a7a6f19815
libcamera: don't set camera configuration in LibCamera::start()
There is no need to set and validate the configuration when the camera
is started, since this was already made when the camera was opened.

The configuration only needs to be set again if the port format changes
due a SPA_PARAM_Format parameter.
2021-09-21 14:49:08 +02:00
Javier Martinez Canillas 2d69f775de
libcamera: add a libcamera_set_config() helper function to the wrapper
The libcamera wrapper provides a set of C functions that wraps libcamera's
C++ interface. But there isn't a function to call LibCamera::set_config().
2021-09-21 14:49:08 +02:00
Wim Taymans 7c11dcf808 alsa: enumerate all passthrough formats
Don't use the audio.channels and audio.rate settings influence the
passthrough formats.

See #93
2021-09-21 13:02:48 +02:00
Wim Taymans 423e8b2f03 Revert "pipewire-alsa: Make it MT safe"
This reverts commit f22dd9d781.

Obsolete now that pw_init and factory loading/unloading has been
made thread safe.
2021-09-21 12:35:03 +02:00
Wim Taymans d8aec1c7b4 pw-play: move dsdplay into pw-cat 2021-09-21 12:29:41 +02:00
Wim Taymans 0ec77ab09c dsd: show rate in bytes per seconds. 2021-09-21 12:25:42 +02:00
Wim Taymans 1c3802bd82 spa: add SPA_ABS helper macro 2021-09-21 12:16:11 +02:00
Wim Taymans 23edb9ab2a pipewire: release lock when clearing handle
The handle might want to unload plugins and we thus need to release the
lock.
2021-09-21 10:58:07 +02:00
Wim Taymans 275b8a0f9e dsdplay: make separate dsffile 2021-09-21 10:50:45 +02:00
Wim Taymans fb0c5f503f media-session: DSD is also a valid passthrough format 2021-09-21 10:50:45 +02:00
Wim Taymans ae9f90eccc dsdplay: implement data processing
Simplify channel layout management a little.
Use the bitorder and interleaving to read and format the DSD in the
buffer.
2021-09-21 10:50:45 +02:00
Wim Taymans 670efe2811 alsa: implement set_format for DSD formats 2021-09-21 10:50:45 +02:00
Wim Taymans af6e887077 spa: add interleave DSD param
And make alsa report the interleaving.
2021-09-21 10:50:45 +02:00
Wim Taymans 25d39a5ea1 alsa: only expose DSD format when DSD_U32_BE is supported 2021-09-21 10:50:44 +02:00
Wim Taymans 43b27002eb tools: add beginnings of DSD player 2021-09-21 10:50:44 +02:00
Wim Taymans 1b5d02dd31 alsa: add enumeration of DSD formats 2021-09-21 10:50:44 +02:00
Wim Taymans c0d3349849 spa: add DSD format definitions 2021-09-21 10:50:44 +02:00
Wim Taymans 68f4dee2d9 pipewire: use lock for registry and init
Use a global lock to serialize concurrent pw_init calls.
Use a global lock to protect the global registry. With the alsa api,
multiple threads could open the device and create streams and
load/unload plugins.

See !942
2021-09-21 10:31:10 +02:00
Peter Hutterer e8e7e72b76 meson: require alsa for pipewire-alsa or media-session
The previous code had alsa optional if pipewire-alsa was on
auto/disabled bug failed later with missing alsa if media-session was in
the session manager array. Which it is by default.

Fixes #1632
2021-09-21 08:59:30 +10:00
Wim Taymans 143f233be3 audioconvert: increase buffer size
64 channels with the new format support needs more space.

See #1620
2021-09-20 20:11:50 +02:00
Ivan 1129e90c4f conf: Fix format inconsistencies and beautify configs 2021-09-20 16:40:40 +00:00
Wim Taymans 8efe54a176 media-session: fall back to EnumRoute for availability check
If the device doesn't have an active Route, also check the EnumRoute to
see if there is something available. If nothing is available, also avoid
selecting this node.

Fixes #1624
2021-09-20 18:34:52 +02:00
Wim Taymans 2ae6ac2bcb media-session: skip route availability check for default nodes
For default nodes, that are explicitly configured, skip the route check.
This makes it possible for the user to select a non-available node
as the default still.

Fixes #1624
2021-09-20 18:33:08 +02:00
Wim Taymans 64f83158f4 alsa-plugin: improve error handling and recovery
Ignore -ENOENT errors, they are likely because some device was
removed.
Make sure we clear the poll descriptor when nothing is pollable, even
in the error case.
Clear the error after we reported it instead of reporting it forever.

Fixes #1627
2021-09-20 15:48:04 +02:00
Wim Taymans 49a0250ecd impl-metadata: avoid infinite loop in cleat_items
When we need to remove all items, copy the storage to a temporary
array and clear the storage.

When one of the callbacks would add a new item to the storage it would
operate on the new empty storage and the loop to iteratively clear
subjects would be able to complete.

Fixes #1622
2021-09-20 15:06:05 +02:00
Wim Taymans afb37dd7fc pipewire: remove useless assignment 2021-09-20 15:05:37 +02:00
Wim Taymans 537fc63cc6 jack: set the final midi size as the buffer size.
The buffer has initially a maxsize. After writing we midi events, we can
update it with the real size.
2021-09-20 12:24:09 +02:00
Wim Taymans 92f35b99a0 alsa: don't mix process return and alsa err
Use a separate error field for the alsa errors, we already use the res
field for the process result.
2021-09-20 12:24:09 +02:00
Peter Hutterer dfb40fb714 test: implement a test for the journal logger 2021-09-20 07:29:03 +00:00
Peter Hutterer 0cbd56f0cd spa: declare a dependency for each used library in meson.build
For SPA libraries that we link against elsewhere in the tree, declare a
declare a dependency "foo_dep" for that library that specifies how to
link to it. Then use that dependency in the various targets.

This removes the knowledge of how to link with the library from the
target which can treat it as just another dependency.

In the case of optional libraries (e.g. the journal support lib) we can
then use declare_dependency() to declare an empty dependencies and thus
link them unconditionally in the target.
2021-09-20 07:29:03 +00:00
Peter Hutterer 56193d474c spa/bluez: correct a library name variable in meson.build
Unused, so no functional change here
2021-09-20 07:29:03 +00:00
Peter Hutterer ebda71d489 spa: fix the indentation in the various meson.build files
Was all over the place using tabs and spaces, let's make this more
consistent.
2021-09-20 07:29:03 +00:00
Peter Hutterer 335ad734de doc: fix example config for echo cancel
Fixes #1625
2021-09-20 15:56:13 +10:00
Pauli Virtanen 229892d45d pw-uninstalled: set SPA_DATA_DIR + fix meson devenv
Set SPA_DATA_DIR needed for the bluez5 plugin hwdb file in
pw-uninstalled.

Also fix its value for meson devenv.
2021-09-19 18:12:19 +00:00
Pauli Virtanen def45adaec bluez5: fix behavior on HSP/HFP backends with no codec switching
Fix HSP/HFP profile not showing correctly when using hsphfpd/ofono
backends, which don't support codec switching and have no HFP codec
profiles.
2021-09-19 17:41:19 +00:00
Pauli Virtanen 90b4efd98d bluez5: cleanup hfp/hsp backend handling + config file option
It seems not uncommon that people have not properly configured ofono
running, which results to loss of HFP/HSP functionality. It's less
surprising if the backend selection is fixed in the configuration file,
and (by default) does not depend on running services.

Add a configuration file option for selecting HFP/HSP backend, and set
the default value to the native backend. Emit warnings if conflicting
backend services are detected to be running.

Also cleanup hfp/hsp backend handling a bit, now that it's mostly
abstracted behind an interface.
2021-09-19 17:33:32 +00:00
Pauli Virtanen cae1554449 bluez5: move bluez-hardware.conf loading to the plugin
It's not really the responsibility of the session manager to load the
bluez5 device quirks, and it's easier for eg. Wireplumber if it doesn't
need to do it.

Move loading bluez-hardware.conf to be the responsibility of the bluez5
spa plugin, similarly as the alsa plugin deals with the ACP database.

Put the configuration to share/spa-0.2/bluez5, mirroring the plugin
directory structure in lib/spa-0.2/bluez5.
2021-09-19 17:28:17 +00:00
Leonardo Neumann 6168067cb2
fix missing limits.h include 2021-09-18 04:36:20 -03:00
Wim Taymans 10abcd92d7 update version number as well 2021-09-16 18:38:56 +02:00
Pauli Virtanen 39c8ed4f62 media-session: don't use-after-free if linking node removed
Should fix an ASAN crash.
2021-09-16 19:20:53 +03:00
Wim Taymans 4997d47f63 0.3.36 2021-09-16 15:08:56 +02:00