Frédéric Danis
fd1b331353
bluez5: Fix sink timeout for BAP
...
Data should be written to the ISO Stream fd every 10ms or 7.5ms depending
on the configuration selected.
2022-09-15 11:17:20 +00:00
Frédéric Danis
071730ecab
bluez5: Use delay from QoS for BAP
2022-09-15 11:17:20 +00:00
Frédéric Danis
39ef812ed5
bluez5: Complete BAP audio location mapping
2022-09-15 11:17:20 +00:00
Frédéric Danis
f428b13d06
bluez5: Set BAP QoS depending on selected configuration
...
This move the QoS setup to be codec specific and fills it depending on the
selected codec configuration.
2022-09-15 11:17:20 +00:00
Frédéric Danis
284da66deb
bluez5: Add BAP_SINK/SOURCE from PACS UUID to adapter profiles
...
BAP sink/source are characteristics of the PACS profile, but we're more
interested by those characteristics then the more generic profile.
2022-09-15 11:17:20 +00:00
Frédéric Danis
496dda1bcc
bluez5: Check if BlueZ daemon support LE Audio
...
Legacy BlueZ 5 API doesn't support to register BAP codecs, which prevents
to register A2DP enhanced codecs.
2022-09-15 11:17:20 +00:00
Frédéric Danis
b7ad1d1869
bluez5: Add SelectProperties DBus method support
2022-09-15 11:17:20 +00:00
Frédéric Danis
96acc5a79a
bluez5: Add LE Audio BAP support to bluez5-device
2022-09-15 11:17:20 +00:00
Frédéric Danis
201fd7755d
bluez5: Add LC3 codec support to LE Audio BAP
...
By default this codec is disabled as the BlueZ support for LE Audio is
still experimental.
2022-09-15 11:17:20 +00:00
Frédéric Danis
fd0bcb1699
bluez5: Add LE Audio BAP support to media-codecs
2022-09-15 11:17:20 +00:00
Frédéric Danis
00d51c3d31
bluez5: Rename codec API from *a2dp* to *media*
...
The BlueZ Media1 interface will not only be used for A2DP but also for
LE Audio and code related can be shared.
2022-09-15 11:17:20 +00:00
Frédéric Danis
2c72597271
bluez5: Use spa_log_hexdump() to dump media properties/configuration
2022-09-07 07:50:23 +02:00
Pauli Virtanen
df858cae7c
bluez5: clarify OPUS-A2DP spec
...
Also remove DRAFT tag.
2022-09-03 19:08:27 +00:00
Wim Taymans
2fa1b4384b
spa: don't warn for NULL io
...
The io is set to NULL when the port becomes unnegotiated.
2022-09-01 15:31:14 +02:00
Pauli Virtanen
c0e8b397f6
bluez5: avoid (harmless) integer overflow
...
If no packets have been received and spa_bt_decode_buffer_process is
called, this->packet_size.max == INT32_MIN, which can give overflows.
Guard against this condition, although it should be harmless.
2022-08-24 16:59:21 +00:00
Frédéric Danis
6b3390387d
bluez5: Test transport pointer before using it
...
If this->transport is NULL the debug log will crash.
2022-08-18 12:57:04 +02:00
Pauli Virtanen
b9baeeb587
bluez5: opus: react faster to too long packet queue
...
React immediately to "bad" buffer level. Use smaller bitrate
increments/decrements. Fix ABR timer increment for fragmented packets.
Handle actual bitrate being smaller than target during silence.
2022-08-13 15:58:08 +03:00
Pauli Virtanen
c1acb5168d
bluez5: bump Opus max bitrates
...
Limit bitrates to 2-2.5x Opus recommended "good quality", instead of
1.5x, which is safer quality-wise for CVBR.
2022-08-13 15:12:35 +03:00
Pauli Virtanen
8f0478a2ce
bluez5: sco-source: deal with incomplete CVSD frames
...
Rarely BT adapter may send CVSD packets with incomplete frames. Ignore
such packets, as it's not clear if they contain valid data at all.
2022-08-05 13:12:24 +00:00
Frédéric Danis
e7f17e1523
bluez5: use lower case for UUIDs
...
BlueZ uses lower case version for the UUIDs in its DBus interface.
This will simplify future UUID tests.
2022-08-03 06:15:54 +00:00
Frédéric Danis
76adcfaabe
bluez5: Add AAC decoder
2022-08-02 11:12:25 +02:00
Isa Mert Gurbuz
f32017c874
bluez5: Disable hw-volume for Soundcore Motion B
2022-08-01 19:34:39 +00:00
Pauli Virtanen
3579857a64
bluez5: opus: tweak ABR
...
Count retry from last non-good interval. Minimum retry interval 5sec.
2022-08-01 19:23:07 +00:00
Pauli Virtanen
5724d405d6
bluez5: opus: better default bitrates
...
Use smaller bitrate caps, as it's not necessary to use all bandwidth
available.
2022-08-01 19:23:07 +00:00
Huang-Huang Bao
c5bce24f01
bluez5: correct type of arguments to a dbus function
...
The 3rd "value" arguments to dbus_message_iter_append_basic() should be the address of a basic-typed value.
Fixes #2591
2022-07-23 16:35:01 +08:00
Frédéric Danis
343ae88bbf
bluez5: Simplify DBus append_basic_* helpers
...
String key is used in all calls to append_basic_variant_dict_entry() and
append_basic_array_variant_dict_entry().
2022-07-22 19:10:26 +00:00
Frédéric Danis
e560468800
bluez5: Removed unused variables in meson.build
2022-07-22 18:46:35 +02:00
Pauli Virtanen
67c41336db
bluez5: fix minor issues / warnings
...
Make static analysis happier.
2022-07-21 07:12:22 +00:00
Pauli Virtanen
434cc6a90b
bluez5: add Opus as a (Pipewire-specific) A2DP vendor codec
...
Support Opus as A2DP vendor codec.
The specification for vendor A2DP codec is our Pipewire-specific one, so
it is compatible only with devices running Pipewire.
2022-07-19 13:44:56 +00:00
Pauli Virtanen
bf52b2acff
bluez5: add opus-a2dp-0.5 caps
2022-07-19 13:44:56 +00:00
Pauli Virtanen
b6d237fa43
bluez5: add OPUS-A2DP specification
2022-07-19 13:44:56 +00:00
Pauli Virtanen
0dc8255057
bluez5: handle sink vs. source correctly in get_supported_codecs
...
Make a distinction between sink and source endpoints when determining
supported codecs.
2022-07-19 13:44:56 +00:00
Pauli Virtanen
889d507e9c
bluez5: enable logging for codecs
...
Add codec->set_log for setting the logging object for each codec.
Bump codec API.
2022-07-19 13:44:56 +00:00
Pauli Virtanen
d29aafd857
bluez5: enable A2DP duplex volume boost only if codec asks for it
...
Make A2DP volume boost conditional on a flag the codec sets.
Bump codec API version.
2022-07-19 13:44:56 +00:00
Pauli Virtanen
92b2b44954
bluez5: pass global setting dict to codec select_config / preference_cmp
...
The device is not know at SelectConfiguration time, so the settings
argument in select_config is currently unused. Pass on a global settings
dict instead, so that codec parameters can be configured.
Also add settings argument to caps_preference_cmp.
Bump codec API version.
2022-07-19 13:44:56 +00:00
Pauli Virtanen
a8eb146d39
bluez5: tell the codec whether endpoint is sink or source
...
Add a flag A2DP_CODEC_FLAG_SINK to incidate a sink endpoint.
Also enum_config and caps_preference_cmp may need to know whether the
codec is being configured for SRC or SNK. Also add the flags argument to
init_props.
Bump codec API version.
2022-07-19 13:44:56 +00:00
Pauli Virtanen
8d66b2b2f7
bluez5: a2dp-source: more duplex codec workarounds
...
a2dp-sink writing duplex data to the BT socket breaks a2dp-source source
polling, also in A2DP source role. Hence, use the timer-based polling
workaround always in duplex mode.
2022-07-19 13:44:56 +00:00
Pauli Virtanen
f593a44069
bluez5: a2dp-sink: support duplex codec
...
Allow running a2dp-sink using the duplex codec, when the local endpoint
is the A2DP sink.
2022-07-19 13:44:56 +00:00
Pauli Virtanen
d6a7db8020
bluez5: mark HFP/HSP streams with media.role=Communication
2022-07-12 14:04:31 +00:00
Pauli Virtanen
6e37110efd
bluez5: adjust source rate control
...
Use different filter function than spa_dll for the rate control.
Also use a longer window for spike determination.
2022-07-12 13:55:54 +00:00
Pauli Virtanen
fe7c6bcef9
bluez5: volume changes from headset should be saved
...
User changing volume via headset buttons should be treated on the same
level as changing from desktop UI. Also initial headset volume should
be considered saved (even though session managers currently ignore the
initial route values on route restore).
Mark route as saved on volume events.
2022-07-09 18:19:45 +00:00
Pauli Virtanen
77959a2c1c
bluez5: get initial node volume from transport
...
When emitting node, get initial volumes from transport hardware volume,
if available.
The session manager usually overrides these immediately with saved
values, but it's better to show the HW volume when the node first
appears.
2022-07-09 18:19:45 +00:00
Pauli Virtanen
d82b3d6479
bluez5: backend-native: set HFP/HSP volume when connecting
...
The HFP/HSP HW volume on the device is not necessarily what we think it
is.
Sync the device volume to our value at connect time.
2022-07-09 18:19:45 +00:00
Pauli Virtanen
276c4bc554
bluez5: use separate routes for HFP and A2DP
...
The A2DP and HFP profiles may have different volume curves, so trying to
convert volumes between the two can produce undesirable volume spikes.
For example, when one of them is using hardware volume and the other
software.
Fix by separating HFP and A2DP routes.
2022-07-09 18:19:45 +00:00
Pauli Virtanen
783fbc507b
bluez5: fix minor error handling/warning issues
2022-07-06 14:36:22 +00:00
Pauli Virtanen
e1cb7c6fb2
bluez5: sco-source: implement sco-source the same way as a2dp-source
2022-07-05 14:21:04 +00:00
Pauli Virtanen
51356ea3d0
bluez5: a2dp-source: separate clock from recv + handle buffering
...
a2dp-source as driver does not produce regularly spaced graph cycles,
because A2DP is not isochronous. This causes e.g. crackling for alsa
etc. that expect regular timings. It also does not rate match.
Change a2dp-source to trigger graph on regular intervals. Change recv to
only accumulate data to a buffer, and put data to buffers in process().
Rate match with DLL, keeping average buffer level constant. Keep track
of jitter to determine a safe target value.
2022-07-05 14:21:04 +00:00
Pauli Virtanen
459a1114f1
bluez5: sco-io: we should always read from socket
...
Not reading from the socket appears to cause messages to pile up to some
limit, which causes problems if we start the source after some point.
2022-07-05 14:21:04 +00:00
Pauli Virtanen
02bdfcb115
bluez5: ad2p-sink: adjust debug log message
...
timeout -> timer, since "timeout" looks like error to users
2022-07-05 14:21:04 +00:00
Frédéric Danis
8bd1d4c7c9
bluez5: Fix LC3plus plugin build
...
LC3PLus plugin should not depend on LDAC C args to build
2022-06-10 18:16:49 +02:00