Commit graph

2495 commits

Author SHA1 Message Date
Wim Taymans
c8c4923fcb spa: use log topics 2021-10-13 10:48:23 +02:00
Peter Hutterer
c44d0a6bbc spa: declare a dependency for the dbus lib
When running meson test without a preceding ninja build, we end up with
missing libraries. This somehow happened to work until recently but now
it triggers an issue with libspa-dbus.so not being available during the
valgrind test run, causing a test case to fail.
2021-10-12 09:45:33 +10:00
Wim Taymans
85d5c8cd6c cpu: add zero_denormals method
Add a method to enable/disable the denormals flush-to-zero and
denormals-as-zero CPU options.

Add a config option to make it possible to disable this again.

Fixes high CPU usage when dealing with denormals, which can happen
in many DSP functions.

Fixes #1681
2021-10-11 14:57:02 +02:00
Wim Taymans
594f67ec04 a2dp: guard against transport NULL
The transport can become NULL so check that and don't try to
deref it.
2021-10-11 11:22:36 +02:00
Pauli Virtanen
4b831021fb bluez5: add a dummy AVRCP player as a workaround
Some devices (Bose Mini Soundlink II, Air 1 Plus, ...) don't enable
AVRCP volume control, or fail to enable it before a hardware button is
pressed.  However, these devices appear to enable it, if an AVRCP player
is present.

As a workaround, register a dummy AVRCP player for each adapter. It only
displays the current transport acquisition state as playing/stopped, but
just its presence appears to be enough to make devices behave.

Multiple AVRCP players interfere with each other, as BlueZ uses the one
registered earliest as the default player. So add also a config option
for disabling this. (It's not common to have mpris-proxy etc. running,
so defaulting to true should be OK.)

See pipewire#1157
2021-10-10 16:24:41 +03:00
Pauli Virtanen
98a0e54d5f doc: link examples to Doxygen docs
Include examples to the documentation, using Doxygen's example system.
2021-10-10 00:35:46 +03:00
Wim Taymans
f6d69f9bcd resample: avoid NULL deref
The function is NULL when the resampler was not initialized.

Fixes #1706
2021-10-09 15:53:40 +02:00
Pauli Virtanen
d28b36bb93 bluez5: fix HFP backend behavior when BlueZ goes away
Ensure unavailable backends get unregistered.

Don't log error-level messages on HFP unregistration failures.
2021-10-09 13:03:08 +00:00
Wim Taymans
5f7c4dec34 meson: make it possible to compile without dbus
Make an option to disable dbus and all the code that depends on
it.

Fixes #1685
2021-10-09 15:00:04 +02:00
Wim Taymans
04344dad20 spa: add mjpg and h264 format build helpers 2021-10-08 13:21:07 +02:00
Björn Daase
cf38b7bdc4 fix codespell issues 2021-10-07 15:26:18 +00:00
Björn Daase
10ededf5d4 bluez5: fix mSBC probing documentation 2021-10-07 15:25:29 +00:00
Wim Taymans
466715672e log: fix logger fallback
The logt function should fall back when both the logger implementation
version is too low or when the method is not implemented.

We can use the new spa_callback_call return value to efficiently
handle this.
2021-10-07 10:15:21 +02:00
Wim Taymans
2435f0d7ff hook: we can use the spa_callbacks_call return value now
instead of reimplementing the check.
2021-10-07 10:14:43 +02:00
Wim Taymans
68748895ea hook: add spa_callbacks_check
That does a version and method check on the callbacks.
2021-10-07 10:13:06 +02:00
Wim Taymans
bb950976da hook: make spa_callbacks_call return true
Make spa_callbacks_call return true when the method could be called
succesfully. This means the callbacks version was correct and the
method existed.

This can then be used to implement a fallback.
2021-10-07 10:10:53 +02:00
Pauli Virtanen
ff8c3d208e bluez5: fix msbc connect probe again
There's a report that on Intel 8086:2723 + Sony WH-1000XM4, the connect
probe shuts the device down.

So, use an invalid dst address instead, since we don't need the host to
be up.

Fixes: 84bc0490a5
Fixes: 717004334b
2021-10-06 19:33:54 +03:00
Dennis D
3512444296 bluez5: update bluez-hardware.conf
Closes https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1686
2021-10-05 18:23:56 +00:00
Pauli Virtanen
49901f2d61 doc: add brief explanations for all groups 2021-10-04 20:55:04 +03:00
Pauli Virtanen
c620121529 bluez5: add faststream quirks
For some devices FastStream causes problems. Add quirk for disabling it.
2021-10-03 20:55:02 +03:00
Pauli Virtanen
84bc0490a5 bluez5: tweak msbc adapter probe for Intel adapters
The msbc capability connection probe seems to cause problems on Intel
Bluetooth 8087:0a2b (Intel 8265), resulting to subsequent connections
apparently ending up with wrong altsetting.

According to testing, the problem is connecting to self, so connect to
device instead.

Fixes #1671
2021-10-03 17:27:42 +00:00
Pauli Virtanen
8159797f89 doc: reorganize Doxygen groups/modules to make more sense
The Doxygen "Modules" page is not very illuminative, as different parts
of the API are mixed together and not all parts are included.

Try to address this:

Put all parts of the public API to some Doxygen group, usually one group
per header file. Use short, systematic names.

Make these groups sub-groups of a few top-level groups, roughly
corresponding to the different logical parts of the API (core, impl,
stream, filter, spa, utilities).
2021-10-03 15:39:27 +03:00
Pauli Virtanen
de7f78f4bd doc: add \copydoc, \sa links for (struct methods) function/macros
Add manually cross-references for struct methods callback
macros/functions, in cases where they're too hard to parse for the
Doxygen input filter.
2021-10-03 14:12:49 +03:00
Wim Taymans
392b2f1f96 dbuf: use log topic 2021-10-03 12:27:20 +02:00
Wim Taymans
783ae4d4e9 libcamera: use log topic 2021-10-03 12:26:00 +02:00
Wim Taymans
865635ef10 v4l2: use log topic 2021-10-03 12:12:09 +02:00
Wim Taymans
dfdd9a6b3b alsa: don't prefix NAME, log topics are enough 2021-10-03 08:05:40 +02:00
Pauli Virtanen
a86ff85444 bluez5: tolerate devices sending incorrect AAC caps
There is a report (#1342) of a device setting multiple bits for AAC
object type in SetConfiguration, although this appears to be forbidden.

It's not completely clear if this was due to e.g. some BlueZ bug, but it
should be safe to be lax and try to guess what is wanted in such case,
instead of being strict, in case it was due to device bug.
2021-10-02 10:29:48 +00:00
Pauli Virtanen
3092e4a7be bluez5: implement validate_config for AAC
Allows bailing out earlier on invalid config, and setting transport
channel info.
2021-10-02 10:29:48 +00:00
Pauli Virtanen
58c7caf1bc bluez5: use log topics
Use log topics instead of prepending NAME: to log messages.
2021-10-02 12:46:02 +03:00
Wim Taymans
9a76feb913 libcamera: handle MemFd buffers
Use EXPBUF when requesting MemFd buffers because it is mostly correct
for v4l2.
2021-10-01 13:19:14 +02:00
Wim Taymans
487792941d libcamera: remove \n in log lines 2021-10-01 12:28:53 +02:00
Pauli Virtanen
d6509a243d bluez5: fix device.profile setting
Only keys with names starting with "bluez" are passed on to device
settings dict. Rename device.profile to match this.

Also add some debug.
2021-09-30 22:39:34 +03:00
Pauli Virtanen
e84f1c6eed bluez5: update bluez-hardware.conf
Closes #1592
2021-09-30 20:01:06 +03:00
Wim Taymans
d71a10b7fa libcamera: handle failure gracefully
Don't try to access NULL pointers
2021-09-30 12:54:29 +02:00
Wim Taymans
f8817b4394 cpu: fix compilation on ARM 2021-09-30 11:12:27 +02:00
Peter Hutterer
abd5f9fbe8 Remove remaining tabs from meson.build files
No changes, just tab-to-space replacement and a little bit of manual
twiddling.
2021-09-30 00:08:27 +00:00
Peter Hutterer
fe79e684b7 spa: remove #define SPA_WEAK
This is a leftover from an earlier version of 0e60e9c063. The
attribute is not supported by clang at this time, so let's remove
the #define until we have a use-case that requires it.
2021-09-30 09:38:57 +10:00
Wim Taymans
013567524a support: res might be used uninitialized 2021-09-29 17:08:46 +02:00
Barnabás Pőcze
184e80d753 spa: support: use spa_list_consume()
Use `spa_list_consume()` when freeing entities in the pattern
list instead of `spa_list_for_each_safe()`.
2021-09-29 15:07:36 +00:00
Barnabás Pőcze
25a0e3beb4 spa: support: do not include C source file
Previously, `log-patterns.c` was included in two other source files
(`journal.c` and `logger.c`). It was also specified in the sources
list for the libspa-support library, which resulted in the unnecessary
independent compilation of the file, generating "defined but not used"
warnings.

Extract the function definitions into `log-patterns.h` and
use that in `journal.c` and `logger.c`, and remove the inclusion
of `log-patterns.c` from both.
2021-09-29 15:07:36 +00:00
Barnabás Pőcze
b292a71220 spa: support: use flexible array member
Use a flexible array member directly to store the pattern.
2021-09-29 15:07:36 +00:00
Wim Taymans
a9c64e1609 fix versions of the log interface 2021-09-29 17:03:26 +02:00
Wim Taymans
b45d906dc4 support: increment methods version
Using the version of the .h files is always the latest.
2021-09-29 16:59:49 +02:00
Wim Taymans
88d7ea3d88 spa-resample: add some verbose info messages 2021-09-29 10:16:25 +02:00
Wim Taymans
4d85e6aead resample: fix off-by-one
Don't use the previously skipped sample to calculate the remaining
amount of samples or else we remove one sample too much in some cases
and cause distortion, mostly when downsampling.

Fixes #1646
2021-09-28 15:31:07 +02:00
Peter Hutterer
b3646743c1 spa: sprinkle more log topics into spa 2021-09-28 09:35:39 +02:00
Peter Hutterer
e9d869b46f spa: implement a log topic for alsa 2021-09-28 09:35:39 +02:00
Peter Hutterer
59a5791d41 spa: implement the new topic logging for the provided loggers
Both simple log implementation now support the new topic-based
functions, and so does the journal logger too.
2021-09-28 09:35:38 +02:00
Peter Hutterer
0e60e9c063 spa: add topic-based logging
Add a struct spa_log_topic that allows for logical grouping of messages.
The new macros spa_log_logt() and spa_log_logtv() take a topic as
argument, the topic's level acts as filter.
A new macro spa_log_topic_init() initializes a topic. By default a topic
inherits its logger's debug level but a logger implementation may set
that topic to a specific fixed log level.

The various spa_log_*() macros transparently wrap new and old
implementations:
- if the implementation is version 0, the new logt() calls drop the
  topic and get routed into the old log() calls
- if the implementation is version 1, the old log() calls use a NULL
  topic and get routed into the new logt() calls

All spa_log_* macros use the SPA_LOG_DEFAULT_TOPIC topic (NULL), it is
up to the caller to redefine that. Alternatively, use spa_logt_* to pass
an explicit topic.

There is one crucial flaw in this implementation: log topics are
initialized to their target level by the current logger. Where a topic
is initialized but the logger is switched later, the topic is not
automatically re-initialized. Ultimately this shouldn't matter for
real-world use-cases.
2021-09-28 09:35:38 +02:00